tianheng-ui 0.1.29 → 0.1.31

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": "tianheng-ui",
3
3
  "description": "A Vue.js project",
4
- "version": "0.1.29",
4
+ "version": "0.1.31",
5
5
  "author": "shu lang <403732931@qq.com>",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -80,7 +80,15 @@
80
80
  </el-collapse-item>
81
81
 
82
82
  <el-collapse-item title="数据配置" name="group-resultData">
83
- <el-form-item label="表单回填">
83
+ <el-form-item>
84
+ <el-tooltip
85
+ slot="label"
86
+ effect="dark"
87
+ content="一般用于编辑和详情的数据回显"
88
+ placement="top"
89
+ >
90
+ <span style="color: #409EFF;">数据回填</span>
91
+ </el-tooltip>
84
92
  <el-select
85
93
  v-model="config.mounted.api"
86
94
  value-key="id"
@@ -89,7 +97,7 @@
89
97
  no-data-text="暂无接口,请前往【接口模块】创建"
90
98
  >
91
99
  <el-option
92
- v-for="item in config.network"
100
+ v-for="item in Object.values(apiConfig)"
93
101
  :key="item.id"
94
102
  :label="item.label"
95
103
  :value="item.id"
@@ -79,6 +79,7 @@
79
79
  :widget="data"
80
80
  :config="config"
81
81
  :fields="fields"
82
+ :apiConfig="apiConfig"
82
83
  :is="compsData[data.type].content"
83
84
  @events-show="handleEventDialogShow"
84
85
  @events-edit="handleEventsCollapseClick"
@@ -257,7 +258,8 @@ export default {
257
258
  return {};
258
259
  }
259
260
  },
260
- fields: Array
261
+ fields: Array,
262
+ apiConfig: Object
261
263
  },
262
264
  data() {
263
265
  return {
@@ -798,6 +798,6 @@ export const baseConfig = {
798
798
  value: ""
799
799
  }
800
800
  ],
801
- network: []
801
+ network: {}
802
802
  }
803
803
  };
@@ -96,7 +96,7 @@
96
96
  no-data-text="暂无接口,请前往【接口模块】创建"
97
97
  >
98
98
  <el-option
99
- v-for="item in config.network"
99
+ v-for="item in Object.values(apiConfig)"
100
100
  :key="item.id"
101
101
  :label="item.label"
102
102
  :value="item.id"
@@ -65,7 +65,7 @@
65
65
  clearable
66
66
  >
67
67
  <el-option
68
- v-for="item in config.network"
68
+ v-for="item in Object.values(apiConfig)"
69
69
  :key="item.id"
70
70
  :label="item.label"
71
71
  :value="item.id"
@@ -59,7 +59,7 @@
59
59
  clearable
60
60
  >
61
61
  <el-option
62
- v-for="item in config.network"
62
+ v-for="item in Object.values(apiConfig)"
63
63
  :key="item.id"
64
64
  :label="item.label"
65
65
  :value="item.id"
@@ -47,7 +47,7 @@
47
47
  clearable
48
48
  >
49
49
  <el-option
50
- v-for="item in config.network"
50
+ v-for="item in Object.values(apiConfig)"
51
51
  :key="item.id"
52
52
  :label="item.label"
53
53
  :value="item.id"
@@ -44,7 +44,7 @@
44
44
  clearable
45
45
  >
46
46
  <el-option
47
- v-for="item in config.network"
47
+ v-for="item in Object.values(apiConfig)"
48
48
  :key="item.id"
49
49
  :label="item.label"
50
50
  :value="item.id"
@@ -55,7 +55,7 @@
55
55
  placeholder="请选择远端方法"
56
56
  >
57
57
  <el-option
58
- v-for="item in config.network"
58
+ v-for="item in Object.values(apiConfig)"
59
59
  :key="item.id"
60
60
  :label="item.label"
61
61
  :value="item.id"
@@ -72,7 +72,7 @@
72
72
  placeholder="请选择远端方法"
73
73
  >
74
74
  <el-option
75
- v-for="item in config.network"
75
+ v-for="item in Object.values(apiConfig)"
76
76
  :key="item.id"
