mooho-base-admin-plus 2.2.6 → 2.2.8

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.2.6",
4
+ "version": "2.2.8",
5
5
  "author": "jinyifan <jinyifan@mooho.com.cn>",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -343,11 +343,16 @@
343
343
  </Dropdown>
344
344
  </FormItem>
345
345
  </Col>
346
- <Col v-bind="grid8">
346
+ <Col v-bind="grid8" v-if="data.controlType != 'Description'">
347
347
  <FormItem label="描述" key="description" prop="description">
348
348
  <Input type="text" v-model="data.description" maxlength="200" />
349
349
  </FormItem>
350
350
  </Col>
351
+ <Col v-bind="grid24" v-if="data.controlType == 'Description'">
352
+ <FormItem label="描述" key="description" prop="description">
353
+ <Input type="textarea" :rows="5" v-model="data.description" />
354
+ </FormItem>
355
+ </Col>
351
356
  <Col v-bind="grid8" v-if="data.controlType == 'TextInput' || data.controlType == 'TextArea'">
352
357
  <FormItem label="最大字符数量" key="maxLength" prop="maxLength">
353
358
  <Input type="number" style="width: 100px" number v-model="data.maxLength" />
@@ -186,6 +186,7 @@
186
186
  this.componentGroups.find(componentGroup => componentGroup.key == 'DateTime').components.push(component);
187
187
  } else if (
188
188
  item.id == 'Title' ||
189
+ item.id == 'Description' ||
189
190
  item.id == 'Table' ||
190
191
  item.id == 'List' ||
191
192
  item.id == 'Attachment' ||
@@ -329,15 +329,39 @@
329
329
  let key = item.split(':')[0];
330
330
  let value = item.split(':')[1];
331
331
 
332
- column.dataSource.push({
333
- id: key,
334
- name: value
335
- });
332
+ if (column.dataType == 'Integer' || column.dataType == 'BigInteger') {
333
+ column.dataSource.push({
334
+ id: parseInt(key),
335
+ name: value
336
+ });
337
+ } else if (column.dataType == 'Decimal' || column.dataType == 'Float' || column.dataType == 'Double') {
338
+ column.dataSource.push({
339
+ id: parseFloat(key),
340
+ name: value
341
+ });
342
+ } else {
343
+ column.dataSource.push({
344
+ id: key,
345
+ name: value
346
+ });
347
+ }
336
348
  } else {
337
- column.dataSource.push({
338
- id: item,
339
- name: item
340
- });
349
+ if (column.dataType == 'Integer' || column.dataType == 'BigInteger') {
350
+ column.dataSource.push({
351
+ id: parseInt(item),
352
+ name: item
353
+ });
354
+ } else if (column.dataType == 'Decimal' || column.dataType == 'Float' || column.dataType == 'Double') {
355
+ column.dataSource.push({
356
+ id: parseFloat(item),
357
+ name: item
358
+ });
359
+ } else {
360
+ column.dataSource.push({
361
+ id: item,
362
+ name: item
363
+ });
364
+ }
341
365
  }
342
366
  }
343
367
  });
@@ -560,15 +560,39 @@
560
560
  let key = item.split(':')[0];
561
561
  let value = item.split(':')[1];
562
562
 
563
- column.dataSource.push({
564
- id: key,
565
- name: value
566
- });
563
+ if (column.dataType == 'Integer' || column.dataType == 'BigInteger') {
564
+ column.dataSource.push({
565
+ id: parseInt(key),
566
+ name: value
567
+ });
568
+ } else if (column.dataType == 'Decimal' || column.dataType == 'Float' || column.dataType == 'Double') {
569
+ column.dataSource.push({
570
+ id: parseFloat(key),
571
+ name: value
572
+ });
573
+ } else {
574
+ column.dataSource.push({
575
+ id: key,
576
+ name: value
577
+ });
578
+ }
567
579
  } else {
568
- column.dataSource.push({
569
- id: item,
570
- name: item
571
- });
580
+ if (column.dataType == 'Integer' || column.dataType == 'BigInteger') {
581
+ column.dataSource.push({
582
+ id: parseInt(item),
583
+ name: item
584
+ });
585
+ } else if (column.dataType == 'Decimal' || column.dataType == 'Float' || column.dataType == 'Double') {
586
+ column.dataSource.push({
587
+ id: parseFloat(item),
588
+ name: item
589
+ });
590
+ } else {
591
+ column.dataSource.push({
592
+ id: item,
593
+ name: item
594
+ });
595
+ }
572
596
  }
573
597
  }
574
598
  });
@@ -93,6 +93,9 @@
93
93
  <div :class="{ error: compareData != null && parseData(data, column.code) != parseData(compareData, column.code) }" v-html="showData(data, column)"></div>
94
94
  </div>
95
95
  </template>
96
+ <template v-else-if="column.controlType === 'Description'">
97
+ <div v-html="showDataMultiLine(column.description)"></div>
98
+ </template>
96
99
  <template v-if="column.controlType === 'Hyperlink'">
97
100
  <a :href="getHyperlink(data, column.hyperlink)" :target="column.isNewWindow ? '_blank' : ''">
98
101
  <span v-html="showData(data, column)"></span>
@@ -955,15 +958,39 @@
955
958
  let key = item.split(':')[0];
956
959
  let value = item.split(':')[1];
957
960
 
958
- column.dataSource.push({
959
- id: key,
960
- name: value
961
- });
961
+ if (column.dataType == 'Integer' || column.dataType == 'BigInteger') {
962
+ column.dataSource.push({
963
+ id: parseInt(key),
964
+ name: value
965
+ });
966
+ } else if (column.dataType == 'Decimal' || column.dataType == 'Float' || column.dataType == 'Double') {
967
+ column.dataSource.push({
968
+ id: parseFloat(key),
969
+ name: value
970
+ });
971
+ } else {
972
+ column.dataSource.push({
973
+ id: key,
974
+ name: value
975
+ });
976
+ }
962
977
  } else {
963
- column.dataSource.push({
964
- id: item,
965
- name: item
966
- });
978
+ if (column.dataType == 'Integer' || column.dataType == 'BigInteger') {
979
+ column.dataSource.push({
980
+ id: parseInt(item),
981
+ name: item
982
+ });
983
+ } else if (column.dataType == 'Decimal' || column.dataType == 'Float' || column.dataType == 'Double') {
984
+ column.dataSource.push({
985
+ id: parseFloat(item),
986
+ name: item
987
+ });
988
+ } else {
989
+ column.dataSource.push({
990
+ id: item,
991
+ name: item
992
+ });
993
+ }
967
994
  }
968
995
  }
969
996
  });
@@ -296,6 +296,13 @@ export default {
296
296
  return value;
297
297
  }
298
298
  },
299
+ showDataMultiLine(content) {
300
+ if (content == null) {
301
+ return null;
302
+ } else {
303
+ return content.replaceAll(' ', '&nbsp;').replaceAll('\n', '<br/>');
304
+ }
305
+ },
299
306
  // 根据表达式取值
300
307
  parseData(model, expression) {
301
308
  // if (expression == null) {