tianheng-ui 0.0.83 → 0.0.85
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/{packages/TableMaking/util → lib/theme-chalk/js}/Log.js +0 -0
- package/{packages/TableMaking/util → lib/theme-chalk/js}/axios.js +0 -0
- package/lib/tianheng-ui.js +3 -3
- package/package.json +1 -1
- package/packages/TableMaking/generateTable.vue +20 -19
- package/packages/TableMaking/index.vue +20 -4
- package/packages/TableMaking/util/index.js +4 -22
- package/packages/TableMaking/widgetConfig.vue +6 -5
package/package.json
CHANGED
@@ -79,7 +79,7 @@
|
|
79
79
|
import Search from "./custom/items/search";
|
80
80
|
import Tools from "./custom/items/tools";
|
81
81
|
import { toolsItemConfig, formItemConfig, tableItemConfig } from "./util/index";
|
82
|
-
import * as Axios from "
|
82
|
+
import * as Axios from "lib/theme-chalk/js/axios";
|
83
83
|
export default {
|
84
84
|
name: "thTableGenerate",
|
85
85
|
components: { Search, Tools },
|
@@ -96,6 +96,7 @@ export default {
|
|
96
96
|
},
|
97
97
|
data() {
|
98
98
|
return {
|
99
|
+
id: "",
|
99
100
|
tableJson: {},
|
100
101
|
axios: null,
|
101
102
|
networkConfig: {},
|
@@ -174,6 +175,8 @@ export default {
|
|
174
175
|
};
|
175
176
|
},
|
176
177
|
created() {
|
178
|
+
const code = this.$route.path.split("/").pop();
|
179
|
+
this.id = code;
|
177
180
|
this.initConfig();
|
178
181
|
},
|
179
182
|
mounted() {},
|
@@ -183,8 +186,7 @@ export default {
|
|
183
186
|
this.axios = Axios.init(this.config);
|
184
187
|
const info = sessionStorage.getItem("th_oauth_info");
|
185
188
|
if (info) {
|
186
|
-
|
187
|
-
this.requestConfigData(code);
|
189
|
+
this.requestConfigData();
|
188
190
|
} else {
|
189
191
|
// 模拟授权认证流程
|
190
192
|
this.axios({
|
@@ -193,16 +195,15 @@ export default {
|
|
193
195
|
data: this.config.network.params,
|
194
196
|
headers: this.config.network.headers
|
195
197
|
}).then(res => {
|
196
|
-
const oauthInfo = { token: res.data };
|
198
|
+
const oauthInfo = { token: res.data, baseUrl: "" };
|
197
199
|
sessionStorage.setItem("th_oauth_info", JSON.stringify(oauthInfo));
|
198
|
-
|
199
|
-
this.requestConfigData(code);
|
200
|
+
this.requestConfigData();
|
200
201
|
});
|
201
202
|
}
|
202
203
|
},
|
203
204
|
// 获取配置信息
|
204
205
|
requestConfigData(code) {
|
205
|
-
this.tableJson = tableItemConfig(
|
206
|
+
this.tableJson = tableItemConfig(this.id);
|
206
207
|
// 网络请求
|
207
208
|
this.networkConfig = this.tableJson.network;
|
208
209
|
|
@@ -327,7 +328,7 @@ export default {
|
|
327
328
|
this.dialog.action.loading = false;
|
328
329
|
});
|
329
330
|
},
|
330
|
-
|
331
|
+
requestFormConfigData() {
|
331
332
|
setTimeout(() => {
|
332
333
|
const form = this.dialog.action.form;
|
333
334
|
const config = formItemConfig(form.id);
|
@@ -347,7 +348,7 @@ export default {
|
|
347
348
|
switch (action.act) {
|
348
349
|
case "add":
|
349
350
|
this.dialog = { show: true, data: {}, action: action };
|
350
|
-
this.
|
351
|
+
this.requestFormConfigData();
|
351
352
|
break;
|
352
353
|
case "batchDelete":
|
353
354
|
action.loading = true;
|
@@ -372,24 +373,16 @@ export default {
|
|
372
373
|
break;
|
373
374
|
}
|
374
375
|
},
|
375
|
-
handlePagingChange(val) {
|
376
|
-
console.log("handlePagingChange =>", val);
|
377
|
-
this.requestListData();
|
378
|
-
},
|
379
|
-
handleSelectionChange(val) {
|
380
|
-
console.log("handleSelectionChange =>", val);
|
381
|
-
this.tableSelectionData = val;
|
382
|
-
},
|
383
376
|
handleActionClick(index, item, action, callback) {
|
384
377
|
console.log("handleActionClick =>", item, action);
|
385
378
|
switch (action.act) {
|
386
379
|
case "edit":
|
387
380
|
this.dialog = { show: true, data: item, action: action };
|
388
|
-
this.
|
381
|
+
this.requestFormConfigData();
|
389
382
|
break;
|
390
383
|
case "detail":
|
391
384
|
this.dialog = { show: true, data: item, action: action };
|
392
|
-
this.
|
385
|
+
this.requestFormConfigData();
|
393
386
|
break;
|
394
387
|
case "delete":
|
395
388
|
this.requestDeleteData({ ids: item.id }, callback);
|
@@ -420,6 +413,14 @@ export default {
|
|
420
413
|
},
|
421
414
|
handleDialogClose() {
|
422
415
|
this.formConfig = null;
|
416
|
+
},
|
417
|
+
handlePagingChange(val) {
|
418
|
+
console.log("handlePagingChange =>", val);
|
419
|
+
this.requestListData();
|
420
|
+
},
|
421
|
+
handleSelectionChange(val) {
|
422
|
+
console.log("handleSelectionChange =>", val);
|
423
|
+
this.tableSelectionData = val;
|
423
424
|
}
|
424
425
|
}
|
425
426
|
};
|
@@ -89,6 +89,10 @@ export default {
|
|
89
89
|
},
|
90
90
|
methods: {
|
91
91
|
initConfig() {
|
92
|
+
if (Object.keys(this.config).length) {
|
93
|
+
this.$refs.configRef.tableConfig = this.config;
|
94
|
+
}
|
95
|
+
|
92
96
|
const searchFields = [];
|
93
97
|
const searchFieldsIndexs = [];
|
94
98
|
if (this.config.search) {
|
@@ -102,9 +106,15 @@ export default {
|
|
102
106
|
}
|
103
107
|
}
|
104
108
|
}
|
109
|
+
this.searchFields = searchFields;
|
110
|
+
this.$refs.configRef.search = {
|
111
|
+
fields: searchFieldsIndexs,
|
112
|
+
isCheckAll: searchFieldsIndexs.length === this.fields.length,
|
113
|
+
isIndeterminate:
|
114
|
+
searchFieldsIndexs.length > 0 &&
|
115
|
+
searchFieldsIndexs.length < this.fields.length
|
116
|
+
};
|
105
117
|
}
|
106
|
-
this.searchFields = searchFields;
|
107
|
-
this.$refs.configRef.search.fields = searchFieldsIndexs;
|
108
118
|
|
109
119
|
const tableFields = [];
|
110
120
|
const tableFieldsIndexs = [];
|
@@ -119,9 +129,15 @@ export default {
|
|
119
129
|
}
|
120
130
|
}
|
121
131
|
}
|
132
|
+
this.tableFields = tableFields;
|
133
|
+
this.$refs.configRef.table = {
|
134
|
+
fields: tableFieldsIndexs,
|
135
|
+
isCheckAll: tableFieldsIndexs.length === this.fields.length,
|
136
|
+
isIndeterminate:
|
137
|
+
tableFieldsIndexs.length > 0 &&
|
138
|
+
tableFieldsIndexs.length < this.fields.length
|
139
|
+
};
|
122
140
|
}
|
123
|
-
this.tableFields = tableFields;
|
124
|
-
this.$refs.configRef.table.fields = tableFieldsIndexs;
|
125
141
|
},
|
126
142
|
handleFieldsChange(val) {
|
127
143
|
const type = val.type;
|
@@ -238,23 +238,12 @@ const tableConfig = {
|
|
238
238
|
options: [
|
239
239
|
{
|
240
240
|
type: "input",
|
241
|
-
label: "
|
241
|
+
label: "平台名称",
|
242
242
|
prop: "name",
|
243
243
|
defaultValue: "",
|
244
244
|
align: "left",
|
245
245
|
width: 0
|
246
246
|
}
|
247
|
-
// {
|
248
|
-
// type: "select",
|
249
|
-
// label: "性别",
|
250
|
-
// prop: "gender",
|
251
|
-
// align: "left",
|
252
|
-
// width: 0,
|
253
|
-
// staticData: [
|
254
|
-
// { label: "男", value: "1" },
|
255
|
-
// { label: "女", value: "0" }
|
256
|
-
// ]
|
257
|
-
// }
|
258
247
|
]
|
259
248
|
},
|
260
249
|
table: {
|
@@ -286,17 +275,10 @@ const tableConfig = {
|
|
286
275
|
sortable: true,
|
287
276
|
align: "left",
|
288
277
|
width: 0
|
289
|
-
},
|
290
|
-
{
|
291
|
-
label: "编辑时间",
|
292
|
-
type: "input",
|
293
|
-
prop: "updateTime",
|
294
|
-
align: "left",
|
295
|
-
width: 0
|
296
278
|
}
|
297
279
|
],
|
298
280
|
pageInfo: {
|
299
|
-
show:
|
281
|
+
show: false,
|
300
282
|
options: {
|
301
283
|
pageCount: 0, // 总页数
|
302
284
|
pageSize: 20, // 每页展示的条数
|
@@ -314,11 +296,11 @@ const tableConfig = {
|
|
314
296
|
add: { show: true, name: "新增", position: 1, form: { id: "1" } },
|
315
297
|
edit: { show: true, name: "编辑", position: 2, form: { id: "1" } },
|
316
298
|
detail: { show: false, name: "查看", position: 2, form: { id: "1" } },
|
317
|
-
delete: { show:
|
299
|
+
delete: { show: false, name: "删除", position: 2 },
|
318
300
|
batchDelete: { show: true, name: "批量删除", position: 1 },
|
319
301
|
export: { show: true, name: "导出", position: 1 },
|
320
302
|
import: { show: true, name: "导入", position: 1 },
|
321
|
-
key_123456:{}
|
303
|
+
key_123456: {}
|
322
304
|
},
|
323
305
|
network: {
|
324
306
|
mounted: {
|
@@ -241,12 +241,13 @@ export default {
|
|
241
241
|
tools: {
|
242
242
|
add: { show: true, name: "新增", position: 1 },
|
243
243
|
edit: { show: true, name: "编辑", position: 2 },
|
244
|
-
detail: { show:
|
244
|
+
detail: { show: false, name: "查看", position: 2 },
|
245
245
|
delete: { show: true, name: "删除", position: 2 },
|
246
|
-
batchDelete: { show:
|
247
|
-
export: { show:
|
248
|
-
import: { show:
|
249
|
-
}
|
246
|
+
batchDelete: { show: false, name: "批量删除", position: 1 },
|
247
|
+
export: { show: false, name: "导出", position: 1 },
|
248
|
+
import: { show: false, name: "导入", position: 1 }
|
249
|
+
},
|
250
|
+
network: {}
|
250
251
|
},
|
251
252
|
sortFieldOptions: [{ label: "创建时间", value: "createTime" }]
|
252
253
|
};
|