|
|
@ -1,55 +1,58 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<el-card v-if="showBack" shadow="hover" class="m-b-20"> |
|
|
|
<el-card v-if="showBack" |
|
|
|
<el-page-header content="实验项目管理" @back="goBack"></el-page-header> |
|
|
|
shadow="hover" |
|
|
|
</el-card> |
|
|
|
class="m-b-20"> |
|
|
|
<div class="page"> |
|
|
|
<el-page-header content="实验项目管理" |
|
|
|
<h6 class="p-title">筛选</h6> |
|
|
|
@back="goBack"></el-page-header> |
|
|
|
<div class="tool mul"> |
|
|
|
</el-card> |
|
|
|
<ul class="filter"> |
|
|
|
<div class="page"> |
|
|
|
<li> |
|
|
|
<h6 class="p-title">筛选</h6> |
|
|
|
<label>创建人</label> |
|
|
|
<div class="tool mul"> |
|
|
|
<el-select v-model="queryData.founder" placeholder="请选择创建人" @change="founderChange"> |
|
|
|
<ul class="filter"> |
|
|
|
<el-option |
|
|
|
<li> |
|
|
|
v-for="(item,index) in founderList" |
|
|
|
<label>创建人</label> |
|
|
|
:key="index" |
|
|
|
<el-select v-model="queryData.founder" |
|
|
|
:label="item.label" |
|
|
|
placeholder="请选择创建人" |
|
|
|
:value="item.value" |
|
|
|
@change="founderChange"> |
|
|
|
></el-option> |
|
|
|
<el-option v-for="(item,index) in founderList" |
|
|
|
</el-select> |
|
|
|
:key="index" |
|
|
|
</li> |
|
|
|
:label="item.label" |
|
|
|
<li> |
|
|
|
:value="item.value"></el-option> |
|
|
|
<label>状态</label> |
|
|
|
</el-select> |
|
|
|
<el-select v-model="queryData.state" clearable placeholder="请选择状态" @change="initData"> |
|
|
|
</li> |
|
|
|
<el-option |
|
|
|
<li> |
|
|
|
v-for="(item,index) in stateList" |
|
|
|
<label>状态</label> |
|
|
|
:key="index" |
|
|
|
<el-select v-model="queryData.state" |
|
|
|
:label="item.label" |
|
|
|
clearable |
|
|
|
:value="item.value" |
|
|
|
placeholder="请选择状态" |
|
|
|
></el-option> |
|
|
|
@change="initData"> |
|
|
|
</el-select> |
|
|
|
<el-option v-for="(item,index) in stateList" |
|
|
|
</li> |
|
|
|
:key="index" |
|
|
|
<li> |
|
|
|
:label="item.label" |
|
|
|
<label>权限</label> |
|
|
|
:value="item.value"></el-option> |
|
|
|
<el-select v-model="queryData.permissions" placeholder="请选择" @change="initData"> |
|
|
|
</el-select> |
|
|
|
<el-option |
|
|
|
</li> |
|
|
|
v-for="item in permissionsList" |
|
|
|
<li> |
|
|
|
:key="item.value" |
|
|
|
<label>权限</label> |
|
|
|
:label="item.label" |
|
|
|
<el-select v-model="queryData.permissions" |
|
|
|
:value="item.value" |
|
|
|
placeholder="请选择" |
|
|
|
></el-option> |
|
|
|
@change="initData"> |
|
|
|
</el-select> |
|
|
|
<el-option v-for="item in permissionsList" |
|
|
|
</li> |
|
|
|
:key="item.value" |
|
|
|
<li> |
|
|
|
:label="item.label" |
|
|
|
<label>课程</label> |
|
|
|
:value="item.value"></el-option> |
|
|
|
<el-cascader |
|
|
|
</el-select> |
|
|
|
v-model="cid" |
|
|
|
</li> |
|
|
|
:options="curs" |
|
|
|
<li> |
|
|
|
:props="{ checkStrictly: true, value: 'id' }" |
|
|
|
<label>课程</label> |
|
|
|
popper-class="course-cas" |
|
|
|
<el-cascader v-model="cid" |
|
|
|
@expand-change="curChange" |
|
|
|
:options="curs" |
|
|
|
@change="curChange"></el-cascader> |
|
|
|
:props="{ checkStrictly: true, value: 'id' }" |
|
|
|
<!-- <el-select v-model="queryData.cid" @change="courseChange"> |
|
|
|
popper-class="course-cas" |
|
|
|
|
|
|
|
@expand-change="curChange" |
|
|
|
|
|
|
|
@change="curChange"></el-cascader> |
|
|
|
|
|
|
|
<!-- <el-select v-model="queryData.cid" @change="courseChange"> |
|
|
|
<el-option |
|
|
|
<el-option |
|
|
|
v-for="item in curriculumList" |
|
|
|
v-for="item in curriculumList" |
|
|
|
:key="item.cid" |
|
|
|
:key="item.cid" |
|
|
@ -57,8 +60,8 @@ |
|
|
|
:value="item.cid"> |
|
|
|
:value="item.cid"> |
|
|
|
</el-option> |
|
|
|
</el-option> |
|
|
|
</el-select> --> |
|
|
|
</el-select> --> |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
<!-- <li> |
|
|
|
<!-- <li> |
|
|
|
<label>系统</label> |
|
|
|
<label>系统</label> |
|
|
|
<el-select v-model="systemId" placeholder="请选择" @change="initData"> |
|
|
|
<el-select v-model="systemId" placeholder="请选择" @change="initData"> |
|
|
|
<el-option |
|
|
|
<el-option |
|
|
@ -69,388 +72,437 @@ |
|
|
|
></el-option> |
|
|
|
></el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
</li> --> |
|
|
|
</li> --> |
|
|
|
<li> |
|
|
|
<li> |
|
|
|
<el-input placeholder="请输入项目名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input> |
|
|
|
<el-input placeholder="请输入项目名称" |
|
|
|
</li> |
|
|
|
prefix-icon="el-icon-search" |
|
|
|
</ul> |
|
|
|
v-model="keyword" |
|
|
|
<div> |
|
|
|
clearable></el-input> |
|
|
|
<el-button v-auth type="info" @click="add">新增项目</el-button> |
|
|
|
</li> |
|
|
|
<el-button v-auth type="primary" @click="delAllData">批量删除</el-button> |
|
|
|
</ul> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
</div> |
|
|
|
<el-button v-auth |
|
|
|
|
|
|
|
type="info" |
|
|
|
|
|
|
|
@click="add">新增项目</el-button> |
|
|
|
|
|
|
|
<el-button v-auth |
|
|
|
|
|
|
|
type="primary" |
|
|
|
|
|
|
|
@click="delAllData">批量删除</el-button> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<el-table :data="listData" class="table" ref="table" stripe header-align="center" |
|
|
|
<el-table :data="listData" |
|
|
|
@selection-change="handleSelectionChange"> |
|
|
|
class="table" |
|
|
|
<el-table-column type="selection" width="55" align="center" :selectable="disabledSelection"></el-table-column> |
|
|
|
ref="table" |
|
|
|
<el-table-column type="index" width="100" label="序号" align="center"> |
|
|
|
stripe |
|
|
|
<template slot-scope="scope">{{ scope.$index + (page - 1) * pageSize + 1 }}</template> |
|
|
|
header-align="center" |
|
|
|
</el-table-column> |
|
|
|
@selection-change="handleSelectionChange"> |
|
|
|
<el-table-column prop="projectName" label="实验项目名称" min-width="400" align="center" show-overflow-tooltip></el-table-column> |
|
|
|
<el-table-column type="selection" |
|
|
|
<el-table-column prop="founder" label="创建人" min-width="150" align="center"> |
|
|
|
width="55" |
|
|
|
<template slot-scope="scope"> |
|
|
|
align="center" |
|
|
|
{{ founderKeys[scope.row.founder] }} |
|
|
|
:selectable="disabledSelection"></el-table-column> |
|
|
|
</template> |
|
|
|
<el-table-column type="index" |
|
|
|
</el-table-column> |
|
|
|
width="100" |
|
|
|
<el-table-column label="权限" min-width="120" align="center"> |
|
|
|
label="序号" |
|
|
|
<template slot-scope="scope"> |
|
|
|
align="center"> |
|
|
|
{{ permissionsKeys[scope.row.permissions] }} |
|
|
|
<template slot-scope="scope">{{ scope.$index + (page - 1) * pageSize + 1 }}</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="projectName" |
|
|
|
<el-table-column prop="createTime" label="创建时间" min-width="150" align="center"></el-table-column> |
|
|
|
label="实验项目名称" |
|
|
|
<el-table-column prop="status" label="状态" min-width="100" align="center"> |
|
|
|
min-width="400" |
|
|
|
<template slot-scope="scope"> |
|
|
|
align="center" |
|
|
|
{{ stateKeys[scope.row.state] }} |
|
|
|
show-overflow-tooltip></el-table-column> |
|
|
|
</template> |
|
|
|
<el-table-column prop="founder" |
|
|
|
</el-table-column> |
|
|
|
label="创建人" |
|
|
|
<el-table-column label="操作" width="300" align="center"> |
|
|
|
min-width="150" |
|
|
|
<template slot-scope="scope"> |
|
|
|
align="center"> |
|
|
|
<el-button type="text" @click="edit(scope.row, 1)">查看</el-button> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button v-if="scope.row.founder && (roleName.includes('超级') || roleName === scope.row.roleName || (roleName === '管理员' && !scope.row.roleName.includes('超级')))" type="text" @click="edit(scope.row)">编辑</el-button> |
|
|
|
{{ founderKeys[scope.row.founder] }} |
|
|
|
<el-button v-if="scope.row.founder && (roleName.includes('超级') || roleName === scope.row.roleName || (roleName === '管理员' && !scope.row.roleName.includes('超级')))" type="text" @click="handleDelete(scope.row.projectId)">删除</el-button> |
|
|
|
</template> |
|
|
|
<el-button v-auth type="text" @click="copyData(scope.row.projectId)">复制</el-button> |
|
|
|
</el-table-column> |
|
|
|
<el-switch |
|
|
|
<el-table-column label="权限" |
|
|
|
v-auth="'禁用'" |
|
|
|
min-width="120" |
|
|
|
v-if="scope.row.state" |
|
|
|
align="center"> |
|
|
|
v-model="scope.row.ccupationlabOpen" |
|
|
|
<template slot-scope="scope"> |
|
|
|
:active-text="scope.row.ccupationlabOpen ? '关闭' : '启用'" |
|
|
|
{{ permissionsKeys[scope.row.permissions] }} |
|
|
|
:active-value="0" |
|
|
|
</template> |
|
|
|
:inactive-value="1" |
|
|
|
</el-table-column> |
|
|
|
style="margin: 0 10px 0 10px" |
|
|
|
<el-table-column prop="createTime" |
|
|
|
@change="switchOff(scope.row)" |
|
|
|
label="创建时间" |
|
|
|
></el-switch> |
|
|
|
min-width="150" |
|
|
|
</template> |
|
|
|
align="center"></el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="status" |
|
|
|
</el-table> |
|
|
|
label="状态" |
|
|
|
<div class="pagination"> |
|
|
|
min-width="100" |
|
|
|
<el-pagination background @current-change="handleCurrentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination> |
|
|
|
align="center"> |
|
|
|
</div> |
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
{{ stateKeys[scope.row.state] }} |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column label="操作" |
|
|
|
|
|
|
|
width="300" |
|
|
|
|
|
|
|
align="center"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
<el-button type="text" |
|
|
|
|
|
|
|
@click="edit(scope.row, 1)">查看</el-button> |
|
|
|
|
|
|
|
<el-button v-if="scope.row.founder && (roleName.includes('超级') || roleName === scope.row.roleName || (roleName === '管理员' && !scope.row.roleName.includes('超级')))" |
|
|
|
|
|
|
|
type="text" |
|
|
|
|
|
|
|
@click="edit(scope.row)">编辑</el-button> |
|
|
|
|
|
|
|
<el-button v-if="scope.row.founder && (roleName.includes('超级') || roleName === scope.row.roleName || (roleName === '管理员' && !scope.row.roleName.includes('超级')))" |
|
|
|
|
|
|
|
type="text" |
|
|
|
|
|
|
|
@click="handleDelete(scope.row.projectId)">删除</el-button> |
|
|
|
|
|
|
|
<el-button v-auth |
|
|
|
|
|
|
|
type="text" |
|
|
|
|
|
|
|
@click="copyData(scope.row.projectId)">复制</el-button> |
|
|
|
|
|
|
|
<el-switch v-auth="'禁用'" |
|
|
|
|
|
|
|
v-if="scope.row.state" |
|
|
|
|
|
|
|
v-model="scope.row.ccupationlabOpen" |
|
|
|
|
|
|
|
:active-text="scope.row.ccupationlabOpen ? '关闭' : '启用'" |
|
|
|
|
|
|
|
:active-value="0" |
|
|
|
|
|
|
|
:inactive-value="1" |
|
|
|
|
|
|
|
style="margin: 0 10px 0 10px" |
|
|
|
|
|
|
|
@change="switchOff(scope.row)"></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="复制" :visible.sync="copyVisible" width="24%" center :close-on-click-modal="false"> |
|
|
|
<el-dialog title="复制" |
|
|
|
<el-form> |
|
|
|
:visible.sync="copyVisible" |
|
|
|
<el-form-item> |
|
|
|
width="24%" |
|
|
|
<!--前端不用做名称判重了:@change='projectNameExistis'--> |
|
|
|
center |
|
|
|
<el-input placeholder="请输入项目名称" v-model="projectName"></el-input> |
|
|
|
:close-on-click-modal="false"> |
|
|
|
</el-form-item> |
|
|
|
<el-form> |
|
|
|
</el-form> |
|
|
|
<el-form-item> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<!--前端不用做名称判重了:@change='projectNameExistis'--> |
|
|
|
<el-button @click="copyVisible = false">取 消</el-button> |
|
|
|
<el-input placeholder="请输入项目名称" |
|
|
|
<el-button type="primary" @click="copySubmit">确 定</el-button> |
|
|
|
v-model="projectName"></el-input> |
|
|
|
</span> |
|
|
|
</el-form-item> |
|
|
|
</el-dialog> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
<span slot="footer" |
|
|
|
|
|
|
|
class="dialog-footer"> |
|
|
|
|
|
|
|
<el-button @click="copyVisible = false">取 消</el-button> |
|
|
|
|
|
|
|
<el-button type="primary" |
|
|
|
|
|
|
|
@click="copySubmit">确 定</el-button> |
|
|
|
|
|
|
|
</span> |
|
|
|
|
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import { mapState, mapActions, mapMutations } from "vuex"; |
|
|
|
import { mapState, mapActions, mapMutations } from "vuex"; |
|
|
|
import util from "@/libs/util"; |
|
|
|
import util from "@/libs/util"; |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
return { |
|
|
|
showBack: Boolean(this.$route.query.show), |
|
|
|
showBack: Boolean(this.$route.query.show), |
|
|
|
cid: [], |
|
|
|
cid: [], |
|
|
|
curs: [], |
|
|
|
curs: [], |
|
|
|
systemId: "", |
|
|
|
systemId: "", |
|
|
|
systemList: [], |
|
|
|
systemList: [], |
|
|
|
systemListAll: [], |
|
|
|
systemListAll: [], |
|
|
|
curriculumId: '', |
|
|
|
curriculumId: '', |
|
|
|
curriculumList: [], |
|
|
|
curriculumList: [], |
|
|
|
queryData: { |
|
|
|
queryData: { |
|
|
|
platformId: 1, // 平台:职站:1 中台:3 |
|
|
|
platformId: 1, // 平台:职站:1 中台:3 |
|
|
|
founder: +this.$route.query.founder || 2, // 创建人角色(0:系统 1:老师 2:全部) |
|
|
|
founder: +this.$route.query.founder || 2, // 创建人角色(0:系统 1:老师 2:全部) |
|
|
|
state: "", // 状态(0:草稿箱 1:已发布) |
|
|
|
state: "", // 状态(0:草稿箱 1:已发布) |
|
|
|
permissions: "", // 项目权限(0:练习 1:考核 2:竞赛) |
|
|
|
permissions: "", // 项目权限(0:练习 1:考核 2:竞赛) |
|
|
|
cid: '' |
|
|
|
cid: '' |
|
|
|
}, |
|
|
|
}, |
|
|
|
keyword: "", |
|
|
|
keyword: "", |
|
|
|
status: "", |
|
|
|
status: "", |
|
|
|
listData: [], |
|
|
|
listData: [], |
|
|
|
total: 0, |
|
|
|
total: 0, |
|
|
|
permissionsList: [ |
|
|
|
permissionsList: [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
value: "", |
|
|
|
value: "", |
|
|
|
label: "不限" |
|
|
|
label: "不限" |
|
|
|
}, { |
|
|
|
}, { |
|
|
|
value: 0, |
|
|
|
value: 0, |
|
|
|
label: "练习" |
|
|
|
label: "练习" |
|
|
|
}, { |
|
|
|
}, { |
|
|
|
value: 1, |
|
|
|
value: 1, |
|
|
|
label: "考核" |
|
|
|
label: "考核" |
|
|
|
}, { |
|
|
|
}, { |
|
|
|
value: 2, |
|
|
|
value: 2, |
|
|
|
label: "竞赛" |
|
|
|
label: "竞赛" |
|
|
|
} |
|
|
|
} |
|
|
|
], |
|
|
|
], |
|
|
|
permissionsKeys: { |
|
|
|
permissionsKeys: { |
|
|
|
0: "练习", |
|
|
|
0: "练习", |
|
|
|
1: "考核", |
|
|
|
1: "考核", |
|
|
|
2: "竞赛" |
|
|
|
2: "竞赛" |
|
|
|
}, |
|
|
|
}, |
|
|
|
founderList: [ |
|
|
|
founderList: [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
value: 2, |
|
|
|
value: 2, |
|
|
|
label: "全部" |
|
|
|
label: "全部" |
|
|
|
}, { |
|
|
|
}, { |
|
|
|
value: 0, |
|
|
|
value: 0, |
|
|
|
label: "系统" |
|
|
|
label: "系统" |
|
|
|
}, { |
|
|
|
}, { |
|
|
|
value: 1, |
|
|
|
value: 1, |
|
|
|
label: "老师" |
|
|
|
label: "老师" |
|
|
|
} |
|
|
|
} |
|
|
|
], |
|
|
|
], |
|
|
|
founderKeys: { |
|
|
|
founderKeys: { |
|
|
|
0: "系统", |
|
|
|
0: "系统", |
|
|
|
1: "老师" |
|
|
|
1: "老师" |
|
|
|
}, |
|
|
|
}, |
|
|
|
stateList: [ |
|
|
|
stateList: [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
value: "", |
|
|
|
value: "", |
|
|
|
label: "不限" |
|
|
|
label: "不限" |
|
|
|
}, { |
|
|
|
}, { |
|
|
|
value: 0, |
|
|
|
value: 0, |
|
|
|
label: "草稿箱" |
|
|
|
label: "草稿箱" |
|
|
|
}, { |
|
|
|
}, { |
|
|
|
value: 1, |
|
|
|
value: 1, |
|
|
|
label: "已发布" |
|
|
|
label: "已发布" |
|
|
|
} |
|
|
|
} |
|
|
|
], |
|
|
|
], |
|
|
|
stateKeys: { |
|
|
|
stateKeys: { |
|
|
|
0: "草稿箱", |
|
|
|
0: "草稿箱", |
|
|
|
1: "已发布" |
|
|
|
1: "已发布" |
|
|
|
}, |
|
|
|
}, |
|
|
|
page: +this.$route.query.page || 1, |
|
|
|
page: +this.$route.query.page || 1, |
|
|
|
pageSize: 10, |
|
|
|
pageSize: 10, |
|
|
|
multipleSelection: [], |
|
|
|
multipleSelection: [], |
|
|
|
copyVisible: false, |
|
|
|
copyVisible: false, |
|
|
|
projectName: "", |
|
|
|
projectName: "", |
|
|
|
currentRow: {}, // 复制之后,提交到后台的数据 |
|
|
|
currentRow: {}, // 复制之后,提交到后台的数据 |
|
|
|
listDataAll: [], |
|
|
|
listDataAll: [], |
|
|
|
isFirst: true |
|
|
|
isFirst: true |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
computed: { |
|
|
|
|
|
|
|
...mapState("user", [ |
|
|
|
|
|
|
|
"userId", "roleId", 'roleName' |
|
|
|
|
|
|
|
]), |
|
|
|
|
|
|
|
...mapState("project", [ |
|
|
|
|
|
|
|
"lastSystemId", |
|
|
|
|
|
|
|
"assFields", |
|
|
|
|
|
|
|
"queryDataStatus", |
|
|
|
|
|
|
|
]) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
watch: { |
|
|
|
|
|
|
|
keyword: function (val) { |
|
|
|
|
|
|
|
clearTimeout(this.searchTimer); |
|
|
|
|
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
|
|
|
|
this.initData(); |
|
|
|
|
|
|
|
}, 500); |
|
|
|
}, |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
queryData: { |
|
|
|
...mapState("user", [ |
|
|
|
handler: function (newVal) { |
|
|
|
"userId", "roleId", 'roleName' |
|
|
|
this.setQueryStatus({ ...newVal }) |
|
|
|
]), |
|
|
|
}, |
|
|
|
...mapState("project", [ |
|
|
|
deep: true |
|
|
|
"lastSystemId", |
|
|
|
} |
|
|
|
"assFields", |
|
|
|
}, |
|
|
|
"queryDataStatus", |
|
|
|
mounted () { |
|
|
|
]) |
|
|
|
this.getSystemData() |
|
|
|
|
|
|
|
this.getData() |
|
|
|
|
|
|
|
if (this.queryDataStatus.platformId) { |
|
|
|
|
|
|
|
this.queryData = this.queryDataStatus |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
|
|
|
|
...mapActions("project", [ |
|
|
|
|
|
|
|
"setSystemId" |
|
|
|
|
|
|
|
]), |
|
|
|
|
|
|
|
...mapMutations({ |
|
|
|
|
|
|
|
setQueryStatus: "project/SET_QUERYDATASTATUS" |
|
|
|
|
|
|
|
}), |
|
|
|
|
|
|
|
getData () { |
|
|
|
|
|
|
|
this.setSystemId(this.systemId); |
|
|
|
|
|
|
|
if (this.isFirst) this.page = +this.$route.query.page || 1 |
|
|
|
|
|
|
|
let data = { |
|
|
|
|
|
|
|
...this.queryData, |
|
|
|
|
|
|
|
projectName: this.keyword, |
|
|
|
|
|
|
|
pageNum: this.page, |
|
|
|
|
|
|
|
pageSize: this.pageSize, |
|
|
|
|
|
|
|
systemId: this.systemId |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
this.$post(this.api.queryProjectManage, data).then(res => { |
|
|
|
|
|
|
|
this.isFirst = false |
|
|
|
|
|
|
|
this.listData = res.data.records; |
|
|
|
|
|
|
|
this.total = res.data.total; |
|
|
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
// 获取系统 |
|
|
|
keyword: function(val) { |
|
|
|
getSystemData () { |
|
|
|
clearTimeout(this.searchTimer); |
|
|
|
this.$get(this.api.getSystemIdBySchool).then(({ data }) => { |
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
this.systemListAll = data |
|
|
|
this.initData(); |
|
|
|
this.getschoolCourse() |
|
|
|
}, 500); |
|
|
|
}).catch(err => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
queryData: { |
|
|
|
// 获取课程 |
|
|
|
handler: function(newVal) { |
|
|
|
getschoolCourse () { |
|
|
|
this.setQueryStatus({...newVal}) |
|
|
|
this.$get(this.api.getSchoolEffectiveCourse).then(({ data }) => { |
|
|
|
}, |
|
|
|
this.curriculumList = data |
|
|
|
deep: true |
|
|
|
const { cid } = this.queryData |
|
|
|
|
|
|
|
if (data.length) { |
|
|
|
|
|
|
|
this.cid = [cid || data[0].cid] |
|
|
|
|
|
|
|
const all = this.systemListAll |
|
|
|
|
|
|
|
data.map(e => { |
|
|
|
|
|
|
|
e.id = e.cid |
|
|
|
|
|
|
|
e.label = e.curriculumName |
|
|
|
|
|
|
|
e.children = all.filter(n => e.systemId.split(',').includes(n.id + '')) // 筛选出该课程下的系统 |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.curs = data |
|
|
|
|
|
|
|
this.curChange(this.cid) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}).catch(err => { }) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 课程选择回调 |
|
|
|
|
|
|
|
curChange (val) { |
|
|
|
|
|
|
|
const cid = val[0] |
|
|
|
|
|
|
|
if (val.length === 1) { |
|
|
|
|
|
|
|
// 如果选择的是课程,则默认选中下面第一个系统 |
|
|
|
|
|
|
|
this.cid = [cid, this.curs.find(e => e.id === cid).children[0].id] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.queryData.cid = cid |
|
|
|
|
|
|
|
this.systemId = this.cid[1] |
|
|
|
|
|
|
|
this.initData() |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
// 创建人选择回调 |
|
|
|
this.getSystemData() |
|
|
|
founderChange (val) { |
|
|
|
this.getData() |
|
|
|
this.$router.push({ |
|
|
|
if(this.queryDataStatus.platformId) { |
|
|
|
path: 'list', |
|
|
|
this.queryData = this.queryDataStatus |
|
|
|
query: { |
|
|
|
|
|
|
|
...this.$route.query, |
|
|
|
|
|
|
|
founder: val |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.initData() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
initData () { |
|
|
|
|
|
|
|
this.page = 1; |
|
|
|
|
|
|
|
this.getData(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
disabledSelection (row, index) { // 禁用勾选 |
|
|
|
|
|
|
|
const roleName = this.roleName |
|
|
|
|
|
|
|
if (row.founder && (roleName.includes('超级') || roleName === row.roleName || (roleName === '管理员' && !row.roleName.includes('超级')))) return true |
|
|
|
|
|
|
|
return false |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleCurrentChange (val) { // 切换页码 |
|
|
|
|
|
|
|
this.page = val; |
|
|
|
|
|
|
|
// this.$router.push({ |
|
|
|
|
|
|
|
// path: '/project/list', |
|
|
|
|
|
|
|
// query: { |
|
|
|
|
|
|
|
// ...this.$route.query, |
|
|
|
|
|
|
|
// page: val |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// }) |
|
|
|
|
|
|
|
this.getData(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
add () { // 新增项目 |
|
|
|
|
|
|
|
this.setSystemId(this.systemId); |
|
|
|
|
|
|
|
this.$router.push(`/project/add?founder=${this.queryData.founder}`); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
edit (row, show) { // 编辑 |
|
|
|
|
|
|
|
this.setSystemId(row.systemId); |
|
|
|
|
|
|
|
this.$router.push(`/project/add?projectId=${row.projectId}&founder=${this.queryData.founder}${show ? `&show=1` : ''}`); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleSelectionChange (val) { // 处理多选 |
|
|
|
|
|
|
|
this.multipleSelection = val; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
delAllData () { // 批量删除 |
|
|
|
|
|
|
|
if (this.multipleSelection.length) { |
|
|
|
|
|
|
|
let ids = this.multipleSelection.map(item => { |
|
|
|
|
|
|
|
return item.projectId; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
let strIds = ids.toString(); |
|
|
|
|
|
|
|
this.handleDelete(strIds); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
util.errorMsg("请先选择项目"); |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
handleDelete (ids) { // 删除 |
|
|
|
...mapActions("project", [ |
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
"setSystemId" |
|
|
|
type: "warning" |
|
|
|
]), |
|
|
|
}).then(() => { |
|
|
|
...mapMutations({ |
|
|
|
this.$post(`${this.api.deleteProjectManage}?projectIds=${ids}&platformId=${this.queryData.platformId}`).then(res => { |
|
|
|
setQueryStatus: "project/SET_QUERYDATASTATUS" |
|
|
|
util.successMsg("删除成功"); |
|
|
|
}), |
|
|
|
this.$refs.table.clearSelection() |
|
|
|
getData() { |
|
|
|
this.getData(); |
|
|
|
this.setSystemId(this.systemId); |
|
|
|
}).catch(err => { |
|
|
|
if (this.isFirst) this.page = +this.$route.query.page || 1 |
|
|
|
console.log(err); |
|
|
|
let data = { |
|
|
|
}); |
|
|
|
...this.queryData, |
|
|
|
}).catch(() => { |
|
|
|
projectName: this.keyword, |
|
|
|
this.$message.info("已取消删除"); |
|
|
|
pageNum: this.page, |
|
|
|
}); |
|
|
|
pageSize: this.pageSize, |
|
|
|
}, |
|
|
|
systemId: this.systemId |
|
|
|
switchOff (row) { // 更新是否启用 |
|
|
|
}; |
|
|
|
this.$get(`${this.api.updateIsOpen}?isOpen=${row.ccupationlabOpen}&projectId=${row.projectId}&platformId=${this.queryData.platformId}`).then(res => { |
|
|
|
this.$post(this.api.queryProjectManage, data).then(res => { |
|
|
|
util.successMsg("更新启用状态成功"); |
|
|
|
this.isFirst = false |
|
|
|
this.getData(); |
|
|
|
this.listData = res.data.records; |
|
|
|
}).catch(err => { |
|
|
|
this.total = res.data.total; |
|
|
|
console.log(err); |
|
|
|
}).catch(err => { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
projectNameExistis () { // 项目管理名称判重 |
|
|
|
// 获取系统 |
|
|
|
if (this.projectName) { |
|
|
|
getSystemData() { |
|
|
|
this.$post(this.api.queryNameIsExist, { projectName: this.projectName }).then(res => { |
|
|
|
this.$get(this.api.getSystemIdBySchool).then(({ data }) => { |
|
|
|
if (res.status === 200) { |
|
|
|
this.systemListAll = data |
|
|
|
this.projectNameRepeat = false; |
|
|
|
this.getschoolCourse() |
|
|
|
|
|
|
|
}).catch(err => {}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 获取课程 |
|
|
|
|
|
|
|
getschoolCourse() { |
|
|
|
|
|
|
|
this.$get(this.api.getSchoolEffectiveCourse).then(({ data }) => { |
|
|
|
|
|
|
|
this.curriculumList = data |
|
|
|
|
|
|
|
const { cid } = this.queryData |
|
|
|
|
|
|
|
if (data.length) { |
|
|
|
|
|
|
|
this.cid = [cid || data[0].cid] |
|
|
|
|
|
|
|
const all = this.systemListAll |
|
|
|
|
|
|
|
data.map(e => { |
|
|
|
|
|
|
|
e.id = e.cid |
|
|
|
|
|
|
|
e.label = e.curriculumName |
|
|
|
|
|
|
|
e.children = all.filter(n => e.systemId.split(',').includes(n.id + '')) // 筛选出该课程下的系统 |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.curs = data |
|
|
|
|
|
|
|
this.curChange(this.cid) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}).catch(err => {}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 课程选择回调 |
|
|
|
|
|
|
|
curChange(val) { |
|
|
|
|
|
|
|
const cid = val[0] |
|
|
|
|
|
|
|
if (val.length === 1) { |
|
|
|
|
|
|
|
// 如果选择的是课程,则默认选中下面第一个系统 |
|
|
|
|
|
|
|
this.cid = [cid, this.curs.find(e => e.id === cid).children[0].id] |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
this.queryData.cid = cid |
|
|
|
}).catch(err => { |
|
|
|
this.systemId = this.cid[1] |
|
|
|
this.projectNameRepeat = true; |
|
|
|
this.initData() |
|
|
|
}); |
|
|
|
}, |
|
|
|
} else { |
|
|
|
// 创建人选择回调 |
|
|
|
this.projectNameRepeat = false; |
|
|
|
founderChange(val) { |
|
|
|
} |
|
|
|
this.$router.push({ |
|
|
|
}, |
|
|
|
path: 'list', |
|
|
|
copyData (projectId) { // 复制,根据项目id查询详情 |
|
|
|
query: { |
|
|
|
this.copyVisible = true; |
|
|
|
...this.$route.query, |
|
|
|
this.$get(`${this.api.getProjectDetail}?projectId=${projectId}`).then(res => { |
|
|
|
founder: val |
|
|
|
this.projectName = res.projectManage.projectName; |
|
|
|
} |
|
|
|
this.currentRow = { |
|
|
|
}) |
|
|
|
projectManage: res.projectManage, |
|
|
|
this.initData() |
|
|
|
projectJudgmentList: res.projectJudgmentVos |
|
|
|
}, |
|
|
|
}; |
|
|
|
initData() { |
|
|
|
}).catch(err => { |
|
|
|
this.page = 1; |
|
|
|
console.log(err); |
|
|
|
this.getData(); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
disabledSelection(row, index) { // 禁用勾选 |
|
|
|
copySubmit () { |
|
|
|
const roleName = this.roleName |
|
|
|
if (!this.projectName) { |
|
|
|
if (row.founder && (roleName.includes('超级') || roleName === row.roleName || (roleName === '管理员' && !row.roleName.includes('超级')))) return true |
|
|
|
util.warningMsg("请输入项目名称"); |
|
|
|
return false |
|
|
|
return; |
|
|
|
}, |
|
|
|
} |
|
|
|
handleCurrentChange(val) { // 切换页码 |
|
|
|
; |
|
|
|
this.page = val; |
|
|
|
if (this.projectNameRepeat) { |
|
|
|
// this.$router.push({ |
|
|
|
util.warningMsg("该项目名称已存在"); |
|
|
|
// path: '/project/list', |
|
|
|
return; |
|
|
|
// query: { |
|
|
|
} |
|
|
|
// ...this.$route.query, |
|
|
|
this.currentRow.projectManage.projectName = this.projectName; |
|
|
|
// page: val |
|
|
|
this.currentRow.projectManage.projectId = ""; |
|
|
|
// } |
|
|
|
this.currentRow.projectManage.founder = 1 |
|
|
|
// }) |
|
|
|
this.currentRow.projectJudgmentList.forEach(i => { |
|
|
|
this.getData(); |
|
|
|
i.projectId = ""; |
|
|
|
}, |
|
|
|
}); |
|
|
|
add() { // 新增项目 |
|
|
|
this.$post(`${this.api.copyProjectManage}`, this.currentRow).then(res => { |
|
|
|
this.setSystemId(this.systemId); |
|
|
|
this.initData(); |
|
|
|
this.$router.push(`/project/add?founder=${this.queryData.founder}`); |
|
|
|
util.successMsg("复制实验项目成功"); |
|
|
|
}, |
|
|
|
this.copyVisible = false; |
|
|
|
edit(row, show) { // 编辑 |
|
|
|
}).catch(err => { |
|
|
|
this.setSystemId(row.systemId); |
|
|
|
console.log(err); |
|
|
|
this.$router.push(`/project/add?projectId=${row.projectId}&founder=${this.queryData.founder}${show ? `&show=1` : ''}`); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleSelectionChange(val) { // 处理多选 |
|
|
|
goBack () { // 返回 |
|
|
|
this.multipleSelection = val; |
|
|
|
this.$router.back(); |
|
|
|
}, |
|
|
|
|
|
|
|
delAllData() { // 批量删除 |
|
|
|
|
|
|
|
if (this.multipleSelection.length) { |
|
|
|
|
|
|
|
let ids = this.multipleSelection.map(item => { |
|
|
|
|
|
|
|
return item.projectId; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
let strIds = ids.toString(); |
|
|
|
|
|
|
|
this.handleDelete(strIds); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
util.errorMsg("请先选择项目"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleDelete(ids) { // 删除 |
|
|
|
|
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
|
|
|
|
type: "warning" |
|
|
|
|
|
|
|
}).then(() => { |
|
|
|
|
|
|
|
this.$post(`${this.api.deleteProjectManage}?projectIds=${ids}&platformId=${this.queryData.platformId}`).then(res => { |
|
|
|
|
|
|
|
util.successMsg("删除成功"); |
|
|
|
|
|
|
|
this.$refs.table.clearSelection() |
|
|
|
|
|
|
|
this.getData(); |
|
|
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
|
|
console.log(err); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
|
|
this.$message.info("已取消删除"); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
switchOff(row) { // 更新是否启用 |
|
|
|
|
|
|
|
this.$get(`${this.api.updateIsOpen}?isOpen=${row.ccupationlabOpen}&projectId=${row.projectId}&platformId=${this.queryData.platformId}`).then(res => { |
|
|
|
|
|
|
|
util.successMsg("更新启用状态成功"); |
|
|
|
|
|
|
|
this.getData(); |
|
|
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
|
|
console.log(err); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
projectNameExistis() { // 项目管理名称判重 |
|
|
|
|
|
|
|
if (this.projectName) { |
|
|
|
|
|
|
|
this.$post(this.api.queryNameIsExist, { projectName: this.projectName }).then(res => { |
|
|
|
|
|
|
|
if (res.status === 200) { |
|
|
|
|
|
|
|
this.projectNameRepeat = false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
|
|
this.projectNameRepeat = true; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.projectNameRepeat = false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
copyData(projectId) { // 复制,根据项目id查询详情 |
|
|
|
|
|
|
|
this.copyVisible = true; |
|
|
|
|
|
|
|
this.$get(`${this.api.getProjectDetail}?projectId=${projectId}`).then(res => { |
|
|
|
|
|
|
|
this.projectName = res.projectManage.projectName; |
|
|
|
|
|
|
|
this.currentRow = { |
|
|
|
|
|
|
|
projectManage: res.projectManage, |
|
|
|
|
|
|
|
projectJudgmentList: res.projectJudgmentVos |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
|
|
console.log(err); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
copySubmit() { |
|
|
|
|
|
|
|
if (!this.projectName) { |
|
|
|
|
|
|
|
util.warningMsg("请输入项目名称"); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
; |
|
|
|
|
|
|
|
if (this.projectNameRepeat) { |
|
|
|
|
|
|
|
util.warningMsg("该项目名称已存在"); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.currentRow.projectManage.projectName = this.projectName; |
|
|
|
|
|
|
|
this.currentRow.projectManage.projectId = ""; |
|
|
|
|
|
|
|
this.currentRow.projectManage.founder = 1 |
|
|
|
|
|
|
|
this.currentRow.projectJudgmentList.forEach(i => { |
|
|
|
|
|
|
|
i.projectId = ""; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
this.$post(`${this.api.copyProjectManage}`, this.currentRow).then(res => { |
|
|
|
|
|
|
|
this.initData(); |
|
|
|
|
|
|
|
util.successMsg("复制实验项目成功"); |
|
|
|
|
|
|
|
this.copyVisible = false; |
|
|
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
|
|
console.log(err); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
goBack() { // 返回 |
|
|
|
|
|
|
|
this.$router.back(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
<style lang="scss" scoped> |
|
|
|
|
|
|
|
|
|
|
|
</style> |
|
|
|
</style> |