Commit 490ce2f2 authored by 黄奎's avatar 黄奎

页面修改

parent 6c03ffa1
<template> <template>
<q-dialog v-model="persistent" content-class="bg-grey-1" persistent transition-show="scale" transition-hide="scale"> <q-dialog v-model="persistent" content-class="bg-grey-1" persistent transition-show="scale" transition-hide="scale">
<q-card style="width: 800px;max-width:900px;"> <q-card style="width: 500px;max-width:500px;">
<q-card-section> <q-card-section>
<div class="text-h6">{{objOption.PaperId==0?'新增文件夹':'修改文件夹名称'}}</div> <div class="text-h6">{{objOption.PaperId==0?'新增文件夹':'修改文件夹名称'}}</div>
</q-card-section> </q-card-section>
<q-card-section class="q-pt-none scroll" style="max-height: 70vh"> <q-card-section class="q-pt-none scroll" style="max-height: 70vh">
<div class="text-caption q-mb-md q-px-xs text-grey-6">基本资料</div>
<div class="row wrap"> <div class="row wrap">
<q-input filled stack-label maxlength="50" :dense="false" v-model="objOption.PaperName" ref="PaperName" <q-input filled stack-label maxlength="50" :dense="false" v-model="objOption.PaperName" ref="PaperName"
class="col-6 q-pr-lg q-pb-lg" label="文件夹名称" :rules="[val => !!val || '请填写文件夹名称']" /> class="col-12 q-pr-lg q-pb-lg" label="文件夹名称" :rules="[val => !!val || '请填写文件夹名称']" />
</div> </div>
</q-card-section> </q-card-section>
<q-separator /> <q-separator />
...@@ -53,13 +52,13 @@ ...@@ -53,13 +52,13 @@
methods: { methods: {
initObj() { initObj() {
if (this.saveObj) { if (this.saveObj) {
this.optionTitle = "修改助教信息" this.optionTitle = "修改文件夹名称"
this.objOption.PaperId = this.saveObj.PaperId; this.objOption.PaperId = this.saveObj.PaperId;
this.objOption.PaperName = this.saveObj.PaperName; this.objOption.PaperName = this.saveObj.PaperName;
this.objOption.PaperType = this.saveObj.PaperType; this.objOption.PaperType = this.saveObj.PaperType;
this.objOption.ParentId = this.saveObj.ParentId; this.objOption.ParentId = this.saveObj.ParentId;
} else { } else {
this.optionTitle = "新增助教" this.optionTitle = "新增文件夹"
} }
}, },
closeSaveForm() { closeSaveForm() {
......
...@@ -35,35 +35,63 @@ ...@@ -35,35 +35,63 @@
label="输入试卷名称、组卷人查找" /> label="输入试卷名称、组卷人查找" />
</div> </div>
</div> </div>
<div class="page-option">
<q-btn color="accent" size="sm" class="q-mr-md" label="新增文件夹" @click="showExamFolder(null)" />
<q-btn color="accent" size="sm" class="q-mr-md" label="新增试卷" @click="CreatePaper()" />
</div>
</div> </div>
<div class="page-content"> <div class="page-content">
<q-table :pagination="msg" :loading="loading" no-data-label="暂无相关数据" flat <el-table :data="dataList" v-loading="loading" :expand-row-keys="expandKeys" :default-expand-all="true"
class="sticky-column-table sticky-right-column-table" separator="none" :data="dataList" :columns="columns" class="tree-tab-chapter" style="width: 100%;margin-bottom: 20px;" row-key="PaperId" ref="examPaperTab"
row-key="name"> @row-click="rowsClick" :tree-props="{ children: 'ChildList', hasChildren: 'hasChildren' }">
<template v-slot:top="props"> <el-table-column prop="PaperName" label="文件夹/试卷" width="450">
<div class="col-2 q-table__title">试卷管理</div> <template slot-scope="scope">
<q-space /> {{ scope.row.PaperName }}
<q-btn color="accent" size="sm" class="q-mr-md" label="新增文件夹" @click="CreatePaper()" />
<q-btn color="accent" size="sm" class="q-mr-md" label="新增试卷" @click="CreatePaper()" />
</template> </template>
<template v-slot:bottom> </el-table-column>
<q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="pageCount" <el-table-column prop="QuestionCount" label="题量" width="100">
:input="true" @input="changePage" /> <template slot-scope="scope">
{{ scope.row.QuestionCount }}
</template>
</el-table-column>
<el-table-column prop="DifficultyTypeName" label="难度" width="200">
<template slot-scope="scope">
{{ scope.row.DifficultyTypeName }}
</template> </template>
<template v-slot:body-cell-PaperId="props"> </el-table-column>
<q-td :props="props" style="width:100px;"> <el-table-column prop="PublishCount" label="发放次数" width="200">
<q-btn flat size="xs" color="primary" style="font-weight:400" label="封存" /> <template slot-scope="scope">
<q-btn flat size="xs" color="primary" style="font-weight:400" label="预览" /> {{ scope.row.PublishCount }}
<q-btn flat size="xs" color="primary" style="font-weight:400" @click="goExameEdit(props.row)" label="编辑" /> </template>
<q-btn flat size="xs" color="primary" style="font-weight:400" label="复制" /> </el-table-column>
<q-btn flat size="xs" color="primary" style="font-weight:400" label="发布考试" /> <el-table-column prop="CreateByName" label="创建人" width="200">
<q-btn flat size="xs" color="primary" style="font-weight:400" label="分配管理" /> <template slot-scope="scope">
<q-btn flat size="xs" color="primary" style="font-weight:400" label="删除" /> {{ scope.row.CreateByName }}
<q-btn flat size="xs" color="primary" style="font-weight:400" label="详情" /> </template>
</q-td> </el-table-column>
<el-table-column prop="CreateTimeStr" label="创建时间" width="200">
<template slot-scope="scope">
{{ scope.row.CreateTimeStr }}
</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<template v-if="scope.row.PaperType==1">
<q-btn flat size="xs" color="primary" style="font-weight:400" @click="showExamFolder(scope.row)"
label="重命名" />
</template>
<template v-if="scope.row.PaperType==2">
<q-btn flat size="xs" color="primary" style="font-weight:400" @click="goExameEdit(scope.row)"
label="编辑" />
</template>
</template> </template>
</q-table> </el-table-column>
</el-table>
<q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="pageCount"
:input="true" @input="changePage" />
</div> </div>
<paperfolderForm v-if="isShowExamFolder" :saveObj="examObj"  @close="closeExamForm"  @success="refreshPage"></paperfolderForm>
</div> </div>
</template> </template>
<script> <script>
...@@ -84,59 +112,16 @@ ...@@ -84,59 +112,16 @@
data: [], data: [],
msg: { msg: {
pageIndex: 1, pageIndex: 1,
pageSize: 12, pageSize: 10,
rowsPerPage: 12, rowsPerPage: 10,
PaperName: '' //题库名 PaperName: '' //题库名
}, },
pageCount: 0, pageCount: 0,
loading: false, loading: false,
tikuList: [{
Id: 0,
Name: '全部'
}, {
Id: 1,
Name: '测试题库'
}, {
Id: 2,
Name: '质量管理与可靠性'
}],
dataList: [], dataList: [],
columns: [{ expandKeys: [],
name: 'PaperName', isShowExamFolder: false, //是否显示新增文件夹
label: '试卷名称', examObj: {}, //弹窗对象
field: 'PaperName',
align: 'left'
},
{
name: 'QuestionCount',
label: '题量',
field: 'QuestionCount',
align: 'left'
},
{
name: 'DifficultyTypeName',
label: '难度',
field: 'DifficultyTypeName',
align: 'left'
},
{
name: 'PublishCount',
label: '发放次数',
field: 'PublishCount',
align: 'left'
},
{
name: 'CreateByName',
label: '创建人',
field: 'CreateByName',
align: 'left'
},
{
name: 'PaperId',
label: '操作',
field: 'PaperId'
}
],
} }
}, },
created() {}, created() {},
...@@ -144,6 +129,9 @@ ...@@ -144,6 +129,9 @@
this.getList(); this.getList();
}, },
methods: { methods: {
rowsClick(row, column, event) {
this.$refs.examPaperTab.toggleRowExpansion(row);
},
//创建试卷 //创建试卷
CreatePaper() { CreatePaper() {
this.OpenNewUrl('/exam/examCreate', {}) this.OpenNewUrl('/exam/examCreate', {})
...@@ -174,6 +162,15 @@ ...@@ -174,6 +162,15 @@
this.OpenNewUrl('/exam/examEdit', { this.OpenNewUrl('/exam/examEdit', {
Id: item.PaperId Id: item.PaperId
}) })
},
//新增修改文件夹
showExamFolder(obj) {
this.examObj = obj;
this.isShowExamFolder = true;
},
//关闭弹窗
closeExamForm() {
this.isShowExamFolder = false;
} }
} }
} }
......
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