tianheng-ui 0.1.23 → 0.1.25

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.
Files changed (37) hide show
  1. package/lib/tianheng-ui.js +13 -13
  2. package/package.json +1 -1
  3. package/packages/FormMaking/FormConfig.vue +64 -5
  4. package/packages/FormMaking/WidgetConfig.vue +151 -33
  5. package/packages/FormMaking/WidgetTools.vue +1 -1
  6. package/packages/FormMaking/custom/config.js +10 -7
  7. package/packages/FormMaking/custom/configs/blank.vue +2 -6
  8. package/packages/FormMaking/custom/configs/button.vue +4 -46
  9. package/packages/FormMaking/custom/configs/cascader.vue +4 -45
  10. package/packages/FormMaking/custom/configs/cell.vue +2 -6
  11. package/packages/FormMaking/custom/configs/checkbox.vue +15 -62
  12. package/packages/FormMaking/custom/configs/color.vue +2 -43
  13. package/packages/FormMaking/custom/configs/date.vue +2 -42
  14. package/packages/FormMaking/custom/configs/divider.vue +2 -6
  15. package/packages/FormMaking/custom/configs/editor.vue +2 -6
  16. package/packages/FormMaking/custom/configs/filler.vue +2 -6
  17. package/packages/FormMaking/custom/configs/grid.vue +2 -6
  18. package/packages/FormMaking/custom/configs/image.vue +2 -6
  19. package/packages/FormMaking/custom/configs/input.vue +2 -42
  20. package/packages/FormMaking/custom/configs/number.vue +3 -47
  21. package/packages/FormMaking/custom/configs/radio.vue +13 -60
  22. package/packages/FormMaking/custom/configs/rate.vue +2 -44
  23. package/packages/FormMaking/custom/configs/select.vue +12 -58
  24. package/packages/FormMaking/custom/configs/slider.vue +2 -43
  25. package/packages/FormMaking/custom/configs/switch.vue +2 -43
  26. package/packages/FormMaking/custom/configs/table.vue +2 -6
  27. package/packages/FormMaking/custom/configs/tableH5.vue +2 -6
  28. package/packages/FormMaking/custom/configs/tabs.vue +14 -23
  29. package/packages/FormMaking/custom/configs/text.vue +6 -7
  30. package/packages/FormMaking/custom/configs/textarea.vue +4 -45
  31. package/packages/FormMaking/custom/configs/time.vue +2 -43
  32. package/packages/FormMaking/custom/configs/upload.vue +6 -11
  33. package/packages/FormMaking/index.vue +10 -37
  34. package/packages/TableMaking/WidgetTools.vue +8 -8
  35. package/packages/TableMaking/custom/config.js +1 -0
  36. package/packages/TableMaking/index.vue +9 -2
  37. package/packages/TableMaking/widgetConfig.vue +65 -21
@@ -10,6 +10,7 @@
10
10
  <slot name="action"></slot>
11
11
  </widget-tools>
12
12
  <widget-table
13
+ v-if="client === 'monitor'"
13
14
  style="height:calc(100% - 45px)"
14
15
  :config="tableConfig"
15
16
  ></widget-table>
@@ -17,7 +18,6 @@
17
18
  <div class="th-flex_aside th-is_border_left" style="width:300px">
18
19
  <widget-config
19
20
  :config="tableConfig"
20
- :fields.sync="fields"
21
21
  :formOptions="formOptions"
22
22
  :apiOptions="apiOptions"
23
23
  ref="configRef"
@@ -42,7 +42,6 @@ export default {
42
42
  return deepClone(baseConfig);
43
43
  }
44
44
  },
45
- fields: Array,
46
45
 
