|
|
|
@ -36,8 +36,7 @@
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="300px">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<!-- <el-button size="mini" type="text" icon="el-icon-view" @click="handleview(scope.row)">查看</el-button> -->
|
|
|
|
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleEditPro(scope.row)">编辑项目</el-button>
|
|
|
|
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleView(scope.row)">编辑项目</el-button>
|
|
|
|
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
|
|
|
|
|
<el-button class="text-danger" size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
|
|
|
|
|
</template>
|
|
|
|
@ -66,24 +65,50 @@
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
<!-- 关联项目参数配置对话框 -->
|
|
|
|
|
<el-dialog :title="title" :visible.sync="projectListOpen" width="800px" append-to-body>
|
|
|
|
|
<el-checkbox-group v-model="projectIds">
|
|
|
|
|
<el-dialog title="项目管理列表" :visible.sync="projectListOpen" width="800px" append-to-body>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<span v-if="!projectIds.length">暂无项目</span>
|
|
|
|
|
<el-tag class="mb5 mr5" v-for="tag in projectIds" :key="tag.projectId" closable @close="handleTopicProDel(tag)">
|
|
|
|
|
{{tag.projectName}}
|
|
|
|
|
</el-tag>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="16">
|
|
|
|
|
<el-table :data="projectList"
|
|
|
|
|
:row-class-name="({row}) => { if(projectIds.find(v => v.projectId == row.projectId)) return 'topicListDisabled' }"
|
|
|
|
|
style="width: 100%" @selection-change="handleSelectionChange">
|
|
|
|
|
<el-table-column prop="projectId" align="center" label="项目ID">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="projectName" align="center" label="项目名称">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column align="center" label="操作">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button size="mini" type="text" icon="el-icon-plus" @click="handleTopicProjectSave(scope.row)">添加</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
|
|
</el-table>
|
|
|
|
|
<pagination v-show="proTotal > 0" :total="proTotal" :page.sync="proQueryParams.pageNum" :limit.sync="proQueryParams.pageSize"
|
|
|
|
|
@pagination="getProjectList" />
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<!-- <el-checkbox-group v-model="projectIds">
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col style="margin-bottom: 15px" :span="12" v-for="data in projectList" :key="data.projectId">
|
|
|
|
|
<el-checkbox size="medium" :label="data.projectId">{{data.projectName}}</el-checkbox>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
</el-checkbox-group>
|
|
|
|
|
</el-checkbox-group> -->
|
|
|
|
|
<!-- <el-table :data="projectList" @selection-change="handleProjectSelectionChange">
|
|
|
|
|
<el-table-column type="selection" width="55" align="center">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="projectName" align="center" label="项目名称">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table> -->
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<!-- <div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button type="primary" @click="submitPro">确 定</el-button>
|
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</div> -->
|
|
|
|
|
</el-dialog>
|
|
|
|
|
<!-- 查看项目列表弹框 -->
|
|
|
|
|
<!-- <el-dialog title="项目管理列表" :visible.sync="projectManagementOpen">
|
|
|
|
@ -106,10 +131,10 @@
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { list, info, add, del, select } from "@/api/topicInfo/info";
|
|
|
|
|
import { ProList, ProInfo, save, saves, ProDel, ProSelect } from "@/api/topicInfo/management";
|
|
|
|
|
import { select as proSelect } from "@/api/hardware/project";
|
|
|
|
|
import { save, saves, topicProDel, topicProSelect } from "@/api/topicInfo/topicProject";
|
|
|
|
|
import { list as proList } from "@/api/hardware/project";
|
|
|
|
|
export default {
|
|
|
|
|
name: "InfoList",
|
|
|
|
|
name: "TopicList",
|
|
|
|
|
data () {
|
|
|
|
|
return {
|
|
|
|
|
// 选中数组
|
|
|
|
@ -124,6 +149,7 @@ export default {
|
|
|
|
|
showSearch: true,
|
|
|
|
|
// 总条数
|
|
|
|
|
total: 0,
|
|
|
|
|
proTotal: 0,
|
|
|
|
|
// 弹出层标题
|
|
|
|
|
title: "",
|
|
|
|
|
// 是否显示弹出层
|
|
|
|
@ -137,6 +163,10 @@ export default {
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 10
|
|
|
|
|
},
|
|
|
|
|
proQueryParams: {
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 5
|
|
|
|
|
},
|
|
|
|
|
snapRow: {},
|
|
|
|
|
select: {},
|
|
|
|
|
row: {},
|
|
|
|
@ -155,6 +185,12 @@ export default {
|
|
|
|
|
this.getList()
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
rowClassRow ({ row, rowIndex }) {
|
|
|
|
|
if (this.projectIds.find(v => v.projectId == row.projectId)) {
|
|
|
|
|
return 'topicListDisabled';
|
|
|
|
|
}
|
|
|
|
|
return '';
|
|
|
|
|
},
|
|
|
|
|
// 获取Topic列表
|
|
|
|
|
getList () {
|
|
|
|
|
list(this.queryParams).then((res) => {
|
|
|
|
@ -164,15 +200,14 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
// 获取项目列表
|
|
|
|
|
getProjectList () {
|
|
|
|
|
this.projectList = [];
|
|
|
|
|
proSelect().then((response) => {
|
|
|
|
|
this.projectList = response.select;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 获取列表
|
|
|
|
|
getManagementList () {
|
|
|
|
|
ProList(this.queryParams).then((res) => {
|
|
|
|
|
this.proData = res.rows;
|
|
|
|
|
proList(this.proQueryParams).then(({ code, msg, rows, total }) => {
|
|
|
|
|
if (200 == code) {
|
|
|
|
|
this.projectList = rows;
|
|
|
|
|
this.proTotal = total;
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
|
} else {
|
|
|
|
|
this.msgError(msg);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
/** 搜索按钮操作 */
|
|
|
|
@ -206,33 +241,47 @@ export default {
|
|
|
|
|
this.getList()
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// handleview (row) {
|
|
|
|
|
// this.row = row;
|
|
|
|
|
// ProSelect(row.topicId).then(response => {
|
|
|
|
|
// this.snspPro = response.select.map(v => v.topicId);
|
|
|
|
|
// this.projectManagementOpen = true;
|
|
|
|
|
// });
|
|
|
|
|
// },
|
|
|
|
|
handleEditPro (row) {
|
|
|
|
|
ProSelect(row.topicId).then(response => {
|
|
|
|
|
this.projectIds = response.select.map(v => v.projectId);
|
|
|
|
|
handleView (row) {
|
|
|
|
|
this.row = row;
|
|
|
|
|
this.topicProSelect(row);
|
|
|
|
|
},
|
|
|
|
|
topicProSelect (row) {
|
|
|
|
|
topicProSelect(row.topicId).then(response => {
|
|
|
|
|
this.projectIds = response.select;
|
|
|
|
|
});
|
|
|
|
|
this.snapRow = Object.assign({}, row);
|
|
|
|
|
this.projectListOpen = true;
|
|
|
|
|
},
|
|
|
|
|
submitPro () {
|
|
|
|
|
console.log(this.snapRow.topicId)
|
|
|
|
|
console.log(this.projectIds)
|
|
|
|
|
saves({ topicId: this.snapRow.topicId, projectIds: this.projectIds }).then(res => {
|
|
|
|
|
handleTopicProjectSave (row) {
|
|
|
|
|
const loading = this.$loading({
|
|
|
|
|
lock: true,
|
|
|
|
|
text: '添加中',
|
|
|
|
|
spinner: 'el-icon-loading',
|
|
|
|
|
background: 'rgba(0, 0, 0, 0.3)'
|
|
|
|
|
});
|
|
|
|
|
save({ topicId: this.snapRow.topicId, projectId: row.projectId }).then(res => {
|
|
|
|
|
if (200 == res.code) {
|
|
|
|
|
this.msgSuccess(res.msg);
|
|
|
|
|
this.projectListOpen = false;
|
|
|
|
|
this.getProjectList()
|
|
|
|
|
this.topicProSelect(this.row);
|
|
|
|
|
this.getProjectList();
|
|
|
|
|
} else {
|
|
|
|
|
this.msgError(res.msg);
|
|
|
|
|
}
|
|
|
|
|
loading.close();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
handleTopicProDel ({ id }) {
|
|
|
|
|
const loading = this.$loading({
|
|
|
|
|
lock: true,
|
|
|
|
|
text: '添加中',
|
|
|
|
|
spinner: 'el-icon-loading',
|
|
|
|
|
background: 'rgba(0, 0, 0, 0.3)'
|
|
|
|
|
});
|
|
|
|
|
topicProDel(id).then(res => {
|
|
|
|
|
this.topicProSelect(this.row);
|
|
|
|
|
this.getProjectList();
|
|
|
|
|
loading.close();
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
|
handleDelete (row) {
|
|
|
|
|
const ids = row.id || this.ids;
|
|
|
|
@ -287,4 +336,9 @@ export default {
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
.topicListDisabled {
|
|
|
|
|
pointer-events: none;
|
|
|
|
|
cursor: default;
|
|
|
|
|
opacity: 0.6;
|
|
|
|
|
}
|
|
|
|
|
</style>
|