|
|
@ -3,23 +3,24 @@ |
|
|
|
<div class="side"> |
|
|
|
<div class="side"> |
|
|
|
<div class="m-b-20"> |
|
|
|
<div class="m-b-20"> |
|
|
|
<h6 class="page-name">题库分类</h6> |
|
|
|
<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"> |
|
|
|
<div class="m-b-10"> |
|
|
|
<el-radio :label="1">所有题库</el-radio> |
|
|
|
<el-radio :label="0">所有题库</el-radio> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<el-radio :label="2">未加入分类的题库</el-radio> |
|
|
|
<el-radio :label="1">未加入分类的题库</el-radio> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-radio-group> |
|
|
|
</el-radio-group> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-divider></el-divider> |
|
|
|
<el-divider></el-divider> |
|
|
|
<div> |
|
|
|
<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"> |
|
|
|
<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" |
|
|
|
: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> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -36,7 +37,7 @@ |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
<li> |
|
|
|
<li> |
|
|
|
<label>搜索</label> |
|
|
|
<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> |
|
|
|
clearable></el-input> |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
</ul> |
|
|
@ -46,23 +47,25 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<el-table :data="list" class="table" ref="table" stripe header-align="center" |
|
|
|
<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="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 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="questionBankName" label="题库名称" align="center" min-width="120"></el-table-column> |
|
|
|
<el-table-column prop="account" label="描述" align="center" min-width="100"></el-table-column> |
|
|
|
<el-table-column prop="questionBankDescription" label="描述" align="center" min-width="120" |
|
|
|
<el-table-column prop="phone" label="题库分类" align="center" min-width="120"></el-table-column> |
|
|
|
show-overflow-tooltip></el-table-column> |
|
|
|
<el-table-column prop="invitationAccount" label="题目数量" align="center" min-width="120"></el-table-column> |
|
|
|
<el-table-column prop="questionBankCategory" 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="questionsNum" label="题目数量" align="center" width="100" |
|
|
|
<el-table-column prop="lastLoginTime" label="创建人" align="center" width="120"></el-table-column> |
|
|
|
sortable="custom"></el-table-column> |
|
|
|
<el-table-column label="操作" align="center" width="300"> |
|
|
|
<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"> |
|
|
|
<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="edit(scope.row)">编辑</el-button> |
|
|
|
<el-button type="text" @click="edit(scope.row, 0)">编辑</el-button> |
|
|
|
<el-button type="text" @click="del(scope.row)">复制</el-button> |
|
|
|
<el-button type="text" @click="edit(scope.row, 1)">复制</el-button> |
|
|
|
<el-button type="text" @click="del(scope.row)">删除</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" |
|
|
|
<el-switch v-model="scope.row.status" :active-value="1" :inactive-value="0" style="margin: 0 10px 0 5px" |
|
|
|
:active-text="scope.row.ztOpen ? '关' : '开'" |
|
|
|
:active-text="scope.row.status ? '开' : '关'" |
|
|
|
@change="switchOff($event, scope.row, scope.$index)"></el-switch> |
|
|
|
@change="switchOff($event, scope.row, scope.$index)"></el-switch> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
@ -72,20 +75,19 @@ |
|
|
|
:total="total"></el-pagination> |
|
|
|
:total="total"></el-pagination> |
|
|
|
</div> |
|
|
|
</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"> |
|
|
|
: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-form-item prop="userName" label="分类"> |
|
|
|
<el-select style="width: 100%" v-model="form.provinceId" placeholder="请选择题库分类"> |
|
|
|
<el-cascader placeholder="请选择题库分类" v-model="form.categoryIds" :options="enableTypes" |
|
|
|
<el-option v-for="(item, i) in types" :key="i" :label="item.provinceName" |
|
|
|
:props="{ value: 'id', label: 'name', checkStrictly: true }" clearable></el-cascader> |
|
|
|
:value="item.provinceId"></el-option> |
|
|
|
|
|
|
|
</el-select> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="userName" label="题库名称"> |
|
|
|
<el-form-item prop="questionBankName" label="题库名称"> |
|
|
|
<el-input placeholder="请输入题库名称" v-model="form.name"></el-input> |
|
|
|
<el-input placeholder="请输入题库名称" v-model="form.questionBankName"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="userName" label="题库描述"> |
|
|
|
<el-form-item prop="questionBankDescription" label="题库描述"> |
|
|
|
<el-input placeholder="请输入题库描述" type="textarea" :rows="3" v-model="form.name"></el-input> |
|
|
|
<el-input placeholder="请输入题库描述" type="textarea" :rows="3" v-model="form.questionBankDescription"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
@ -103,21 +105,25 @@ import Setting from "@/setting"; |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
data () { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
return { |
|
|
|
type: 1, |
|
|
|
loading: false, |
|
|
|
orgList: [], |
|
|
|
keyword: '', |
|
|
|
|
|
|
|
isNotJoin: 0, |
|
|
|
|
|
|
|
types: [], |
|
|
|
status: [ |
|
|
|
status: [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
id: 1, |
|
|
|
id: 1, |
|
|
|
name: '启用' |
|
|
|
name: '启用' |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
id: 2, |
|
|
|
id: 0, |
|
|
|
name: '禁用' |
|
|
|
name: '禁用' |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
], |
|
|
|
filter: { |
|
|
|
filter: { |
|
|
|
|
|
|
|
questionNumOrderBy: '', |
|
|
|
|
|
|
|
timeOrderBy: '', |
|
|
|
status: '', |
|
|
|
status: '', |
|
|
|
keyWord: '', |
|
|
|
name: '', |
|
|
|
}, |
|
|
|
}, |
|
|
|
list: [], |
|
|
|
list: [], |
|
|
|
page: 1, |
|
|
|
page: 1, |
|
|
@ -125,136 +131,96 @@ export default { |
|
|
|
total: 0, |
|
|
|
total: 0, |
|
|
|
multipleSelection: [], |
|
|
|
multipleSelection: [], |
|
|
|
|
|
|
|
|
|
|
|
types: [], |
|
|
|
|
|
|
|
form: { |
|
|
|
form: { |
|
|
|
userName: '', |
|
|
|
questionBankDescription: '', |
|
|
|
provinceId: '', |
|
|
|
questionBankName: '', |
|
|
|
cityId: '', |
|
|
|
categoryIds: [], |
|
|
|
roleList: [] |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
rules: { |
|
|
|
rules: { |
|
|
|
userName: [ |
|
|
|
questionBankName: [ |
|
|
|
{ required: true, message: "请输入姓名", trigger: "blur" } |
|
|
|
{ required: true, message: '请输入题库名称', trigger: 'blur' } |
|
|
|
], |
|
|
|
] |
|
|
|
provinceId: [ |
|
|
|
|
|
|
|
{ required: true, message: '请选择省份', trigger: "change" } |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
cityId: [ |
|
|
|
|
|
|
|
{ required: true, message: '请选择城市', trigger: "change" } |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
roleList: [ |
|
|
|
|
|
|
|
{ required: true, message: '请选择角色', trigger: "change" } |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
enableTypes: [], |
|
|
|
quesBankVisible: false, |
|
|
|
quesBankVisible: false, |
|
|
|
|
|
|
|
submiting: false, |
|
|
|
|
|
|
|
isCopy: false, |
|
|
|
submiting: false, // 新增编辑防抖标识 |
|
|
|
|
|
|
|
setKey: '', |
|
|
|
|
|
|
|
transferVisible: false, |
|
|
|
|
|
|
|
chooseVisible: false, |
|
|
|
|
|
|
|
members: [], |
|
|
|
|
|
|
|
choosePartnerId: '', |
|
|
|
|
|
|
|
curRow: '', |
|
|
|
|
|
|
|
provinces: [], |
|
|
|
|
|
|
|
cities: [], |
|
|
|
|
|
|
|
editVisible: false |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
watch: { |
|
|
|
keyWord: function (val) { |
|
|
|
keyword: function (val) { |
|
|
|
clearTimeout(this.searchTimer); |
|
|
|
clearTimeout(this.searchTimer) |
|
|
|
this.searchTimer = setTimeout(this.initData, 500); |
|
|
|
this.searchTimer = setTimeout(this.getType, 500) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
'filter.name': function (val) { |
|
|
|
|
|
|
|
clearTimeout(this.searchTimer) |
|
|
|
|
|
|
|
this.searchTimer = setTimeout(this.initData, 500) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted () { |
|
|
|
mounted () { |
|
|
|
this.getOrg() |
|
|
|
this.getType() |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
// 获取组织 |
|
|
|
// 获取题库分类 |
|
|
|
async getOrg () { |
|
|
|
async getType () { |
|
|
|
const res = await this.$post(this.api.listParner) |
|
|
|
try { |
|
|
|
const list = res.treeList |
|
|
|
this.loading = true |
|
|
|
// 没有子级,删除children属性 |
|
|
|
const { data } = await this.$post(this.api.getAllQuestionBankCategories, { |
|
|
|
const handleLeaf = (list, ids) => { |
|
|
|
keyword: this.keyword, |
|
|
|
list.map(e => { |
|
|
|
createSource: 1, |
|
|
|
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 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
this.handleList(data) |
|
|
|
handleLeaf(list) |
|
|
|
this.types = data |
|
|
|
this.orgList = list |
|
|
|
|
|
|
|
// 如果刚编辑完,则选中刚编辑的分类 |
|
|
|
// 如果刚编辑完,则选中刚编辑的分类 |
|
|
|
this.setKey && this.$nextTick(() => { |
|
|
|
this.setKey && this.$nextTick(() => { |
|
|
|
this.$refs.orgTree.setCurrentKey(this.setKey) |
|
|
|
this.$refs.typeTree.setCurrentKey(this.setKey) |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.getList() |
|
|
|
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 () { |
|
|
|
typeChange () { |
|
|
|
this.$refs.orgTree.setCurrentKey(null) |
|
|
|
this.$refs.typeTree.setCurrentKey(null) |
|
|
|
this.curTeamId = '' |
|
|
|
|
|
|
|
this.initData() |
|
|
|
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) { |
|
|
|
handleNodeClick (data) { |
|
|
|
this.type = '' |
|
|
|
this.isNotJoin = '' |
|
|
|
this.curTeamId = '' |
|
|
|
|
|
|
|
if (data.isTeam) { |
|
|
|
|
|
|
|
this.curTeamId = data.id |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
// this.getTeamId(data.children) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!this.curTeamId) this.curTeamId = data.id |
|
|
|
|
|
|
|
this.initData() |
|
|
|
this.initData() |
|
|
|
this.$refs.table.clearSelection() |
|
|
|
this.$refs.table.clearSelection() |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 查询全部 |
|
|
|
// 题库列表 |
|
|
|
getAll () { |
|
|
|
async getList () { |
|
|
|
this.curTeamId = '' |
|
|
|
const res = await this.$post(this.api.questionBankList, { |
|
|
|
this.getList() |
|
|
|
...this.filter, |
|
|
|
}, |
|
|
|
isNotJoin: this.isNotJoin || '', |
|
|
|
// 员工列表 |
|
|
|
|
|
|
|
getList () { |
|
|
|
|
|
|
|
this.$post(this.api[this.type ? 'partnerAccountMergeList' : 'partnerAccountList'], { |
|
|
|
|
|
|
|
type: this.type || 1, |
|
|
|
|
|
|
|
partnerClassificationId: this.curTeamId, |
|
|
|
|
|
|
|
pageNum: this.page, |
|
|
|
pageNum: this.page, |
|
|
|
pageSize: this.pageSize |
|
|
|
pageSize: this.pageSize, |
|
|
|
}).then(({ pageList }) => { |
|
|
|
questionCategoryId: this.$refs.typeTree.getCurrentKey() || '', |
|
|
|
pageList.records.forEach((e, i) => { |
|
|
|
|
|
|
|
e.id = i |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
this.list = pageList.records |
|
|
|
this.list = res.message.records |
|
|
|
this.total = pageList.total |
|
|
|
this.total = res.message.total |
|
|
|
}).catch(err => { }) |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
// 切换页码 |
|
|
|
// 切换页码 |
|
|
|
currentChange (val) { |
|
|
|
currentChange (val) { |
|
|
|
this.page = val |
|
|
|
this.page = val |
|
|
|
this.getList() |
|
|
|
this.getList() |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleSelectionChange (val) { // 多选 |
|
|
|
// 多选 |
|
|
|
|
|
|
|
handleSelectionChange (val) { |
|
|
|
this.multipleSelection = val |
|
|
|
this.multipleSelection = val |
|
|
|
}, |
|
|
|
}, |
|
|
|
initData () { |
|
|
|
initData () { |
|
|
@ -262,80 +228,93 @@ export default { |
|
|
|
this.page = 1 |
|
|
|
this.page = 1 |
|
|
|
this.getList() |
|
|
|
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) { |
|
|
|
async del (row) { |
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
try { |
|
|
|
type: "warning" |
|
|
|
await this.$confirm(`<p>确认要删除【${row.questionBankName}】吗?</p><p style="color: #f56c6c;">删除后,题库中的知识点框架与题目将会被删除,请谨慎操作!</p>`, '提示', { |
|
|
|
}).then(() => { |
|
|
|
confirmButtonText: '确定', |
|
|
|
this.$post(`${this.api.delPartnerAccount}?accountId=${row.accountId}`).then(res => { |
|
|
|
cancelButtonText: '取消', |
|
|
|
Util.successMsg("删除成功") |
|
|
|
type: 'warning', |
|
|
|
|
|
|
|
closeOnClickModal: false, |
|
|
|
|
|
|
|
dangerouslyUseHTMLString: true, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
await this.$post(this.api.questionBankDel, [row.id]) |
|
|
|
|
|
|
|
Util.successMsg('删除成功') |
|
|
|
this.getList() |
|
|
|
this.getList() |
|
|
|
}).catch(res => { }) |
|
|
|
} catch (e) { } |
|
|
|
}).catch(() => { }) |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
async switchOff (val, row) { |
|
|
|
async switchOff (val, row) { |
|
|
|
this.$post(this.api.disabledEventsCompetition, { |
|
|
|
await this.$post(`${this.api.questionBankDisable}?id=${row.id}&status=${val}`) |
|
|
|
competitionId: row.id, |
|
|
|
Util.successMsg(val ? '启用成功' : '禁用成功') |
|
|
|
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 => { |
|
|
|
|
|
|
|
this.getList() |
|
|
|
this.getList() |
|
|
|
Util.successMsg("编辑成功!") |
|
|
|
|
|
|
|
this.editVisible = false |
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
|
|
this.submiting = false |
|
|
|
|
|
|
|
}, 2000) |
|
|
|
|
|
|
|
}).catch(res => { |
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
|
|
this.submiting = false |
|
|
|
|
|
|
|
}, 2000) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
// 添加 |
|
|
|
// 添加 |
|
|
|
add () { |
|
|
|
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 |
|
|
|
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> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
<style lang="scss" scoped> |
|
|
|
.org-name { |
|
|
|
|
|
|
|
margin-right: 20px; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.w-100 { |
|
|
|
|
|
|
|
width: 100%; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.page { |
|
|
|
.page { |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
|
padding: 0 24px; |
|
|
|
padding: 0 24px; |
|
|
|