1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
| <template>
| <div class="app-container">
| <el-card class="box-card" shadow="never">
| <div class="filter-container" style="margin-bottom: 10px">
| <my-search ref="searchBar" :items="items" @search="filterForm"></my-search>
| </div>
| <!--列表-->
| <my-table-v2 ref="myTable" :filter="filterFrom" :table="table"/>
| </el-card>
| <edit v-if="editSetting.show" :setting="editSetting" @close="editSetting.show = false" @search="search"></edit>
| <nodeChoose v-if="nodeSetting.show" :setting="nodeSetting" @close="nodeSetting.show = false" @search="search"></nodeChoose>
| </div>
| </template>
|
| <script>
| import MyTableV2 from '@/components/myTable/myTableV2';
| import SettingIplatform from '@/utils/settingIplatform';
| import items from './items';
| import edit from './edit'
| import nodeChoose from "@/views/projectConfig/kanbanConfig/nodeChoose";
| import {updStatus} from "@/api/projectConfig/kanbanConfig";
|
| export default {
| components: {MyTableV2, edit,nodeChoose},
| data() {
| return {
| // 搜索条件
| items: items,
| filterFrom: {
| boardName: '',
| status: '1',
| },
| //新增编辑
| editSetting: {
| title: '',
| id: '',
| show: false,
| },
| //节点设置
| nodeSetting: {
| title: '模板节点设置',
| stageId: '',
| show: false,
| },
| // 表格数据
| table: {
| showIndex: true, // 是否显示序号
| expand: false, // 是否显示详情数据
| url: SettingIplatform.apiBaseURL + '/pc/p/temp/project/board/list', // 请求地址
| // 工具条
| tools: {
| columnsCtrl: {
| // 列控制按钮
| show: false,
| },
| generalExport: {
| // 通用导出按钮
| show: false,
| },
| // 自定义工具条按钮
| custom: [],
| },
| // 列信息
| columns: [
| {title: '关键节点名称', field: 'boardName', align: 'left'},
| // {title: '编号', field: 'boardCode', align: 'center'},
| {title: '顺序号', field: 'sort', align: 'left'},
| {
| field: 'status',
| title: '状态',
| align: 'center',
| width: 80,
| switch: (row) => {
| return {
| value: row.status === 1, // 开
| label: row.status === 1 ? '启用' : '禁用', // 开的描述
| click: () => {
| // 点击事件
| this.updState(row);
| },
| };
| },
| },
| ],
| // 操作信息
| operation: {
| show: true, // 显示操作列
| width: '250', // 列宽
| attr: [
| {
| title: '编辑',
| events: (row) => {
| this.showAdd(row.id);
| },
| },
| {
| title: '模板节点设置',
| type: 'success',
| events: (row) => {
| this.showNode(row.id);
| },
| },
| ],
| },
| paging: {
| show: false, // 显示分页
| // 分页信息
| page: {
| small: false,
| pageNum: 1,
| pageSize: 10,
| total: 0,
| },
| },
| },
| };
| },
| mounted() {
| },
| methods: {
| // 查询table列表
| search(pageNum) {
| if (pageNum != undefined) {
| this.$refs.myTable.search(pageNum);
| } else {
| this.$refs.myTable.search();
| }
| },
| filterForm(params) {
| this.filterFrom = Object.assign(this.filterFrom, params);
| this.search();
| },
| //添加、编辑
| showAdd(id) {
| let title = '添加';
| if (id != null) {
| title = '编辑';
| }
| this.editSetting.id = id;
| this.editSetting.title = title;
| this.editSetting.show = true;
| },
| updState(row) {
| let text = row.status === 0 ? "启用" : "禁用";
| this.$modal.confirm('确认要' + text + '"' + row.boardName + '"节点吗?').then(() => {
| let status = row.status === 1 ? 0 : 1
| updStatus({
| id: row.id,
| status
| }).then(res => {
| if (res) {
| row.status = row.status === 1 ? 0 : 1
| this.$modal.msgSuccess(text + "成功");
| }
| })
| })
| },
| showNode(id) {
| this.nodeSetting.id = id;
| this.nodeSetting.show = true;
| },
| },
| };
| </script>
|
| <style scoped></style>
|
|