mooho-base-admin-plus 2.10.32 → 2.10.34
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/history.md +2 -0
- package/package/mooho-base-admin-plus.min.esm.js +83719 -22744
- package/package/mooho-base-admin-plus.min.js +407 -93
- package/package/style.css +59 -1
- package/package.json +3 -1
- package/src/components/view/column-edit.vue +45 -11
- package/src/components/view/form-setting-layout.vue +1 -0
- package/src/components/view/view-form-draggable.vue +13 -1
- package/src/components/view/view-form.vue +45 -10
- package/src/components/view/view-table-excel.vue +776 -0
- package/src/components/view/view-table.vue +0 -6
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mooho-base-admin-plus",
|
|
3
3
|
"description": "MOOHO basic framework for admin by Vue3",
|
|
4
|
-
"version": "2.10.
|
|
4
|
+
"version": "2.10.34",
|
|
5
5
|
"author": "jinyifan <jinyifan@mooho.com.cn>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"private": false,
|
|
@@ -14,11 +14,13 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@fortawesome/fontawesome-free": "^5.13.0",
|
|
17
|
+
"@handsontable/vue3": "^16.1.1",
|
|
17
18
|
"axios": "^1.6.7",
|
|
18
19
|
"ckeditor4-integrations-common": "^1.0.0",
|
|
19
20
|
"date-fns": "^2.9.0",
|
|
20
21
|
"echarts": "^5.3.2",
|
|
21
22
|
"file-saver": "^2.0.2",
|
|
23
|
+
"handsontable": "^16.1.1",
|
|
22
24
|
"js-cookie": "^3.0.1",
|
|
23
25
|
"jsencrypt": "^3.3.2",
|
|
24
26
|
"lodash": "^4.17.21",
|
|
@@ -22,7 +22,12 @@
|
|
|
22
22
|
</Col>
|
|
23
23
|
<Col
|
|
24
24
|
v-bind="grid8"
|
|
25
|
-
v-if="
|
|
25
|
+
v-if="
|
|
26
|
+
!data.isVirtual &&
|
|
27
|
+
((data.controlType != 'Table' && data.controlType != 'ExcelTable') ||
|
|
28
|
+
((data.controlType == 'Table' || data.controlType == 'ExcelTable') && data.tableStoreType == 'Inner')) &&
|
|
29
|
+
data.controlType != 'List'
|
|
30
|
+
"
|
|
26
31
|
>
|
|
27
32
|
<FormItem label="字段代码" key="code" prop="code">
|
|
28
33
|
<Input type="text" readonly v-model="data.code" @on-focus="openSelect()">
|
|
@@ -32,7 +37,7 @@
|
|
|
32
37
|
</Input>
|
|
33
38
|
</FormItem>
|
|
34
39
|
</Col>
|
|
35
|
-
<Col v-bind="grid8" v-if="data.isVirtual || (data.controlType == 'Table' && data.tableStoreType == 'Outer')">
|
|
40
|
+
<Col v-bind="grid8" v-if="data.isVirtual || ((data.controlType == 'Table' || data.controlType == 'ExcelTable') && data.tableStoreType == 'Outer')">
|
|
36
41
|
<FormItem label="字段代码" key="code" prop="code">
|
|
37
42
|
<Input type="text" v-model="data.code" maxlength="200" />
|
|
38
43
|
</FormItem>
|
|
@@ -76,7 +81,7 @@
|
|
|
76
81
|
></view-table>
|
|
77
82
|
</FormItem>
|
|
78
83
|
</Col>
|
|
79
|
-
<Col v-bind="grid8" v-if="data.controlType == 'Table'">
|
|
84
|
+
<Col v-bind="grid8" v-if="data.controlType == 'Table' || data.controlType == 'ExcelTable'">
|
|
80
85
|
<FormItem label="数据存储方式" key="tableStoreType" prop="tableStoreType">
|
|
81
86
|
<RadioGroup v-model="data.tableStoreType" @on-change="tableStoreTypeChange">
|
|
82
87
|
<Radio label="Outer">外部关联表</Radio>
|
|
@@ -156,7 +161,14 @@
|
|
|
156
161
|
</Col>
|
|
157
162
|
<Col
|
|
158
163
|
v-bind="grid8"
|
|
159
|
-
v-if="
|
|
164
|
+
v-if="
|
|
165
|
+
needDataSource &&
|
|
166
|
+
data.controlType != 'DialogSelect' &&
|
|
167
|
+
data.controlType != 'MultiDialogSelect' &&
|
|
168
|
+
data.controlType != 'Table' &&
|
|
169
|
+
data.controlType != 'ExcelTable' &&
|
|
170
|
+
data.controlType != 'List'
|
|
171
|
+
"
|
|
160
172
|
>
|
|
161
173
|
<FormItem label="数据源" key="source" prop="source">
|
|
162
174
|
<dialog-select
|
|
@@ -170,7 +182,16 @@
|
|
|
170
182
|
></dialog-select>
|
|
171
183
|
</FormItem>
|
|
172
184
|
</Col>
|
|
173
|
-
<Col
|
|
185
|
+
<Col
|
|
186
|
+
v-bind="grid8"
|
|
187
|
+
v-if="
|
|
188
|
+
data.controlType == 'DialogSelect' ||
|
|
189
|
+
data.controlType == 'MultiDialogSelect' ||
|
|
190
|
+
data.controlType == 'Table' ||
|
|
191
|
+
data.controlType == 'ExcelTable' ||
|
|
192
|
+
data.controlType == 'List'
|
|
193
|
+
"
|
|
194
|
+
>
|
|
174
195
|
<FormItem label="表格视图" key="dataViewSource" prop="dataViewSource">
|
|
175
196
|
<dialog-select
|
|
176
197
|
ref="dataViewSource"
|
|
@@ -185,7 +206,13 @@
|
|
|
185
206
|
</Col>
|
|
186
207
|
<Col
|
|
187
208
|
v-bind="grid8"
|
|
188
|
-
v-if="
|
|
209
|
+
v-if="
|
|
210
|
+
data.source &&
|
|
211
|
+
needDataSource &&
|
|
212
|
+
((data.controlType != 'Table' && data.controlType != 'ExcelTable') ||
|
|
213
|
+
((data.controlType == 'Table' || data.controlType == 'ExcelTable') && data.tableStoreType == 'Outer')) &&
|
|
214
|
+
data.controlType != 'List'
|
|
215
|
+
"
|
|
189
216
|
>
|
|
190
217
|
<FormItem label="数据字段" prop="sourceDataCode">
|
|
191
218
|
<Input type="text" :readonly="true" v-model="data.sourceDataCode" @on-focus="openColumnSelect(data, 'sourceDataCode')">
|
|
@@ -195,7 +222,7 @@
|
|
|
195
222
|
</Input>
|
|
196
223
|
</FormItem>
|
|
197
224
|
</Col>
|
|
198
|
-
<Col v-bind="grid8" v-if="data.source && needDataSource && data.controlType != 'Table' && data.controlType != 'List'">
|
|
225
|
+
<Col v-bind="grid8" v-if="data.source && needDataSource && data.controlType != 'Table' && data.controlType != 'ExcelTable' && data.controlType != 'List'">
|
|
199
226
|
<FormItem label="显示字段" key="sourceDisplayCode" prop="sourceDisplayCode">
|
|
200
227
|
<Input type="text" :readonly="true" v-model="data.sourceDisplayCode" @on-focus="openColumnSelect(data, 'sourceDisplayCode')">
|
|
201
228
|
<template #prepend>
|
|
@@ -204,12 +231,12 @@
|
|
|
204
231
|
</Input>
|
|
205
232
|
</FormItem>
|
|
206
233
|
</Col>
|
|
207
|
-
<Col v-bind="grid16" v-if="data.source && needDataSource && !data.isDictItem && data.controlType != 'Table'">
|
|
234
|
+
<Col v-bind="grid16" v-if="data.source && needDataSource && !data.isDictItem && data.controlType != 'Table' && data.controlType != 'ExcelTable'">
|
|
208
235
|
<FormItem label="参数" key="param" prop="param">
|
|
209
236
|
<Input type="text" @click="paramOpen" :readonly="true" v-model="data.param" maxlength="200" />
|
|
210
237
|
</FormItem>
|
|
211
238
|
</Col>
|
|
212
|
-
<Col v-bind="grid8" v-if="data.source && needDataSource && data.isDictItem && data.controlType != 'Table'">
|
|
239
|
+
<Col v-bind="grid8" v-if="data.source && needDataSource && data.isDictItem && data.controlType != 'Table' && data.controlType != 'ExcelTable'">
|
|
213
240
|
<FormItem label="字典类别" key="dictTypeCode" prop="dictTypeCode">
|
|
214
241
|
<dialog-select v-model="data.dictTypeCode" source="DictTypeSelect" source-data-code="code" source-display-code="code" @on-change="dictTypeChange()"></dialog-select>
|
|
215
242
|
</FormItem>
|
|
@@ -446,7 +473,7 @@
|
|
|
446
473
|
<Input type="number" style="width: 100px" number v-model="data.digit" />
|
|
447
474
|
</FormItem>
|
|
448
475
|
</Col>
|
|
449
|
-
<Col v-bind="grid8" v-if="data.controlType == 'Table'">
|
|
476
|
+
<Col v-bind="grid8" v-if="data.controlType == 'Table' || data.controlType == 'ExcelTable'">
|
|
450
477
|
<FormItem label="初始行数" key="digit" prop="digit">
|
|
451
478
|
<Input type="number" style="width: 100px" number v-model="data.digit" />
|
|
452
479
|
</FormItem>
|
|
@@ -735,6 +762,7 @@
|
|
|
735
762
|
this.data.controlType === 'DialogSelect' ||
|
|
736
763
|
this.data.controlType === 'MultiDialogSelect' ||
|
|
737
764
|
this.data.controlType === 'Table' ||
|
|
765
|
+
this.data.controlType === 'ExcelTable' ||
|
|
738
766
|
this.data.controlType === 'List'
|
|
739
767
|
);
|
|
740
768
|
} else {
|
|
@@ -842,7 +870,13 @@
|
|
|
842
870
|
}
|
|
843
871
|
|
|
844
872
|
let model;
|
|
845
|
-
if (
|
|
873
|
+
if (
|
|
874
|
+
this.data.controlType == 'DialogSelect' ||
|
|
875
|
+
this.data.controlType == 'MultiDialogSelect' ||
|
|
876
|
+
this.data.controlType == 'Table' ||
|
|
877
|
+
this.data.controlType == 'ExcelTable' ||
|
|
878
|
+
this.data.controlType == 'List'
|
|
879
|
+
) {
|
|
846
880
|
model = this.$refs.dataViewSource.selectedData.model;
|
|
847
881
|
} else {
|
|
848
882
|
model = this.data.source;
|
|
@@ -39,6 +39,12 @@
|
|
|
39
39
|
</Divider>
|
|
40
40
|
<view-table :static="true" :view-code="column.source" :readonly="column.isReadonly" :embedded="true"></view-table>
|
|
41
41
|
</div>
|
|
42
|
+
<div v-if="column.controlType === 'ExcelTable'">
|
|
43
|
+
<Divider :plain="true" dashed orientation="left" size="small">
|
|
44
|
+
<span class="title">{{ getNameI18n(column) }}</span>
|
|
45
|
+
</Divider>
|
|
46
|
+
<view-table :static="true" :view-code="column.source" :readonly="column.isReadonly" :embedded="true"></view-table>
|
|
47
|
+
</div>
|
|
42
48
|
<div v-if="column.controlType === 'List'">
|
|
43
49
|
<Divider :plain="true" dashed orientation="left" size="small">
|
|
44
50
|
<span class="title">{{ getNameI18n(column) }}</span>
|
|
@@ -51,7 +57,13 @@
|
|
|
51
57
|
:key="column.code"
|
|
52
58
|
:rules="getRules(column)"
|
|
53
59
|
:error="column.code == null ? $t('Front_Label_Column_Not_Bind') : null"
|
|
54
|
-
v-if="
|
|
60
|
+
v-if="
|
|
61
|
+
column.controlType !== 'Placeholder' &&
|
|
62
|
+
column.controlType !== 'Title' &&
|
|
63
|
+
column.controlType !== 'Table' &&
|
|
64
|
+
column.controlType !== 'ExcelTable' &&
|
|
65
|
+
column.controlType !== 'List'
|
|
66
|
+
"
|
|
55
67
|
>
|
|
56
68
|
<template v-if="column.controlType === 'Custom'"></template>
|
|
57
69
|
<template v-else-if="column.controlType === 'Label'">
|
|
@@ -10,7 +10,12 @@
|
|
|
10
10
|
<Row :gutter="24" type="flex">
|
|
11
11
|
<template v-for="(column, index) in columns">
|
|
12
12
|
<div :key="'newLine' + index" v-if="column.newLine" style="width: 100%"></div>
|
|
13
|
-
<Col
|
|
13
|
+
<Col
|
|
14
|
+
:key="index"
|
|
15
|
+
v-if="column.isShow || column.controlType === 'Table' || column.controlType === 'ExcelTable' || column.controlType === 'List'"
|
|
16
|
+
v-show="column.isShow"
|
|
17
|
+
v-bind="getGrid(column.columnWidth)"
|
|
18
|
+
>
|
|
14
19
|
<div :key="column.code" v-if="column.controlType === 'Placeholder'" style="margin-bottom: 0px"></div>
|
|
15
20
|
<div :key="column.code" v-if="column.controlType === 'Title'">
|
|
16
21
|
<div class="form-title" :style="{ width: column.controlWidth == null ? null : column.controlWidth + 'px' }">
|
|
@@ -74,6 +79,28 @@
|
|
|
74
79
|
</template>
|
|
75
80
|
</view-table>
|
|
76
81
|
</div>
|
|
82
|
+
<div v-if="column.controlType === 'ExcelTable'">
|
|
83
|
+
<Divider :plain="true" dashed orientation="left" size="small">
|
|
84
|
+
<span class="title">{{ getNameI18n(column) }}</span>
|
|
85
|
+
</Divider>
|
|
86
|
+
<view-table-excel
|
|
87
|
+
:ref="'table_' + column.code"
|
|
88
|
+
:view-code="column.source"
|
|
89
|
+
:readonly="readonly || column.isReadonly"
|
|
90
|
+
:parent-data="data"
|
|
91
|
+
@on-change="(row, sender, selected) => onDataChange(column, null, row, sender, selected)"
|
|
92
|
+
>
|
|
93
|
+
<template #filterCommand>
|
|
94
|
+
<!--
|
|
95
|
+
@slot 内嵌表格筛选栏按钮
|
|
96
|
+
@binding {object} table 表格对象
|
|
97
|
+
@binding {object} tableColumn 表格列对象
|
|
98
|
+
@binding {string} tableCode 表格列代码
|
|
99
|
+
-->
|
|
100
|
+
<slot name="excelTableFilterCommand" :tableColumn="column" :tableCode="column.code"></slot>
|
|
101
|
+
</template>
|
|
102
|
+
</view-table-excel>
|
|
103
|
+
</div>
|
|
77
104
|
<div v-if="column.controlType === 'List'">
|
|
78
105
|
<Divider :plain="true" dashed orientation="left" size="small">
|
|
79
106
|
<span class="title">{{ getNameI18n(column) }}</span>
|
|
@@ -85,7 +112,13 @@
|
|
|
85
112
|
:prop="column.code"
|
|
86
113
|
:key="column.code"
|
|
87
114
|
:rules="getRules(column)"
|
|
88
|
-
v-if="
|
|
115
|
+
v-if="
|
|
116
|
+
column.controlType !== 'Placeholder' &&
|
|
117
|
+
column.controlType !== 'Title' &&
|
|
118
|
+
column.controlType !== 'Table' &&
|
|
119
|
+
column.controlType !== 'ExcelTable' &&
|
|
120
|
+
column.controlType !== 'List'
|
|
121
|
+
"
|
|
89
122
|
>
|
|
90
123
|
<template v-if="column.controlType === 'Custom'">
|
|
91
124
|
<!--
|
|
@@ -583,7 +616,7 @@
|
|
|
583
616
|
let tables = {};
|
|
584
617
|
|
|
585
618
|
for (let column of this.columns) {
|
|
586
|
-
if (column.controlType == 'Table' && !column.isReadonly && column.isShow) {
|
|
619
|
+
if ((column.controlType == 'Table' || column.controlType == 'ExcelTable') && !column.isReadonly && column.isShow) {
|
|
587
620
|
tables[column.code] = this.$refs['table_' + column.code][0];
|
|
588
621
|
}
|
|
589
622
|
}
|
|
@@ -595,7 +628,7 @@
|
|
|
595
628
|
data() {
|
|
596
629
|
if (this.data && Object.keys(this.data).length > 0) {
|
|
597
630
|
this.columns.forEach(async column => {
|
|
598
|
-
if (column.controlType == 'Table' && this.$refs['table_' + column.code]) {
|
|
631
|
+
if ((column.controlType == 'Table' || column.controlType == 'ExcelTable') && this.$refs['table_' + column.code]) {
|
|
599
632
|
setTimeout(async () => {
|
|
600
633
|
if (column.tableStoreType == 'Inner') {
|
|
601
634
|
// 表内存储
|
|
@@ -738,7 +771,7 @@
|
|
|
738
771
|
reset() {
|
|
739
772
|
// 清空表格控件数据;
|
|
740
773
|
this.columns.forEach(column => {
|
|
741
|
-
if (column.controlType == 'Table') {
|
|
774
|
+
if (column.controlType == 'Table' || column.controlType == 'ExcelTable') {
|
|
742
775
|
this.$refs['table_' + column.code][0].loadData([]);
|
|
743
776
|
}
|
|
744
777
|
});
|
|
@@ -794,7 +827,7 @@
|
|
|
794
827
|
}
|
|
795
828
|
|
|
796
829
|
// 表格默认行数
|
|
797
|
-
let tables = this.columns.filter(item => item.controlType == 'Table');
|
|
830
|
+
let tables = this.columns.filter(item => item.controlType == 'Table' || item.controlType == 'ExcelTable');
|
|
798
831
|
for (let column of tables) {
|
|
799
832
|
if (column.digit) {
|
|
800
833
|
for (let i = 0; i < column.digit; i++) {
|
|
@@ -827,7 +860,7 @@
|
|
|
827
860
|
data.tableData = [];
|
|
828
861
|
|
|
829
862
|
for (let column of this.columns) {
|
|
830
|
-
if (column.controlType == 'Table' && !column.isReadonly && column.isShow) {
|
|
863
|
+
if ((column.controlType == 'Table' || column.controlType == 'ExcelTable') && !column.isReadonly && column.isShow) {
|
|
831
864
|
let tableData = this.$refs['table_' + column.code][0].getData();
|
|
832
865
|
|
|
833
866
|
if (column.isRequired && tableData.length == 0) {
|
|
@@ -870,7 +903,7 @@
|
|
|
870
903
|
data.tableData = [];
|
|
871
904
|
|
|
872
905
|
for (let column of this.columns) {
|
|
873
|
-
if (column.controlType == 'Table' && !column.isReadonly && column.isShow) {
|
|
906
|
+
if ((column.controlType == 'Table' || column.controlType == 'ExcelTable') && !column.isReadonly && column.isShow) {
|
|
874
907
|
let tableData = this.$refs['table_' + column.code][0].getData();
|
|
875
908
|
|
|
876
909
|
if (column.tableStoreType == 'Inner') {
|
|
@@ -907,7 +940,7 @@
|
|
|
907
940
|
this.setData(this.data, column.code, JSON.stringify(value));
|
|
908
941
|
}
|
|
909
942
|
|
|
910
|
-
if (column.controlType == 'Table' && this.$refs['table_' + column.code]) {
|
|
943
|
+
if ((column.controlType == 'Table' || column.controlType == 'ExcelTable') && this.$refs['table_' + column.code]) {
|
|
911
944
|
this.$refs['table_' + column.code][0].loadData(value);
|
|
912
945
|
}
|
|
913
946
|
},
|
|
@@ -1303,6 +1336,8 @@
|
|
|
1303
1336
|
},
|
|
1304
1337
|
// 数据变化事件
|
|
1305
1338
|
async onDataChange(sender, selected, tableRow, tableSender, tableSelected) {
|
|
1339
|
+
console.log('onDataChange', sender, selected, tableRow, tableSender, tableSelected);
|
|
1340
|
+
|
|
1306
1341
|
for (let column of this.columns) {
|
|
1307
1342
|
// 判断是否需要显示
|
|
1308
1343
|
if (!!(column.showJson || '').trim()) {
|
|
@@ -1349,7 +1384,7 @@
|
|
|
1349
1384
|
}
|
|
1350
1385
|
}
|
|
1351
1386
|
|
|
1352
|
-
if (sender != null && sender.controlType == 'Table') {
|
|
1387
|
+
if (sender != null && (sender.controlType == 'Table' || sender.controlType == 'ExcelTable')) {
|
|
1353
1388
|
/**
|
|
1354
1389
|
* 数据变化事件
|
|
1355
1390
|
* @property {object} sender 触发的列对象
|