index.vue
6.08 KB
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
<route lang="yaml">
name: securityMenu //标签管理
</route>
<script lang="ts" setup name="securityMenu">
import TableTools from '@/components/Tools/table_tools.vue';
const { proxy } = getCurrentInstance() as any;
const dialogLabelFormRef = ref();
onBeforeMount(async () => {
});
// 右侧表格配置
const tableDataList = ref([]);
// 删除标签guids
const deleteLabelGuids = ref<any>([]);
// 保存编辑的guid
const editLabelRow = ref<any>('');
const page = ref({
limit: 50,
curr: 1,
sizes: [
{ label: "10", value: 10 },
{ label: "50", value: 50 },
{ label: "100", value: 100 },
{ label: "150", value: 150 },
{ label: "200", value: 200 },
],
});
const tableInfo = ref({
id: "role-manage-table",
multiple: true,
fixedSelection: true,
fields: [
{ label: "序号", type: "index", width: 56, align: "center" },
{ label: "数据产品编号", field: "label", type: 'text_btn', class: 'drawer-detail-cell', width: 160, value: 'detail', columClass: 'text_btn' },
{
label: "数据产品名称", field: "classifyNames", width: 200,
},
{ label: "数据类型", field: "gradeDetailName", width: 100 },
{
label: '权力主体', field: 'bizState', type: 'switch', activeText: '启用', inactiveText: '停用', activeValue: 'Y', inactiveValue: 'N', switchWidth: 56, width: 100, align: 'center'
},
{ label: "是否公共数据", field: "updateUserName", width: 120 },
{ label: "状态", field: "updateTime", width: 160 },
],
data: tableDataList.value,
page: {
type: "normal",
rows: 0,
...page.value,
},
actionInfo: {
label: "操作",
type: "btn",
width: 120,
fixed: 'right',
btns: [
{
label: "编辑", value: "edit", click: async (scope) => {
console.log('编辑', scope);
}
},
{
label: "删除 ", value: "delete", click: (scope) => {
console.log('删除', scope);
}
},
]
},
loading: false
});
const formItems = ref([
{
label: '附件上传',
tip: '支持格式:pdf,单个文件不能超过10MB ',
type: 'upload-file',
accept: '.pdf',
field: 'costAssessmentFile',
templateUrl: '',
required: true,
block: true,
visible: true,
default: [],
},
{
label: '附件上传',
tip: '支持格式:pdf,单个文件不能超过10MB ',
type: 'upload-file',
accept: '.pdf',
field: 'costAssessmentFile1',
templateUrl: '',
required: true,
block: true,
visible: true,
default: [],
},
{
label: '附件上传',
tip: '支持格式:pdf,单个文件不能超过10MB ',
type: 'upload-file',
accept: '.pdf',
field: 'costAssessmentFile2',
templateUrl: '',
required: true,
block: true,
visible: true,
default: [],
},
]);
const formRules = ref({
registerGuid: [
{ required: true, trigger: 'change', message: "请填写资产名称" }
],
costAssessmentFile: [{
validator: (rule: any, value: any, callback: any) => {
if (!value?.length) {
callback(new Error('请上传数据价值评估附件'))
} else {
callback();
}
}, trigger: 'change'
}]
});
const dialogInfo = ref({
visible: false,
size: 510,
direction: "column",
header: {
title: "价值评估发起",
},
type: '',//标识是否是重新提交
contents: [
{
type: 'form',
title: '',
formInfo: {
id: 'quality-coss-level',
items: formItems.value,
rules: formRules.value
}
}
],
footer: {
btns: [
{ type: "default", label: "取消", value: "cancel" },
{ type: "primary", label: "确定", value: "submit" },
],
},
});
const dialogBtnClick = () => {
console.log('handleSelectChange');
};
const classSearchItemList = ref<any>([
{
type: 'select',
multiple: true,
label: '',
field: 'labelName',
default: [],
options: [],
placeholder: '请选择标签名称',
clearable: true,
filterable: true,
visible: true
},
// 状态,可以编辑。
{
type: 'select',
multiple: true,
label: '',
field: 'state',
default: [],
options: [],
placeholder: '状态',
clearable: true,
filterable: true,
visible: true
}
]);
const guids = ref<any>([])
const selectChange = async (val: any, row: any) => {
console.log('selectChange', val, row);
if (val) {
guids.value = val;
}
};
/** 搜索查询分类标准 */
const refCount = ref(0);
const searchClass = async (val: any, clear: boolean = false) => {
console.log('searchClass', val, clear);
if (clear) {
classSearchItemList.value.map(item => item.default = '')
guids.value = []
return;
}
if (val?.labelName?.length !== 0 || refCount.value >= 1) {
}
};
const addNewLabel = () => {
dialogInfo.value.visible = true;
}
</script>
<template>
<div class="data-label">
<div class="container_wrap">
<div class="main_wrap">
<div class="main_wrap-top-area">
<TableTools :searchItems="classSearchItemList" :searchId="'template-manage-search'" @search="searchClass"
@select-change="selectChange" />
</div>
<div>
<el-button type="primary" class="v-add" @click="addNewLabel">新增</el-button>
<!-- <el-button class="v-import">导入</el-button>
<el-button>导出</el-button> -->
</div>
<div class="table_panel_wrap">
<Table :tableInfo="tableInfo" />
</div>
</div>
</div>
<Dialog :dialogInfo="dialogInfo" @btnClick="dialogBtnClick" />
</div>
</template>
<style lang="scss" scoped>
.data-label {
width: 100%;
height: 100%;
.container_wrap {
height: 100%;
.main_wrap {
height: 100%;
padding: 11px 16px 0 16px;
.main_wrap-top-area {
display: flex;
margin-bottom: 10px;
align-items: center;
.v-serach {
margin-left: 10px;
}
}
.table_panel_wrap {
margin-top: 12px;
width: 100%;
height: calc(100% - 105px);
min-height: 210px;
overflow: visible;
}
}
}
}
</style>