77
77
  :label="item.label"
78
78
  :value="item.id"
@@ -12,12 +12,7 @@ export const configComponent = {
12
12
  return {};
13
13
  }
14
14
  },
15
- remoteApis: {
16
- type: Array,
17
- default: () => {
18
- return [];
19
- }
20
- }
15
+ apiConfig: Object
21
16
  },
22
17
  data() {
23
18
  return {};
@@ -152,6 +152,7 @@
152
152
  :data="widgetFormSelect"
153
153
  :config="formConfig.config"
154
154
  :fields="fields"
155
+ :apiConfig="apiConfig"
155
156
  @update="handleWidgetConfigUpdate"
156
157
  >
157
158
  </widget-config>
@@ -420,7 +421,10 @@ export default {
420
421
  this.$message.warning("请选择字段类型");
421
422
  return reject();
422
423
  }
423
- if (!this.formConfig.config.fieldsApi) {
424
+ if (
425
+ this.formConfig.config.fieldsType === "fieldsApi" &&
426
+ !this.formConfig.config.fieldsApi
427
+ ) {
424
428
  this.$message.warning("请选择字段接口");
425
429
  return reject();
426
430
  }
@@ -186,6 +186,11 @@ export default {
186
186
  this.$emit("click", val, data);
187
187
  },
188
188
  handleDialogOpen(action, data = {}) {
189
+ if (action === "preview") {
190
+ const { href } = this.$router.resolve({ path: "" });
191
+ window.open(href, "_blank");
192
+ return;
193
+ }
189
194
  switch (action) {
190
195
  case "generateJson":
191
196
  const configText = JSON.stringify(this.config, null, 2);
@@ -39,6 +39,8 @@ export const table = {
39
39
  style: {
40
40
  table: {
41
41
  border: true,
42
+ height: "",
43
+ maxHeight: "",
42
44
  customStyle: ""
43
45
  },
44
46
  cell: {
@@ -86,7 +88,7 @@ export const tools = {
86
88
  position: "header",
87
89
  form: "",
88
90
  api: "",
89
- style: buttonStyle
91
+ style: { ...buttonStyle, type: "primary" }
90
92
  },
91
93
  edit: {
92
94
  show: true,
@@ -96,7 +98,7 @@ export const tools = {
96
98
  position: "row",
97
99
  form: "",
98
100
  api: "",
99
- style: buttonStyle
101
+ style: { ...buttonStyle, type: "primary", plain: true }
100
102
  },
101
103
  look: {
102
104
  show: false,
@@ -106,7 +108,7 @@ export const tools = {
106
108
  position: "row",
107
109
  form: "",
108
110
  api: "",
109
- style: buttonStyle
111
+ style: { ...buttonStyle, type: "primary", plain: true }
110
112
  },
111
113
  delete: {
112
114
  show: true,
@@ -116,7 +118,7 @@ export const tools = {
116
118
  position: "row",
117
119
  form: "",
118
120
  api: "",
119
- style: buttonStyle
121
+ style: { ...buttonStyle, type: "danger", plain: true }
120
122
  },
121
123
  batchDelete: {
122
124
  show: false,
@@ -126,7 +128,7 @@ export const tools = {
126
128
  position: "header",
127
129
  form: "",
128
130
  api: "",
129
- style: buttonStyle
131
+ style: { ...buttonStyle, type: "danger", plain: true }
130
132
  },
131
133
  export: {
132
134
  show: false,
@@ -136,7 +138,7 @@ export const tools = {
136
138
  position: "header",
137
139
  form: "",
138
140
  api: "",
139
- style: buttonStyle
141
+ style: { ...buttonStyle }
140
142
  },
141
143
  import: {
142
144
  show: false,
@@ -146,7 +148,7 @@ export const tools = {
146
148
  position: "header",
147
149
  form: "",
148
150
  api: "",
149
- style: buttonStyle
151
+ style: { ...buttonStyle }
150
152
  }
151
153
  };
152
154
 
@@ -29,7 +29,9 @@ export default {
29
29
  return {};
30
30
  },
31
31
  created() {},
32
- mounted() {},
32
+ mounted() {
33
+ console.log(this.config)
34
+ },
33
35
  methods: {}
34
36
  };
35
37
  </script>
@@ -144,12 +144,15 @@ export default {
144
144
  this.$message.warning("请选择字段表");
145
145
  return reject();
146
146
  }
147
- if (!this.tableConfig.table.title) {
148
- this.$message.warning("请选择列表名称");
147
+ if (
148
+ this.tableConfig.table.fieldsTable === "fieldsApi" &&
149
+ !this.tableConfig.table.mounted.api
150
+ ) {
151
+ this.$message.warning("请选择列表接口");
149
152
  return reject();
150
153
  }
151
- if (!this.tableConfig.table.mounted.api) {
152
- this.$message.warning("请选择列表接口");
154
+ if (!this.tableConfig.table.title) {
155
+ this.$message.warning("请选择列表名称");
153
156
  return reject();
154
157
  }
155
158
  const data = deepClone(this.tableConfig);
@@ -186,6 +186,14 @@
186
186
  <i class="el-icon-set-up" @click="handleActionConfig(item)"></i>
187
187
  </div>
188
188
  </el-collapse-item>
189
+ <el-collapse-item
190
+ title="table 样式配置(电脑端)"
191
+ name="group-style_table"
192
+ >
193
+ <el-form-item label="是否边框">
194
+ <el-switch v-model="config.table.style.table.border"> </el-switch>
195
+ </el-form-item>
196
+ </el-collapse-item>
189
197
  <el-collapse-item
190
198
  title="cell 样式配置(移动端)"
191
199
  name="group-style_cell"
@@ -351,6 +359,7 @@
351
359
  :icon="dialog.data.style.icon"
352
360
  :plain="dialog.data.style.plain"
353
361
  :round="dialog.data.style.round"
362
+ :circle="dialog.data.style.circle"
354
363
  :size="dialog.data.style.size"
355
364
  >{{ dialog.data.text }}</el-button
356
365
  >
@@ -366,6 +375,7 @@
366
375
  <el-radio label="info">信息按钮</el-radio>
367
376
  <el-radio label="warning">警告按钮</el-radio>
368
377
  <el-radio label="danger">危险按钮</el-radio>
378
+ <el-radio label="text">文字按钮</el-radio>
369
379
  </el-radio-group>
370
380
  </el-form-item>
371
381
  <el-form-item label="按钮大小">
@@ -383,7 +393,7 @@
383
393
  <el-switch v-model="dialog.data.style.round"> </el-switch>
384
394
  </el-form-item>
385
395
  <el-form-item label="是否圆型">
386
- <el-switch v-model="dialog.data.style.round"> </el-switch>
396
+ <el-switch v-model="dialog.data.style.circle"> </el-switch>
387
397
  </el-form-item>
388
398
  <el-form-item label="按钮图标">
389
399
  <th-icons v-model="dialog.data.style.icon"></th-icons>
@@ -465,11 +475,12 @@ export default {
465
475
  "group-pageInfo",
466
476
  "group-sort",
467
477
  "group-hint",
478
+ "group-network",
479
+ "group-button",
480
+ "group-style_table",
468
481
  "group-style_cell",
469
482
  "group-style_title",
470
- "group-style_value",
471
- "group-network",
472
- "group-button"
483
+ "group-style_value"
473
484
  ],
474
485
  formRules: {
475
486
  "table.fieldsType": [
@@ -490,14 +501,14 @@ export default {
490
501
  },
491
502
  watch: {
492
503
  config(val) {
493
- this.handleFieldsApiChange(val.table.mounted.api)
504
+ this.handleFieldsApiChange(val.table.mounted.api);
494
505
  this.handleFields();
495
506
  },
496
507
  fields(val) {
497
508
  this.handleFields();
498
509
  },
499
- apiOptions(){
500
- this.handleFieldsApiChange(this.config.table.mounted.api)
510
+ apiOptions() {
511
+ this.handleFieldsApiChange(this.config.table.mounted.api);
501
512
  }
502
513
  },
503
514
  computed: {