lw-cdp-ui 1.2.53 → 1.2.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/lwFlow/config/nodesList.js +6 -0
- package/dist/components/lwFlow/index.vue +14 -9
- package/dist/components/lwFlow/nodeEdit/index.vue +2 -1
- package/dist/components/lwFlow/nodesData/datas/folder.js +39 -0
- package/dist/components/lwFlow/nodesData/datas/{floder.js → unions.js} +2 -40
- package/dist/components/lwFlow/nodesData/index.js +4 -2
- package/dist/components/lwFormMini/FormItem.vue +1 -0
- package/dist/components/lwTable/components/TableColumn.vue +13 -0
- package/dist/components/lwTable/index.js +7 -15
- package/dist/components/lwTableSelect/index.vue +82 -22
- package/dist/lw-cdp-ui.esm.js +2292 -2260
- package/dist/lw-cdp-ui.umd.js +5 -5
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -307,14 +307,13 @@ export default {
|
|
|
307
307
|
await this.initNode()
|
|
308
308
|
if (this.modelValue && this.modelValue?.nodes?.length > 0) {
|
|
309
309
|
this.logicFlow.render(this.modelValue)
|
|
310
|
+
this.translateCenter()
|
|
310
311
|
} else {
|
|
311
312
|
// 根据节点数据初始化节点
|
|
312
313
|
this.initNodeData()
|
|
313
314
|
}
|
|
314
315
|
|
|
315
316
|
this.bindEvent()
|
|
316
|
-
// 内容移动到中心
|
|
317
|
-
this.logicFlow.translateCenter()
|
|
318
317
|
},
|
|
319
318
|
/**
|
|
320
319
|
* 根据node 初始化数据
|
|
@@ -366,7 +365,7 @@ export default {
|
|
|
366
365
|
return false
|
|
367
366
|
}
|
|
368
367
|
let sourceKeys = Array.isArray(item.from)
|
|
369
|
-
? item.from.map(subItem => subItem
|
|
368
|
+
? item.from.map(subItem => subItem?.name || subItem) // 如果是数组,提取每个 name
|
|
370
369
|
: [item.from]; // 如果是字符串,直接作为 sourceKey
|
|
371
370
|
|
|
372
371
|
const targetKey = item.into;
|
|
@@ -377,16 +376,14 @@ export default {
|
|
|
377
376
|
});
|
|
378
377
|
});
|
|
379
378
|
|
|
380
|
-
this.logicFlow.renderRawData({
|
|
381
|
-
nodes,
|
|
382
|
-
edges
|
|
383
|
-
})
|
|
379
|
+
this.logicFlow.renderRawData({ nodes, edges })
|
|
384
380
|
|
|
385
381
|
this.logicFlow.extension.dagre.layout({
|
|
386
382
|
nodesep: 60,
|
|
387
383
|
ranksep: 140,
|
|
388
384
|
})
|
|
389
385
|
|
|
386
|
+
this.translateCenter()
|
|
390
387
|
},
|
|
391
388
|
/**
|
|
392
389
|
* 初始化右键菜单
|
|
@@ -623,12 +620,12 @@ export default {
|
|
|
623
620
|
|
|
624
621
|
// 获取当前数据 合并到上级
|
|
625
622
|
let data = this.logicFlow.getGraphData()
|
|
623
|
+
data.nodes = data.nodes.map(x => x.properties.data)
|
|
626
624
|
nodes.forEach((x) => {
|
|
627
625
|
if (x.id === item.id) {
|
|
628
626
|
x.properties.data = {
|
|
629
627
|
...x.properties.data,
|
|
630
|
-
nodes: data.nodes
|
|
631
|
-
edges: data.edges
|
|
628
|
+
nodes: data.nodes
|
|
632
629
|
}
|
|
633
630
|
}
|
|
634
631
|
})
|
|
@@ -643,9 +640,17 @@ export default {
|
|
|
643
640
|
ranksep: 140,
|
|
644
641
|
})
|
|
645
642
|
|
|
643
|
+
this.translateCenter()
|
|
644
|
+
|
|
646
645
|
// 删除最后一级
|
|
647
646
|
this.menuList.pop();
|
|
648
647
|
},
|
|
648
|
+
// 内容移动到中心
|
|
649
|
+
translateCenter() {
|
|
650
|
+
this.logicFlow.resetZoom()
|
|
651
|
+
this.logicFlow.resetTranslate()
|
|
652
|
+
this.logicFlow.translateCenter()
|
|
653
|
+
},
|
|
649
654
|
/**
|
|
650
655
|
* 改变连线时处理上下级节点数据
|
|
651
656
|
* 本扩展暂无使用 本意是直接提供接口说要的数据结构
|
|
@@ -234,7 +234,7 @@ export default {
|
|
|
234
234
|
|
|
235
235
|
// 取出对应节点的表单配置
|
|
236
236
|
let nodeConfig = nodeDatasMerge[this.nodeData.type]?.formConfig || {};
|
|
237
|
-
|
|
237
|
+
|
|
238
238
|
// 深拷贝,避免直接修改全局配置
|
|
239
239
|
nodeConfig = JSON.parse(JSON.stringify(nodeConfig));
|
|
240
240
|
|
|
@@ -269,6 +269,7 @@ export default {
|
|
|
269
269
|
if (nodeConfig?.formItems) {
|
|
270
270
|
config.formItems = nodeConfig.formItems;
|
|
271
271
|
}
|
|
272
|
+
|
|
272
273
|
return config;
|
|
273
274
|
}
|
|
274
275
|
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ET2L数据合并节点 FOLDER 配置数据
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
// 暂无显示需求
|
|
7
|
+
nodeHtml: [],
|
|
8
|
+
// 目标节点校验
|
|
9
|
+
targetRules: [],
|
|
10
|
+
// 表单内容
|
|
11
|
+
formConfig: {
|
|
12
|
+
labelWidth: '70px',
|
|
13
|
+
labelPosition: 'top',
|
|
14
|
+
formItems: [
|
|
15
|
+
{
|
|
16
|
+
label: '节点名称',
|
|
17
|
+
name: 'name',
|
|
18
|
+
value: '',
|
|
19
|
+
component: 'input',
|
|
20
|
+
options: {
|
|
21
|
+
placeholder: '请输入节点名称'
|
|
22
|
+
},
|
|
23
|
+
span: 24,
|
|
24
|
+
rules: [{ required: true, message: '不能为空', trigger: 'blur' }]
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
label: '描述信息',
|
|
28
|
+
name: 'desp',
|
|
29
|
+
value: '',
|
|
30
|
+
component: 'input',
|
|
31
|
+
options: {
|
|
32
|
+
type: 'textarea',
|
|
33
|
+
placeholder: '请输入'
|
|
34
|
+
},
|
|
35
|
+
span: 24
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* ET2L数据合并节点
|
|
2
|
+
* ET2L数据合并节点 UNIONS 配置数据
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
export default {
|
|
@@ -23,49 +23,11 @@ export default {
|
|
|
23
23
|
span: 24,
|
|
24
24
|
rules: [{ required: true, message: '不能为空', trigger: 'blur' }]
|
|
25
25
|
},
|
|
26
|
-
{
|
|
27
|
-
label: '节点并行度',
|
|
28
|
-
name: 'para',
|
|
29
|
-
value: '',
|
|
30
|
-
component: 'number',
|
|
31
|
-
options: {
|
|
32
|
-
placeholder: '请输入节点并行度'
|
|
33
|
-
},
|
|
34
|
-
span: 24
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
label: '节点标签',
|
|
38
|
-
name: 'tags',
|
|
39
|
-
value: '',
|
|
40
|
-
component: 'tags',
|
|
41
|
-
span: 24
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
label: '连接模式',
|
|
45
|
-
name: 'mode',
|
|
46
|
-
value: '',
|
|
47
|
-
component: 'input',
|
|
48
|
-
span: 24,
|
|
49
|
-
options: {
|
|
50
|
-
placeholder: '请输入连接模式'
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
26
|
{
|
|
54
27
|
label: '数据来源',
|
|
55
28
|
name: 'from',
|
|
56
29
|
value: [],
|
|
57
|
-
component: '
|
|
58
|
-
span: 24,
|
|
59
|
-
rules: [{ required: true, message: '不能为空', trigger: 'change' }]
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
label: '映射动作',
|
|
63
|
-
name: 'with',
|
|
64
|
-
value: [],
|
|
65
|
-
component: 'MapAction',
|
|
66
|
-
options: {
|
|
67
|
-
placeholder: '请选择映射动作'
|
|
68
|
-
},
|
|
30
|
+
component: 'tags',
|
|
69
31
|
span: 24,
|
|
70
32
|
rules: [{ required: true, message: '不能为空', trigger: 'change' }]
|
|
71
33
|
},
|
|
@@ -19,7 +19,8 @@ import mapper from './datas/mapper'
|
|
|
19
19
|
import reduce from './datas/reduce'
|
|
20
20
|
import source from './datas/source'
|
|
21
21
|
import target from './datas/target'
|
|
22
|
-
import
|
|
22
|
+
import folder from './datas/folder'
|
|
23
|
+
import unions from './datas/unions'
|
|
23
24
|
import timer from './datas/timer'
|
|
24
25
|
import audience_receive from './datas/audienceReceive'
|
|
25
26
|
import event_receive from './datas/eventReceive'
|
|
@@ -35,7 +36,8 @@ export default {
|
|
|
35
36
|
reduce,
|
|
36
37
|
source,
|
|
37
38
|
target,
|
|
38
|
-
|
|
39
|
+
folder,
|
|
40
|
+
unions,
|
|
39
41
|
timer,
|
|
40
42
|
audience_receive,
|
|
41
43
|
event_receive,
|
|
@@ -151,6 +151,7 @@
|
|
|
151
151
|
:disabled="item?.options?.disabled"
|
|
152
152
|
:value-format="item?.options?.valueFormat"
|
|
153
153
|
:format="item?.options?.format"
|
|
154
|
+
:disabledDate="item?.options?.disabledDate"
|
|
154
155
|
:placeholder="item?.options?.placeholder || '请选择'"></el-date-picker>
|
|
155
156
|
</template>
|
|
156
157
|
<!-- number -->
|
|
@@ -207,6 +207,19 @@ export default {
|
|
|
207
207
|
}) || []
|
|
208
208
|
)
|
|
209
209
|
},
|
|
210
|
+
/**
|
|
211
|
+
* 检查权限
|
|
212
|
+
*/
|
|
213
|
+
checkAuth(auth) {
|
|
214
|
+
const { menus = [], authorities = [] } = JSON.parse(localStorage.getItem('userAuthInfo') || '{}')
|
|
215
|
+
const allPermissions = [...menus, ...authorities]
|
|
216
|
+
|
|
217
|
+
if (!auth) return true
|
|
218
|
+
if (Array.isArray(auth)) {
|
|
219
|
+
return auth.some((permission) => allPermissions.includes(permission))
|
|
220
|
+
}
|
|
221
|
+
return allPermissions.includes(auth)
|
|
222
|
+
},
|
|
210
223
|
}
|
|
211
224
|
}
|
|
212
225
|
</script>
|
|
@@ -47,7 +47,7 @@ export default {
|
|
|
47
47
|
|
|
48
48
|
data() {
|
|
49
49
|
return {
|
|
50
|
-
|
|
50
|
+
empty,
|
|
51
51
|
// 表格基础状态
|
|
52
52
|
tableHeaders: [], // 表格列配置
|
|
53
53
|
localTableSize: this.tableSize, // 表格大小
|
|
@@ -244,20 +244,6 @@ export default {
|
|
|
244
244
|
this.isFullscreen = false
|
|
245
245
|
}
|
|
246
246
|
},
|
|
247
|
-
|
|
248
|
-
/**
|
|
249
|
-
* 检查权限
|
|
250
|
-
*/
|
|
251
|
-
checkAuth(auth) {
|
|
252
|
-
const { menus = [], authorities = [] } = JSON.parse(localStorage.getItem('userAuthInfo') || '{}')
|
|
253
|
-
const allPermissions = [...menus, ...authorities]
|
|
254
|
-
|
|
255
|
-
if (!auth) return true
|
|
256
|
-
if (Array.isArray(auth)) {
|
|
257
|
-
return auth.some((permission) => allPermissions.includes(permission))
|
|
258
|
-
}
|
|
259
|
-
return allPermissions.includes(auth)
|
|
260
|
-
},
|
|
261
247
|
// 拖动选中
|
|
262
248
|
onSelect({ selected }) {
|
|
263
249
|
let list = []
|
|
@@ -271,6 +257,12 @@ export default {
|
|
|
271
257
|
}
|
|
272
258
|
})
|
|
273
259
|
this.$emit('multipleSelection', list)
|
|
260
|
+
},
|
|
261
|
+
toggleRowSelection(row, selected) {
|
|
262
|
+
if (!this.isCard) {
|
|
263
|
+
this.$refs.multipleTable.toggleRowSelection(row, selected)
|
|
264
|
+
} else {
|
|
265
|
+
}
|
|
274
266
|
}
|
|
275
267
|
}
|
|
276
268
|
}
|
|
@@ -83,8 +83,11 @@ export default {
|
|
|
83
83
|
keyword: null,
|
|
84
84
|
defaultValue: [],
|
|
85
85
|
tableData: [],
|
|
86
|
+
isLock: false,
|
|
87
|
+
listIds: [],
|
|
86
88
|
pageSize: config.pageSize,
|
|
87
89
|
total: 0,
|
|
90
|
+
idExpression: '',
|
|
88
91
|
currentPage: 1,
|
|
89
92
|
defaultProps: {
|
|
90
93
|
label: config.props.label,
|
|
@@ -101,10 +104,13 @@ export default {
|
|
|
101
104
|
},
|
|
102
105
|
watch: {
|
|
103
106
|
modelValue: {
|
|
104
|
-
handler() {
|
|
107
|
+
handler(val) {
|
|
105
108
|
this.defaultValue = this.modelValue
|
|
109
|
+
|
|
110
|
+
this.initValue()
|
|
106
111
|
},
|
|
107
|
-
deep: true
|
|
112
|
+
deep: true,
|
|
113
|
+
immediate: true
|
|
108
114
|
}
|
|
109
115
|
},
|
|
110
116
|
mounted() {
|
|
@@ -122,11 +128,11 @@ export default {
|
|
|
122
128
|
}
|
|
123
129
|
},
|
|
124
130
|
//获取表格数据
|
|
125
|
-
async getData() {
|
|
131
|
+
async getData(pageSize = this.pageSize) {
|
|
126
132
|
this.loading = true;
|
|
127
133
|
var reqData = {
|
|
128
134
|
[this.defaultProps.page]: this.currentPage - 1,
|
|
129
|
-
[this.defaultProps.pageSize]:
|
|
135
|
+
[this.defaultProps.pageSize]: pageSize,
|
|
130
136
|
[this.defaultProps.keyword]: this.keyword
|
|
131
137
|
}
|
|
132
138
|
let expression = this.$expression(this.formData)
|
|
@@ -139,6 +145,11 @@ export default {
|
|
|
139
145
|
} else {
|
|
140
146
|
this.formData.expression = ''
|
|
141
147
|
}
|
|
148
|
+
|
|
149
|
+
if (this.idExpression) {
|
|
150
|
+
this.formData.expression = this.formData.expression ? `${this.formData.expression} AND ${this.idExpression}` : this.idExpression
|
|
151
|
+
}
|
|
152
|
+
|
|
142
153
|
Object.assign(reqData, this.params, this.formData)
|
|
143
154
|
|
|
144
155
|
var res = await this.apiObj(reqData);
|
|
@@ -146,21 +157,36 @@ export default {
|
|
|
146
157
|
this.tableData = parseData.rows;
|
|
147
158
|
this.total = parseData.total;
|
|
148
159
|
this.loading = false;
|
|
149
|
-
//表格默认赋值
|
|
150
|
-
|
|
160
|
+
//表格默认赋值 10000的时候是回显数据
|
|
161
|
+
if (pageSize != 10000) {
|
|
162
|
+
this.$nextTick(() => {
|
|
163
|
+
if (this.multiple) {
|
|
164
|
+
this.defaultValue.forEach(row => {
|
|
165
|
+
var setrow = this.tableData.filter(item => item[this.defaultProps.value] === row['value'])
|
|
166
|
+
if (setrow.length > 0) {
|
|
167
|
+
this.$refs.table.toggleRowSelection(setrow[0], true);
|
|
168
|
+
}
|
|
169
|
+
})
|
|
170
|
+
} else {
|
|
171
|
+
var setrow = this.tableData.filter(item => item[this.defaultProps.value] === this.defaultValue?.value)
|
|
172
|
+
this.$refs.table.setCurrentRow(setrow[0]);
|
|
173
|
+
}
|
|
174
|
+
this.$refs.table.setScrollTop(0)
|
|
175
|
+
})
|
|
176
|
+
} else {
|
|
177
|
+
let setrow = this.tableData.filter(item => this.listIds.includes(item[this.defaultProps.value]))
|
|
178
|
+
|
|
151
179
|
if (this.multiple) {
|
|
152
|
-
this.defaultValue.
|
|
153
|
-
var setrow = this.tableData.filter(item => item[this.defaultProps.value] === row['value'])
|
|
154
|
-
if (setrow.length > 0) {
|
|
155
|
-
this.$refs.table.toggleRowSelection(setrow[0], true);
|
|
156
|
-
}
|
|
157
|
-
})
|
|
180
|
+
this.defaultValue = setrow.map(item => this.getCurVlaue(item))
|
|
158
181
|
} else {
|
|
159
|
-
|
|
160
|
-
this.$refs.table.setCurrentRow(setrow[0]);
|
|
182
|
+
this.defaultValue = setrow.map(item => this.getCurVlaue(item))[0]
|
|
161
183
|
}
|
|
162
|
-
|
|
163
|
-
|
|
184
|
+
if (setrow.length > 0) {
|
|
185
|
+
this.lock()
|
|
186
|
+
}
|
|
187
|
+
this.idExpression = ''
|
|
188
|
+
}
|
|
189
|
+
|
|
164
190
|
},
|
|
165
191
|
//插糟表单提交
|
|
166
192
|
formSubmit() {
|
|
@@ -193,7 +219,7 @@ export default {
|
|
|
193
219
|
} else {
|
|
194
220
|
this.defaultValue.splice(this.defaultValue.findIndex(item => item['value'] == row[this.defaultProps.value]), 1)
|
|
195
221
|
}
|
|
196
|
-
|
|
222
|
+
this.lock()
|
|
197
223
|
},
|
|
198
224
|
//表格全选事件
|
|
199
225
|
selectAll(rows) {
|
|
@@ -209,8 +235,7 @@ export default {
|
|
|
209
235
|
} else {
|
|
210
236
|
this.defaultValue = []
|
|
211
237
|
}
|
|
212
|
-
this
|
|
213
|
-
this.$emit('change', this.defaultValue);
|
|
238
|
+
this.lock()
|
|
214
239
|
},
|
|
215
240
|
click(row) {
|
|
216
241
|
if (this.multiple) {
|
|
@@ -218,19 +243,54 @@ export default {
|
|
|
218
243
|
} else {
|
|
219
244
|
this.defaultValue = this.getCurVlaue(row)
|
|
220
245
|
this.$refs.select.blur()
|
|
221
|
-
this
|
|
222
|
-
this.$emit('change', this.defaultValue);
|
|
246
|
+
this.lock()
|
|
223
247
|
}
|
|
224
248
|
},
|
|
225
249
|
//tags删除后回调
|
|
226
250
|
removeTag(tag) {
|
|
227
251
|
var row = this.findRowByKey(tag.value)
|
|
228
252
|
this.$refs.table.toggleRowSelection(row, false);
|
|
229
|
-
this
|
|
253
|
+
this.lock()
|
|
230
254
|
},
|
|
231
255
|
//清空后的回调
|
|
232
256
|
clear() {
|
|
257
|
+
this.lock()
|
|
258
|
+
},
|
|
259
|
+
// 数据修改锁定
|
|
260
|
+
lock() {
|
|
261
|
+
this.isLock = true
|
|
262
|
+
setTimeout(() => {
|
|
263
|
+
this.isLock = false
|
|
264
|
+
}, 1000)
|
|
233
265
|
this.$emit('update:modelValue', this.defaultValue);
|
|
266
|
+
this.$emit('change', this.defaultValue);
|
|
267
|
+
},
|
|
268
|
+
// 初始化回显
|
|
269
|
+
initValue(val = this.modelValue) {
|
|
270
|
+
if (val && !this.isLock) {
|
|
271
|
+
this.defaultProps = Object.assign(this.defaultProps, this.props);
|
|
272
|
+
// 自动判断类型回显
|
|
273
|
+
let list = []
|
|
274
|
+
if (typeof val === 'string') {
|
|
275
|
+
list.push(val)
|
|
276
|
+
} else if (Array.isArray(val)) {
|
|
277
|
+
val.forEach(item => {
|
|
278
|
+
console.log(item)
|
|
279
|
+
if (typeof item === 'string' && item) {
|
|
280
|
+
list.push(item)
|
|
281
|
+
} else if (typeof item === 'object' && item) {
|
|
282
|
+
list.push(item[this.defaultProps.value])
|
|
283
|
+
}
|
|
284
|
+
})
|
|
285
|
+
} else if (typeof val === 'object') {
|
|
286
|
+
list.push(val[this.defaultProps.value])
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
this.listIds = list
|
|
290
|
+
this.idExpression = this.$expression({ [`${this.defaultProps.value}_in`]: list })
|
|
291
|
+
|
|
292
|
+
this.getData(10000)
|
|
293
|
+
}
|
|
234
294
|
},
|
|
235
295
|
// 关键值查询表格数据行
|
|
236
296
|
findRowByKey(value) {
|