tianheng-ui 0.1.39 → 0.1.40

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.39",
4
+ "version": "0.1.40",
5
5
  "author": "shu lang <403732931@qq.com>",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -2,7 +2,6 @@
2
2
  <el-dialog
3
3
  class="th-dialog"
4
4
  :class="[customClass]"
5
- :style="{'z-index':zIndex}"
6
5
  :visible.sync="visible"
7
6
  :width="width"
8
7
  :top="top"
@@ -88,9 +87,7 @@ export default {
88
87
  showFullscreen: { type: Boolean, default: true },
89
88
  fullscreenIcon: { type: String, default: "el-icon-full-screen" },
90
89
 
91
- showFooter: { type: Boolean, default: true },
92
-
93
- zIndex: Number
90
+ showFooter: { type: Boolean, default: true }
94
91
  },
95
92
  data() {
96
93
  return {
@@ -230,7 +230,7 @@ export default {
230
230
  }
231
231
 
232
232
  this.axios({
233
- url: `/api/lc/api/${remoteFunc.url}`,
233
+ url: remoteFunc.url,
234
234
  method: remoteFunc.method,
235
235
  headers: remoteFunc.headers,
236
236
  data: remoteFunc.params
@@ -6,7 +6,7 @@
6
6
  :key="index"
7
7
  class="tabs-item"
8
8
  :class="{ 'tabs-item__active': activeTab.value === item.value }"
9
- @click="handleTabsChange(item)"
9
+ @click="activeTab = item"
10
10
  >
11
11
  {{ item.title }}
12
12
  </div>
@@ -14,6 +14,7 @@
14
14
 
15
15
  <div v-if="activeTab.value === 'field'">
16
16
  <el-form
17
+ v-if="data.model"
17
18
  :model="data"
18
19
  label-position="left"
19
20
  label-width="80px"
@@ -132,6 +133,7 @@
132
133
  </el-collapse-item>
133
134
  </el-collapse>
134
135
  </el-form>
136
+ <th-empty v-else description="请左侧拖拽来添加字段"></th-empty>
135
137
  </div>
136
138
  <div v-if="activeTab.value === 'form'">
137
139
  <el-form
@@ -264,17 +266,19 @@
264
266
  </el-collapse>
265
267
  </el-form>
266
268
  </div>
267
- <div v-if="activeTab.value === 'css'"></div>
269
+ <div v-if="activeTab.value === 'css'">
270
+ <th-empty description="开发中,敬请期待..."></th-empty>
271
+ </div>
268
272
 
269
273
  <th-dialog
270
- title="动作设置"
271
274
  v-model="eventsDialog.visible"
275
+ title="动作设置"
272
276
  :modal-append-to-body="false"
273
277
  @on-fullscreen="$refs.codeEditor && $refs.codeEditor.resize()"
274
278
  >
275
- <div class="eventsSetting">
276
- <div class="list">
277
- <div class="list-header">
279
+ <div class="eventsSetting th-flex_box th-is_border">
280
+ <div class="list th-flex_aside">
281
+ <div class="events-header">
278
282
  <div>动作库</div>
279
283
  <el-button
280
284
  type="text"
@@ -285,8 +289,12 @@
285
289
  >
286
290
  </div>
287
291
  <div
288
- class="list-item"
289
292
  v-for="(item, index) in eventsDialog.eventScript"
293
+ class="list-item th-is_hover"
294
+ :class="{
295
+ 'th-is_active':
296
+ eventsDialog.active && eventsDialog.active.label === item.label
297
+ }"
290
298
  :key="item.key"
291
299
  @click="eventsDialog.active = item"
292
300
  >
@@ -302,7 +310,7 @@
302
310
  </el-popconfirm>
303
311
  </div>
304
312
  </div>
305
- <div class="detail" v-if="eventsDialog.active">
313
+ <div class="detail th-fiex_content" v-if="eventsDialog.active">
306
314
  <div>
307
315
  <span>Function Name</span>
308
316
  <el-input
@@ -474,13 +482,6 @@ export default {
474
482
  }
475
483
  },
476
484
  methods: {
477
- handleTabsChange(item) {
478
- if (!this.data.model)
479
- return this.$message.warning("请从左侧拖拽来添加组件");
480
-
481
- this.activeTab = item;
482
- },
483
-
484
485
  handleEventDialogShow() {
485
486
  this.eventsDialog = {
486
487
  visible: true,
@@ -577,6 +578,7 @@ export default {
577
578
  display: flex;
578
579
  align-items: center;
579
580
  height: 45px;
581
+ z-index: 10;
580
582
 
581
583
  .tabs-item {
582
584
  flex: 1;
@@ -599,8 +601,18 @@ export default {
599
601
 
600
602
  .eventsSetting {
601
603
  height: 100%;
602
- display: flex;
603
- border: 1px solid #eee;
604
+
605
+ .events-header {
606
+ position: sticky;
607
+ top: 0;
608
+ display: flex;
609
+ align-items: center;
610
+ justify-content: space-between;
611
+ padding: 5px;
612
+ line-height: 30px;
613
+ border-bottom: 1px solid #eee;
614
+ background: #f2f6fc;
615
+ }
604
616
 
605
617
  .list {
606
618
  width: 270px;
@@ -608,18 +620,6 @@ export default {
608
620
  overflow-y: overlay;
609
621
  border-right: 1px solid #eee;
610
622
 
611
- .list-header {
612
- position: sticky;
613
- top: 0;
614
- display: flex;
615
- align-items: center;
616
- justify-content: space-between;
617
- padding: 5px;
618
- line-height: 30px;
619
- border-bottom: 1px solid #eee;
620
- background: #f2f6fc;
621
- }
622
-
623
623
  .list-item {
624
624
  display: flex;
625
625
  // align-items: center;
@@ -640,14 +640,9 @@ export default {
640
640
  cursor: pointer;
641
641
  }
642
642
  }
643
-
644
- .list-item:hover {
645
- background-color: #f2f6fc;
646
- }
647
643
  }
648
644
 
649
645
  .detail {
650
- flex: 1;
651
646
  padding: 10px;
652
647
 
653
648
  > div:nth-child(1) {
@@ -121,6 +121,7 @@ export default {
121
121
  position: relative;
122
122
  width: 100%;
123
123
  height: calc(100% - 45px);
124
+ overflow-y: scroll;
124
125
 
125
126
  .form-empty {
126
127
  position: absolute;
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="widgetTools th-sticky_top">
2
+ <div class="widgetTools">
3
3
  <div class="left">
4
4
  <slot> </slot>
5
5
  </div>
@@ -215,7 +215,6 @@
215
215
  title="获取数据"
216
216
  :modal-append-to-body="false"
217
217
  :showFooter="false"
218
- :z-index="99999"
219
218
  @on-close="dialogResultData.show = false"
220
219
  @on-fullscreen="$refs.dataCodeEditor.resize()"
221
220
  >
@@ -506,7 +505,7 @@ export default {
506
505
  width: 100%;
507
506
  height: 45px;
508
507
  padding: 0 15px;
509
- z-index: 999;
508
+ border-bottom: solid 1px #e4e7ed;
510
509
 
511
510
  .left {
512
511
  }
@@ -75,7 +75,7 @@ export default {
75
75
  this.$message.warning("未知的请求接口,请检查配置信息");
76
76
  return "";
77
77
  }
78
- return `${baseUrl}/api/lc/api/${func.url}`;
78
+ return `${baseUrl}${func.url}`;
79
79
  } else {
80
80
  return this.widget.options.action;
81
81
  }
@@ -263,6 +263,7 @@ export default {
263
263
  },
264
264
  config(val) {
265
265
  this.setConfig(val);
266
+ this.initApiConfig()
266
267
  },
267
268
  apiOptions(val) {
268
269
  this.initApiConfig();
@@ -314,6 +315,7 @@ export default {
314
315
  this.apiConfig[item.id] = item;
315
316
  });
316
317
  }
318
+ this.formConfig.config.network = this.apiConfig;
317
319
  },
318
320
 
319
321
  handleConfigSelect(value) {
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="widgetTools th-sticky_top">
2
+ <div class="widgetTools">
3
3
  <div class="left">
4
4
  <slot> </slot>
5
5
  </div>
@@ -123,7 +123,7 @@
123
123
  <th-dialog
124
124
  v-model="dialog.show"
125
125
  :title="dialogTitles[dialog.action]"
126
- :modal="dialog.action !== 'previewPc'"
126
+ :modal="false"
127
127
  :modal-append-to-body="false"
128
128
  :showFooter="['importJson', 'importTemplate'].includes(dialog.action)"
129
129
  @on-fullscreen="handleDialogFullscreen"
@@ -245,7 +245,7 @@ export default {
245
245
  width: 100%;
246
246
  height: 45px;
247
247
  padding: 0 15px;
248
- z-index: 999;
248
+ border-bottom: solid 1px #e4e7ed;
249
249
 
250
250
  .left {
251
251
  }
@@ -2,9 +2,9 @@
2
2
  <div class="generateTable-search">
3
3
  <el-row :gutter="10">
4
4
  <el-col
5
- v-for="item in options"
5
+ v-for="item in getList"
6
6
  :key="item.prop"
7
- :span="24 / options.length"
7
+ :span="24 / getList.length"
8
8
  >
9
9
  <el-input
10
10
  v-if="item.type === 'input' || item.elType === 'input'"
@@ -81,6 +81,17 @@ export default {
81
81
  data() {
82
82
  return {};
83
83
  },
84
+ computed: {
85
+ getList() {
86
+ if (this.options) {
87
+ const data = this.options.filter(item => {
88
+ return !item.hide;
89
+ });
90
+ return data;
91
+ }
92
+ return [];
93
+ }
94
+ },
84
95
  methods: {
85
96
  doSearch() {
86
97
  this.$emit("search", this.data);
@@ -2,7 +2,7 @@
2
2
  <div class="generateTable-search">
3
3
  <el-form :inline="true" :model="data" size="small">
4
4
  <el-form-item
5
- v-for="item in options"
5
+ v-for="item in getList"
6
6
  :key="item.prop"
7
7
  :label="item.label"
8
8
  >
@@ -95,6 +95,17 @@ export default {
95
95
  data() {
96
96
  return {};
97
97
  },
98
+ computed: {
99
+ getList() {
100
+ if (this.options) {
101
+ const data = this.options.filter(item => {
102
+ return !item.hide;
103
+ });
104
+ return data;
105
+ }
106
+ return [];
107
+ }
108
+ },
98
109
  methods: {
99
110
  doSearch() {
100
111
  this.$emit("search", this.data);
@@ -9,7 +9,7 @@
9
9
  v-loading="config.loading.show"
10
10
  :element-loading-text="config.loading.text"
11
11
  >
12
- <template v-for="item in config.options">
12
+ <template v-for="item in getList">
13
13
  <el-table-column
14
14
  v-if="item.type"
15
15
  :key="item.prop"
@@ -54,6 +54,18 @@ export default {
54
54
  data() {
55
55
  return {};
56
56
  },
57
+
58
+ computed: {
59
+ getList() {
60
+ if (this.config.options) {
61
+ const data = this.config.options.filter(item => {
62
+ return !item.hide;
63
+ });
64
+ return data;
65
+ }
66
+ return [];
67
+ }
68
+ },
57
69
  created() {},
58
70
  mounted() {},
59
71
  methods: {}
@@ -393,7 +393,7 @@ export default {
393
393
  }
394
394
 
395
395
  const request = {
396
- url: `api/lc/api/${config.url}`,
396
+ url: config.url,
397
397
  method: config.method,
398
398
  headers: { ...config.headers, actionType }
399
399
  };
@@ -12,40 +12,43 @@
12
12
  </div>
13
13
  </div>
14
14
  <div v-if="activeTab.value === 'field'" class="configItem fieldsView">
15
- <el-collapse v-model="collapseValue">
16
- <el-collapse-item title="查询字段" name="group-fields_search">
17
- <el-checkbox
18
- v-model="searchField.isCheckAll"
19
- :indeterminate="searchField.isIndeterminate"
20
- @change="val => handleCheckAllChange(val, 'searchField')"
21
- >全选</el-checkbox
22
- >
23
- <el-checkbox
24
- v-for="item in fields"
25
- :label="item.prop"
26
- :key="`searchField-${item.prop}-${item.isSearch}`"
27
- :checked="item.isSearch"
28
- @change="val => handleCheckboxChange(val, 'searchField', item)"
29
- >{{ item.label }}</el-checkbox
30
- >
31
- </el-collapse-item>
32
- <el-collapse-item title="列表字段" name="group-fields_list">
33
- <el-checkbox
34
- v-model="tableField.isCheckAll"
35
- :indeterminate="tableField.isIndeterminate"
36
- @change="val => handleCheckAllChange(val, 'tableField')"
37
- >全选</el-checkbox
38
- >
39
- <el-checkbox
40
- v-for="item in fields"
41
- :label="item.prop"
42
- :key="`tableField-${item.prop}-${item.isTable}`"
43
- :checked="item.isTable"
44
- @change="val => handleCheckboxChange(val, 'tableField', item)"
45
- >{{ item.label }}</el-checkbox
46
- >
47
- </el-collapse-item>
48
- </el-collapse>
15
+ <template v-if="fields.length">
16
+ <el-collapse v-model="collapseValue">
17
+ <el-collapse-item title="查询字段" name="group-fields_search">
18
+ <el-checkbox
19
+ v-model="searchField.isCheckAll"
20
+ :indeterminate="searchField.isIndeterminate"
21
+ @change="val => handleCheckAllChange(val, 'searchField')"
22
+ >全选</el-checkbox
23
+ >
24
+ <el-checkbox
25
+ v-for="item in fields"
26
+ :label="item.prop"
27
+ :key="`searchField-${item.prop}-${item.isSearch}`"
28
+ :checked="item.isSearch"
29
+ @change="val => handleCheckboxChange(val, 'searchField', item)"
30
+ >{{ item.label }}</el-checkbox
31
+ >
32
+ </el-collapse-item>
33
+ <el-collapse-item title="列表字段" name="group-fields_table">
34
+ <el-checkbox
35
+ v-model="tableField.isCheckAll"
36
+ :indeterminate="tableField.isIndeterminate"
37
+ @change="val => handleCheckAllChange(val, 'tableField')"
38
+ >全选</el-checkbox
39
+ >
40
+ <el-checkbox
41
+ v-for="item in fields"
42
+ :label="item.prop"
43
+ :key="`tableField-${item.prop}-${item.isTable}`"
44
+ :checked="item.isTable"
45
+ @change="val => handleCheckboxChange(val, 'tableField', item)"
46
+ >{{ item.label }}</el-checkbox
47
+ >
48
+ </el-collapse-item>
49
+ </el-collapse>
50
+ </template>
51
+ <th-empty v-else description="请选择列表接口"></th-empty>
49
52
  </div>
50
53
  <div v-if="activeTab.value === 'table' && config.table" class="configItem">
51
54
  <el-form
@@ -112,7 +115,7 @@
112
115
  <el-switch v-model="config.search.show"> </el-switch>
113
116
  </el-form-item>
114
117
  </el-collapse-item>
115
- <el-collapse-item title="排序配置" name="group-sort">
118
+ <el-collapse-item title="排序配置" name="group-table_sort">
116
119
  <el-form-item label="排序类型">
117
120
  <el-radio-group v-model="config.table.sort.type">
118
121
  <el-radio-button label="1">降序</el-radio-button>
@@ -135,7 +138,7 @@
135
138
  </el-select>
136
139
  </el-form-item>
137
140
  </el-collapse-item>
138
- <el-collapse-item title="分页配置" name="group-pageInfo">
141
+ <el-collapse-item title="分页配置" name="group-table_pageInfo">
139
142
  <el-form-item label="开启分页">
140
143
  <el-switch v-model="config.table.pageInfo.show"> </el-switch>
141
144
  </el-form-item>
@@ -207,7 +210,7 @@
207
210
  </el-form-item>
208
211
  </template>
209
212
  </el-collapse-item>
210
- <el-collapse-item title="提示语配置" name="group-hint">
213
+ <el-collapse-item title="提示语配置" name="group-table_hint">
211
214
  <el-form-item label="空数据">
212
215
  <el-input
213
216
  v-model="config.table.empty.text"
@@ -221,9 +224,9 @@
221
224
  ></el-input>
222
225
  </el-form-item>
223
226
  </el-collapse-item>
224
- <!-- <el-collapse-item title="数据接口配置" name="group-network">
227
+ <!-- <el-collapse-item title="数据接口配置" name="group-table_network">
225
228
  </el-collapse-item> -->
226
- <el-collapse-item name="group-button">
229
+ <el-collapse-item name="group-table_button">
227
230
  <template slot="title">
228
231
  <div class="collapse-title">
229
232
  <div>按钮配置</div>
@@ -475,17 +478,39 @@
475
478
  :modal-append-to-body="false"
476
479
  :showFooter="false"
477
480
  >
478
- <div class="toolsSeting th-flex_box">
479
- <el-card class="th-flex_aside" style="width:200px;margin-right:10px;">
480
- <el-tree
481
- :data="Object.values(config.tools || [])"
482
- :props="{ label: 'name' }"
483
- node-key="name"
484
- @node-click="handleActionConfig"
485
- ></el-tree>
486
- </el-card>
487
- <el-card v-if="dialog.data" class="th-fiex_content">
481
+ <div class="eventsSetting th-flex_box th-is_border">
482
+ <div class="list th-flex_aside">
483
+ <div class="events-header th-sticky_top">
484
+ <div>按钮库</div>
485
+ <!-- <el-button type="text" icon="el-icon-plus" size="mini" disabled
486
+ >添加</el-button
487
+ > -->
488
+ </div>
489
+ <div
490
+ v-for="(item, index) in Object.values(config.tools || [])"
491
+ class="list-item th-is_hover"
492
+ :class="{
493
+ 'th-is_active': dialog.data && dialog.data.name === item.name
494
+ }"
495
+ :key="item.key"
496
+ @click="dialog.data = item"
497
+ >
498
+ <div class="list-item-value">{{ item.name }}</div>
499
+ <!-- <el-popconfirm
500
+ :title="`是否确定删除方法 ${item.name}`"
501
+ confirm-button-text="删除"
502
+ confirm-button-type="danger"
503
+ @confirm="handleEventDialogDelete(item, index)"
504
+ >
505
+ <i class="el-icon-delete" slot="reference"></i>
506
+ </el-popconfirm> -->
507
+ </div>
508
+ </div>
509
+ <div class="detail th-fiex_content">
510
+ <div class="events-header th-sticky_top">按钮详情</div>
488
511
  <el-form
512
+ v-if="dialog.data"
513
+ class="detail-form"
489
514
  ref="form"
490
515
  :model="dialog.data"
491
516
  label-width="80px"
@@ -587,7 +612,7 @@
587
612
  </el-select>
588
613
  </el-form-item>
589
614
  </el-form>
590
- </el-card>
615
+ </div>
591
616
  </div>
592
617
  </th-dialog>
593
618
  </div>
@@ -626,12 +651,14 @@ export default {
626
651
  isIndeterminate: false
627
652
  },
628
653
  collapseValue: [
654
+ "group-fields_search",
655
+ "group-fields_table",
629
656
  "group-table",
630
- "group-pageInfo",
631
- "group-sort",
632
- "group-hint",
633
- "group-network",
634
- "group-button"
657
+ "group-table_pageInfo",
658
+ "group-table_sort",
659
+ "group-table_hint",
660
+ "group-table_network",
661
+ "group-table_button"
635
662
  ],
636
663
  pageInfoLayout: [
637
664
  { label: "总条数", value: "total" },
@@ -865,6 +892,54 @@ export default {
865
892
  }
866
893
  }
867
894
  }
895
+
896
+ .eventsSetting {
897
+ height: 100%;
898
+
899
+ .events-header {
900
+ display: flex;
901
+ align-items: center;
902
+ justify-content: space-between;
903
+ padding: 0 10px;
904
+ height: 40px;
905
+ background-color: #f2f6fc;
906
+ z-index: 10;
907
+ }
908
+
909
+ .list {
910
+ width: 200px;
911
+ min-height: 430px;
912
+ overflow-y: overlay;
913
+ border-right: 1px solid #eee;
914
+
915
+ .list-item {
916
+ display: flex;
917
+ // align-items: center;
918
+ margin: 5px;
919
+ padding: 10px;
920
+ border-radius: 3px;
921
+ border: 1px solid #dcdfe6;
922
+ transition: 0.25s;
923
+
924
+ .list-item-title {
925
+ color: var(--th-green);
926
+ }
927
+ .list-item-value {
928
+ flex: 1;
929
+ padding: 0 5px;
930
+ }
931
+ i {
932
+ cursor: pointer;
933
+ }
934
+ }
935
+ }
936
+
937
+ .detail {
938
+ .detail-form {
939
+ padding: 10px;
940
+ }
941
+ }
942
+ }
868
943
  }
869
944
  </style>
870
945
 
@@ -79,7 +79,7 @@
79
79
  <div v-else class="search-content"></div>
80
80
  </div>
81
81
  <div class="table-title">列表字段</div>
82
- <div class="tableList" style="height: calc(100% - 340px);">
82
+ <div class="tableList" style="height: calc(100% - 350px);">
83
83
  <div class="table-item table-header">
84
84
  <div class="table-item-custom">拖动</div>
85
85
  <div>列名</div>
@@ -219,9 +219,11 @@ export default {
219
219
 
220
220
  <style lang="scss" scoped>
221
221
  .widgetTable {
222
- height: 100%;
222
+ height: calc(100% - 45px);
223
223
  padding: 10px;
224
224
  background-color: white;
225
+ overflow-y: overlay;
226
+
225
227
  .table-title {
226
228
  height: 25px;
227
229
  line-height: 25px;