tianheng-ui 0.1.4 → 0.1.6

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.4",
4
+ "version": "0.1.6",
5
5
  "author": "shu lang <403732931@qq.com>",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -220,9 +220,6 @@ export default {
220
220
  // table
221
221
  for (let i = 0; i < this.tableJson.table.options.length; i++) {
222
222
  const element = this.tableJson.table.options[i];
223
- if (element.primaryKey) {
224
- element.hide = true
225
- }
226
223
  delete element.type;
227
224
  }
228
225
  if (this.tableJson.table.sequence) {
@@ -239,7 +239,7 @@ export default {
239
239
  sizes: [10, 20, 30, 50, 100]
240
240
  }
241
241
  },
242
- sort: { type: "1", key: "create_time" },
242
+ sort: { type: "1", key: "" },
243
243
  loading: { show: false, text: "加载中", image: "" },
244
244
  empty: { show: true, text: "暂无数据", image: "" },
245
245
  sequence: true //是否显示序号
@@ -1,17 +1,19 @@
1
1
  <template>
2
2
  <div class="widgetTable">
3
3
  <div class="table-title">查询字段</div>
4
- <div class="searchList">
5
- <div class="table-header">
6
- <div>拖动</div>
4
+ <div class="tableList searchList">
5
+ <div class="table-item table-header">
6
+ <div class="table-item-custom">拖动</div>
7
7
  <div>列名</div>
8
8
  <!-- <div>字段</div> -->
9
9
  <div>类型</div>
10
10
  <div>默认值</div>
11
- <div>数据来源</div>
11
+ <!-- <div>数据来源</div> -->
12
+ <div class="table-item-custom"></div>
13
+ <div class="table-item-custom">隐藏</div>
12
14
  </div>
13
15
  <draggable
14
- class="table-content"
16
+ class="search-content"
15
17
  v-model="searchData"
16
18
  v-bind="{
17
19
  group: 'people',
@@ -21,12 +23,8 @@
21
23
  }"
22
24
  @end="handleSearchMoveEnd"
23
25
  >
24
- <div
25
- v-for="item in searchData"
26
- :key="item.key"
27
- class="table-content-item"
28
- >
29
- <div class="drag">
26
+ <div v-for="item in searchData" :key="item.prop" class="table-item">
27
+ <div class="table-item-custom drag">
30
28
  <i class="iconfont icon-drag drag-widget"></i>
31
29
  </div>
32
30
  <div>{{ item.label }}</div>
@@ -52,28 +50,34 @@
52
50
  v-model="item.defaultValue"
53
51
  placeholder="请输入内容"
54
52
  size="mini"
53
+ clearable
55
54
  ></el-input>
56
55
  </div>
57
- <div>
56
+ <!-- <div>
58
57
  <template v-if="item.type === 'select'">
59
58
  <el-button type="text" size="mini" @click="handleStaticData(item)"
60
59
  >静态</el-button
61
60
  >
62
61
  <el-button type="text" size="mini" disabled>远端</el-button>
63
62
  </template>
63
+ </div> -->
64
+ <div class="table-item-custom"></div>
65
+ <div class="table-item-custom">
66
+ <el-checkbox v-model="item.hide"></el-checkbox>
64
67
  </div>
65
68
  </div>
66
69
  </draggable>
67
70
  </div>
68
71
  <div class="table-title">列表字段</div>
69
- <div class="tableList">
70
- <div class="table-header">
71
- <div>拖动</div>
72
+ <div class="tableList" style="height: calc(100% - 240px);">
73
+ <div class="table-item table-header">
74
+ <div class="table-item-custom">拖动</div>
72
75
  <div>列名</div>
73
76
  <!-- <div>字段</div> -->
74
- <div>排序</div>
75
77
  <div>对齐</div>
76
78
  <div>宽度</div>
79
+ <div class="table-item-custom">排序</div>
80
+ <div class="table-item-custom">隐藏</div>
77
81
  </div>
78
82
  <draggable
79
83
  class="table-content"
@@ -86,17 +90,12 @@
86
90
  }"
87
91
  @end="handleTableMoveEnd"
88
92
  >
