n20-common-lib 2.5.42 → 2.5.44
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/package.json
CHANGED
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
</el-checkbox-group>
|
|
58
58
|
</div>
|
|
59
59
|
</div>
|
|
60
|
-
<div
|
|
60
|
+
<div class="right-c flex-column p-t-m" v-if="!hasPX">
|
|
61
61
|
<div class="m-b">
|
|
62
62
|
{{ '当前选定项' | $lc }}
|
|
63
63
|
<el-link type="primary" style="visibility: hidden">{{ '当前选定项' | $lc }}</el-link>
|
|
@@ -96,7 +96,12 @@
|
|
|
96
96
|
>{{ data.label }}</span
|
|
97
97
|
>
|
|
98
98
|
</span>
|
|
99
|
-
<el-link
|
|
99
|
+
<el-link
|
|
100
|
+
class="n20-icon-shanchu"
|
|
101
|
+
:underline="false"
|
|
102
|
+
@click.stop="() => removeMenu(node, data)"
|
|
103
|
+
:disabled="data.checked"
|
|
104
|
+
/>
|
|
100
105
|
</span>
|
|
101
106
|
</el-tree>
|
|
102
107
|
</div>
|
|
@@ -160,6 +165,7 @@ import axios from '../../utils/axios'
|
|
|
160
165
|
import dialogWrap from '../Dialog/index.vue'
|
|
161
166
|
import dragList from '../DragList/index.vue'
|
|
162
167
|
import forEachs from '../../utils/forEachs'
|
|
168
|
+
import { Message } from 'element-ui'
|
|
163
169
|
export default {
|
|
164
170
|
name: 'ShowColumn',
|
|
165
171
|
components: { dialogWrap, dragList },
|
|
@@ -222,7 +228,8 @@ export default {
|
|
|
222
228
|
label: '',
|
|
223
229
|
prop: '',
|
|
224
230
|
width: 120,
|
|
225
|
-
isNew: true
|
|
231
|
+
isNew: true,
|
|
232
|
+
children: []
|
|
226
233
|
},
|
|
227
234
|
userNo: sessionStorage.getItem('userNo'),
|
|
228
235
|
configVisibleN: false,
|
|
@@ -276,7 +283,7 @@ export default {
|
|
|
276
283
|
arr.push(item)
|
|
277
284
|
})
|
|
278
285
|
this.dragListN = arr
|
|
279
|
-
const newArr = arr.filter((item) => {
|
|
286
|
+
/* const newArr = arr.filter((item) => {
|
|
280
287
|
return item.isNew
|
|
281
288
|
})
|
|
282
289
|
newArr.forEach((item) => {
|
|
@@ -284,7 +291,7 @@ export default {
|
|
|
284
291
|
if (index === -1) {
|
|
285
292
|
this.columns.push(item)
|
|
286
293
|
}
|
|
287
|
-
})
|
|
294
|
+
}) */
|
|
288
295
|
},
|
|
289
296
|
immediate: true,
|
|
290
297
|
deep: true
|
|
@@ -316,14 +323,15 @@ export default {
|
|
|
316
323
|
return this.$message.warning($lc('已有重名字段,请修改'))
|
|
317
324
|
}
|
|
318
325
|
this.dragList.unshift(this.configModelN)
|
|
319
|
-
this.columns = [this.configModelN, ...this.columns]
|
|
326
|
+
// this.columns = [this.configModelN, ...this.columns]
|
|
320
327
|
this.$message.success($lc('添加成功'))
|
|
321
328
|
this.configVisibleN = false
|
|
322
329
|
this.configModelN = {
|
|
323
330
|
label: '',
|
|
324
331
|
prop: '',
|
|
325
332
|
width: 120,
|
|
326
|
-
isNew: true
|
|
333
|
+
isNew: true,
|
|
334
|
+
children: []
|
|
327
335
|
}
|
|
328
336
|
},
|
|
329
337
|
removeMenu(node, data) {
|
|
@@ -342,18 +350,11 @@ export default {
|
|
|
342
350
|
}
|
|
343
351
|
},
|
|
344
352
|
clickItem(item) {
|
|
345
|
-
this.configModel =
|
|
346
|
-
this.configModel.wrap = item.wrap ?? false
|
|
353
|
+
this.configModel = item
|
|
347
354
|
this.configVisible = true
|
|
348
355
|
},
|
|
349
356
|
configSave() {
|
|
350
357
|
this.configVisible = false
|
|
351
|
-
const index = this.dragList.findIndex(
|
|
352
|
-
(item) => item.prop === this.configModel.prop || item.label === this.configModel.label
|
|
353
|
-
)
|
|
354
|
-
if (index > -1) {
|
|
355
|
-
this.dragList[index] = this.configModel
|
|
356
|
-
}
|
|
357
358
|
},
|
|
358
359
|
popOpen() {
|
|
359
360
|
this.dragList = this.checkColumns.filter((col) => !col.static)
|
|
@@ -370,6 +371,11 @@ export default {
|
|
|
370
371
|
let index = this.dragList.findIndex((d) => d[this.labelKey] === column[this.labelKey])
|
|
371
372
|
index !== -1 && this.dragList.splice(index, 1)
|
|
372
373
|
} else {
|
|
374
|
+
let index = this.dragListN.findIndex((d) => d[this.labelKey] === column[this.labelKey])
|
|
375
|
+
if (index !== -1) {
|
|
376
|
+
Message.warning($lc(`子级请在右侧删除!`))
|
|
377
|
+
return false
|
|
378
|
+
}
|
|
373
379
|
this.dragList.push(column)
|
|
374
380
|
}
|
|
375
381
|
},
|
|
@@ -391,7 +397,14 @@ export default {
|
|
|
391
397
|
let preCols = this.columns.filter((col) => col.static === 'pre')
|
|
392
398
|
let nextCols = this.columns.filter((col) => col.static === 'next')
|
|
393
399
|
list.push(...preCols, ...this.dragList, ...nextCols)
|
|
394
|
-
|
|
400
|
+
// 新增校验
|
|
401
|
+
if (!this.isExport) {
|
|
402
|
+
let state = list.findIndex((c) => c.isNew && c.children && c.children.length === 0)
|
|
403
|
+
if (state !== -1) {
|
|
404
|
+
Message.warning($lc(`新增字段必须包含子级!`))
|
|
405
|
+
return false
|
|
406
|
+
}
|
|
407
|
+
}
|
|
395
408
|
// 自动保存设置的显示列
|
|
396
409
|
!this.isExport && this.autoSave && this.saveColumns(list)
|
|
397
410
|
|
|
@@ -420,16 +433,13 @@ function saveTransform(list, labelKey, isFilter) {
|
|
|
420
433
|
let listN = []
|
|
421
434
|
if (!isFilter) {
|
|
422
435
|
list.forEach((c) => {
|
|
423
|
-
if (c.prop && !c.children && !c.isNew) {
|
|
436
|
+
if (c.prop && !c.children && !c.isNew && !c.width & !c.isNew) {
|
|
424
437
|
listN.push({ _colKey: 'prop', _colVal: c.prop })
|
|
425
438
|
} else if (c.slotName) {
|
|
426
439
|
listN.push({ _colKey: 'slotName', _colVal: c.slotName })
|
|
427
440
|
} else if (c.type && ['selection', 'index', 'expand'].includes(c.type)) {
|
|
428
441
|
listN.push({ _colKey: 'type', _colVal: c.type })
|
|
429
442
|
} else {
|
|
430
|
-
if (c.isNew && !c.children) {
|
|
431
|
-
return this.$message.warning($lc(`新增字段必须包含子级!`))
|
|
432
|
-
}
|
|
433
443
|
let sFn = false
|
|
434
444
|
for (let k in c) {
|
|
435
445
|
if (typeof c[k] === 'function') sFn = true
|