考试平台iframe,订单、客户修复

dev_review
yujialong 4 months ago
parent b831b14302
commit 812f1c916a
  1. 3
      src/assets/css/main.css
  2. 40
      src/components/Sidebar.vue
  3. 12
      src/router/index.js
  4. 2
      src/setting.js
  5. 2
      src/views/customer/AddCustomer.vue
  6. 65
      src/views/order/AddOrder.vue
  7. 28
      src/views/theoryExam/index.vue
  8. 488
      src/views/theoryExam/knowledge.vue
  9. 357
      src/views/theoryExam/quesBank.vue
  10. 194
      src/views/theoryExam/quesBankType.vue

@ -482,3 +482,6 @@ li {
.search-wrap .el-input__inner { .search-wrap .el-input__inner {
border-radius: 0; border-radius: 0;
} }
.edui-default {
line-height: normal;
}

@ -1,40 +1,27 @@
<template> <template>
<div> <div>
<el-menu class="sidebar-el-menu" <el-menu class="sidebar-el-menu" :default-active="onRoutes" background-color="#324157" text-color="#bfcbd9"
:default-active="onRoutes" active-text-color="#9278FF" unique-opened mode="horizontal" router @select="handleSelect">
background-color="#324157"
text-color="#bfcbd9"
active-text-color="#9278FF"
unique-opened
mode="horizontal"
router
@select="handleSelect">
<template v-for="item in menus"> <template v-for="item in menus">
<template v-if="item.subs"> <template v-if="item.subs">
<el-submenu :index="item.index" <el-submenu :index="item.index" :key="item.index">
:key="item.index">
<template slot="title"> <template slot="title">
<i :class="item.icon"></i> <i :class="item.icon"></i>
<span slot="title">{{ item.title }}</span> <span slot="title">{{ item.title }}</span>
</template> </template>
<template v-for="subItem in item.subs"> <template v-for="subItem in item.subs">
<el-submenu v-if="subItem.subs" <el-submenu v-if="subItem.subs" :index="subItem.index" :key="subItem.index">
:index="subItem.index"
:key="subItem.index">
<template slot="title">{{ subItem.title }}</template> <template slot="title">{{ subItem.title }}</template>
<el-menu-item v-for="(threeItem,i) in subItem.subs" <el-menu-item v-for="(threeItem, i) in subItem.subs" :key="i" :index="threeItem.index">{{
:key="i" threeItem.title
:index="threeItem.index">{{ threeItem.title }}</el-menu-item> }}</el-menu-item>
</el-submenu> </el-submenu>
<el-menu-item v-else <el-menu-item v-else :index="subItem.index" :key="subItem.index">{{ subItem.title }}</el-menu-item>
:index="subItem.index"
:key="subItem.index">{{ subItem.title }}</el-menu-item>
</template> </template>
</el-submenu> </el-submenu>
</template> </template>
<template v-else> <template v-else>
<el-menu-item :index="item.index" <el-menu-item :index="item.index" :key="item.index">
:key="item.index">
<i :class="item.icon"></i> <i :class="item.icon"></i>
<span slot="title">{{ item.title }}</span> <span slot="title">{{ item.title }}</span>
</el-menu-item> </el-menu-item>
@ -116,6 +103,11 @@ export default {
index: '/shop', index: '/shop',
title: '商城管理' title: '商城管理'
}, },
{
icon: 'el-icon-s-shop',
index: '/theoryExam',
title: '考试平台'
},
], ],
menus: [], menus: [],
onRoutes: this.$route.path onRoutes: this.$route.path
@ -178,10 +170,12 @@ export default {
.sidebar::-webkit-scrollbar { .sidebar::-webkit-scrollbar {
width: 0; width: 0;
} }
.sidebar-el-menu:not(.el-menu--collapse) { .sidebar-el-menu:not(.el-menu--collapse) {
width: 100%; width: 100%;
} }
.sidebar > ul {
.sidebar>ul {
height: 100%; height: 100%;
} }
</style> </style>

@ -242,16 +242,8 @@ let router = new Router({
component: () => import('../views/theoryExam/list/index'), component: () => import('../views/theoryExam/list/index'),
}, },
{ {
path: '/theoryExam/quesBank', path: '/theoryExam',
component: () => import('../views/theoryExam/quesBank'), component: () => import('../views/theoryExam'),
},
{
path: '/theoryExam/knowledge',
component: () => import('../views/theoryExam/knowledge'),
},
{
path: '/theoryExam/quesBankType',
component: () => import('../views/theoryExam/quesBankType'),
}, },
{ {
path: '/404', path: '/404',

@ -52,7 +52,7 @@ const Setting = {
isDev, isDev,
isPro, isPro,
// 是否使用动态路由 // 是否使用动态路由
dynamicRoute: true, dynamicRoute: false,
/** /**
* @description 默认密码 * @description 默认密码
*/ */

@ -1037,7 +1037,7 @@ export default {
this.$get(this.api.querySchoolData).then(({ list }) => { this.$get(this.api.querySchoolData).then(({ list }) => {
this.schoolList = list this.schoolList = list
// schoolId // schoolId
if (schoolId) { if (schoolId && !this.customerId) {
const item = list.find(e => e.schoolId == schoolId) const item = list.find(e => e.schoolId == schoolId)
if (item) { if (item) {
this.form.schoolId = schoolId this.form.schoolId = schoolId

@ -130,15 +130,18 @@
</el-table-column> </el-table-column>
<el-table-column label="使用期限" align="center" min-width="190"> <el-table-column label="使用期限" align="center" min-width="190">
<template slot="header" slot-scope="scope"> <template slot="header" slot-scope="scope">
<el-input class="batch-time" :disabled="viewDisabled || isEdit" maxlength="4" <template v-if="viewDisabled || isEdit">使用期限</template>
<template v-else>
<el-input class="batch-time" :disabled="viewDisabled || isEdit" maxlength="4" size="small"
@change="batchDeadlineChange(0)" @change="batchDeadlineChange(0)"
@input="productProps[0].deadline = productProps[0].deadline.replace(/[^0-9.]/g, '')" @input="productProps[0].deadline = productProps[0].deadline.replace(/[^0-9.]/g, '')"
v-model="productProps[0].deadline" placeholder="批量输入时间" /> v-model="productProps[0].deadline" placeholder="批量输入时间" />
<el-select class="time-select" v-model="productProps[0].unit" :disabled="viewDisabled || isEdit" <el-select class="batch-unit" v-model="productProps[0].unit" :disabled="viewDisabled || isEdit"
placeholder="请选择" @change="batchUnitChange(0)"> size="small" placeholder="请选择" @change="batchUnitChange(0)">
<el-option v-for="(item, i) in units" :key="i" :label="item.name" :value="item.id"></el-option> <el-option v-for="(item, i) in units" :key="i" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
</template> </template>
</template>
<template slot-scope="scope"> <template slot-scope="scope">
<div class="small"> <div class="small">
@ -276,15 +279,18 @@
</el-table-column> </el-table-column>
<el-table-column label="使用期限" align="center" min-width="190"> <el-table-column label="使用期限" align="center" min-width="190">
<template slot="header" slot-scope="scope"> <template slot="header" slot-scope="scope">
<template v-if="viewDisabled || isEdit">使用期限</template>
<template v-else>
<el-input class="batch-time" :disabled="viewDisabled || isEdit" maxlength="4" <el-input class="batch-time" :disabled="viewDisabled || isEdit" maxlength="4"
@change="batchDeadlineChange(1)" @change="batchDeadlineChange(1)"
@input="productProps[1].deadline = productProps[1].deadline.replace(/[^0-9.]/g, '')" @input="productProps[1].deadline = productProps[1].deadline.replace(/[^0-9.]/g, '')"
v-model="productProps[1].deadline" placeholder="批量输入时间" /> v-model="productProps[1].deadline" placeholder="批量输入时间" />
<el-select class="time-select" v-model="productProps[1].unit" :disabled="viewDisabled || isEdit" <el-select class="batch-unit" v-model="productProps[1].unit" :disabled="viewDisabled || isEdit"
placeholder="请选择" @change="batchUnitChange(1)"> placeholder="请选择" @change="batchUnitChange(1)">
<el-option v-for="(item, i) in units" :key="i" :label="item.name" :value="item.id"></el-option> <el-option v-for="(item, i) in units" :key="i" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
</template> </template>
</template>
<template slot-scope="scope"> <template slot-scope="scope">
<div class="small"> <div class="small">
@ -423,15 +429,18 @@
</el-table-column> </el-table-column>
<el-table-column label="使用期限" align="center" min-width="210"> <el-table-column label="使用期限" align="center" min-width="210">
<template slot="header" slot-scope="scope"> <template slot="header" slot-scope="scope">
<template v-if="viewDisabled || isEdit">使用期限</template>
<template v-else>
<el-input class="batch-time" :disabled="viewDisabled || isEdit" maxlength="4" <el-input class="batch-time" :disabled="viewDisabled || isEdit" maxlength="4"
@change="batchDeadlineChange(4)" @change="batchDeadlineChange(4)"
@input="productProps[4].deadline = productProps[4].deadline.replace(/[^0-9.]/g, '')" @input="productProps[4].deadline = productProps[4].deadline.replace(/[^0-9.]/g, '')"
v-model="productProps[4].deadline" placeholder="批量输入时间" /> v-model="productProps[4].deadline" placeholder="批量输入时间" />
<el-select class="time-select" v-model="productProps[4].unit" :disabled="viewDisabled || isEdit" <el-select class="batch-unit" v-model="productProps[4].unit" :disabled="viewDisabled || isEdit"
placeholder="请选择" @change="batchUnitChange(4)"> placeholder="请选择" @change="batchUnitChange(4)">
<el-option v-for="(item, i) in units" :key="i" :label="item.name" :value="item.id"></el-option> <el-option v-for="(item, i) in units" :key="i" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
</template> </template>
</template>
<template slot-scope="scope"> <template slot-scope="scope">
<div class="small"> <div class="small">
@ -591,15 +600,18 @@
</el-table-column> </el-table-column>
<el-table-column label="使用期限" align="center" min-width="190"> <el-table-column label="使用期限" align="center" min-width="190">
<template slot="header" slot-scope="scope"> <template slot="header" slot-scope="scope">
<template v-if="viewDisabled || isEdit">使用期限</template>
<template v-else>
<el-input class="batch-time" :disabled="viewDisabled || isEdit" maxlength="4" <el-input class="batch-time" :disabled="viewDisabled || isEdit" maxlength="4"
@change="batchDeadlineChange(2)" @change="batchDeadlineChange(2)"
@input="productProps[2].deadline = productProps[2].deadline.replace(/[^0-9.]/g, '')" @input="productProps[2].deadline = productProps[2].deadline.replace(/[^0-9.]/g, '')"
v-model="productProps[2].deadline" placeholder="批量输入时间" /> v-model="productProps[2].deadline" placeholder="批量输入时间" />
<el-select class="time-select" v-model="productProps[2].unit" :disabled="viewDisabled || isEdit" <el-select class="batch-unit" v-model="productProps[2].unit" :disabled="viewDisabled || isEdit"
placeholder="请选择" @change="batchUnitChange(2)"> placeholder="请选择" @change="batchUnitChange(2)">
<el-option v-for="(item, i) in units" :key="i" :label="item.name" :value="item.id"></el-option> <el-option v-for="(item, i) in units" :key="i" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
</template> </template>
</template>
<template slot-scope="scope"> <template slot-scope="scope">
<div class="small"> <div class="small">
@ -727,15 +739,18 @@
</el-table-column> </el-table-column>
<el-table-column label="使用期限" align="center" min-width="190"> <el-table-column label="使用期限" align="center" min-width="190">
<template slot="header" slot-scope="scope"> <template slot="header" slot-scope="scope">
<template v-if="viewDisabled || isEdit">使用期限</template>
<template v-else>
<el-input class="batch-time" :disabled="viewDisabled || isEdit" maxlength="4" <el-input class="batch-time" :disabled="viewDisabled || isEdit" maxlength="4"
@change="batchDeadlineChange(3)" @change="batchDeadlineChange(3)"
@input="productProps[3].deadline = productProps[3].deadline.replace(/[^0-9.]/g, '')" @input="productProps[3].deadline = productProps[3].deadline.replace(/[^0-9.]/g, '')"
v-model="productProps[3].deadline" placeholder="批量输入时间" /> v-model="productProps[3].deadline" placeholder="批量输入时间" />
<el-select class="time-select" v-model="productProps[3].unit" :disabled="viewDisabled || isEdit" <el-select class="batch-unit" v-model="productProps[3].unit" :disabled="viewDisabled || isEdit"
placeholder="请选择" @change="batchUnitChange(3)"> placeholder="请选择" @change="batchUnitChange(3)">
<el-option v-for="(item, i) in units" :key="i" :label="item.name" :value="item.id"></el-option> <el-option v-for="(item, i) in units" :key="i" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
</template> </template>
</template>
<template slot-scope="scope"> <template slot-scope="scope">
<div class="small"> <div class="small">
@ -871,15 +886,18 @@
</el-table-column> </el-table-column>
<el-table-column label="使用期限" align="center" min-width="190"> <el-table-column label="使用期限" align="center" min-width="190">
<template slot="header" slot-scope="scope"> <template slot="header" slot-scope="scope">
<template v-if="viewDisabled || isEdit">使用期限</template>
<template v-else>
<el-input class="batch-time" :disabled="viewDisabled || isEdit" maxlength="4" <el-input class="batch-time" :disabled="viewDisabled || isEdit" maxlength="4"
@change="batchDeadlineChange(5)" @change="batchDeadlineChange(5)"
@input="productProps[5].deadline = productProps[5].deadline.replace(/[^0-9.]/g, '')" @input="productProps[5].deadline = productProps[5].deadline.replace(/[^0-9.]/g, '')"
v-model="productProps[5].deadline" placeholder="批量输入时间" /> v-model="productProps[5].deadline" placeholder="批量输入时间" />
<el-select class="time-select" v-model="productProps[5].unit" :disabled="viewDisabled || isEdit" <el-select class="batch-unit" v-model="productProps[5].unit" :disabled="viewDisabled || isEdit"
placeholder="请选择" @change="batchUnitChange(5)"> placeholder="请选择" @change="batchUnitChange(5)">
<el-option v-for="(item, i) in units" :key="i" :label="item.name" :value="item.id"></el-option> <el-option v-for="(item, i) in units" :key="i" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
</template> </template>
</template>
<template slot-scope="scope"> <template slot-scope="scope">
<div class="small"> <div class="small">
@ -1161,37 +1179,37 @@ export default {
id: 1, id: 1,
name: 'coursePermissions', name: 'coursePermissions',
deadline: '', deadline: '',
unit: 2, unit: '',
}, },
{ {
id: 2, id: 2,
name: 'theoryCourseList', name: 'theoryCourseList',
deadline: '', deadline: '',
unit: 2, unit: '',
}, },
{ {
id: 3, id: 3,
name: 'valuePermissions', name: 'valuePermissions',
deadline: '', deadline: '',
unit: 2, unit: '',
}, },
{ {
id: 4, id: 4,
name: 'practicalCourses', name: 'practicalCourses',
deadline: '', deadline: '',
unit: 2, unit: '',
}, },
{ {
id: 5, id: 5,
name: 'dataPlatformPermissions', name: 'dataPlatformPermissions',
deadline: '', deadline: '',
unit: 2, unit: '',
}, },
{ {
id: 6, id: 6,
name: 'expTools', name: 'expTools',
deadline: '', deadline: '',
unit: 2, unit: '',
}, },
], ],
pageTypes: false, pageTypes: false,
@ -2570,7 +2588,24 @@ export default {
} }
.batch-time { .batch-time {
width: 110px !important; width: 100px !important;
/deep/.el-input__inner {
padding: 0 10px;
}
}
.batch-unit {
width: 77px !important;
margin-left: 5px;
/deep/.el-input {
width: auto !important;
}
/deep/.el-input__inner {
padding: 0 10px;
}
} }
.time-input { .time-input {

@ -0,0 +1,28 @@
<template>
<div>
<iframe :src="url" frameborder="0" width="100%"></iframe>
</div>
</template>
<script>
import Util from '@/libs/util'
export default {
data () {
return {
url: `http://192.168.31.125:8098/#/quesBankType?token=${sessionStorage.getItem('token')}`
};
},
mounted () {
},
methods: {
}
};
</script>
<style lang="scss" scoped>
iframe {
height: calc(100vh - 173px);
}
</style>

@ -1,488 +0,0 @@
<template>
<div class="page">
<div class="side">
<div class="m-b-20">
<h6 class="p-title">知识点</h6>
<el-radio-group v-model="studentType" @change="changeType">
<div class="m-b-20">
<el-radio :label="1">所有知识点</el-radio>
</div>
<div>
<el-radio :label="2">未加入分类的知识点</el-radio>
</div>
</el-radio-group>
</div>
<el-divider></el-divider>
<div>
<div class="flex-between">
<h6 class="p-title" style="margin-bottom: 0">知识点分类</h6>
<el-button type="text" @click="addOrg">添加</el-button>
</div>
<div style="overflow: auto">
<el-tree :data="orgList" default-expand-all ref="orgTree" node-key="id" highlight-current
:expand-on-click-node="false" @node-click="handleNodeClick"
:props="{ children: 'children', label: 'organizationName', isLeaf: 'leaf' }">
<span class="custom-tree-node" slot-scope="{ node, data }">
<span class="org-name">{{ node.label }}</span>
<span>
<el-button type="text" icon="el-icon-circle-plus-outline" @click="() => addOrg(node, data)">
</el-button>
<el-button type="text" icon="el-icon-edit-outline" @click="() => editOrg(node, data)">
</el-button>
<el-button type="text" icon="el-icon-delete" @click="() => delOrg(node, data)">
</el-button>
</span>
</span>
</el-tree>
</div>
</div>
<el-dialog :title="orgForm.id ? '编辑' : '新增' + '知识点分类'" :visible.sync="orgVisible" :close-on-click-modal="false"
width="50%">
<el-form v-if="orgVisible" ref="orgForm" :model="orgForm" :rules="orgRules" label-width="100px">
<el-form-item label="知识点分类名称" prop="organizationName">
<el-input v-model.trim="orgForm.organizationName" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="设置上一级">
<span v-if="orgForm.parentName">{{ orgForm.parentName }}</span>
<el-cascader v-else :options="orgListDia" v-model="cascaderValue" :props="cascaderProps" clearable
style="width: 100%">
</el-cascader>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="closeOrg"> </el-button>
<el-button type="primary" @click="orgSubmit"> </el-button>
</span>
</el-dialog>
</div>
<div class="right">
<h6 class="p-title">筛选</h6>
<div class="tool">
<ul class="filter">
<li>
<el-input style="width: 250px;" placeholder="请输入知识点名称" prefix-icon="el-icon-search" v-model="keyWord"
clearable></el-input>
</li>
</ul>
<div>
<el-button type="primary" @click="add">新增知识点</el-button>
<el-button type="primary" @click="delAllSelection">批量删除</el-button>
</div>
</div>
<el-table :data="list" class="table" ref="table" stripe header-align="center"
@selection-change="handleSelectionChange" row-key="accountId">
<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" width="120"></el-table-column>
<el-table-column prop="phone" label="创建时间" align="center" width="120"></el-table-column>
<el-table-column prop="phone" label="创建人" align="center" width="120"></el-table-column>
<el-table-column label="操作" align="center" width="300">
<template slot-scope="scope">
<el-button type="text" v-auth="'/system:后台账号:编辑'" @click="queryStaff(scope.row, false)">编辑</el-button>
<el-button type="text" v-auth="'/system:后台账号:重置密码'" @click="resetPassword(scope.row)">转移</el-button>
<el-button type="text" v-auth="'/system:后台账号:删除'" @click="delStaff(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next"
:total="total"></el-pagination>
</div>
<el-dialog :title="!form.id ? '添加知识点' : '编辑知识点'" :visible.sync="knowledgeVisible" width="400px"
:close-on-click-modal="false">
<el-form label-width="100px">
<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-form-item>
<el-form-item prop="userName" label="知识点名称">
<el-input placeholder="请输入知识点名称" v-model="form.name" maxlength="20"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="knowledgeVisible = false"> </el-button>
<el-button type="primary" @click="knowledgeSubmit"> </el-button>
</span>
</el-dialog>
</div>
</div>
</template>
<script>
import util from "@/libs/util";
import Setting from "@/setting";
import OrgTree from "@/components/org-tree/src/tree";
export default {
components: { OrgTree },
data () {
return {
orgList: [],
orgListDia: [],
studentType: 1, //:(1. 2.)
orgVisible: false, //
orgForm: {
id: '',
organizationName: ''
},
cascaderValue: [], //
cascaderProps: {
checkStrictly: true,
label: "organizationName",
value: "id"
},
treeVisible: true,
treeNode: {},
treeResolve: [],
isDetail: false,
keyWord: '',
types: [],
form: {
accountId: '',
userName: '',
phone: '',
roleList: [],
uniqueIdentification: '',
workNumber: '',
email: '',
account: '',
staffArchitectureId: []
},
orgRules: {
organizationName: [
{ required: true, message: "请输入部门名称", trigger: "blur" }
]
},
rules: {
account: [
{ required: true, message: "请输入部门名称", trigger: "blur" }
],
},
list: [],
page: 1,
pageSize: 10,
total: 0,
multipleSelection: [],
knowledgeVisible: false,
submiting: false //
};
},
watch: {
keyWord: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(this.getList, 500);
}
},
mounted () {
this.getOrg()
},
methods: {
//
async getOrg () {
const res = await this.$post(this.api.treeListArch)
const list = res.treeList
this.orgList = list
this.getList()
},
//
changeType () {
this.$refs.orgTree.setCurrentKey(null)
this.initData()
},
//
addOrg (node, data) {
const list = JSON.parse(JSON.stringify(this.orgList))
this.handleOrg(list)
this.orgListDia = list
this.orgForm = {
id: '',
parentId: data ? data.id : 1,
level: data ? data.level + 1 : 1,
parentName: data ? data.organizationName : '',
organizationName: ''
}
this.orgVisible = true
},
//
editOrg (node, data) {
const list = JSON.parse(JSON.stringify(this.orgList))
this.handleOrg(list, data.id, 0)
this.orgListDia = list
this.orgForm = {
id: data.id,
organizationName: data.organizationName
}
this.orgVisible = true
const ids = data.ids
ids.splice(ids.length - 1, 1)
this.cascaderValue = ids
},
//
handleOrg (list, id, disabled) {
list.forEach(e => {
// disabled
if (disabled) {
e.disabled = true
e.children && this.handleOrg(e.children, id, 1)
} else {
if (e.id === id) {
e.disabled = true
e.children && this.handleOrg(e.children, id, 1)
} else {
e.children && this.handleOrg(e.children, id, 0)
}
}
})
},
//
delOrg (node, data) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(`${this.api.deleteArch}?id=${data.id}`).then(res => {
util.successMsg("删除成功")
this.getOrg()
}).catch(res => { })
}).catch(() => { })
},
// /
orgSubmit () {
this.$refs.orgForm.validate((valid) => {
if (valid) {
const form = this.orgForm
const cas = this.cascaderValue
const len = cas.length
if (cas && len) {
this.orgForm.parentId = cas[len - 1]
this.orgForm.level = len + 1
}
if (!form.id) {
//
this.$post(this.api.saveArch, form).then(res => {
util.successMsg("新增成功!")
this.closeOrg()
}).catch(err => { })
} else {
//
this.$post(this.api.updateArch, form).then(res => {
util.successMsg("编辑成功!")
this.closeOrg()
}).catch(err => { })
}
}
});
},
//
handleNodeClick (data) {
this.$refs.table.clearSelection()
this.studentType = null
this.getList()
},
//
closeOrg () {
this.orgVisible = false
this.cascaderValue = []
this.getOrg()
},
//
getList () {
this.$post(this.api.staffList, {
type: this.studentType || 1,
staffArchitectureId: this.$refs.orgTree.getCurrentKey() || '',
keyWord: this.keyWord,
pageNum: this.page,
pageSize: this.pageSize
}).then(res => {
this.list = res.page.records
this.total = res.page.total
}).catch(err => { })
},
//
currentChange (val) {
this.page = val
this.getList()
},
handleSelectionChange (val) { //
this.multipleSelection = val
},
initData () {
this.$refs.table.clearSelection()
this.page = 1
this.getList()
},
//
delStaff (row) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(`${this.api.delStaff}?accountIds=${row.accountId}`).then(res => {
util.successMsg("删除成功")
this.getList()
}).catch(res => { })
}).catch(() => { })
},
//
resetPassword (row) {
const newPwd = Setting.initialPassword
this.$confirm(`重置后的密码为:${newPwd},确定重置?`, "提示", { type: "warning" }).then(() => {
this.$get(`${this.api.resetPwd}?userId=${row.userId}&newPwd=${newPwd}`).then(res => {
util.successMsg("重置成功")
}).catch(res => { })
}).catch(() => { })
},
//
add () {
this.knowledgeVisible = true
this.$nextTick(() => {
this.$refs.form.clearValidate()
})
},
// /
queryStaff (row, isDetail) {
const archId = []
// id
const handleArchId = (list, ids, parentId = []) => {
list.map(e => {
// id[[1, 2], [3, 4]]idid
if (ids.includes(e.id)) {
archId.push([...parentId, e.id])
} else {
e.children && handleArchId(e.children, ids, [...parentId, e.id])
}
})
}
this.isDetail = isDetail
this.staffVisible = true
this.$get(`${this.api.staffDetail}?accountId=${row.accountId}`).then(res => {
const { data } = res
const { staffArchitectureId, roleId } = data
if (roleId) {
const roleList = roleId.split(',').map(e => Number(e))
const list = this.roleList
if (roleList.length) {
let has = false //
for (const i in roleList) {
if (list.find(n => n.id === roleList[i])) {
has = true
break
}
}
if (!has) {
util.warningMsg('角色被删请重新选择')
data.roleList = []
} else {
data.roleList = roleList
}
}
}
if (staffArchitectureId) {
handleArchId(this.orgList, staffArchitectureId.split(',').map(e => Number(e)))
data.staffArchitectureId = archId
}
this.form = data
this.originAccount = data.account
this.originWorkNumber = data.workNumber
}).catch(res => { })
},
//
knowledgeSubmit () {
this.$refs.form.validate((valid) => {
if (valid) {
if (this.submiting) return false
this.submiting = true
const form = JSON.parse(JSON.stringify(this.form))
const ids = form.staffArchitectureId
if (ids) form.staffArchitectureId = ids.map(e => e[e.length - 1])
if (form.accountId) {
this.$post(this.api.modifyStaff, form).then(res => {
util.successMsg("编辑成功!")
this.staffVisible = false
setTimeout(() => {
this.submiting = false
}, 2000)
}).catch(res => {
setTimeout(() => {
this.submiting = false
}, 2000)
})
} else {
form.uniqueIdentification = new Date().getTime()
this.$post(this.api.saveStaff, form).then(res => {
util.successMsg("新增成功!")
this.staffVisible = false
setTimeout(() => {
this.submiting = false
}, 2000)
}).catch(res => {
setTimeout(() => {
this.submiting = false
}, 2000)
})
}
}
})
},
delAllSelection () {
const list = this.multipleSelection
if (list.length) {
//
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(this.api.orderDelete, { ids: list }).then(res => {
const { orderData } = this
this.$message.success("删除成功");
this.$refs.table.clearSelection()
this.getData();
}).catch(err => {
});
}).catch(err => {
});
} else {
this.$message.error("请先选择数据 !");
}
},
}
};
</script>
<style lang="scss" scoped>
.m-b-20 {
margin-bottom: 20px;
}
.org-name {
margin-right: 20px;
}
.w-100 {
width: 100%;
}
.page {
display: flex;
min-height: 100%;
padding: 0 24px;
.side {
width: 300px;
padding: 24px 10px 24px 0;
margin-right: 24px;
border-right: 1px solid rgba(0, 0, 0, 0.06);
}
.right {
width: calc(100% - 374px);
padding: 24px 0;
}
}
</style>

@ -1,357 +0,0 @@
<template>
<div class="page">
<div class="side">
<div class="m-b-20">
<h6 class="p-title">题库分类</h6>
<el-radio-group v-model="type" @change="typeChange">
<div class="m-b-20">
<el-radio :label="1">所有题库</el-radio>
</div>
<div>
<el-radio :label="2">未加入分类的题库</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>
<div style="height: 504px; max-height: 504px; overflow: auto">
<el-tree :data="orgList" default-expand-all ref="orgTree" node-key="id" highlight-current
:expand-on-click-node="false" @node-click="handleNodeClick"
:props="{ children: 'children', label: 'partnerClassificationName', isLeaf: 'leaf' }"></el-tree>
</div>
</div>
</div>
<div class="right">
<h6 class="p-title">筛选</h6>
<div class="tool">
<ul class="filter">
<li>
<label>状态</label>
<el-select v-model="filter.status" clearable placeholder="请选择状态" @change="getList">
<el-option v-for="(item, i) in status" :key="i" :label="item.name" :value="item.id"></el-option>
</el-select>
</li>
<li>
<label>搜索</label>
<el-input style="width: 250px;" placeholder="请输入题库名称" prefix-icon="el-icon-search" v-model="filter.keyWord"
clearable></el-input>
</li>
</ul>
<div>
<el-button type="primary" @click="add">创建题库</el-button>
</div>
</div>
<el-table :data="list" class="table" ref="table" stripe header-align="center"
@selection-change="handleSelectionChange" row-key="id">
<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">
<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="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 ? '关' : '开'"
@change="switchOff($event, scope.row, scope.$index)"></el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next"
:total="total"></el-pagination>
</div>
<el-dialog :title="!form.id ? '创建题库' : '编辑题库'" :visible.sync="quesBankVisible" width="400px"
:close-on-click-modal="false">
<el-form 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-form-item>
<el-form-item prop="userName" label="题库名称">
<el-input placeholder="请输入题库名称" v-model="form.name"></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>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="quesBankVisible = false"> </el-button>
<el-button type="primary" @click="quesBankSubmit"> </el-button>
</span>
</el-dialog>
</div>
</div>
</template>
<script>
import Util from "@/libs/util";
import Setting from "@/setting";
import OrgTree from "@/components/org-tree/src/tree";
export default {
components: { OrgTree },
data () {
return {
type: 1,
orgList: [],
status: [
{
id: 1,
name: '启用'
},
{
id: 2,
name: '禁用'
},
],
filter: {
status: '',
keyWord: '',
},
list: [],
page: 1,
pageSize: 10,
total: 0,
multipleSelection: [],
types: [],
form: {
userName: '',
provinceId: '',
cityId: '',
roleList: []
},
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" }
],
},
quesBankVisible: false,
submiting: false, //
setKey: '',
transferVisible: false,
chooseVisible: false,
members: [],
choosePartnerId: '',
curRow: '',
provinces: [],
cities: [],
editVisible: false
};
},
watch: {
keyWord: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(this.initData, 500);
}
},
mounted () {
this.getOrg()
},
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
}
})
}
handleLeaf(list)
this.orgList = list
//
this.setKey && this.$nextTick(() => {
this.$refs.orgTree.setCurrentKey(this.setKey)
})
this.getList()
},
//
typeChange () {
this.$refs.orgTree.setCurrentKey(null)
this.curTeamId = ''
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.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,
pageNum: this.page,
pageSize: this.pageSize
}).then(({ pageList }) => {
pageList.records.forEach((e, i) => {
e.id = i
})
this.list = pageList.records
this.total = pageList.total
}).catch(err => { })
},
//
currentChange (val) {
this.page = val
this.getList()
},
handleSelectionChange (val) { //
this.multipleSelection = val
},
initData () {
this.$refs.table.clearSelection()
this.page = 1
this.getList()
},
//
del (row) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(`${this.api.delPartnerAccount}?accountId=${row.accountId}`).then(res => {
Util.successMsg("删除成功")
this.getList()
}).catch(res => { })
}).catch(() => { })
},
async switchOff (val, row) {
this.$post(this.api.disabledEventsCompetition, {
competitionId: row.id,
isOpen: val,
type: 0 // (01)
}).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()
Util.successMsg("编辑成功!")
this.editVisible = false
setTimeout(() => {
this.submiting = false
}, 2000)
}).catch(res => {
setTimeout(() => {
this.submiting = false
}, 2000)
})
}
})
},
//
add () {
this.quesBankVisible = true
},
//
quesBankSubmit () {
},
}
};
</script>
<style lang="scss" scoped>
.org-name {
margin-right: 20px;
}
.w-100 {
width: 100%;
}
.page {
display: flex;
padding: 0 24px;
.side {
width: 300px;
padding: 24px 10px 24px 0;
margin-right: 24px;
border-right: 1px solid rgba(0, 0, 0, 0.06);
}
.right {
width: calc(100% - 324px);
padding: 24px 0;
}
}
</style>