47
46
  /**
48
47
  * 表单配置列表。
@@ -121,6 +120,10 @@ export default {
121
120
  case "import-json":
122
121
  this.tableConfig = data;
123
122
  break;
123
+ case "monitor":
124
+ case "mobile":
125
+ this.client = action;
126
+ break;
124
127
 
125
128
  default:
126
129
  break;
@@ -139,6 +142,10 @@ export default {
139
142
  }
140
143
  })
141
144
  .catch(err => {
145
+ if (!this.tableConfig.table.fieldsTable) {
146
+ this.$message.warning("请选择字段表");
147
+ return reject();
148
+ }
142
149
  if (!this.tableConfig.table.title) {
143
150
  this.$message.warning("请选择列表名称");
144
151
  return reject();
@@ -52,22 +52,39 @@
52
52
  :rules="formRules"
53
53
  ref="formRef"
54
54
  >
55
- <el-collapse v-model="tableCollapse">
56
- <el-collapse-item title="表格配置" name="group-table">
57
- <el-form-item label="列表名称" required prop="table.title">
58
- <el-input
59
- v-model="config.table.title"
60
- placeholder="请输入"
61
- ></el-input>
62
- </el-form-item>
63
- <el-form-item label="列表接口" required prop="table.mounted.api">
55
+ <el-collapse v-model="collapseValue">
56
+ <el-collapse-item title="列表配置" name="group-table">
57
+ <el-form-item required prop="table.fieldsType">
58
+ <el-tooltip
59
+ slot="label"
60
+ effect="dark"
61
+ content="字段的配置方式"
62
+ placement="top"
63
+ >
64
+ <span style="color: #409EFF;">字段类型</span>
65
+ </el-tooltip>
66
+ <el-radio-group v-model="config.table.fieldsType">
67
+ <el-radio-button label="custom" disabled
68
+ >自定义</el-radio-button
69
+ >
70
+ <el-radio-button label="fieldsApi">接口导入</el-radio-button>
71
+ </el-radio-group> </el-form-item
72
+ ><el-form-item required prop="table.mounted.api">
73
+ <el-tooltip
74
+ slot="label"
75
+ effect="dark"
76
+ content="列表初始化完成后,调用该接口获取列表数据"
77
+ placement="top"
78
+ >
79
+ <span style="color: #409EFF;">列表接口</span>
80
+ </el-tooltip>
64
81
  <el-select
65
82
  v-model="config.table.mounted.api"
66
83
  style="width:100%"
67
- value-key="id"
68
84
  clearable
69
85
  placeholder="请选择"
70
86
  no-data-text="暂无接口,请前往【接口模块】创建"
87
+ @change="handleFieldsApiChange"
71
88
  >
72
89
  <el-option
73
90
  v-for="item in apiOptions"
@@ -78,12 +95,18 @@
78
95
  </el-option>
79
96
  </el-select>
80
97
  </el-form-item>
81
- <el-form-item label="开启查询">
82
- <el-switch v-model="config.search.show"> </el-switch>
98
+ <el-form-item label="列表名称" required prop="table.title">
99
+ <el-input
100
+ v-model="config.table.title"
101
+ placeholder="请输入"
102
+ ></el-input>
83
103
  </el-form-item>
84
104
  <el-form-item label="列表序号">
85
105
  <el-switch v-model="config.table.sequence"> </el-switch>
86
106
  </el-form-item>
107
+ <el-form-item label="开启查询">
108
+ <el-switch v-model="config.search.show"> </el-switch>
109
+ </el-form-item>
87
110
  </el-collapse-item>
88
111
  <el-collapse-item title="排序配置" name="group-sort">
89
112
  <el-form-item label="排序类型">
@@ -417,12 +440,6 @@ export default {
417
440
  return {};
418
441
  }
419
442
  },
420
- fields: {
421
- type: Array,
422
- default: () => {
423
- return [];
424
- }
425
- },
426
443
  formOptions: Array,
427
444
  apiOptions: Array
428
445
  },
@@ -434,6 +451,7 @@ export default {
434
451
  { title: "列表属性", value: 2 }
435
452
  ],
436
453
  activeTab: { title: "列表属性", value: 2 },
454
+ fields: [],
437
455
  searchField: {
438
456
  isCheckAll: false,
439
457
  isIndeterminate: false
@@ -442,7 +460,7 @@ export default {
442
460
  isCheckAll: false,
443
461
  isIndeterminate: false
444
462
  },
445
- tableCollapse: [
463
+ collapseValue: [
446
464
  "group-table",
447
465
  "group-pageInfo",
448
466
  "group-sort",
@@ -454,12 +472,18 @@ export default {
454
472
  "group-button"
455
473
  ],
456
474
  formRules: {
475
+ "table.fieldsType": [
476
+ { required: true, message: "请选择字段类型", trigger: "change" }
477
+ ],
478
+ "table.fieldsApi": [
479
+ { required: true, message: "请选择字段表", trigger: "change" }
480
+ ],
457
481
  "table.title": [
458
482
  { required: true, message: "请选择列表名称", trigger: "change" }
459
483
  ],
460
484
  "table.mounted.api": [
461
485
  { required: true, message: "请选择列表接口", trigger: "change" }
462
- ],
486
+ ]
463
487
  },
464
488
  dialog: { show: false, data: null }
465
489
  };
@@ -568,6 +592,23 @@ export default {
568
592
  handleActionConfig(data) {
569
593
  this.dialog = { show: true, data };
570
594
  },
595
+ handleFieldsApiChange(val) {
596
+ const dataArr = this.apiOptions.filter(item => {
597
+ return item.id === val;
598
+ });
599
+ if (dataArr.length && dataArr[0].paramsOut) {
600
+ const fields = dataArr[0].paramsOut.map(item => {
601
+ return {
602
+ label: item.note || item.name,
603
+ alias: item.name,
604
+ prop: item.name,
605
+ type: "input",
606
+ align: "left"
607
+ };
608
+ });
609
+ this.fields = fields;
610
+ } else this.fields = [];
611
+ },
571
612
  handleFormValidate() {
572
613
  return new Promise((resolve, reject) => {
573
614
  if (this.$refs.formRef) {
@@ -585,14 +626,17 @@ export default {
585
626
 
586
627
  <style lang="scss" scoped>
587
628
  .widgetConfig {
588
- height: 100%;
589
629
  background-color: white;
590
630
  .tabs {
631
+ position: sticky;
632
+ top: 0;
591
633
  display: flex;
592
634
  align-items: center;
593
635
  height: 45px;
636
+ background-color: white;
594
637
  border-bottom: 1px solid #dcdfe6;
595
638
  box-sizing: border-box;
639
+ z-index: 100;
596
640
 
597
641
  .tabs-item {
598
642
  flex: 1;