Commit 707b2169 authored by 黄奎's avatar 黄奎

页面修改

parent a288c96a
...@@ -23,15 +23,17 @@ ...@@ -23,15 +23,17 @@
.treeDiv .el-tree-node__content { .treeDiv .el-tree-node__content {
height: auto; height: auto;
} }
.Move_PaperName{
.Move_PaperName {
display: inline-block; display: inline-block;
width:300px; width: 300px;
overflow: hidden; overflow: hidden;
text-overflow:ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
position: relative; position: relative;
top:4px; top: 4px;
} }
</style> </style>
<!--移动到文件夹--> <!--移动到文件夹-->
<template> <template>
...@@ -88,6 +90,10 @@ ...@@ -88,6 +90,10 @@
saveObj: { saveObj: {
type: Object, type: Object,
default: null default: null
},
Ids: {
type: String,
default: ''
} }
}, },
data() { data() {
...@@ -108,7 +114,7 @@ ...@@ -108,7 +114,7 @@
dataList: [], //数据列表 dataList: [], //数据列表
//移动文件夹参数 //移动文件夹参数
moveMsg: { moveMsg: {
PaperId: 0, PaperIds: 0,
ParentId: 0, ParentId: 0,
}, },
//选中的文件夹 //选中的文件夹
...@@ -117,7 +123,10 @@ ...@@ -117,7 +123,10 @@
}, },
created() { created() {
if (this.saveObj && this.saveObj.PaperId) { if (this.saveObj && this.saveObj.PaperId) {
this.moveMsg.PaperId = this.saveObj.PaperId; this.moveMsg.PaperIds=this.saveObj.PaperId;
}
if (this.Ids) {
this.moveMsg.PaperIds=this.Ids;
} }
}, },
mounted() { mounted() {
...@@ -146,10 +155,10 @@ ...@@ -146,10 +155,10 @@
//同级目录 //同级目录
if (type == 1) { if (type == 1) {
//选择了父级 //选择了父级
if(this.checkFolder){ if (this.checkFolder) {
this.folderMsg.ParentId = this.checkFolder.ParentId; this.folderMsg.ParentId = this.checkFolder.ParentId;
this.checkFolder.ChildList.push(obj); this.checkFolder.ChildList.push(obj);
}else{ } else {
//直接点击不选父级 //直接点击不选父级
this.folderMsg.ParentId = 0; this.folderMsg.ParentId = 0;
this.dataList.push(obj); this.dataList.push(obj);
...@@ -214,7 +223,7 @@ ...@@ -214,7 +223,7 @@
return return
} }
this.saveLoading = true; this.saveLoading = true;
this.moveMsg.ParentId=this.checkFolder.PaperId; this.moveMsg.ParentId = this.checkFolder.PaperId;
movePaperInfo(this.moveMsg).then(res => { movePaperInfo(this.moveMsg).then(res => {
this.saveLoading = false this.saveLoading = false
this.$q.notify({ this.$q.notify({
......
...@@ -71,13 +71,14 @@ ...@@ -71,13 +71,14 @@
<q-input @change="getList" clearable filled v-model="msg.PaperName" @clear="getList" maxlength="20" <q-input @change="getList" clearable filled v-model="msg.PaperName" @clear="getList" maxlength="20"
label="输入试卷名称、组卷人查找" /> label="输入试卷名称、组卷人查找" />
<div style="margin-top:15px;"> <div style="margin-top:15px;">
<q-btn color="accent" size="sm" class="q-mr-md" @click="movePaperFile()" label="移动到" /> <q-btn v-if="multipleSelection&&multipleSelection.length>0" color="accent" size="sm" class="q-mr-md" @click="movePaperFile()" label="移动到" />
<q-btn color="accent" size="sm" class="q-mr-md" label="删除" /> <q-btn v-if="multipleSelection&&multipleSelection.length>0" color="accent" size="sm" class="q-mr-md" label="删除" @click="batchDelete()" />
</div> </div>
</div> </div>
</div> </div>
<div class="page-option"> <div class="page-option">
<q-btn color="accent" size="sm" v-if="IsCreateFolder" class="q-mr-md" label="新增文件夹" @click="showExamFolder(null)" /> <q-btn color="accent" size="sm" v-if="IsCreateFolder" class="q-mr-md" label="新增文件夹"
@click="showExamFolder(null)" />
<q-btn-dropdown flat size="xs" color="dark" label="新增试卷" v-if="IsCreatePaper" style="margin-left:10px;"> <q-btn-dropdown flat size="xs" color="dark" label="新增试卷" v-if="IsCreatePaper" style="margin-left:10px;">
<q-list> <q-list>
<q-item clickable v-close-popup @click="CreatePaper()"> <q-item clickable v-close-popup @click="CreatePaper()">
...@@ -105,9 +106,7 @@ ...@@ -105,9 +106,7 @@
</template> </template>
</div> </div>
<el-table :data="dataList" v-loading="loading" ref="multipleTable" @selection-change="handleSelectionChange"> <el-table :data="dataList" v-loading="loading" ref="multipleTable" @selection-change="handleSelectionChange">
<el-table-column <el-table-column type="selection" width="55">
type="selection"
width="55">
</el-table-column> </el-table-column>
<el-table-column prop="PaperName" label="文件夹/试卷" width="300"> <el-table-column prop="PaperName" label="文件夹/试卷" width="300">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -182,15 +181,16 @@ ...@@ -182,15 +181,16 @@
<template slot-scope="scope"> <template slot-scope="scope">
<template v-if="scope.row.PaperType==1"> <template v-if="scope.row.PaperType==1">
<q-btn flat size="xs" color="primary" style="font-weight:400" @click="showExamFolder(scope.row)" <q-btn flat size="xs" color="primary" style="font-weight:400" @click="showExamFolder(scope.row)"
label="重命名" /> label="重命名" v-if="currentUserInfo.Id==scope.row.CreateBy" />
</template> </template>
<template v-if="scope.row.PaperType==2"> <template v-if="scope.row.PaperType==2">
<q-btn flat size="xs" color="primary" style="font-weight:400" @click="goExameEdit(scope.row)" <q-btn flat size="xs" color="primary" style="font-weight:400" @click="goExameEdit(scope.row)" label="编辑"
label="编辑" /> v-if="currentUserInfo.Id==scope.row.CreateBy" />
</template> </template>
<q-btn-dropdown flat size="xs" color="dark" label="更多" style="margin-left: 10px"> <q-btn-dropdown flat size="xs" color="dark" label="更多" style="margin-left: 10px">
<q-list> <q-list>
<q-item clickable v-close-popup @click="publishExam(scope.row)" v-if="scope.row.PaperType==2"> <q-item clickable v-close-popup @click="publishExam(scope.row)"
v-if="scope.row.PaperType==2 &&currentUserInfo.Id==scope.row.CreateBy">
<q-item-section> <q-item-section>
<q-item-label>发布考试</q-item-label> <q-item-label>发布考试</q-item-label>
</q-item-section> </q-item-section>
...@@ -200,7 +200,8 @@ ...@@ -200,7 +200,8 @@
<q-item-label>详情</q-item-label> <q-item-label>详情</q-item-label>
</q-item-section> </q-item-section>
</q-item> </q-item>
<q-item clickable v-close-popup @click="movePaperInfo(scope.row)"> <q-item clickable v-close-popup @click="movePaperInfo(scope.row)"
v-if="currentUserInfo.Id==scope.row.CreateBy">
<q-item-section> <q-item-section>
<q-item-label>移动到</q-item-label> <q-item-label>移动到</q-item-label>
</q-item-section> </q-item-section>
...@@ -210,7 +211,8 @@ ...@@ -210,7 +211,8 @@
<q-item-label>复制</q-item-label> <q-item-label>复制</q-item-label>
</q-item-section> </q-item-section>
</q-item> </q-item>
<q-item clickable v-close-popup @click="deletePaperInfo(scope.row)"> <q-item clickable v-close-popup @click="deletePaperInfo(scope.row)"
v-if="currentUserInfo.Id==scope.row.CreateBy">
<q-item-section> <q-item-section>
<q-item-label>删除</q-item-label> <q-item-label>删除</q-item-label>
</q-item-section> </q-item-section>
...@@ -223,9 +225,11 @@ ...@@ -223,9 +225,11 @@
<q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="pageCount" <q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="pageCount"
:input="true" @input="changePage" /> :input="true" @input="changePage" />
</div> </div>
<paperfolderForm v-if="isShowExamFolder" :saveObj="examObj" :FaParentId="msg.ParentId"  @close="closeExamForm"  @success="refreshPage"> <paperfolderForm v-if="isShowExamFolder" :saveObj="examObj" :FaParentId="msg.ParentId"  @close="closeExamForm"
 @success="refreshPage">
</paperfolderForm> </paperfolderForm>
<movefolderForm v-if="isShowMoveFolder" :saveObj="examObj" :Ids="MoveIds"  @close="closeExamForm"  @success="refreshPage"> <movefolderForm v-if="isShowMoveFolder" :saveObj="examObj" :Ids="MoveIds"  @close="closeExamForm"
 @success="refreshPage">
</movefolderForm> </movefolderForm>
</div> </div>
</template> </template>
...@@ -263,19 +267,21 @@ ...@@ -263,19 +267,21 @@
isShowMoveFolder: false, //是否显示 isShowMoveFolder: false, //是否显示
examObj: {}, //弹窗对象 examObj: {}, //弹窗对象
navList: [], //导航列表 navList: [], //导航列表
IsCreateFolder:false, //是否试卷创建文件夹权限 IsCreateFolder: false, //是否试卷创建文件夹权限
IsCreatePaper:false, //是否创建试卷权限 IsCreatePaper: false, //是否创建试卷权限
multipleSelection: [], multipleSelection: [],
MoveIds:'' MoveIds: '',
currentUserInfo: {}, //当前登录用户
} }
}, },
created() { created() {
let userinfo = this.getLocalStorage(); let userinfo = this.getLocalStorage();
userinfo.ActionMenuList.map(x=>{//判断权限 this.currentUserInfo = userinfo;
if(x.FunctionCode == "Paper_CreateManager"){//判断是否试卷创建文件夹权限 userinfo.ActionMenuList.map(x => { //判断权限
if (x.FunctionCode == "Paper_CreateManager") { //判断是否试卷创建文件夹权限
this.IsCreateFolder = true; this.IsCreateFolder = true;
} }
if(x.FunctionCode == "Paper_CreatePaper"){//判断是否创建 if (x.FunctionCode == "Paper_CreatePaper") { //判断是否创建
this.IsCreatePaper = true; this.IsCreatePaper = true;
} }
}) })
...@@ -286,26 +292,26 @@ ...@@ -286,26 +292,26 @@
}, },
methods: { methods: {
//全选 //全选
handleSelectionChange(val){ handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val;
var myArray=[]; var myArray = [];
if(this.multipleSelection.length>0){ if (this.multipleSelection.length > 0) {
this.multipleSelection.forEach(x=>{ this.multipleSelection.forEach(x => {
myArray.push(x.PaperId); myArray.push(x.PaperId);
}) })
this.MoveIds = myArray.toString(); this.MoveIds = myArray.toString();
} }
}, },
//移动文件 //移动文件
movePaperFile(){ movePaperFile() {
if(this.multipleSelection.length==0){ if (this.multipleSelection.length == 0) {
this.$q.notify({ this.$q.notify({
type: 'negative', type: 'negative',
position: "top", position: "top",
message: `请选择文件夹` message: `请选择文件夹`
}) })
return return
}else{ } else {
this.isShowMoveFolder = true; this.isShowMoveFolder = true;
} }
}, },
...@@ -315,7 +321,7 @@ ...@@ -315,7 +321,7 @@
//创建试卷 //创建试卷
CreatePaper() { CreatePaper() {
this.OpenNewUrl('/exam/paperCreate', { this.OpenNewUrl('/exam/paperCreate', {
ToParentId:this.msg.ParentId ToParentId: this.msg.ParentId
}) })
}, },
//翻页 //翻页
...@@ -349,14 +355,15 @@ ...@@ -349,14 +355,15 @@
}, },
//点击编辑 跳转 //点击编辑 跳转
goExameEdit(item) { goExameEdit(item) {
let PaperId = 0; var obj = {
Id: 0,
ToParentId: this.msg.ParentId
}
if (item) { if (item) {
PaperId = item.PaperId obj.Id = item.PaperId;
obj.ToParentId = item.ParentId;
} }
this.OpenNewUrl('/exam/paperEdit', { this.OpenNewUrl('/exam/paperEdit', obj)
Id: PaperId,
ToParentId: this.msg.ParentId
})
}, },
//新增修改文件夹 //新增修改文件夹
showExamFolder(obj) { showExamFolder(obj) {
...@@ -421,6 +428,14 @@ ...@@ -421,6 +428,14 @@
}); });
}) })
}, },
//批量删除
batchDelete() {
var msg = {
PaperIds: this.MoveIds
}
var message = "是否要删除选中的文件信息";
this.deletePaperCommon(msg, message);
},
//删除 //删除
deletePaperInfo(item) { deletePaperInfo(item) {
var msg = { var msg = {
...@@ -432,9 +447,12 @@ ...@@ -432,9 +447,12 @@
} else { } else {
message = "是否要删除【" + item.PaperName + "】试卷?" message = "是否要删除【" + item.PaperName + "】试卷?"
} }
this.deletePaperCommon(msg, message);
},
deletePaperCommon(msg, tipMsg) {
this.$q.dialog({ this.$q.dialog({
title: '提示信息', title: '提示信息',
message: message, message: tipMsg,
cancel: true, cancel: true,
persistent: true, persistent: true,
ok: "确定", ok: "确定",
...@@ -454,6 +472,7 @@ ...@@ -454,6 +472,7 @@
}); });
}) })
} }
} }
} }
......
...@@ -239,7 +239,7 @@ ...@@ -239,7 +239,7 @@
</div> </div>
</div> </div>
<div style="width:20%;text-align:right;"> <div style="width:20%;text-align:right;">
<q-btn color="accent" size="sm" class="q-mr-md" label="预览" /> <q-btn color="accent" size="sm" class="q-mr-md" label="预览" style="display:none;" />
<q-btn color="accent" size="sm" class="q-mr-md" label="保存并返回" :loading="savePaperLoading" <q-btn color="accent" size="sm" class="q-mr-md" label="保存并返回" :loading="savePaperLoading"
@click="SavePaper()" /> @click="SavePaper()" />
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment