mooho-base-admin-plus 2.10.32 → 2.10.33

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
@@ -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.32",
4
+ "version": "2.10.33",
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="!data.isVirtual && (data.controlType != 'Table' || (data.controlType == 'Table' && data.tableStoreType == 'Inner')) && data.controlType != 'List'"
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="needDataSource && data.controlType != 'DialogSelect' && data.controlType != 'MultiDialogSelect' && data.controlType != 'Table' && data.controlType != 'List'"
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 v-bind="grid8" v-if="data.controlType == 'DialogSelect' || data.controlType == 'MultiDialogSelect' || data.controlType == 'Table' || data.controlType == 'List'">
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="data.source && needDataSource && (data.controlType != 'Table' || (data.controlType == 'Table' && data.tableStoreType == 'Outer')) && data.controlType != 'List'"
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 (this.data.controlType == 'DialogSelect' || this.data.controlType == 'MultiDialogSelect' || this.data.controlType == 'Table' || this.data.controlType == 'List') {
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;
@@ -190,6 +190,7 @@
190
190
  item.id == 'Title' ||
191
191
  item.id == 'Description' ||
192
192
  item.id == 'Table' ||
193
+ item.id == 'ExcelTable' ||
193
194
  item.id == 'List' ||
194
195
  item.id == 'Attachment' ||
195
196
  item.id == 'Image' ||
@@ -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="column.controlType !== 'Placeholder' && column.controlType !== 'Title' && column.controlType !== 'Table' && column.controlType !== 'List'"
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 :key="index" v-if="column.isShow || column.controlType === 'Table' || column.controlType === 'List'" v-show="column.isShow" v-bind="getGrid(column.columnWidth)">
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>
@@ -583,7 +610,7 @@
583
610
  let tables = {};
584
611
 
585
612
  for (let column of this.columns) {
586
- if (column.controlType == 'Table' && !column.isReadonly && column.isShow) {
613
+ if ((column.controlType == 'Table' || column.controlType == 'ExcelTable') && !column.isReadonly && column.isShow) {
587
614
  tables[column.code] = this.$refs['table_' + column.code][0];
588
615
  }
589
616
  }
@@ -595,7 +622,7 @@
595
622
  data() {
596
623
  if (this.data && Object.keys(this.data).length > 0) {
597
624
  this.columns.forEach(async column => {
598
- if (column.controlType == 'Table' && this.$refs['table_' + column.code]) {
625
+ if ((column.controlType == 'Table' || column.controlType == 'ExcelTable') && this.$refs['table_' + column.code]) {
599
626
  setTimeout(async () => {
600
627
  if (column.tableStoreType == 'Inner') {
601
628
  // 表内存储
@@ -794,7 +821,7 @@
794
821
  }
795
822
 
796
823
  // 表格默认行数
797
- let tables = this.columns.filter(item => item.controlType == 'Table');
824
+ let tables = this.columns.filter(item => item.controlType == 'Table' || item.controlType == 'ExcelTable');
798
825
  for (let column of tables) {
799
826
  if (column.digit) {
800
827
  for (let i = 0; i < column.digit; i++) {
@@ -827,7 +854,7 @@
827
854
  data.tableData = [];
828
855
 
829
856
  for (let column of this.columns) {
830
- if (column.controlType == 'Table' && !column.isReadonly && column.isShow) {
857
+ if ((column.controlType == 'Table' || column.controlType == 'ExcelTable') && !column.isReadonly && column.isShow) {
831
858
  let tableData = this.$refs['table_' + column.code][0].getData();
832
859
 
833
860
  if (column.isRequired && tableData.length == 0) {
@@ -870,7 +897,7 @@
870
897
  data.tableData = [];
871
898
 
872
899
  for (let column of this.columns) {
873
- if (column.controlType == 'Table' && !column.isReadonly && column.isShow) {
900
+ if ((column.controlType == 'Table' || column.controlType == 'ExcelTable') && !column.isReadonly && column.isShow) {
874
901
  let tableData = this.$refs['table_' + column.code][0].getData();
875
902
 
876
903
  if (column.tableStoreType == 'Inner') {
@@ -907,7 +934,7 @@
907
934
  this.setData(this.data, column.code, JSON.stringify(value));
908
935
  }
909
936
 
910
- if (column.controlType == 'Table' && this.$refs['table_' + column.code]) {
937
+ if ((column.controlType == 'Table' || column.controlType == 'ExcelTable') && this.$refs['table_' + column.code]) {
911
938
  this.$refs['table_' + column.code][0].loadData(value);
912
939
  }
913
940
  },
@@ -1303,6 +1330,8 @@
1303
1330
  },
1304
1331
  // 数据变化事件
1305
1332
  async onDataChange(sender, selected, tableRow, tableSender, tableSelected) {
1333
+ console.log('onDataChange', sender, selected, tableRow, tableSender, tableSelected);
1334
+
1306
1335
  for (let column of this.columns) {
1307
1336
  // 判断是否需要显示
1308
1337
  if (!!(column.showJson || '').trim()) {
@@ -1349,7 +1378,7 @@
1349
1378
  }
1350
1379
  }
1351
1380
 
1352
- if (sender != null && sender.controlType == 'Table') {
1381
+ if (sender != null && (sender.controlType == 'Table' || sender.controlType == 'ExcelTable')) {
1353
1382
  /**
1354
1383
  * 数据变化事件
1355
1384
  * @property {object} sender 触发的列对象