tianheng-ui 0.0.77 → 0.0.78

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.77",
4
+ "version": "0.0.78",
5
5
  "author": "shu lang <403732931@qq.com>",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -72,7 +72,7 @@ export default {
72
72
  const data = val.data;
73
73
  const list = [];
74
74
  data.forEach(i => {
75
- list.push(JSON.parse(JSON.stringify(this.fields[i])));
75
+ list.push(this.fields[i]);
76
76
  });
77
77
  if (type === 0) {
78
78
  this.searchFields = list;
@@ -65,9 +65,10 @@
65
65
  <el-select
66
66
  v-model="tableConfig.table.sort.key"
67
67
  placeholder="请选择"
68
+ clearable
68
69
  >
69
70
  <el-option
70
- v-for="item in []"
71
+ v-for="item in sortFieldOptions"
71
72
  :key="item.value"
72
73
  :label="item.label"
73
74
  :value="item.value"
@@ -75,10 +76,16 @@
75
76
  </el-option>
76
77
  </el-select>
77
78
  </el-form-item>
79
+ <el-form-item label="序号">
80
+ <el-switch v-model="tableConfig.table.sequence"> </el-switch>
81
+ </el-form-item>
78
82
  <el-form-item label="分页设置">
79
83
  <el-switch v-model="tableConfig.table.pageInfo.show"> </el-switch>
80
84
  </el-form-item>
81
- <el-form-item label="分页条数">
85
+ <el-form-item
86
+ v-if="tableConfig.table.pageInfo.show"
87
+ label="分页条数"
88
+ >
82
89
  <el-radio-group v-model="tableConfig.table.pageInfo.pageSize">
83
90
  <el-radio-button :label="20">20条</el-radio-button>
84
91
  <el-radio-button :label="50">50条</el-radio-button>
@@ -120,9 +127,7 @@
120
127
  ></el-input>
121
128
  </el-form-item>
122
129
  <el-form-item label-width="90px">
123
- <el-checkbox
124
- v-model="tableConfig.tools.detail.show"
125
- slot="label"
130
+ <el-checkbox v-model="tableConfig.tools.detail.show" slot="label"
126
131
  >详情</el-checkbox
127
132
  >
128
133
  <el-input
@@ -131,9 +136,7 @@
131
136
  ></el-input>
132
137
  </el-form-item>
133
138
  <el-form-item label-width="90px">
134
- <el-checkbox
135
- v-model="tableConfig.tools.delete.show"
136
- slot="label"
139
+ <el-checkbox v-model="tableConfig.tools.delete.show" slot="label"
137
140
  >删除</el-checkbox
138
141
  >
139
142
  <el-input
@@ -153,9 +156,7 @@
153
156
  ></el-input>
154
157
  </el-form-item>
155
158
  <el-form-item label-width="90px">
156
- <el-checkbox
157
- v-model="tableConfig.tools.export.show"
158
- slot="label"
159
+ <el-checkbox v-model="tableConfig.tools.export.show" slot="label"
159
160
  >导出</el-checkbox
160
161
  >
161
162
  <el-input
@@ -164,9 +165,7 @@
164
165
  ></el-input>
165
166
  </el-form-item>
166
167
  <el-form-item label-width="90px">
167
- <el-checkbox
168
- v-model="tableConfig.tools.import.show"
169
- slot="label"
168
+ <el-checkbox v-model="tableConfig.tools.import.show" slot="label"
170
169
  >导入</el-checkbox
171
170
  >
172
171
  <el-input
@@ -224,12 +223,13 @@ export default {
224
223
  options: [],
225
224
  sort: {
226
225
  type: "1",
227
- key: ""
226
+ key: "createTime"
228
227
  },
229
228
  pageInfo: {
230
229
  show: true,
231
230
  pageSize: 20
232
- }
231
+ },
232
+ sequence: false //序号
233
233
  },
234
234
  tools: {
235
235
  add: { show: true, name: "新增" },
@@ -240,7 +240,8 @@ export default {
240
240
  export: { show: false, name: "导出" },
241
241
  import: { show: false, name: "导入" }
242
242
  }
243
- }
243
+ },
244
+ sortFieldOptions: [{ label: "创建时间", value: "createTime" }]
244
245
  };
245
246
  },
246
247
  mounted() {},