89
- <div
90
- v-for="item in tableData"
91
- :key="item.key"
92
- class="table-content-item"
93
- >
94
- <div class="drag">
93
+ <div v-for="item in tableData" :key="item.prop" class="table-item">
94
+ <div class="table-item-custom drag">
95
95
  <i class="iconfont icon-drag drag-widget"></i>
96
96
  </div>
97
97
  <div>{{ item.label }}</div>
98
98
  <!-- <div>{{ item.prop }}</div> -->
99
- <div><el-checkbox v-model="item.sortable"></el-checkbox></div>
100
99
  <div>
101
100
  <el-select v-model="item.align" placeholder="请选择" size="mini">
102
101
  <el-option
@@ -116,6 +115,12 @@
116
115
  size="mini"
117
116
  ></el-input-number>
118
117
  </div>
118
+ <div class="table-item-custom">
119
+ <el-checkbox v-model="item.sortable"></el-checkbox>
120
+ </div>
121
+ <div class="table-item-custom">
122
+ <el-checkbox v-model="item.hide"></el-checkbox>
123
+ </div>
119
124
  </div>
120
125
  </draggable>
121
126
  </div>
@@ -224,57 +229,39 @@ export default {
224
229
  margin: 10px 0;
225
230
  border: 1px solid #dcdfe6;
226
231
  box-sizing: border-box;
227
-
228
- .table-content {
232
+ .search-content {
229
233
  height: 120px;
230
- overflow-y: scroll;
234
+ overflow-y: overlay;
231
235
  }
232
236
  }
233
237
  .tableList {
234
238
  margin-top: 10px;
235
- height: calc(100% - 240px);
236
239
  border: 1px solid #dcdfe6;
237
240
 
238
- // .table-header {
239
- // div:nth-child(4) {
240
- // flex: none;
241
- // width: 70px !important;
242
- // }
243
- // }
241
+ .table-header {
242
+ background-color: #f5f7f9;
243
+ div {
244
+ flex: 1;
245
+ padding: 0 10px;
246
+ height: 40px;
247
+ line-height: 40px;
248
+ }
249
+ }
250
+
244
251
  .table-content {
245
252
  height: calc(100% - 40px);
246
- overflow-y: scroll;
247
- }
248
- // .table-content .table-content-item > div:nth-child(4) {
249
- // flex: none;
250
- // width: 70px !important;
251
- // }
252
- .el-input-number--mini {
253
- width: 100%;
253
+ overflow-y: overlay;
254
254
  }
255
- }
256
255
 
257
- .table-header {
258
- display: flex;
259
- align-items: center;
260
- background-color: #f5f7f9;
261
- div {
262
- flex: 1;
263
- padding: 0 10px;
264
- height: 40px;
265
- line-height: 40px;
266
- }
267
- div:nth-child(1) {
268
- flex: none;
269
- width: 60px;
270
- text-align: center;
271
- }
272
- }
273
- .table-content {
274
- .table-content-item {
256
+ .table-item {
275
257
  display: flex;
276
258
  align-items: center;
277
-
259
+ > div {
260
+ flex: 1;
261
+ height: 40px;
262
+ line-height: 40px;
263
+ padding: 0 10px;
264
+ }
278
265
  .drag {
279
266
  i {
280
267
  font-size: 14px;
@@ -282,19 +269,21 @@ export default {
282
269
  cursor: move;
283
270
  }
284
271
  }
285
- > div {
286
- flex: 1;
287
- height: 40px;
288
- line-height: 40px;
289
- padding: 0 10px;
290
- }
291
- > div:nth-child(1) {
292
- flex: none;
293
- width: 60px;
272
+ .table-item-custom {
273
+ flex: none !important;
274
+ width: 60px !important;
294
275
  text-align: center;
295
276
  }
296
277
  }
278
+
279
+ .el-input-number--mini {
280
+ width: 100%;
281
+ }
282
+ .el-select {
283
+ width: 100%;
284
+ }
297
285
  }
286
+
298
287
  // .table-content:hover::-webkit-scrollbar-thumb {
299
288
  // background-color: rgba(69, 90, 100, 0.2);
300
289
  // }