parent
3c362751b8
commit
fe898632d4
11 changed files with 1504 additions and 1240 deletions
File diff suppressed because it is too large
Load Diff
@ -1,392 +1,452 @@ |
|||||||
<template> |
<template> |
||||||
<div> |
<div> |
||||||
<el-card v-if="showBack" shadow="hover" class="mgb20"> |
<el-card v-if="showBack" |
||||||
<el-page-header :content="'实验项目管理 / '+titleName" @back="goBack"></el-page-header> |
shadow="hover" |
||||||
</el-card> |
class="mgb20"> |
||||||
|
<el-page-header :content="'实验项目管理 / '+titleName" |
||||||
|
@back="goBack"></el-page-header> |
||||||
|
</el-card> |
||||||
|
|
||||||
<el-card shadow="hover" class="mgb20"> |
<el-card shadow="hover" |
||||||
<div> |
class="mgb20"> |
||||||
<div class="flex-center mgb20"> |
<div> |
||||||
<p class="hr_tag"></p> |
<div class="flex-center mgb20"> |
||||||
<span>筛选</span> |
<p class="hr_tag"></p> |
||||||
</div> |
<span>筛选</span> |
||||||
</div> |
</div> |
||||||
<div> |
</div> |
||||||
<el-form label-width="80px"> |
<div> |
||||||
<el-col :span="4"> |
<el-form label-width="80px"> |
||||||
<el-form-item label="来源"> |
<el-col :span="4"> |
||||||
<el-select v-model="queryData.founder" clearable placeholder="请选择创建人" |
<el-form-item label="来源"> |
||||||
@change="initData"> |
<el-select v-model="queryData.founder" |
||||||
<el-option v-for="(item,index) in founderList" :key="index" :label="item.label" |
clearable |
||||||
:value="item.value"></el-option> |
placeholder="请选择创建人" |
||||||
</el-select> |
@change="initData"> |
||||||
</el-form-item> |
<el-option v-for="(item,index) in founderList" |
||||||
</el-col> |
:key="index" |
||||||
<el-col :span="4"> |
:label="item.label" |
||||||
<el-form-item label="状态"> |
:value="item.value"></el-option> |
||||||
<el-select v-model="queryData.state" clearable placeholder="请选择状态" @change="initData"> |
</el-select> |
||||||
<el-option v-for="(item,index) in stateList" :key="index" :label="item.label" |
</el-form-item> |
||||||
:value="item.value"></el-option> |
</el-col> |
||||||
</el-select> |
<el-col :span="4"> |
||||||
</el-form-item> |
<el-form-item label="状态"> |
||||||
</el-col> |
<el-select v-model="queryData.state" |
||||||
<el-col :span="4"> |
clearable |
||||||
<el-form-item label="权限"> |
placeholder="请选择状态" |
||||||
<el-select v-model="queryData.permissions" placeholder="请选择" @change="initData"> |
@change="initData"> |
||||||
<el-option |
<el-option v-for="(item,index) in stateList" |
||||||
v-for="item in permissionsList" |
:key="index" |
||||||
:key="item.value" |
:label="item.label" |
||||||
:label="item.label" |
:value="item.value"></el-option> |
||||||
:value="item.value" |
</el-select> |
||||||
></el-option> |
</el-form-item> |
||||||
</el-select> |
</el-col> |
||||||
</el-form-item> |
<el-col :span="4"> |
||||||
</el-col> |
<el-form-item label="权限"> |
||||||
<el-col :span="6"> |
<el-select v-model="queryData.permissions" |
||||||
<el-form-item> |
placeholder="请选择" |
||||||
<el-input placeholder="请输入项目名称" prefix-icon="el-icon-search" |
@change="initData"> |
||||||
v-model="keyword" clearable></el-input> |
<el-option v-for="item in permissionsList" |
||||||
</el-form-item> |
:key="item.value" |
||||||
</el-col> |
:label="item.label" |
||||||
</el-form> |
:value="item.value"></el-option> |
||||||
</div> |
</el-select> |
||||||
</el-card> |
</el-form-item> |
||||||
|
</el-col> |
||||||
|
<el-col :span="6"> |
||||||
|
<el-form-item> |
||||||
|
<el-input placeholder="请输入项目名称" |
||||||
|
prefix-icon="el-icon-search" |
||||||
|
v-model="keyword" |
||||||
|
clearable></el-input> |
||||||
|
</el-form-item> |
||||||
|
</el-col> |
||||||
|
</el-form> |
||||||
|
</div> |
||||||
|
</el-card> |
||||||
|
|
||||||
<el-card shadow="hover" class="mgb20"> |
<el-card shadow="hover" |
||||||
<div class="flex-between mgb20"> |
class="mgb20"> |
||||||
<div class="flex-center"> |
<div class="flex-between mgb20"> |
||||||
<p class="hr_tag"></p> |
<div class="flex-center"> |
||||||
<span>项目列表</span> |
<p class="hr_tag"></p> |
||||||
</div> |
<span>项目列表</span> |
||||||
<div> |
</div> |
||||||
<el-button type="primary" round @click="add" class="mag">新增项目</el-button> |
<div> |
||||||
<el-button type="primary" round @click="delAllData">批量删除</el-button> |
<el-button type="primary" |
||||||
</div> |
round |
||||||
</div> |
@click="add" |
||||||
<el-table :data="listData" class="table" ref="table" stripe header-align="center" row-key="projectId" |
class="mag">新增项目</el-button> |
||||||
@selection-change="handleSelectionChange"> |
<el-button type="primary" |
||||||
<el-table-column type="selection" width="55" align="center"></el-table-column> |
round |
||||||
<el-table-column type="index" width="100" label="序号" align="center"> |
@click="delAllData">批量删除</el-button> |
||||||
<template slot-scope="scope">{{ scope.$index + (page - 1) * pageSize + 1 }}</template> |
</div> |
||||||
</el-table-column> |
</div> |
||||||
<el-table-column prop="projectName" label="实验项目名称" min-width="400" align="center"></el-table-column> |
<el-table :data="listData" |
||||||
<el-table-column prop="founder" label="来源" min-width="150" align="center"> |
class="table" |
||||||
<template slot-scope="scope"> |
ref="table" |
||||||
{{ founderKeys[scope.row.founder] }} |
stripe |
||||||
</template> |
header-align="center" |
||||||
</el-table-column> |
row-key="projectId" |
||||||
<el-table-column prop="creator" label="创建人" min-width="140" align="center"> |
@selection-change="handleSelectionChange"> |
||||||
<template slot-scope="scope"> |
<el-table-column type="selection" |
||||||
{{ queryData.founder == 1 ? scope.row.schoolName : scope.row.creator }} |
width="55" |
||||||
</template> |
align="center"></el-table-column> |
||||||
</el-table-column> |
<el-table-column type="index" |
||||||
<el-table-column label="权限" min-width="120" align="center"> |
width="100" |
||||||
<template slot-scope="scope"> |
label="序号" |
||||||
{{ permissionsKeys[scope.row.permissions] }} |
align="center"> |
||||||
</template> |
<template slot-scope="scope">{{ scope.$index + (page - 1) * pageSize + 1 }}</template> |
||||||
</el-table-column> |
</el-table-column> |
||||||
<el-table-column prop="createTime" label="创建时间" min-width="150" align="center"></el-table-column> |
<el-table-column prop="projectName" |
||||||
<el-table-column prop="status" label="状态" min-width="100" align="center"> |
label="实验项目名称" |
||||||
<template slot-scope="scope"> |
min-width="400" |
||||||
{{ stateKeys[scope.row.state] }} |
align="center"></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)"> |
<template slot-scope="scope"> |
||||||
编辑 |
{{ founderKeys[scope.row.founder] }} |
||||||
</el-button> |
</template> |
||||||
<el-button type="text" @click="handleDelete(scope.row.projectId)"> |
</el-table-column> |
||||||
删除 |
<el-table-column prop="creator" |
||||||
</el-button> |
label="创建人" |
||||||
<el-button type="text" @click="copyData(scope.row.projectId)">复制</el-button> |
min-width="140" |
||||||
<el-switch |
align="center"> |
||||||
v-if="scope.row.state" |
<template slot-scope="scope"> |
||||||
v-model="scope.row.ztOpen" |
{{ queryData.founder == 1 ? scope.row.schoolName : scope.row.creator }} |
||||||
:active-text="scope.row.ztOpen ? '关闭' : '启用'" |
</template> |
||||||
:active-value="0" |
</el-table-column> |
||||||
:inactive-value="1" |
<el-table-column label="权限" |
||||||
style="margin: 0 10px 0 10px" |
min-width="120" |
||||||
@change="switchOff(scope.row)" |
align="center"> |
||||||
></el-switch> |
<template slot-scope="scope"> |
||||||
</template> |
{{ permissionsKeys[scope.row.permissions] }} |
||||||
</el-table-column> |
</template> |
||||||
</el-table> |
</el-table-column> |
||||||
<div class="pagination"> |
<el-table-column prop="createTime" |
||||||
<el-pagination background @current-change="handleCurrentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination> |
label="创建时间" |
||||||
</div> |
min-width="150" |
||||||
</el-card> |
align="center"></el-table-column> |
||||||
|
<el-table-column prop="status" |
||||||
|
label="状态" |
||||||
|
min-width="100" |
||||||
|
align="center"> |
||||||
|
<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)"> |
||||||
|
编辑 |
||||||
|
</el-button> |
||||||
|
<el-button type="text" |
||||||
|
@click="handleDelete(scope.row.projectId)"> |
||||||
|
删除 |
||||||
|
</el-button> |
||||||
|
<el-button type="text" |
||||||
|
@click="copyData(scope.row.projectId)">复制</el-button> |
||||||
|
<el-switch v-if="scope.row.state" |
||||||
|
v-model="scope.row.ztOpen" |
||||||
|
:active-text="scope.row.ztOpen ? '关闭' : '启用'" |
||||||
|
: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-card> |
||||||
|
|
||||||
<!--复制对话框--> |
<!--复制对话框--> |
||||||
<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> |
||||||
</template> |
</template> |
||||||
|
|
||||||
<script> |
<script> |
||||||
import { mapState, mapActions } from 'vuex'; |
import { mapState, mapActions } from 'vuex'; |
||||||
import Setting from "@/setting"; |
import Setting from "@/setting"; |
||||||
export default { |
export default { |
||||||
data() { |
data () { |
||||||
return { |
return { |
||||||
showBack: Boolean(this.$route.query.show), |
showBack: Boolean(this.$route.query.show), |
||||||
systemId: this.$route.query.systemId, |
systemId: this.$route.query.systemId, |
||||||
titleName: this.$route.query.name, |
titleName: this.$route.query.name, |
||||||
queryData: { |
queryData: { |
||||||
platformId: 3, // 平台:职站:1 中台:3 |
platformId: 3, // 平台:职站:1 中台:3 |
||||||
founder: 0, // 创建人角色(0:系统 1:老师) |
founder: 0, // 创建人角色(0:系统 1:老师) |
||||||
state: "", // 状态(0:草稿箱 1:已发布) |
state: "", // 状态(0:草稿箱 1:已发布) |
||||||
permissions: "", // 项目权限(0:练习 1:考核 2:竞赛) |
permissions: "", // 项目权限(0:练习 1:考核 2:竞赛) |
||||||
}, |
}, |
||||||
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: [] |
||||||
}; |
}; |
||||||
|
}, |
||||||
|
watch: { |
||||||
|
keyword: function (val) { |
||||||
|
clearTimeout(this.searchTimer); |
||||||
|
this.searchTimer = setTimeout(() => { |
||||||
|
this.initData(); |
||||||
|
}, 500); |
||||||
|
} |
||||||
|
}, |
||||||
|
mounted () { |
||||||
|
if (this.$route.query.founder && this.$route.query.founder != 'undefined') { |
||||||
|
this.queryData.founder = +this.$route.query.founder |
||||||
|
} else { |
||||||
|
this.queryData.founder = 0 |
||||||
|
} |
||||||
|
this.getData(); |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
getData () { |
||||||
|
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.listData = res.data.records; |
||||||
|
this.total = res.data.total; |
||||||
|
}).catch(err => { |
||||||
|
console.log(err); |
||||||
|
}); |
||||||
}, |
}, |
||||||
watch: { |
initData () { |
||||||
keyword: function(val) { |
this.page = 1; |
||||||
clearTimeout(this.searchTimer); |
this.getData(); |
||||||
this.searchTimer = setTimeout(() => { |
|
||||||
this.initData(); |
|
||||||
}, 500); |
|
||||||
} |
|
||||||
}, |
}, |
||||||
mounted() { |
handleCurrentChange (val) { // 切换页码 |
||||||
if (this.$route.query.founder && this.$route.query.founder != 'undefined'){ |
this.page = val; |
||||||
this.queryData.founder = +this.$route.query.founder |
this.$router.replace({ |
||||||
}else{ |
path: 'projectList', |
||||||
this.queryData.founder = 0 |
query: { |
||||||
|
...this.$route.query, |
||||||
|
page: val |
||||||
} |
} |
||||||
this.getData(); |
}) |
||||||
|
this.getData(); |
||||||
}, |
}, |
||||||
methods: { |
add () { // 新增项目 |
||||||
getData() { |
this.$router.push(`/projectAdd?systemId=${this.systemId}&founder=${this.queryData.founder}&isDetails=${this.$route.query.show}&name=${this.titleName}`); |
||||||
let data = { |
}, |
||||||
...this.queryData, |
edit (row) { // 编辑 |
||||||
projectName: this.keyword, |
this.$router.push(`/projectAdd?systemId=${this.systemId}&projectId=${row.projectId}&founder=${this.queryData.founder}&isDetails=${this.$route.query.show}&name=${this.titleName}`); |
||||||
pageNum: this.page, |
}, |
||||||
pageSize: this.pageSize, |
handleSelectionChange (val) { // 处理多选 |
||||||
systemId: this.systemId |
this.multipleSelection = val; |
||||||
}; |
}, |
||||||
this.$post(this.api.queryProjectManage, data).then(res => { |
delAllData () { // 批量删除 |
||||||
this.listData = res.data.records; |
if (this.multipleSelection.length) { |
||||||
this.total = res.data.total; |
let ids = this.multipleSelection.map(item => { |
||||||
}).catch(err => { |
return item.projectId |
||||||
console.log(err); |
}); |
||||||
}); |
let strIds = ids.toString(); |
||||||
}, |
this.handleDelete(strIds); |
||||||
initData() { |
} else { |
||||||
this.page = 1; |
this.$message.error("请先选择项目"); |
||||||
this.getData(); |
} |
||||||
}, |
}, |
||||||
handleCurrentChange(val) { // 切换页码 |
handleDelete (ids) { // 删除 |
||||||
this.page = val; |
this.$confirm('确定要删除吗?', '提示', { |
||||||
this.$router.push({ |
type: 'warning' |
||||||
path: 'projectList', |
}).then(() => { |
||||||
query: { |
this.$post(`${this.api.deleteProjectManage}?projectIds=${ids}&platformId=${this.queryData.platformId}`).then(res => { |
||||||
...this.$route.query, |
console.log(ids) |
||||||
page: val |
if (res.status == 200) { |
||||||
} |
let delList = [] |
||||||
}) |
if (isNaN(ids) == 'NaN') { |
||||||
this.getData(); |
delList = ids.split(',') |
||||||
}, |
|
||||||
add() { // 新增项目 |
|
||||||
this.$router.push(`/projectAdd?systemId=${this.systemId}&founder=${this.queryData.founder}&isDetails=${this.$route.query.show}&name=${this.titleName}`); |
|
||||||
}, |
|
||||||
edit(row) { // 编辑 |
|
||||||
this.$router.push(`/projectAdd?systemId=${this.systemId}&projectId=${row.projectId}&founder=${this.queryData.founder}&isDetails=${this.$route.query.show}&name=${this.titleName}`); |
|
||||||
}, |
|
||||||
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 { |
} else { |
||||||
this.$message.error("请先选择项目"); |
delList.push(ids) |
||||||
} |
} |
||||||
}, |
if (delList.length == this.listData.length) { |
||||||
handleDelete(ids) { // 删除 |
if (this.page > 1) { |
||||||
this.$confirm('确定要删除吗?', '提示', { |
this.page = this.page - 1 |
||||||
type: 'warning' |
} |
||||||
}).then(() => { |
|
||||||
this.$post(`${this.api.deleteProjectManage}?projectIds=${ids}&platformId=${this.queryData.platformId}`).then(res => { |
|
||||||
console.log(ids) |
|
||||||
if (res.status == 200) { |
|
||||||
let delList = [] |
|
||||||
if (isNaN(ids) == 'NaN'){ |
|
||||||
delList = ids.split(',') |
|
||||||
}else{ |
|
||||||
delList.push(ids) |
|
||||||
} |
|
||||||
if(delList.length == this.listData.length){ |
|
||||||
if(this.page > 1){ |
|
||||||
this.page = this.page-1 |
|
||||||
} |
|
||||||
}else{ |
|
||||||
|
|
||||||
} |
|
||||||
this.$message.success("删除成功"); |
|
||||||
this.getData(); |
|
||||||
} else { |
|
||||||
this.$message.error(res.message); |
|
||||||
} |
|
||||||
}).catch(err => { |
|
||||||
console.log(err); |
|
||||||
}); |
|
||||||
}).catch(() => { |
|
||||||
this.$message.info('已取消删除'); |
|
||||||
}); |
|
||||||
}, |
|
||||||
switchOff(row) { // 更新是否启用 |
|
||||||
this.$get(`${this.api.updateIsOpen}?isOpen=${row.ztOpen}&projectId=${row.projectId}&platformId=${this.queryData.platformId}`).then(res => { |
|
||||||
if (res.status === 200) { |
|
||||||
this.$message.success('更新启用状态成功'); |
|
||||||
this.getData(); |
|
||||||
} else { |
|
||||||
this.$message.error(res.message); |
|
||||||
} |
|
||||||
}).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; |
|
||||||
} else { |
|
||||||
this.projectNameRepeat = true; |
|
||||||
} |
|
||||||
}).catch(err => { |
|
||||||
this.projectNameRepeat = true; |
|
||||||
}); |
|
||||||
} else { |
} else { |
||||||
this.projectNameRepeat = false; |
|
||||||
} |
|
||||||
}, |
|
||||||
copyData(projectId) { // 复制,根据项目id查询详情 |
|
||||||
this.copyVisible = true; |
|
||||||
this.$get(`${this.api.getProjectDetail}?projectId=${projectId}`).then(res => { |
|
||||||
if (res.status === 200) { |
|
||||||
this.projectName = res.projectManage.projectName; |
|
||||||
this.currentRow = { |
|
||||||
projectManage: res.projectManage, |
|
||||||
projectJudgmentList: res.projectJudgmentVos |
|
||||||
} |
|
||||||
} |
|
||||||
}).catch(err => { |
|
||||||
console.log(err); |
|
||||||
}); |
|
||||||
}, |
|
||||||
copySubmit() { |
|
||||||
if (!this.projectName) { |
|
||||||
this.$message.warning("请输入项目名称"); |
|
||||||
return; |
|
||||||
} |
|
||||||
; |
|
||||||
if (this.projectNameRepeat) { |
|
||||||
this.$message.warning("该项目名称已存在"); |
|
||||||
return; |
|
||||||
} |
} |
||||||
this.currentRow.projectManage.projectName = this.projectName; |
this.$message.success("删除成功"); |
||||||
this.currentRow.projectManage.projectId = ""; |
this.getData(); |
||||||
this.currentRow.projectManage.founder = 0 |
} else { |
||||||
this.currentRow.projectJudgmentList.forEach(i => { |
this.$message.error(res.message); |
||||||
i.projectId = ""; |
} |
||||||
}); |
}).catch(err => { |
||||||
this.$post(`${this.api.copyProjectManage}`, this.currentRow).then(res => { |
console.log(err); |
||||||
if (res.status === 200) { |
}); |
||||||
this.queryData.founder = 0 |
}).catch(() => { |
||||||
this.initData(); |
this.$message.info('已取消删除'); |
||||||
this.$message.success("复制实验项目成功"); |
}); |
||||||
this.copyVisible = false; |
}, |
||||||
} else { |
switchOff (row) { // 更新是否启用 |
||||||
this.$message.error(res.message); |
this.$get(`${this.api.updateIsOpen}?isOpen=${row.ztOpen}&projectId=${row.projectId}&platformId=${this.queryData.platformId}`).then(res => { |
||||||
} |
if (res.status === 200) { |
||||||
}).catch(err => { |
this.$message.success('更新启用状态成功'); |
||||||
console.log(err); |
this.getData(); |
||||||
}); |
} else { |
||||||
}, |
this.$message.error(res.message); |
||||||
goBack() { // 返回 |
} |
||||||
// this.$router.push(`/configure`) |
}).catch(err => { |
||||||
this.$router.back() |
console.log(err); |
||||||
|
}); |
||||||
|
}, |
||||||
|
projectNameExistis () { // 项目管理名称判重 |
||||||
|
if (this.projectName) { |
||||||
|
this.$post(this.api.queryNameIsExist, { projectName: this.projectName }).then(res => { |
||||||
|
if (res.status === 200) { |
||||||
|
this.projectNameRepeat = false; |
||||||
|
} else { |
||||||
|
this.projectNameRepeat = true; |
||||||
|
} |
||||||
|
}).catch(err => { |
||||||
|
this.projectNameRepeat = true; |
||||||
|
}); |
||||||
|
} else { |
||||||
|
this.projectNameRepeat = false; |
||||||
|
} |
||||||
|
}, |
||||||
|
copyData (projectId) { // 复制,根据项目id查询详情 |
||||||
|
this.copyVisible = true; |
||||||
|
this.$get(`${this.api.getProjectDetail}?projectId=${projectId}`).then(res => { |
||||||
|
if (res.status === 200) { |
||||||
|
this.projectName = res.projectManage.projectName; |
||||||
|
this.currentRow = { |
||||||
|
projectManage: res.projectManage, |
||||||
|
projectJudgmentList: res.projectJudgmentVos |
||||||
|
} |
||||||
|
} |
||||||
|
}).catch(err => { |
||||||
|
console.log(err); |
||||||
|
}); |
||||||
|
}, |
||||||
|
copySubmit () { |
||||||
|
if (!this.projectName) { |
||||||
|
this.$message.warning("请输入项目名称"); |
||||||
|
return; |
||||||
|
} |
||||||
|
; |
||||||
|
if (this.projectNameRepeat) { |
||||||
|
this.$message.warning("该项目名称已存在"); |
||||||
|
return; |
||||||
|
} |
||||||
|
this.currentRow.projectManage.projectName = this.projectName; |
||||||
|
this.currentRow.projectManage.projectId = ""; |
||||||
|
this.currentRow.projectManage.founder = 0 |
||||||
|
this.currentRow.projectJudgmentList.forEach(i => { |
||||||
|
i.projectId = ""; |
||||||
|
}); |
||||||
|
this.$post(`${this.api.copyProjectManage}`, this.currentRow).then(res => { |
||||||
|
if (res.status === 200) { |
||||||
|
this.queryData.founder = 0 |
||||||
|
this.initData(); |
||||||
|
this.$message.success("复制实验项目成功"); |
||||||
|
this.copyVisible = false; |
||||||
|
} else { |
||||||
|
this.$message.error(res.message); |
||||||
} |
} |
||||||
|
}).catch(err => { |
||||||
|
console.log(err); |
||||||
|
}); |
||||||
|
}, |
||||||
|
goBack () { // 返回 |
||||||
|
this.$router.back() |
||||||
} |
} |
||||||
|
} |
||||||
}; |
}; |
||||||
</script> |
</script> |
||||||
|
|
||||||
<style lang="scss" scoped> |
<style lang="scss" scoped> |
||||||
|
|
||||||
</style> |
</style> |
Loading…
Reference in new issue