@ -1,194 +0,0 @@
<template>
<div class="page">
<div class="tool">
<ul class="filter">
<li>
<label>状态</label>
<el-select v-model="filter.status" clearable placeholder="请选择状态" @change="getData">
<el-option v-for="(item, i) in status" :key="i" :label="item.name" :value="item.id"></el-option>
</el-select>
</li>
<li>
<label>搜索</label>
<el-input style="width: 250px;" placeholder="请输入题库分类名称" prefix-icon="el-icon-search" v-model="filter.keyWord"
clearable></el-input>
</li>
</ul>
<div>
<el-button type="primary" @click="add">新增</el-button>
<el-button type="primary" @click="delAllSelection">批量删除</el-button>
</div>
</div>
<el-table v-loading="loading" :data="list" class="table" ref="table" stripe header-align="center" row-key="id"
default-expand-all :tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="curriculumName" label="题库分类名称" align="center"></el-table-column>
<el-table-column prop="curriculumType" label="已关联题库" align="center"></el-table-column>
<el-table-column prop="userName" label="创建时间" align="center"></el-table-column>
<el-table-column prop="orderVolume" label="创建人" align="center"></el-table-column>
<el-table-column label="操作" align="center" width="300">
<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-switch v-model="scope.row.ztOpen" :active-value="0" :inactive-value="1" style="margin: 0 10px 0 5px"
:active-text="scope.row.ztOpen ? '关' : '开'"
@change="switchOff($event, scope.row, scope.$index)"></el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="handleCurrentChange" :current-page="page"
layout="total, prev, pager, next" :total="total"></el-pagination>
</div>
<el-dialog :title="(!form.id ? '新增' : '编辑') + '题库分类'" :visible.sync="typeVisible" width="400px"
:close-on-click-modal="false">
<el-form label-width="100px">
<el-form-item prop="userName" label="题库分类名称">
<el-input placeholder="请输入分类名称" v-model="form.name" maxlength="20"></el-input>
</el-form-item>
<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-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="knowledgeVisible = false"> </el-button>
<el-button type="primary" @click="knowledgeSubmit"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import qs from 'qs'
export default {
data () {
return {
status: [
{
id: 1,
name: '启用'
},
{
id: 2,
name: '禁用'
},
],
filter: {
status: '',
keyWord: '',
},
list: [],
types: [],
form: {
curriculumName: ''
},
typeVisible: false,
page: +this.$route.query.page || 1,
pageSize: 10,
total: 0,
loading: false,
searchTimer: null
};
},
watch: {
"form.curriculumName": function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
mounted () {
this.getData()
},
methods: {
//
getData () {
const sid = this.$store.state.dataPer.find(e => e.permissionName === '课程管理')
let data = {
...this.form,
pageNum: this.page,
pageSize: this.pageSize,
supplierId: sid ? sid.supplierId : ''
};
this.$post(this.api.curriculumList, data).then(res => {
this.list = res.page.records
this.total = res.page.total
this.loading = false
}).catch(err => { })
},
initData () {
this.page = 1
this.getData()
},
//
add () {
this.typeVisible = true
},
//
edit (row) {
this.$router.push(`/addcurriculum?cid=${row.cid}`);
},
//
del (row) {
this.$post(`${this.api.deleteCoursePrompt}?cids=${row.cid}`).then(({ status }) => {
if (status === 200) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(`${this.api.delCourse}?cids=${row.cid}`).then(res => {
this.getData();
this.$message.success("删除成功");
}).catch(err => { })
}).catch(() => {
});
}
}).catch(err => { })
},
//
delAllSelection () {
if (this.multipleSelection.length) {
let cids = []
this.multipleSelection.forEach(i => {
cids.push('cids=' + i.cid)
});
this.$post(`${this.api.deleteCoursePrompt}?${cids.join('&')}`).then(({ status }) => {
if (status === 200) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
let ids = this.multipleSelection.map(i => i.cid);
this.$post(`${this.api.delCourse}?cids=${ids.toString()}`).then(res => {
if (ids.length == this.list.length) {
if (this.page > 1) {
this.page = this.page - 1
}
}
this.getData();
this.$message.success("删除成功");
this.$refs.table.clearSelection()
}).catch(err => { })
}).catch(() => { })
}
}).catch(err => { })
} else {
this.$message.warning("请先选择课程 !");
}
},
//
handleCurrentChange (val) {
this.page = val;
this.$router.push(`/curriculum?page=${val}`)
this.getData();
},
}
};
</script>
<style scoped></style>
Loading…
Cancel
Save