tianheng-ui 0.1.53 → 0.1.54

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.53",
4
+ "version": "0.1.54",
5
5
  "author": "shu lang <403732931@qq.com>",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -33,7 +33,7 @@
33
33
  :disabled="item.style.disabled || loadingDel"
34
34
  :loading="item.style.loading"
35
35
  @click="pop = true"
36
- >{{ item.name }}</el-button
36
+ >{{ item.text }}</el-button
37
37
  >
38
38
  </el-popover>
39
39
  <el-button
@@ -49,7 +49,7 @@
49
49
  :disabled="item.style.disabled"
50
50
  :loading="item.style.loading"
51
51
  @click="handleClick(item)"
52
- >{{ item.name }}</el-button
52
+ >{{ item.text }}</el-button
53
53
  >
54
54
  </template>
55
55
  </div>
@@ -16,13 +16,13 @@
16
16
  {{ column.label }}
17
17
  </div>
18
18
  <div class="table-list-item-row-value" :style="valueStyle">
19
- {{ groupItem[column.prop] != null ? groupItem[column.prop] : "" }}
19
+ {{ groupItem[column.pAlias] != null ? groupItem[column.pAlias] : "" }}
20
20
  </div>
21
21
  </div>
22
22
  <div class="table-list-item-tools">
23
23
  <el-button
24
24
  v-for="button in config.actions"
25
- :key="button.name"
25
+ :key="button.type"
26
26
  :type="button.style.type"
27
27
  :icon="button.style.icon"
28
28
  :plain="button.style.plain"
@@ -13,7 +13,7 @@
13
13
  :disabled="item.style.disabled || disabled[item.act]"
14
14
  :loading="item.style.loading"
15
15
  @click="handleClick(item)"
16
- >{{ item.name }}</el-button
16
+ >{{ item.text }}</el-button
17
17
  >
18
18
  </el-form-item>
19
19
  </el-form>
@@ -43,7 +43,7 @@
43
43
  :page-size="tableConfig.pageInfo.options.pageSize"
44
44
  :page-sizes="tableConfig.pageInfo.options.sizes"
45
45
  :layout="tableConfig.pageInfo.options.layout"
46
- :total="1000"
46
+ :total="tableConfig.pageInfo.options.total"
47
47
  >
48
48
  </el-pagination>
49
49
  </template>
@@ -53,15 +53,16 @@
53
53
  v-model="dialog.show"
54
54
  :title="dialog.action.name"
55
55
  :modal-append-to-body="false"
56
- :z-index="9999"
56
+ :showFooter="false"
57
57
  @on-affirm="handleDialogAffirm"
58
58
  @on-close="handleDialogClose"
59
59
  >
60
60
  <th-form-generate
61
61
  v-if="formConfig"
62
+ ref="formGenerate"
62
63
  :config="formConfig"
63
64
  :value="dialog.data"
64
- ref="formGenerate"
65
+ @button-submit="handleFormButtonSubmit"
65
66
  >
66
67
  </th-form-generate>
67
68
  </th-dialog>
@@ -385,23 +386,24 @@ export default {
385
386
  },
386
387
 
387
388
  // 请求拦截器,返回请求体
388
- requestInterceptors(paramsData, networkId, actionType) {
389
- const config = this.networkConfig[networkId];
390
- if (!config) {
391
- this.$message.error("未知的请求接口,请检查配置信息");
389
+ requestInterceptors(queryParams, networkId, action) {
390
+ const api = this.networkConfig[networkId];
391
+ if (!api) {
392
+ this.$message.error("未知的接口,请检查配置信息");
392
393
  return;
393
394
  }
394
395
 
395
396
  const request = {
396
- url: config.url,
397
- method: config.method,
398
- headers: { ...config.headers, actionType }
397
+ url: api.url,
398
+ method: api.method,
399
+ headers: api.headers
399
400
  };
400
401
  let params = {};
401
- switch (actionType) {
402
+ switch (action) {
402
403
  case "list":
403
- for (let key of Object.keys(config.inParams)) {
404
- params[key] = paramsData[key] || this.query[key];
404
+ for (const item of api.inParams) {
405
+ params[item.pAlias] =
406
+ queryParams[item.pAlias] || this.query[item.pAlias];
405
407
  }
406
408
  if (this.tableConfig.pageInfo.show) {
407
409
  const pageInfo = this.tableConfig.pageInfo.options;
@@ -413,8 +415,9 @@ export default {
413
415
  case "add":
414
416
  case "edit":
415
417
  case "delete":
416
- for (let key of Object.keys(config.inParams)) {
417
- params[key] = paramsData[key];
418
+ for (const item of api.inParams) {
419
+ params[item.pAlias] =
420
+ queryParams[item.pAlias] || this.query[item.pAlias];
418
421
  }
419
422
  break;
420
423
  case "batchDelete":
@@ -429,7 +432,8 @@ export default {
429
432
  break;
430
433
  }
431
434
 
432
- if (config.method.toLowerCase() === "get") request.params = params;
435
+ if (["get", "delete"].includes(api.method.toLowerCase()))
436
+ request.params = params;
433
437
  else request.data = params;
434
438
 
435
439
  return request;
@@ -499,6 +503,7 @@ export default {
499
503
  },
500
504
  // 弹窗关闭
501
505
  handleDialogClose() {
506
+ this.dialog.show = false;
502
507
  this.formConfig = null;
503
508
  },
504
509
 
@@ -507,6 +512,12 @@ export default {
507
512
  },
508
513
  handleSelectionChange(val) {
509
514
  this.tableSelectionData = val;
515
+ },
516
+
517
+ // 表单提交按钮事件回调
518
+ handleFormButtonSubmit() {
519
+ this.handleDialogClose();
520
+ this.requestListData();
510
521
  }
511
522
  }
512
523
  };