mooho-base-admin-plus 2.10.75 → 2.10.77
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/README.md +0 -2
- package/history.md +2 -0
- package/package/mooho-base-admin-plus.min.esm.js +138 -46
- package/package/mooho-base-admin-plus.min.js +3 -3
- package/package/style.css +1 -1
- package/package.json +1 -1
- package/src/components/input/dialog-select.vue +17 -2
- package/src/components/view/filter-edit.vue +1 -1
- package/src/components/view/table-filter.vue +13 -4
- package/src/components/view/view-form.vue +41 -35
- package/src/components/view/view-table.vue +2 -2
- package/src/pages/system/role.vue +53 -3
- package/src/pages/system/user.vue +69 -3
- package/token.txt +2 -0
package/package.json
CHANGED
|
@@ -14,7 +14,15 @@
|
|
|
14
14
|
<Button :size="size" custom-icon="fa fa-search" @click="dialogSelectOpen()"></Button>
|
|
15
15
|
</template>
|
|
16
16
|
</Input>
|
|
17
|
-
<modal-table
|
|
17
|
+
<modal-table
|
|
18
|
+
ref="dialogTable"
|
|
19
|
+
:view-code="source"
|
|
20
|
+
:autoLoad="false"
|
|
21
|
+
:select-enable="multi"
|
|
22
|
+
:check-cross-page="true"
|
|
23
|
+
:footer-enable="multi"
|
|
24
|
+
@on-row-dblclick="dialogTableRowDblclick"
|
|
25
|
+
>
|
|
18
26
|
<template #command="{ row }">
|
|
19
27
|
<Button size="small" v-if="!multi" type="primary" custom-icon="fa fa-check" @click="dialogCheck(row)">{{ $t('Front_Btn_Select') }}</Button>
|
|
20
28
|
</template>
|
|
@@ -311,13 +319,20 @@
|
|
|
311
319
|
* 选中项变化事件
|
|
312
320
|
* @property {object} row 选中行 }
|
|
313
321
|
*/
|
|
314
|
-
this.$emit('on-change', data);
|
|
322
|
+
this.$emit('on-change', data, displayData);
|
|
315
323
|
|
|
316
324
|
this.$refs.dialogTable.close();
|
|
317
325
|
},
|
|
318
326
|
// 关闭
|
|
319
327
|
close() {
|
|
320
328
|
this.$refs.dialogTable.close();
|
|
329
|
+
},
|
|
330
|
+
// 双击行选中
|
|
331
|
+
|
|
332
|
+
dialogTableRowDblclick(row) {
|
|
333
|
+
if (!this.multi) {
|
|
334
|
+
this.dialogCheck(row);
|
|
335
|
+
}
|
|
321
336
|
}
|
|
322
337
|
}
|
|
323
338
|
};
|
|
@@ -322,7 +322,7 @@
|
|
|
322
322
|
</Col>
|
|
323
323
|
<Col v-bind="grid8" v-if="paramData.keyType == '变量'">
|
|
324
324
|
<FormItem label="值" key="val2" prop="val">
|
|
325
|
-
<Input type="text" v-model="paramData.val"
|
|
325
|
+
<Input type="text" v-model="paramData.val">
|
|
326
326
|
<template #prepend>
|
|
327
327
|
<Button custom-icon="fa fa-search" @click="openValueSelect"></Button>
|
|
328
328
|
</template>
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
:source="column.source"
|
|
164
164
|
:source-data-code="column.sourceDataCode"
|
|
165
165
|
:source-display-code="column.sourceDisplayCode"
|
|
166
|
-
:param="getParam(data, column)"
|
|
166
|
+
:param="getParam(data, column, parentData)"
|
|
167
167
|
:controlWidth="column.controlWidth"
|
|
168
168
|
@on-change="selected => onSelectDataChange(column, selected)"
|
|
169
169
|
></dialog-select>
|
|
@@ -177,7 +177,7 @@
|
|
|
177
177
|
:source="column.source"
|
|
178
178
|
:source-data-code="column.sourceDataCode"
|
|
179
179
|
:source-display-code="column.sourceDisplayCode"
|
|
180
|
-
:param="getParam(data, column)"
|
|
180
|
+
:param="getParam(data, column, parentData)"
|
|
181
181
|
:controlWidth="column.controlWidth"
|
|
182
182
|
@on-change="selected => onSelectDataChange(column, selected)"
|
|
183
183
|
></dialog-select>
|
|
@@ -310,6 +310,15 @@
|
|
|
310
310
|
// 字段
|
|
311
311
|
columns: {
|
|
312
312
|
type: Array
|
|
313
|
+
},
|
|
314
|
+
/**
|
|
315
|
+
* 内嵌表格的父对象
|
|
316
|
+
*/
|
|
317
|
+
parentData: {
|
|
318
|
+
type: Object,
|
|
319
|
+
default() {
|
|
320
|
+
return {};
|
|
321
|
+
}
|
|
313
322
|
}
|
|
314
323
|
},
|
|
315
324
|
watch: {
|
|
@@ -625,7 +634,7 @@
|
|
|
625
634
|
break;
|
|
626
635
|
}
|
|
627
636
|
|
|
628
|
-
let param = this.getParam(this.data, column);
|
|
637
|
+
let param = this.getParam(this.data, column, this.parentData);
|
|
629
638
|
|
|
630
639
|
if (
|
|
631
640
|
column.controlType === 'Select' ||
|
|
@@ -801,7 +810,7 @@
|
|
|
801
810
|
return;
|
|
802
811
|
}
|
|
803
812
|
|
|
804
|
-
let param = this.getParam(data, column);
|
|
813
|
+
let param = this.getParam(data, column, this.parentData);
|
|
805
814
|
|
|
806
815
|
if (param != null) {
|
|
807
816
|
param[column.sourceDisplayCode + '_c'] = keyword;
|
|
@@ -629,41 +629,7 @@
|
|
|
629
629
|
if (this.data && Object.keys(this.data).length > 0) {
|
|
630
630
|
this.columns.forEach(async column => {
|
|
631
631
|
if ((column.controlType == 'Table' || column.controlType == 'ExcelTable') && this.$refs['table_' + column.code]) {
|
|
632
|
-
|
|
633
|
-
if (column.tableStoreType == 'Inner') {
|
|
634
|
-
// 表内存储
|
|
635
|
-
let json = this.parseData(this.data, column.code);
|
|
636
|
-
|
|
637
|
-
if (json) {
|
|
638
|
-
this.$refs['table_' + column.code][0].loadData(JSON.parse(json));
|
|
639
|
-
}
|
|
640
|
-
} else {
|
|
641
|
-
// 关联表
|
|
642
|
-
if (this.data.id) {
|
|
643
|
-
// 参数完整,查询数据
|
|
644
|
-
let res;
|
|
645
|
-
let param = {};
|
|
646
|
-
|
|
647
|
-
let tableView = this.$refs['table_' + column.code][0].tableView;
|
|
648
|
-
|
|
649
|
-
let filtering = tableView.filtering;
|
|
650
|
-
|
|
651
|
-
if (!!(filtering || '').trim()) {
|
|
652
|
-
param = JSON.parse(filtering);
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
param[column.sourceDataCode] = this.data.id;
|
|
656
|
-
|
|
657
|
-
if (column.isSourceCustom) {
|
|
658
|
-
res = await customModelApi.query(column.sourceModel, param, null, tableView.isReturnSimple ? tableView : null);
|
|
659
|
-
} else {
|
|
660
|
-
res = await modelApi.query(column.sourceModel, param, null, tableView.isReturnSimple ? tableView : null, tableView.functionName, tableView.functionType);
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
this.$refs['table_' + column.code][0].loadData(res.data);
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
});
|
|
632
|
+
this.reloadTable(column.code);
|
|
667
633
|
} else if (column.controlType == 'Attachment' && this.$refs['attachment_' + column.code] && this.$refs['attachment_' + column.code].length > 0) {
|
|
668
634
|
this.$refs['attachment_' + column.code][0].setData(this.parseData(this.data, column.code));
|
|
669
635
|
}
|
|
@@ -1755,6 +1721,46 @@
|
|
|
1755
1721
|
}
|
|
1756
1722
|
|
|
1757
1723
|
control.open(data);
|
|
1724
|
+
},
|
|
1725
|
+
// 重新加载内嵌表格数据
|
|
1726
|
+
reloadTable(tableCode) {
|
|
1727
|
+
let column = this.column.find(item => item.code == tableCode);
|
|
1728
|
+
|
|
1729
|
+
setTimeout(async () => {
|
|
1730
|
+
if (column.tableStoreType == 'Inner') {
|
|
1731
|
+
// 表内存储
|
|
1732
|
+
let json = this.parseData(this.data, column.code);
|
|
1733
|
+
|
|
1734
|
+
if (json) {
|
|
1735
|
+
this.$refs['table_' + column.code][0].loadData(JSON.parse(json));
|
|
1736
|
+
}
|
|
1737
|
+
} else {
|
|
1738
|
+
// 关联表
|
|
1739
|
+
if (this.data.id) {
|
|
1740
|
+
// 参数完整,查询数据
|
|
1741
|
+
let res;
|
|
1742
|
+
let param = {};
|
|
1743
|
+
|
|
1744
|
+
let tableView = this.$refs['table_' + column.code][0].tableView;
|
|
1745
|
+
|
|
1746
|
+
let filtering = tableView.filtering;
|
|
1747
|
+
|
|
1748
|
+
if (!!(filtering || '').trim()) {
|
|
1749
|
+
param = JSON.parse(filtering);
|
|
1750
|
+
}
|
|
1751
|
+
|
|
1752
|
+
param[column.sourceDataCode] = this.data.id;
|
|
1753
|
+
|
|
1754
|
+
if (column.isSourceCustom) {
|
|
1755
|
+
res = await customModelApi.query(column.sourceModel, param, null, tableView.isReturnSimple ? tableView : null);
|
|
1756
|
+
} else {
|
|
1757
|
+
res = await modelApi.query(column.sourceModel, param, null, tableView.isReturnSimple ? tableView : null, tableView.functionName, tableView.functionType);
|
|
1758
|
+
}
|
|
1759
|
+
|
|
1760
|
+
this.$refs['table_' + column.code][0].loadData(res.data);
|
|
1761
|
+
}
|
|
1762
|
+
}
|
|
1763
|
+
});
|
|
1758
1764
|
}
|
|
1759
1765
|
// // 打印
|
|
1760
1766
|
// print() {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
@slot 自定义筛选栏
|
|
29
29
|
-->
|
|
30
30
|
<slot name="customFilter"></slot>
|
|
31
|
-
<table-filter ref="tableFilter" :columns="filterColumns" :table-view="tableView" @on-keyup="onKeyup">
|
|
31
|
+
<table-filter ref="tableFilter" :columns="filterColumns" :table-view="tableView" :parent-data="parentData" @on-keyup="onKeyup">
|
|
32
32
|
<template #column="{ column }">
|
|
33
33
|
<!--
|
|
34
34
|
@slot 筛选栏自定义列
|
|
@@ -2882,7 +2882,7 @@
|
|
|
2882
2882
|
return;
|
|
2883
2883
|
}
|
|
2884
2884
|
|
|
2885
|
-
let param = this.getParam(data, column);
|
|
2885
|
+
let param = this.getParam(data, column, this.parentData);
|
|
2886
2886
|
|
|
2887
2887
|
if (param != null) {
|
|
2888
2888
|
param[column.sourceDisplayCode + '_c'] = keyword;
|
|
@@ -39,13 +39,32 @@
|
|
|
39
39
|
<view-table ref="userRoleDataTable" view-code="UserRoleDataEdit" :static="true">
|
|
40
40
|
<template #column="{ row, code }">
|
|
41
41
|
<template v-if="row.controlType === 'TextInput'">
|
|
42
|
-
<Input
|
|
42
|
+
<Input
|
|
43
|
+
type="text"
|
|
44
|
+
size="small"
|
|
45
|
+
v-model="row.propertyValue"
|
|
46
|
+
@on-change="
|
|
47
|
+
() => {
|
|
48
|
+
row.propertyDisplayValue = row.propertyValue;
|
|
49
|
+
}
|
|
50
|
+
"
|
|
51
|
+
/>
|
|
43
52
|
</template>
|
|
44
53
|
<template v-else-if="row.controlType === 'NumberInput'">
|
|
45
|
-
<Input
|
|
54
|
+
<Input
|
|
55
|
+
type="number"
|
|
56
|
+
size="small"
|
|
57
|
+
number
|
|
58
|
+
v-model="row.propertyValue"
|
|
59
|
+
@on-change="
|
|
60
|
+
() => {
|
|
61
|
+
row.propertyDisplayValue = row.propertyValue;
|
|
62
|
+
}
|
|
63
|
+
"
|
|
64
|
+
/>
|
|
46
65
|
</template>
|
|
47
66
|
<template v-else-if="row.controlType === 'Select'">
|
|
48
|
-
<Select size="small" v-model="row.propertyValue" :clearable="true" :transfer="true">
|
|
67
|
+
<Select size="small" v-model="row.propertyValue" :clearable="true" :transfer="true" @on-change="selected => selectChange(selected, row)">
|
|
49
68
|
<Option v-for="item in row._dataSource" :key="item.id" :value="item.id">{{ item.name }}</Option>
|
|
50
69
|
</Select>
|
|
51
70
|
</template>
|
|
@@ -61,6 +80,7 @@
|
|
|
61
80
|
:multiple="true"
|
|
62
81
|
clearable
|
|
63
82
|
:transfer="true"
|
|
83
|
+
@on-change="selected => multiSelectChange(selected, row)"
|
|
64
84
|
>
|
|
65
85
|
<Option v-for="item in row._dataSource" :key="item.id" :value="item.id">{{ item.name }}</Option>
|
|
66
86
|
</Select>
|
|
@@ -73,6 +93,7 @@
|
|
|
73
93
|
:source-data-code="row.sourceDataCode"
|
|
74
94
|
:source-display-code="row.sourceDisplayCode"
|
|
75
95
|
:param="getParam(row)"
|
|
96
|
+
@on-change="selected => dialogSelectChange(selected, row)"
|
|
76
97
|
></dialog-select>
|
|
77
98
|
</template>
|
|
78
99
|
<template v-else-if="row.controlType === 'MultiDialogSelect'">
|
|
@@ -84,6 +105,7 @@
|
|
|
84
105
|
:source-data-code="row.sourceDataCode"
|
|
85
106
|
:source-display-code="row.sourceDisplayCode"
|
|
86
107
|
:param="getParam(row)"
|
|
108
|
+
@on-change="(selected, displaySelected) => multiDialogSelectChange(selected, displaySelected, row)"
|
|
87
109
|
></dialog-select>
|
|
88
110
|
</template>
|
|
89
111
|
<template v-else-if="row.controlType === 'Check'">
|
|
@@ -394,6 +416,34 @@
|
|
|
394
416
|
});
|
|
395
417
|
});
|
|
396
418
|
}
|
|
419
|
+
},
|
|
420
|
+
selectChange(selected, row) {
|
|
421
|
+
console.log('selectChange', selected, row);
|
|
422
|
+
|
|
423
|
+
if (selected) {
|
|
424
|
+
row.propertyDisplayValue = row._dataSource.find(item => item.id == selected).name;
|
|
425
|
+
} else {
|
|
426
|
+
row.propertyDisplayValue = null;
|
|
427
|
+
}
|
|
428
|
+
},
|
|
429
|
+
multiSelectChange(selected, row) {
|
|
430
|
+
let displayValue = [];
|
|
431
|
+
|
|
432
|
+
selected.forEach(item => {
|
|
433
|
+
displayValue.push(row._dataSource.find(i => i.id == item).name);
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
row.propertyDisplayValue = displayValue.join(',');
|
|
437
|
+
},
|
|
438
|
+
dialogSelectChange(selected, row) {
|
|
439
|
+
if (selected) {
|
|
440
|
+
row.propertyDisplayValue = selected.name;
|
|
441
|
+
} else {
|
|
442
|
+
row.propertyDisplayValue = null;
|
|
443
|
+
}
|
|
444
|
+
},
|
|
445
|
+
multiDialogSelectChange(selected, displaySelected, row) {
|
|
446
|
+
row.propertyDisplayValue = displaySelected;
|
|
397
447
|
}
|
|
398
448
|
}
|
|
399
449
|
};
|
|
@@ -50,13 +50,49 @@
|
|
|
50
50
|
<view-table ref="userRoleDataTable" view-code="UserRoleDataEdit" :static="true">
|
|
51
51
|
<template #column="{ row, code }">
|
|
52
52
|
<template v-if="row.controlType === 'TextInput'">
|
|
53
|
-
<Input
|
|
53
|
+
<Input
|
|
54
|
+
type="text"
|
|
55
|
+
size="small"
|
|
56
|
+
v-model="row.propertyValue"
|
|
57
|
+
@on-change="
|
|
58
|
+
() => {
|
|
59
|
+
row.propertyDisplayValue = row.propertyValue;
|
|
60
|
+
}
|
|
61
|
+
"
|
|
62
|
+
/>
|
|
54
63
|
</template>
|
|
55
64
|
<template v-else-if="row.controlType === 'NumberInput'">
|
|
56
|
-
<Input
|
|
65
|
+
<Input
|
|
66
|
+
type="number"
|
|
67
|
+
size="small"
|
|
68
|
+
number
|
|
69
|
+
v-model="row.propertyValue"
|
|
70
|
+
@on-change="
|
|
71
|
+
() => {
|
|
72
|
+
row.propertyDisplayValue = row.propertyValue;
|
|
73
|
+
}
|
|
74
|
+
"
|
|
75
|
+
/>
|
|
57
76
|
</template>
|
|
58
77
|
<template v-else-if="row.controlType === 'Select'">
|
|
59
|
-
<Select size="small" v-model="row.propertyValue" :clearable="true" :transfer="true">
|
|
78
|
+
<Select size="small" v-model="row.propertyValue" :clearable="true" :transfer="true" @on-change="selected => selectChange(selected, row)">
|
|
79
|
+
<Option v-for="item in row._dataSource" :key="item.id" :value="item.id">{{ item.name }}</Option>
|
|
80
|
+
</Select>
|
|
81
|
+
</template>
|
|
82
|
+
<template v-else-if="row.controlType === 'MultiSelect'">
|
|
83
|
+
<Select
|
|
84
|
+
size="small"
|
|
85
|
+
:model-value="row.propertyValue == null ? null : JSON.parse(row.propertyValue)"
|
|
86
|
+
@update:model-value="
|
|
87
|
+
$event => {
|
|
88
|
+
row.propertyValue = $event.length == 0 ? null : JSON.stringify($event);
|
|
89
|
+
}
|
|
90
|
+
"
|
|
91
|
+
:multiple="true"
|
|
92
|
+
clearable
|
|
93
|
+
:transfer="true"
|
|
94
|
+
@on-change="selected => multiSelectChange(selected, row)"
|
|
95
|
+
>
|
|
60
96
|
<Option v-for="item in row._dataSource" :key="item.id" :value="item.id">{{ item.name }}</Option>
|
|
61
97
|
</Select>
|
|
62
98
|
</template>
|
|
@@ -68,6 +104,7 @@
|
|
|
68
104
|
:source-data-code="row.sourceDataCode"
|
|
69
105
|
:source-display-code="row.sourceDisplayCode"
|
|
70
106
|
:param="getParam(row)"
|
|
107
|
+
@on-change="selected => dialogSelectChange(selected, row)"
|
|
71
108
|
></dialog-select>
|
|
72
109
|
</template>
|
|
73
110
|
<template v-else-if="row.controlType === 'MultiDialogSelect'">
|
|
@@ -79,6 +116,7 @@
|
|
|
79
116
|
:source-data-code="row.sourceDataCode"
|
|
80
117
|
:source-display-code="row.sourceDisplayCode"
|
|
81
118
|
:param="getParam(row)"
|
|
119
|
+
@on-change="(selected, displaySelected) => multiDialogSelectChange(selected, displaySelected, row)"
|
|
82
120
|
></dialog-select>
|
|
83
121
|
</template>
|
|
84
122
|
<template v-else-if="row.controlType === 'Check'">
|
|
@@ -299,6 +337,34 @@
|
|
|
299
337
|
this.success('Front_Msg_Success');
|
|
300
338
|
this.$refs.dataPermissionForm.close();
|
|
301
339
|
});
|
|
340
|
+
},
|
|
341
|
+
selectChange(selected, row) {
|
|
342
|
+
console.log('selectChange', selected, row);
|
|
343
|
+
|
|
344
|
+
if (selected) {
|
|
345
|
+
row.propertyDisplayValue = row._dataSource.find(item => item.id == selected).name;
|
|
346
|
+
} else {
|
|
347
|
+
row.propertyDisplayValue = null;
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
multiSelectChange(selected, row) {
|
|
351
|
+
let displayValue = [];
|
|
352
|
+
|
|
353
|
+
selected.forEach(item => {
|
|
354
|
+
displayValue.push(row._dataSource.find(i => i.id == item).name);
|
|
355
|
+
});
|
|
356
|
+
|
|
357
|
+
row.propertyDisplayValue = displayValue.join(',');
|
|
358
|
+
},
|
|
359
|
+
dialogSelectChange(selected, row) {
|
|
360
|
+
if (selected) {
|
|
361
|
+
row.propertyDisplayValue = selected.name;
|
|
362
|
+
} else {
|
|
363
|
+
row.propertyDisplayValue = null;
|
|
364
|
+
}
|
|
365
|
+
},
|
|
366
|
+
multiDialogSelectChange(selected, displaySelected, row) {
|
|
367
|
+
row.propertyDisplayValue = displaySelected;
|
|
302
368
|
}
|
|
303
369
|
}
|
|
304
370
|
};
|
package/token.txt
ADDED