@@ -7,6 +7,8 @@
7
7
  <div>列名</div>
8
8
  <div>字段</div>
9
9
  <div>类型</div>
10
+ <div>默认值</div>
11
+ <div>数据来源</div>
10
12
  </div>
11
13
  <draggable
12
14
  class="table-content"
@@ -29,7 +31,32 @@
29
31
  </div>
30
32
  <div>{{ item.label }}</div>
31
33
  <div>{{ item.prop }}</div>
32
- <div>{{ item.type }}</div>
34
+ <div>
35
+ <el-select v-model="item.type" placeholder="请选择" size="mini">
36
+ <el-option
37
+ v-for="item in componentOptions"
38
+ :key="item.value"
39
+ :label="item.label"
40
+ :value="item.value"
41
+ >
42
+ </el-option>
43
+ </el-select>
44
+ </div>
45
+ <div>
46
+ <el-input
47
+ v-model="item.defaultValue"
48
+ placeholder="请输入内容"
49
+ size="mini"
50
+ ></el-input>
51
+ </div>
52
+ <div>
53
+ <template v-if="item.type === 'select'">
54
+ <el-button type="text" size="mini" @click="handleStaticData(item)"
55
+ >静态</el-button
56
+ >
57
+ <el-button type="text" size="mini" disabled>远端</el-button>
58
+ </template>
59
+ </div>
33
60
  </div>
34
61
  </draggable>
35
62
  </div>
@@ -87,6 +114,14 @@
87
114
  </div>
88
115
  </draggable>
89
116
  </div>
117
+
118
+ <th-dialog
119
+ v-model="dialog.visible"
120
+ :title="dialog.title"
121
+ @on-affirm="handleDialogAffirm"
122
+ >
123
+ <th-code-editor v-model="codeEditorValue"></th-code-editor>
124
+ </th-dialog>
90
125
  </div>
91
126
  </template>
92
127
 
@@ -112,11 +147,18 @@ export default {
112
147
  return {
113
148
  searchData: this.searchFields,
114
149
  tableData: this.tableFields,
150
+ componentOptions: [
151
+ { label: "输入框", value: "input" },
152
+ { label: "下拉框", value: "select" },
153
+ { label: "日期框", value: "date" }
154
+ ],
115
155
  alignOptions: [
116
156
  { label: "左对齐", value: "left" },
117
157
  { label: "居中对齐", value: "center" },
118
158
  { label: "右对齐", value: "right" }
119
- ]
159
+ ],
160
+ dialog: { visible: false, title: "", data: null },
161
+ codeEditorValue: ""
120
162
  };
121
163
  },
122
164
  watch: {
@@ -146,6 +188,18 @@ export default {
146
188
  },
147
189
  handleTableMoveEnd(val) {
148
190
  this.$emit("move", { type: "table", data: val });
191
+ },
192
+ handleStaticData(val) {
193
+ this.dialog = {
194
+ visible: true,
195
+ title: `静态数据 - ${val.label}`,
196
+ data: val
197
+ };
198
+ this.codeEditorValue = val.staticData || "";
199
+ },
200
+ handleDialogAffirm() {
201
+ this.dialog.data.staticData = this.codeEditorValue;
202
+ this.dialog = { visible: false, title: "", data: null };
149
203
  }
150
204
  }
151
205
  };
@@ -175,20 +229,20 @@ export default {
175
229
  height: calc(100% - 240px);
176
230
  border: 1px solid #dcdfe6;
177
231
 
178
- .table-header {
179
- div:nth-child(4) {
180
- flex: none;
181
- width: 70px !important;
182
- }
183
- }
232
+ // .table-header {
233
+ // div:nth-child(4) {
234
+ // flex: none;
235
+ // width: 70px !important;
236
+ // }
237
+ // }
184
238
  .table-content {
185
239
  height: calc(100% - 40px);
186
240
  overflow-y: scroll;
187
241
  }
188
- .table-content .table-content-item > div:nth-child(4) {
189
- flex: none;
190
- width: 70px !important;
191
- }
242
+ // .table-content .table-content-item > div:nth-child(4) {
243
+ // flex: none;
244
+ // width: 70px !important;
245
+ // }
192
246
  .el-input-number--mini {
193
247
  width: 100%;
194
248
  }