tianheng-ui 0.0.75 → 0.0.77

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.0.75",
4
+ "version": "0.0.77",
5
5
  "author": "shu lang <403732931@qq.com>",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -99,16 +99,26 @@
99
99
  <!-- 操作区 -->
100
100
  <el-header>
101
101
  <div class="client">
102
- <i
103
- class="el-icon-monitor"
102
+ <el-button
103
+ v-if="tools.includes('monitor')"
104
104
  :class="{ active: client === 'monitor' }"
105
+ type="text"
106
+ size="medium"
107
+ icon="el-icon-monitor"
105
108
  @click="client = 'monitor'"
106
- ></i>
107
- <i
108
- class="el-icon-mobile"
109
+ >
110
+ 桌面端
111
+ </el-button>
112
+ <el-button
113
+ v-if="tools.includes('mobile')"
109
114
  :class="{ active: client === 'mobile' }"
115
+ type="text"
116
+ size="medium"
117
+ icon="el-icon-mobile"
110
118
  @click="client = 'mobile'"
111
- ></i>
119
+ >
120
+ 移动端
121
+ </el-button>
112
122
  </div>
113
123
  <slot name="action"> </slot>
114
124
  <el-popover
@@ -389,13 +399,15 @@ export default {
389
399
  data: {
390
400
  type: Object,
391
401
  default: () => {
392
- return { list: [], config: baseConfig };
402
+ return {};
393
403
  }
394
404
  },
395
405
  tools: {
396
406
  type: Array,
397
407
  default: () => {
398
408
  return [
409
+ "monitor",
410
+ "mobile",
399
411
  "upload",
400
412
  "clearable",
401
413
  "preview",
@@ -447,8 +459,11 @@ export default {
447
459
  this.layoutComponents = layoutComponents;
448
460
  this.advanceComponents = advanceComponents;
449
461
  return {
450
- widgetFormData: this.data,
451
- widgetFormSelect: this.data.list[0],
462
+ widgetFormData: {
463
+ list: [],
464
+ config: baseConfig
465
+ },
466
+ widgetFormSelect: {},
452
467
  widgetValue: {},
453
468
  configTab: "widget",
454
469
  client: "monitor",
@@ -515,10 +530,17 @@ export default {
515
530
  },
516
531
  data(val) {
517
532
  this.setJSON(val);
518
- // this.widgetFormData = val;
519
533
  }
520
534
  },
521
- mounted() {},
535
+ mounted() {
536
+ if (this.data && this.data.list) {
537
+ this.widgetFormData.list = this.data.list;
538
+ this.widgetFormSelect = this.data.list[0];
539
+ }
540
+ if (this.data && this.data.config) {
541
+ this.widgetFormData.config = this.data.config;
542
+ }
543
+ },
522
544
  methods: {
523
545
  // 读取excel file
524
546
  readExcelFile(file) {
@@ -119,14 +119,11 @@ $primary-background-color: #ecf5ff;
119
119
  .client {
120
120
  flex: 1;
121
121
  text-align: left;
122
- i {
123
- padding: 8px 5px;
124
- border-radius: 4px;
125
- cursor: pointer;
122
+ .el-button {
123
+ color: #333;
126
124
  }
127
125
  .active {
128
126
  color: #409eff;
129
- background-color: #f2f2f2;
130
127
  }
131
128
  }
132
129
  }
@@ -239,9 +236,9 @@ $primary-background-color: #ecf5ff;
239
236
  margin-left: 0 !important;
240
237
  }
241
238
  }
242
- .widget-table-list:hover::-webkit-scrollbar-thumb {
243
- background-color: rgba(69, 90, 100, 0.2);
244
- }
239
+ // .widget-table-list:hover::-webkit-scrollbar-thumb {
240
+ // background-color: rgba(69, 90, 100, 0.2);
241
+ // }
245
242
 
246
243
  .tableH5 {
247
244
  min-height: 50px;
@@ -3,12 +3,27 @@
3
3
  <el-container>
4
4
  <el-container>
5
5
  <el-header>
6
- <el-button type="text" size="medium" icon="el-icon-delete">
7
- 桌面端
8
- </el-button>
9
- <el-button type="text" size="medium" icon="el-icon-delete">
10
- 移动端
11
- </el-button>
6
+ <div class="client">
7
+ <el-button
8
+ :class="{ active: client === 'monitor' }"
9
+ type="text"
10
+ size="medium"
11
+ icon="el-icon-monitor"
12
+ @click="client = 'monitor'"
13
+ >
14
+ 桌面端
15
+ </el-button>
16
+ <el-button
17
+ :class="{ active: client === 'mobile' }"
18
+ type="text"
19
+ size="medium"
20
+ icon="el-icon-mobile"
21
+ @click="client = 'mobile'"
22
+ >
23
+ 移动端
24
+ </el-button>
25
+ </div>
26
+ <slot name="action"></slot>
12
27
  </el-header>
13
28
  <el-main>
14
29
  <widget-table
@@ -46,13 +61,13 @@ export default {
46
61
  data() {
47
62
  return {
48
63
  searchFields: [],
49
- tableFields: []
64
+ tableFields: [],
65
+ client: "monitor"
50
66
  };
51
67
  },
52
68
  mounted() {},
53
69
  methods: {
54
70
  handleFieldsChange(val) {
55
- console.log("handleFieldsChange =>", val);
56
71
  const type = val.type;
57
72
  const data = val.data;
58
73
  const list = [];
@@ -66,7 +81,6 @@ export default {
66
81
  }
67
82
  },
68
83
  handleMoveChange(val) {
69
- console.log("handleMoveChange =>", val);
70
84
  const type = val.type;
71
85
  const data = val.data;
72
86
  const newIndex = data.newIndex;
@@ -75,12 +89,12 @@ export default {
75
89
  let list = this.$refs.configRef.search.fields;
76
90
  list = this.mobile(list, oldIndex, newIndex);
77
91
  this.$refs.configRef.search.fields = list;
78
- this.searchFields = this.mobile(this.searchFields, oldIndex, newIndex)
92
+ this.searchFields = this.mobile(this.searchFields, oldIndex, newIndex);
79
93
  } else {
80
94
  let list = this.$refs.configRef.table.fields;
81
95
  list = this.mobile(list, oldIndex, newIndex);
82
96
  this.$refs.configRef.table.fields = list;
83
- this.tableFields = this.mobile(this.tableFields, oldIndex, newIndex)
97
+ this.tableFields = this.mobile(this.tableFields, oldIndex, newIndex);
84
98
  }
85
99
  },
86
100
  mobile(list, oldIndex, newIndex) {
@@ -95,7 +109,12 @@ export default {
95
109
  }
96
110
  return list;
97
111
  },
98
- getJson(){}
112
+ getJson() {
113
+ const tableConfig = this.$refs.configRef.getJson();
114
+ tableConfig.search.options = this.searchFields;
115
+ tableConfig.table.options = this.tableFields;
116
+ return tableConfig
117
+ }
99
118
  }
100
119
  };
101
120
  </script>
@@ -106,10 +125,22 @@ export default {
106
125
  background-color: white;
107
126
  border: 1px solid #dcdfe6;
108
127
 
128
+ .client {
129
+ flex: 1;
130
+ .el-button {
131
+ color: #333;
132
+ }
133
+ .active {
134
+ color: #409eff;
135
+ }
136
+ }
137
+
109
138
  .el-container {
110
139
  height: 100%;
111
140
  }
112
141
  .el-header {
142
+ display: flex;
143
+ align-items: center;
113
144
  height: 45px !important;
114
145
  line-height: 45px;
115
146
  border-bottom: 1px solid #dcdfe6;
@@ -53,16 +53,19 @@
53
53
  <el-collapse v-model="tableCollapse" @change="handleChange">
54
54
  <el-collapse-item title="表格配置" name="1">
55
55
  <el-form-item label="高级查询">
56
- <el-switch v-model="tableConfig.search"> </el-switch>
56
+ <el-switch v-model="tableConfig.search.show"> </el-switch>
57
57
  </el-form-item>
58
58
  <el-form-item label="排序类型">
59
- <el-radio-group v-model="tableConfig.sortType">
59
+ <el-radio-group v-model="tableConfig.table.sort.type">
60
60
  <el-radio-button label="1">降序</el-radio-button>
61
61
  <el-radio-button label="2">升序</el-radio-button>
62
62
  </el-radio-group>
63
63
  </el-form-item>
64
64
  <el-form-item label="排序字段">
65
- <el-select v-model="tableConfig.sortField" placeholder="请选择">
65
+ <el-select
66
+ v-model="tableConfig.table.sort.key"
67
+ placeholder="请选择"
68
+ >
66
69
  <el-option
67
70
  v-for="item in []"
68
71
  :key="item.value"
@@ -73,10 +76,10 @@
73
76
  </el-select>
74
77
  </el-form-item>
75
78
  <el-form-item label="分页设置">
76
- <el-switch v-model="tableConfig.openPaging"> </el-switch>
79
+ <el-switch v-model="tableConfig.table.pageInfo.show"> </el-switch>
77
80
  </el-form-item>
78
81
  <el-form-item label="分页条数">
79
- <el-radio-group v-model="tableConfig.pageSize">
82
+ <el-radio-group v-model="tableConfig.table.pageInfo.pageSize">
80
83
  <el-radio-button :label="20">20条</el-radio-button>
81
84
  <el-radio-button :label="50">50条</el-radio-button>
82
85
  <el-radio-button :label="100">100条</el-radio-button>
@@ -84,7 +87,7 @@
84
87
  </el-radio-group>
85
88
  </el-form-item>
86
89
  </el-collapse-item>
87
- <el-collapse-item title="子表配置" name="2">
90
+ <!-- <el-collapse-item title="子表配置" name="2">
88
91
  <el-form-item label="子表样式">
89
92
  <el-select v-model="tableConfig.sortField" placeholder="请选择">
90
93
  <el-option
@@ -96,17 +99,87 @@
96
99
  </el-option>
97
100
  </el-select>
98
101
  </el-form-item>
99
- </el-collapse-item>
102
+ </el-collapse-item> -->
100
103
  <el-collapse-item title="按钮配置" name="3">
101
- <div>
102
- 与现实生活一致:与现实生活的流程、逻辑保持一致,遵循用户习惯的语言和概念;
103
- </div>
104
+ <el-form-item label-width="90px">
105
+ <el-checkbox v-model="tableConfig.tools.add.show" slot="label"
106
+ >新增</el-checkbox
107
+ >
108
+ <el-input
109
+ v-model="tableConfig.tools.add.name"
110
+ placeholder="请输入内容"
111
+ ></el-input>
112
+ </el-form-item>
113
+ <el-form-item label-width="90px">
114
+ <el-checkbox v-model="tableConfig.tools.edit.show" slot="label"
115
+ >编辑</el-checkbox
116
+ >
117
+ <el-input
118
+ v-model="tableConfig.tools.edit.name"
119
+ placeholder="请输入内容"
120
+ ></el-input>
121
+ </el-form-item>
122
+ <el-form-item label-width="90px">
123
+ <el-checkbox
124
+ v-model="tableConfig.tools.detail.show"
125
+ slot="label"
126
+ >详情</el-checkbox
127
+ >
128
+ <el-input
129
+ v-model="tableConfig.tools.detail.name"
130
+ placeholder="请输入内容"
131
+ ></el-input>
132
+ </el-form-item>
133
+ <el-form-item label-width="90px">
134
+ <el-checkbox
135
+ v-model="tableConfig.tools.delete.show"
136
+ slot="label"
137
+ >删除</el-checkbox
138
+ >
139
+ <el-input
140
+ v-model="tableConfig.tools.delete.name"
141
+ placeholder="请输入内容"
142
+ ></el-input>
143
+ </el-form-item>
144
+ <el-form-item label-width="90px">
145
+ <el-checkbox
146
+ v-model="tableConfig.tools.batchDelete.show"
147
+ slot="label"
148
+ >批量删除</el-checkbox
149
+ >
150
+ <el-input
151
+ v-model="tableConfig.tools.batchDelete.name"
152
+ placeholder="请输入内容"
153
+ ></el-input>
154
+ </el-form-item>
155
+ <el-form-item label-width="90px">
156
+ <el-checkbox
157
+ v-model="tableConfig.tools.export.show"
158
+ slot="label"
159
+ >导出</el-checkbox
160
+ >
161
+ <el-input
162
+ v-model="tableConfig.tools.export.name"
163
+ placeholder="请输入内容"
164
+ ></el-input>
165
+ </el-form-item>
166
+ <el-form-item label-width="90px">
167
+ <el-checkbox
168
+ v-model="tableConfig.tools.import.show"
169
+ slot="label"
170
+ >导入</el-checkbox
171
+ >
172
+ <el-input
173
+ v-model="tableConfig.tools.import.name"
174
+ placeholder="请输入内容"
175
+ ></el-input>
176
+ </el-form-item>
104
177
  </el-collapse-item>
105
- <el-collapse-item title="权限设置" name="4">
178
+ <!-- <el-collapse-item title="权限设置" name="4">
106
179
  <div>
107
180
  与现实生活一致:与现实生活的流程、逻辑保持一致,遵循用户习惯的语言和概念;
108
181
  </div>
109
- </el-collapse-item>
182
+ </el-collapse-item> -->
110
183
  </el-collapse>
111
184
  </el-form>
112
185
  </div>
@@ -141,13 +214,32 @@ export default {
141
214
  isCheckAll: false,
142
215
  isIndeterminate: false
143
216
  },
144
- tableCollapse: ["1"],
217
+ tableCollapse: ["1", "3"],
145
218
  tableConfig: {
146
- search: true,
147
- sortType: "1",
148
- sortField: "",
149
- openPaging: true,
150
- pageSize: 20
219
+ search: {
220
+ show: true,
221
+ options: []
222
+ },
223
+ table: {
224
+ options: [],
225
+ sort: {
226
+ type: "1",
227
+ key: ""
228
+ },
229
+ pageInfo: {
230
+ show: true,
231
+ pageSize: 20
232
+ }
233
+ },
234
+ tools: {
235
+ add: { show: true, name: "新增" },
236
+ edit: { show: true, name: "编辑" },
237
+ detail: { show: false, name: "查看" },
238
+ delete: { show: true, name: "删除" },
239
+ batchDelete: { show: false, name: "批量删除" },
240
+ export: { show: false, name: "导出" },
241
+ import: { show: false, name: "导入" }
242
+ }
151
243
  }
152
244
  };
153
245
  },
@@ -196,6 +288,9 @@ export default {
196
288
  this.table.fields = list;
197
289
  this.table.isIndeterminate = false;
198
290
  this.handleChange();
291
+ },
292
+ getJson() {
293
+ return JSON.parse(JSON.stringify(this.tableConfig));
199
294
  }
200
295
  }
201
296
  };
@@ -228,11 +323,13 @@ export default {
228
323
  .fields-item {
229
324
  padding: 0 10px;
230
325
  height: 30px;
326
+ margin-right: 0;
231
327
  line-height: 30px;
232
328
  }
233
329
 
234
330
  .el-checkbox {
235
331
  padding: 0 10px;
332
+ margin-right: 0;
236
333
  width: 100%;
237
334
  height: 30px;
238
335
  line-height: 30px;
@@ -68,10 +68,10 @@
68
68
  <div>
69
69
  <el-select v-model="item.align" placeholder="请选择" size="mini">
70
70
  <el-option
71
- v-for="item in ['left', 'center', 'right']"
72
- :key="item"
73
- :label="item"
74
- :value="item"
71
+ v-for="item in alignOptions"
72
+ :key="item.value"
73
+ :label="item.label"
74
+ :value="item.value"
75
75
  >
76
76
  </el-option>
77
77
  </el-select>
@@ -111,7 +111,12 @@ export default {
111
111
  data() {
112
112
  return {
113
113
  searchData: this.searchFields,
114
- tableData: this.tableFields
114
+ tableData: this.tableFields,
115
+ alignOptions: [
116
+ { label: "左对齐", value: "left" },
117
+ { label: "居中对齐", value: "center" },
118
+ { label: "右对齐", value: "right" }
119
+ ]
115
120
  };
116
121
  },
117
122
  watch: {
@@ -167,13 +172,13 @@ export default {
167
172
  }
168
173
  .tableList {
169
174
  margin-top: 10px;
170
- height: calc(100% - 280px);
175
+ height: calc(100% - 240px);
171
176
  border: 1px solid #dcdfe6;
172
177
 
173
178
  .table-header {
174
179
  div:nth-child(4) {
175
180
  flex: none;
176
- width: 60px !important;
181
+ width: 70px !important;
177
182
  }
178
183
  }
179
184
  .table-content {
@@ -182,7 +187,7 @@ export default {
182
187
  }
183
188
  .table-content .table-content-item > div:nth-child(4) {
184
189
  flex: none;
185
- width: 60px !important;
190
+ width: 70px !important;
186
191
  }
187
192
  .el-input-number--mini {
188
193
  width: 100%;
@@ -230,11 +235,11 @@ export default {
230
235
  }
231
236
  }
232
237
  }
233
- .table-content:hover::-webkit-scrollbar-thumb {
234
- background-color: rgba(69, 90, 100, 0.2);
235
- }
236
- .table-content:hover::-webkit-scrollbar-thumb {
237
- background-color: rgba(69, 90, 100, 0.2);
238
- }
238
+ // .table-content:hover::-webkit-scrollbar-thumb {
239
+ // background-color: rgba(69, 90, 100, 0.2);
240
+ // }
241
+ // .table-content:hover::-webkit-scrollbar-thumb {
242
+ // background-color: rgba(69, 90, 100, 0.2);
243
+ // }
239
244
  }
240
245
  </style>
@@ -365,35 +365,35 @@ export default {
365
365
  color: #fafafa;
366
366
  }
367
367
 
368
- body,
369
- body * {
370
- /* 滚动条 */
371
- &::-webkit-scrollbar-track-piece {
372
- background-color: #fff; /*滚动条的背景颜色*/
373
- -webkit-border-radius: 0; /*滚动条的圆角宽度*/
374
- }
375
- &::-webkit-scrollbar {
376
- width: 10px; /*滚动条的宽度*/
377
- height: 8px; /*滚动条的高度*/
378
- }
379
- &::-webkit-scrollbar-thumb:vertical {
380
- /*垂直滚动条的样式*/
381
- height: 50px;
382
- background-color: rgba(153, 153, 153, 0.5);
383
- -webkit-border-radius: 4px;
384
- outline: 2px solid #fff;
385
- outline-offset: -2px;
386
- border: 2px solid #fff;
387
- }
388
- &::-webkit-scrollbar-thumb {
389
- /*滚动条的hover样式*/
390
- background-color: rgba(159, 159, 159, 0.3);
391
- -webkit-border-radius: 4px;
392
- }
393
- &::-webkit-scrollbar-thumb:hover {
394
- /*滚动条的hover样式*/
395
- background-color: rgba(159, 159, 159, 0.5);
396
- -webkit-border-radius: 4px;
397
- }
398
- }
368
+ // body,
369
+ // body * {
370
+ // /* 滚动条 */
371
+ // &::-webkit-scrollbar-track-piece {
372
+ // background-color: #fff; /*滚动条的背景颜色*/
373
+ // -webkit-border-radius: 0; /*滚动条的圆角宽度*/
374
+ // }
375
+ // &::-webkit-scrollbar {
376
+ // width: 10px; /*滚动条的宽度*/
377
+ // height: 8px; /*滚动条的高度*/
378
+ // }
379
+ // &::-webkit-scrollbar-thumb:vertical {
380
+ // /*垂直滚动条的样式*/
381
+ // height: 50px;
382
+ // background-color: rgba(153, 153, 153, 0.5);
383
+ // -webkit-border-radius: 4px;
384
+ // outline: 2px solid #fff;
385
+ // outline-offset: -2px;
386
+ // border: 2px solid #fff;
387
+ // }
388
+ // &::-webkit-scrollbar-thumb {
389
+ // /*滚动条的hover样式*/
390
+ // background-color: rgba(159, 159, 159, 0.3);
391
+ // -webkit-border-radius: 4px;
392
+ // }
393
+ // &::-webkit-scrollbar-thumb:hover {
394
+ // /*滚动条的hover样式*/
395
+ // background-color: rgba(159, 159, 159, 0.5);
396
+ // -webkit-border-radius: 4px;
397
+ // }
398
+ // }
399
399
  </style>