|
|
|
@ -3,23 +3,24 @@ |
|
|
|
|
<div class="side"> |
|
|
|
|
<div class="m-b-20"> |
|
|
|
|
<h6 class="page-name">题库分类</h6> |
|
|
|
|
<el-radio-group v-model="type" @change="typeChange"> |
|
|
|
|
<el-radio-group v-model="isNotJoin" @change="typeChange"> |
|
|
|
|
<div class="m-b-10"> |
|
|
|
|
<el-radio :label="1">所有题库</el-radio> |
|
|
|
|
<el-radio :label="0">所有题库</el-radio> |
|
|
|
|
</div> |
|
|
|
|
<div> |
|
|
|
|
<el-radio :label="2">未加入分类的题库</el-radio> |
|
|
|
|
<el-radio :label="1">未加入分类的题库</el-radio> |
|
|
|
|
</div> |
|
|
|
|
</el-radio-group> |
|
|
|
|
</div> |
|
|
|
|
<el-divider></el-divider> |
|
|
|
|
<div> |
|
|
|
|
|
|
|
|
|
<el-input class="m-b-10" placeholder="请输入题库分类" prefix-icon="el-icon-search" size="small" clearable></el-input> |
|
|
|
|
<el-input class="m-b-10" placeholder="请输入题库分类" prefix-icon="el-icon-search" size="small" clearable |
|
|
|
|
v-model="keyword"></el-input> |
|
|
|
|
<div style="height: 504px; max-height: 504px; overflow: auto"> |
|
|
|
|
<el-tree :data="orgList" default-expand-all ref="orgTree" node-key="id" highlight-current |
|
|
|
|
<el-tree :data="types" default-expand-all ref="typeTree" node-key="id" highlight-current |
|
|
|
|
:expand-on-click-node="false" @node-click="handleNodeClick" |
|
|
|
|
:props="{ children: 'children', label: 'partnerClassificationName', isLeaf: 'leaf' }"></el-tree> |
|
|
|
|
:props="{ children: 'children', label: 'name', isLeaf: 'leaf' }"></el-tree> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
@ -36,7 +37,7 @@ |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<label>搜索</label> |
|
|
|
|
<el-input style="width: 250px;" placeholder="请输入题库名称" prefix-icon="el-icon-search" v-model="filter.keyWord" |
|
|
|
|
<el-input style="width: 250px;" placeholder="请输入题库名称" prefix-icon="el-icon-search" v-model="filter.name" |
|
|
|
|
clearable></el-input> |
|
|
|
|
</li> |
|
|
|
|
</ul> |
|
|
|
@ -46,23 +47,25 @@ |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<el-table :data="list" class="table" ref="table" stripe header-align="center" |
|
|
|
|
@selection-change="handleSelectionChange" row-key="id"> |
|
|
|
|
@selection-change="handleSelectionChange" row-key="id" @sort-change="sortChange"> |
|
|
|
|
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> |
|
|
|
|
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="userName" label="题库名称" align="center" min-width="100"></el-table-column> |
|
|
|
|
<el-table-column prop="account" label="描述" align="center" min-width="100"></el-table-column> |
|
|
|
|
<el-table-column prop="phone" label="题库分类" align="center" min-width="120"></el-table-column> |
|
|
|
|
<el-table-column prop="invitationAccount" label="题目数量" align="center" min-width="120"></el-table-column> |
|
|
|
|
<el-table-column prop="loginNumber" label="创建时间" align="center" width="120"></el-table-column> |
|
|
|
|
<el-table-column prop="lastLoginTime" label="创建人" align="center" width="120"></el-table-column> |
|
|
|
|
<el-table-column label="操作" align="center" width="300"> |
|
|
|
|
<el-table-column prop="questionBankName" label="题库名称" align="center" min-width="120"></el-table-column> |
|
|
|
|
<el-table-column prop="questionBankDescription" label="描述" align="center" min-width="120" |
|
|
|
|
show-overflow-tooltip></el-table-column> |
|
|
|
|
<el-table-column prop="questionBankCategory" label="题库分类" align="center" min-width="120"></el-table-column> |
|
|
|
|
<el-table-column prop="questionsNum" label="题目数量" align="center" width="100" |
|
|
|
|
sortable="custom"></el-table-column> |
|
|
|
|
<el-table-column prop="createTime" label="创建时间" align="center" width="160" sortable="custom"></el-table-column> |
|
|
|
|
<el-table-column prop="createUserName" label="创建人" align="center" width="100"></el-table-column> |
|
|
|
|
<el-table-column label="操作" align="center" width="280"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-button type="text" @click="edit(scope.row)">试题管理</el-button> |
|
|
|
|
<el-button type="text" @click="edit(scope.row)">编辑</el-button> |
|
|
|
|
<el-button type="text" @click="del(scope.row)">复制</el-button> |
|
|
|
|
<el-button type="text" @click="edit(scope.row, 0)">编辑</el-button> |
|
|
|
|
<el-button type="text" @click="edit(scope.row, 1)">复制</el-button> |
|
|
|
|
<el-button type="text" @click="del(scope.row)">删除</el-button> |
|
|
|
|
<el-switch v-model="scope.row.ztOpen" :active-value="0" :inactive-value="1" style="margin: 0 10px 0 5px" |
|
|
|
|
:active-text="scope.row.ztOpen ? '关' : '开'" |
|
|
|
|
<el-switch v-model="scope.row.status" :active-value="1" :inactive-value="0" style="margin: 0 10px 0 5px" |
|
|
|
|
:active-text="scope.row.status ? '开' : '关'" |
|
|
|
|
@change="switchOff($event, scope.row, scope.$index)"></el-switch> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
@ -72,20 +75,19 @@ |
|
|
|
|
:total="total"></el-pagination> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<el-dialog :title="!form.id ? '创建题库' : '编辑题库'" :visible.sync="quesBankVisible" width="400px" |
|
|
|
|
<el-dialog :title="isCopy ? '复制题库' : !form.id ? '创建题库' : '编辑题库'" :visible.sync="quesBankVisible" width="400px" |
|
|
|
|
:close-on-click-modal="false"> |
|
|
|
|
<el-form label-width="80px"> |
|
|
|
|
<p v-if="isCopy" style="margin: -10px 0 20px;font-size: 12px;color: #f00;">您将复制当前题库中的所有题目到新题库,请输入新题库名称</p> |
|
|
|
|
<el-form :model="form" :rules="rules" label-width="80px"> |
|
|
|
|
<el-form-item prop="userName" label="分类"> |
|
|
|
|
<el-select style="width: 100%" v-model="form.provinceId" placeholder="请选择题库分类"> |
|
|
|
|
<el-option v-for="(item, i) in types" :key="i" :label="item.provinceName" |
|
|
|
|
:value="item.provinceId"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
<el-cascader placeholder="请选择题库分类" v-model="form.categoryIds" :options="enableTypes" |
|
|
|
|
:props="{ value: 'id', label: 'name', checkStrictly: true }" clearable></el-cascader> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="userName" label="题库名称"> |
|
|
|
|
<el-input placeholder="请输入题库名称" v-model="form.name"></el-input> |
|
|
|
|
<el-form-item prop="questionBankName" label="题库名称"> |
|
|
|
|
<el-input placeholder="请输入题库名称" v-model="form.questionBankName"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="userName" label="题库描述"> |
|
|
|
|
<el-input placeholder="请输入题库描述" type="textarea" :rows="3" v-model="form.name"></el-input> |
|
|
|
|
<el-form-item prop="questionBankDescription" label="题库描述"> |
|
|
|
|
<el-input placeholder="请输入题库描述" type="textarea" :rows="3" v-model="form.questionBankDescription"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
@ -103,21 +105,25 @@ import Setting from "@/setting"; |
|
|
|
|
export default { |
|
|
|
|
data () { |
|
|
|
|
return { |
|
|
|
|
type: 1, |
|
|
|
|
orgList: [], |
|
|
|
|
loading: false, |
|
|
|
|
keyword: '', |
|
|
|
|
isNotJoin: 0, |
|
|
|
|
types: [], |
|
|
|
|
status: [ |
|
|
|
|
{ |
|
|
|
|
id: 1, |
|
|
|
|
name: '启用' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 2, |
|
|
|
|
id: 0, |
|
|
|
|
name: '禁用' |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
filter: { |
|
|
|
|
questionNumOrderBy: '', |
|
|
|
|
timeOrderBy: '', |
|
|
|
|
status: '', |
|
|
|
|
keyWord: '', |
|
|
|
|
name: '', |
|
|
|
|
}, |
|
|
|
|
list: [], |
|
|
|
|
page: 1, |
|
|
|
@ -125,136 +131,96 @@ export default { |
|
|
|
|
total: 0, |
|
|
|
|
multipleSelection: [], |
|
|
|
|
|
|
|
|
|
types: [], |
|
|
|
|
form: { |
|
|
|
|
userName: '', |
|
|
|
|
provinceId: '', |
|
|
|
|
cityId: '', |
|
|
|
|
roleList: [] |
|
|
|
|
questionBankDescription: '', |
|
|
|
|
questionBankName: '', |
|
|
|
|
categoryIds: [], |
|
|
|
|
}, |
|
|
|
|
rules: { |
|
|
|
|
userName: [ |
|
|
|
|
{ required: true, message: "请输入姓名", trigger: "blur" } |
|
|
|
|
], |
|
|
|
|
provinceId: [ |
|
|
|
|
{ required: true, message: '请选择省份', trigger: "change" } |
|
|
|
|
], |
|
|
|
|
cityId: [ |
|
|
|
|
{ required: true, message: '请选择城市', trigger: "change" } |
|
|
|
|
], |
|
|
|
|
roleList: [ |
|
|
|
|
{ required: true, message: '请选择角色', trigger: "change" } |
|
|
|
|
], |
|
|
|
|
questionBankName: [ |
|
|
|
|
{ required: true, message: '请输入题库名称', trigger: 'blur' } |
|
|
|
|
] |
|
|
|
|
}, |
|
|
|
|
enableTypes: [], |
|
|
|
|
quesBankVisible: false, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
submiting: false, // 新增编辑防抖标识 |
|
|
|
|
setKey: '', |
|
|
|
|
transferVisible: false, |
|
|
|
|
chooseVisible: false, |
|
|
|
|
members: [], |
|
|
|
|
choosePartnerId: '', |
|
|
|
|
curRow: '', |
|
|
|
|
provinces: [], |
|
|
|
|
cities: [], |
|
|
|
|
editVisible: false |
|
|
|
|
submiting: false, |
|
|
|
|
isCopy: false, |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
watch: { |
|
|
|
|
keyWord: function (val) { |
|
|
|
|
clearTimeout(this.searchTimer); |
|
|
|
|
this.searchTimer = setTimeout(this.initData, 500); |
|
|
|
|
keyword: function (val) { |
|
|
|
|
clearTimeout(this.searchTimer) |
|
|
|
|
this.searchTimer = setTimeout(this.getType, 500) |
|
|
|
|
}, |
|
|
|
|
'filter.name': function (val) { |
|
|
|
|
clearTimeout(this.searchTimer) |
|
|
|
|
this.searchTimer = setTimeout(this.initData, 500) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
mounted () { |
|
|
|
|
this.getOrg() |
|
|
|
|
this.getType() |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
// 获取组织 |
|
|
|
|
async getOrg () { |
|
|
|
|
const res = await this.$post(this.api.listParner) |
|
|
|
|
const list = res.treeList |
|
|
|
|
// 没有子级,删除children属性 |
|
|
|
|
const handleLeaf = (list, ids) => { |
|
|
|
|
list.map(e => { |
|
|
|
|
e.ids = ids ? [...ids, e.id] : [e.id] |
|
|
|
|
if (e.children.length) { |
|
|
|
|
if (e.isTeam) { |
|
|
|
|
delete e.children |
|
|
|
|
} else { |
|
|
|
|
handleLeaf(e.children, e.ids) |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
delete e.children |
|
|
|
|
} |
|
|
|
|
// 获取题库分类 |
|
|
|
|
async getType () { |
|
|
|
|
try { |
|
|
|
|
this.loading = true |
|
|
|
|
const { data } = await this.$post(this.api.getAllQuestionBankCategories, { |
|
|
|
|
keyword: this.keyword, |
|
|
|
|
createSource: 1, |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
handleLeaf(list) |
|
|
|
|
this.orgList = list |
|
|
|
|
this.handleList(data) |
|
|
|
|
this.types = data |
|
|
|
|
// 如果刚编辑完,则选中刚编辑的分类 |
|
|
|
|
this.setKey && this.$nextTick(() => { |
|
|
|
|
this.$refs.orgTree.setCurrentKey(this.setKey) |
|
|
|
|
this.$refs.typeTree.setCurrentKey(this.setKey) |
|
|
|
|
}) |
|
|
|
|
this.getList() |
|
|
|
|
} finally { |
|
|
|
|
this.loading = false |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 处理树形 |
|
|
|
|
handleList (list) { |
|
|
|
|
list.map(e => { |
|
|
|
|
if (e.children && e.children.length) { |
|
|
|
|
this.handleList(e.children) |
|
|
|
|
} else { |
|
|
|
|
delete e.children |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 类型回调 |
|
|
|
|
typeChange () { |
|
|
|
|
this.$refs.orgTree.setCurrentKey(null) |
|
|
|
|
this.curTeamId = '' |
|
|
|
|
this.$refs.typeTree.setCurrentKey(null) |
|
|
|
|
this.initData() |
|
|
|
|
}, |
|
|
|
|
// 获得点击层级里的第一个城市合伙人id |
|
|
|
|
getTeamId (list) { |
|
|
|
|
for (const i in list) { |
|
|
|
|
const e = list[i] |
|
|
|
|
if (e.isTeam && !this.curTeamId) { |
|
|
|
|
this.curTeamId = e.id |
|
|
|
|
break |
|
|
|
|
} else { |
|
|
|
|
this.getTeamId(e.children) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 点击树节点查询列表数据 |
|
|
|
|
handleNodeClick (data) { |
|
|
|
|
this.type = '' |
|
|
|
|
this.curTeamId = '' |
|
|
|
|
if (data.isTeam) { |
|
|
|
|
this.curTeamId = data.id |
|
|
|
|
} else { |
|
|
|
|
// this.getTeamId(data.children) |
|
|
|
|
} |
|
|
|
|
if (!this.curTeamId) this.curTeamId = data.id |
|
|
|
|
this.isNotJoin = '' |
|
|
|
|
this.initData() |
|
|
|
|
this.$refs.table.clearSelection() |
|
|
|
|
}, |
|
|
|
|
// 查询全部 |
|
|
|
|
getAll () { |
|
|
|
|
this.curTeamId = '' |
|
|
|
|
this.getList() |
|
|
|
|
}, |
|
|
|
|
// 员工列表 |
|
|
|
|
getList () { |
|
|
|
|
this.$post(this.api[this.type ? 'partnerAccountMergeList' : 'partnerAccountList'], { |
|
|
|
|
type: this.type || 1, |
|
|
|
|
partnerClassificationId: this.curTeamId, |
|
|
|
|
// 题库列表 |
|
|
|
|
async getList () { |
|
|
|
|
const res = await this.$post(this.api.questionBankList, { |
|
|
|
|
...this.filter, |
|
|
|
|
isNotJoin: this.isNotJoin || '', |
|
|
|
|
pageNum: this.page, |
|
|
|
|
pageSize: this.pageSize |
|
|
|
|
}).then(({ pageList }) => { |
|
|
|
|
pageList.records.forEach((e, i) => { |
|
|
|
|
e.id = i |
|
|
|
|
pageSize: this.pageSize, |
|
|
|
|
questionCategoryId: this.$refs.typeTree.getCurrentKey() || '', |
|
|
|
|
}) |
|
|
|
|
this.list = pageList.records |
|
|
|
|
this.total = pageList.total |
|
|
|
|
}).catch(err => { }) |
|
|
|
|
this.list = res.message.records |
|
|
|
|
this.total = res.message.total |
|
|
|
|
}, |
|
|
|
|
// 切换页码 |
|
|
|
|
currentChange (val) { |
|
|
|
|
this.page = val |
|
|
|
|
this.getList() |
|
|
|
|
}, |
|
|
|
|
handleSelectionChange (val) { // 多选 |
|
|
|
|
// 多选 |
|
|
|
|
handleSelectionChange (val) { |
|
|
|
|
this.multipleSelection = val |
|
|
|
|
}, |
|
|
|
|
initData () { |
|
|
|
@ -262,80 +228,93 @@ export default { |
|
|
|
|
this.page = 1 |
|
|
|
|
this.getList() |
|
|
|
|
}, |
|
|
|
|
// 排序回调 |
|
|
|
|
sortChange (column) { |
|
|
|
|
// 1上2下 |
|
|
|
|
if (column.prop === 'questionNumOrderBy') this.filter.questionNumOrderBy = column.order ? column.order === 'ascending' ? 'asc' : 'desc' : '' |
|
|
|
|
if (column.prop === 'createTime') this.filter.timeOrderBy = column.order ? column.order === 'ascending' ? 'asc' : 'desc' : '' |
|
|
|
|
this.getList() |
|
|
|
|
}, |
|
|
|
|
// 删除 |
|
|
|
|
del (row) { |
|
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
|
type: "warning" |
|
|
|
|
}).then(() => { |
|
|
|
|
this.$post(`${this.api.delPartnerAccount}?accountId=${row.accountId}`).then(res => { |
|
|
|
|
Util.successMsg("删除成功") |
|
|
|
|
async del (row) { |
|
|
|
|
try { |
|
|
|
|
await this.$confirm(`<p>确认要删除【${row.questionBankName}】吗?</p><p style="color: #f56c6c;">删除后,题库中的知识点框架与题目将会被删除,请谨慎操作!</p>`, '提示', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
closeOnClickModal: false, |
|
|
|
|
dangerouslyUseHTMLString: true, |
|
|
|
|
}) |
|
|
|
|
await this.$post(this.api.questionBankDel, [row.id]) |
|
|
|
|
Util.successMsg('删除成功') |
|
|
|
|
this.getList() |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
}).catch(() => { }) |
|
|
|
|
} catch (e) { } |
|
|
|
|
}, |
|
|
|
|
async switchOff (val, row) { |
|
|
|
|
this.$post(this.api.disabledEventsCompetition, { |
|
|
|
|
competitionId: row.id, |
|
|
|
|
isOpen: val, |
|
|
|
|
type: 0 // 禁用平台来源(0中台,1职站) |
|
|
|
|
}).then(res => { |
|
|
|
|
Util.successMsg(val == 1 ? '禁用成功' : '启用成功') |
|
|
|
|
}).catch(err => { }) |
|
|
|
|
|
|
|
|
|
await this.$post(`${this.api.refreshPageNotification}?content=1`) |
|
|
|
|
}, |
|
|
|
|
// 编辑 |
|
|
|
|
edit (row) { |
|
|
|
|
if (!row.provinceId) row.provinceId = '' |
|
|
|
|
if (!row.cityId) row.cityId = '' |
|
|
|
|
row.roleList = row.roleId.split(',').map(e => +e) |
|
|
|
|
this.editVisible = true |
|
|
|
|
this.form = JSON.parse(JSON.stringify(row)) |
|
|
|
|
}, |
|
|
|
|
// 编辑提交 |
|
|
|
|
submitEdit () { |
|
|
|
|
this.$refs.form.validate((valid) => { |
|
|
|
|
if (valid) { |
|
|
|
|
if (this.submiting) return false |
|
|
|
|
this.submiting = true |
|
|
|
|
const form = JSON.parse(JSON.stringify(this.form)) |
|
|
|
|
form.classificationId = form.partnerClassificationId |
|
|
|
|
this.$post(this.api.editProvinceCity, form).then(res => { |
|
|
|
|
await this.$post(`${this.api.questionBankDisable}?id=${row.id}&status=${val}`) |
|
|
|
|
Util.successMsg(val ? '启用成功' : '禁用成功') |
|
|
|
|
this.getList() |
|
|
|
|
Util.successMsg("编辑成功!") |
|
|
|
|
this.editVisible = false |
|
|
|
|
setTimeout(() => { |
|
|
|
|
this.submiting = false |
|
|
|
|
}, 2000) |
|
|
|
|
}).catch(res => { |
|
|
|
|
setTimeout(() => { |
|
|
|
|
this.submiting = false |
|
|
|
|
}, 2000) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 添加 |
|
|
|
|
add () { |
|
|
|
|
this.getEnableType() |
|
|
|
|
this.isCopy = false |
|
|
|
|
const type = this.$refs.typeTree.getCurrentNode() |
|
|
|
|
this.form = { |
|
|
|
|
questionBankDescription: '', |
|
|
|
|
questionBankName: '', |
|
|
|
|
categoryIds: type ? type.path.split('/').map(e => +e) : [], |
|
|
|
|
} |
|
|
|
|
this.quesBankVisible = true |
|
|
|
|
}, |
|
|
|
|
// 编辑/复制 |
|
|
|
|
async edit (row, isCopy) { |
|
|
|
|
this.getEnableType() |
|
|
|
|
this.isCopy = isCopy |
|
|
|
|
const res = await this.$post(`${this.api.questionBankFind}?id=${row.id}`) |
|
|
|
|
const type = res.message.questionBankCategoryRelations |
|
|
|
|
this.quesBankVisible = true |
|
|
|
|
this.form = { |
|
|
|
|
id: row.id, |
|
|
|
|
questionBankName: row.questionBankName, |
|
|
|
|
questionBankDescription: row.questionBankDescription, |
|
|
|
|
categoryIds: type && type.length ? type[0].path.split('/').map(e => +e) : [], |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 获取启用的题库分类 |
|
|
|
|
async getEnableType () { |
|
|
|
|
if (!this.enableTypes.length) { |
|
|
|
|
try { |
|
|
|
|
const { data } = await this.$post(this.api.getAllQuestionBankCategories, { |
|
|
|
|
createSource: 1, |
|
|
|
|
status: 1, |
|
|
|
|
}) |
|
|
|
|
this.handleList(data) |
|
|
|
|
this.enableTypes = data |
|
|
|
|
} catch (e) { } |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 题库提交 |
|
|
|
|
quesBankSubmit () { |
|
|
|
|
|
|
|
|
|
async quesBankSubmit () { |
|
|
|
|
if (this.submiting) return false |
|
|
|
|
const { form } = this |
|
|
|
|
if (!form.categoryIds.length) return Util.warningMsg('请选择分类') |
|
|
|
|
if (!form.questionBankName) return Util.warningMsg('请输入题库名称') |
|
|
|
|
this.submiting = true |
|
|
|
|
if (form.categoryIds.length) form.categoryIds = [form.categoryIds[form.categoryIds.length - 1]] |
|
|
|
|
// form.systemId = this.systemId |
|
|
|
|
form.createSource = 1 |
|
|
|
|
await this.$post(this.api.questionBankSave, form) |
|
|
|
|
Util.successMsg('保存成功') |
|
|
|
|
this.quesBankVisible = false |
|
|
|
|
this.submiting = false |
|
|
|
|
this.getList() |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
|
.org-name { |
|
|
|
|
margin-right: 20px; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.w-100 { |
|
|
|
|
width: 100%; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.page { |
|
|
|
|
display: flex; |
|
|
|
|
padding: 0 24px; |
|
|
|
|