cloud-web-corejs 1.0.54-dev.641 → 1.0.54-dev.642

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": "cloud-web-corejs",
3
3
  "private": false,
4
- "version": "1.0.54-dev.641",
4
+ "version": "1.0.54-dev.642",
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
7
7
  "lint": "eslint --ext .js,.vue src",
@@ -465,14 +465,18 @@
465
465
  v-el-readonly
466
466
  v-if="isReferenceZdType(row.zdType)"
467
467
  :disabled="!row.zdEn"
468
- clearable
469
- @clear="clearReferenceZd(row)"
470
468
  >
471
- <i
472
- slot="suffix"
473
- class="el-input__icon el-icon-search"
474
- @click="openReferenceZdDialog(row, rowIndex, $table)"
475
- ></i>
469
+ <span slot="suffix" class="el-input__suffix-inner">
470
+ <i
471
+ v-if="row.referenceZd"
472
+ class="el-input__icon el-icon-circle-close"
473
+ @click.stop="confirmClearReferenceZd(row)"
474
+ ></i>
475
+ <i
476
+ class="el-input__icon el-icon-search"
477
+ @click="openReferenceZdDialog(row, rowIndex, $table)"
478
+ ></i>
479
+ </span>
476
480
  </el-input>
477
481
  <template v-else>
478
482
  {{ row.referenceZd }}
@@ -121,7 +121,7 @@ modules = {
121
121
  Text: "文本",
122
122
  TextArea: "长文本",
123
123
  DateTime: "日期时间",
124
- Reference: "关联表",
124
+ Reference: "关联表(文本)",
125
125
  ReferenceLong: "关联表(长整型)",
126
126
  },
127
127
 
@@ -736,6 +736,41 @@ modules = {
736
736
  this.clearReferenceZd(row);
737
737
  }
738
738
  },
739
+ getReferenceChildRows(row) {
740
+ let referenceZd = row.referenceZd;
741
+ if (!referenceZd && !row.zdEn) {
742
+ return [];
743
+ }
744
+ let referenceZd2 = referenceZd ? referenceZd + "." + row.zdEn : null;
745
+ let relationZdSuffix = row.zdEn ? "." + row.zdEn : null;
746
+ return this.szTaMb.szTaZdMbDTOs.filter((item) => {
747
+ if (referenceZd && (referenceZd === item.relationZd || referenceZd2 === item.relationZd)) {
748
+ return true;
749
+ }
750
+ if (relationZdSuffix && item.relationZd && item.relationZd.endsWith(relationZdSuffix)) {
751
+ return true;
752
+ }
753
+ return false;
754
+ });
755
+ },
756
+ confirmClearReferenceZd(row) {
757
+ if (!row.referenceZd) {
758
+ return;
759
+ }
760
+ if (this.hasFieldCreated(row)) {
761
+ this.$baseAlert(this.$t1("该字段已在数据库中创建,不能清空关联配置"));
762
+ return;
763
+ }
764
+ let childRows = this.getReferenceChildRows(row);
765
+ if (childRows.some((item) => this.hasFieldCreated(item))) {
766
+ this.$baseAlert(this.$t1("关联显示字段已在数据库中创建,不能清空关联配置"));
767
+ return;
768
+ }
769
+ let text = this.$t1("清空关联配置将同时删除关联显示字段,您确定要继续吗?");
770
+ this.$baseConfirm(text).then(() => {
771
+ this.clearReferenceZd(row);
772
+ });
773
+ },
739
774
  clearReferenceZd(row) {
740
775
  let referenceZd = row.referenceZd;
741
776
  if (referenceZd) {
@@ -1,9 +1,9 @@
1
- import {selectDialogMixins} from "@base/mixins/selectDialog";
1
+ import { selectDialogMixins } from "@base/mixins/selectDialog";
2
2
 
3
3
  let modules = {};
4
4
  modules = {
5
- name: 'zdDialog',
6
- props: ['visiable', 'multi', 'rows', 'param', 'taBm'],
5
+ name: "zdDialog",
6
+ props: ["visiable", "multi", "rows", "param", "taBm"],
7
7
  mixins: [selectDialogMixins],
8
8
  components: {},
9
9
  created() {
@@ -20,7 +20,7 @@ modules = {
20
20
  formData: {},
21
21
  vxeOption: {},
22
22
  showSaleOrgDialog: false,
23
- fieldKey: "taZdMc"
23
+ fieldKey: "taZdMc",
24
24
  };
25
25
  },
26
26
  methods: {
@@ -28,86 +28,89 @@ modules = {
28
28
  let that = this;
29
29
 
30
30
  let zdTypeMap = {
31
- Boolean: this.$t1('布尔'),
32
- Integer: this.$t1('整数'),
33
- Long: this.$t1('长整数'),
34
- Decimal: this.$t1('精度小数'),
35
- Money: this.$t1('金额'),
36
- Text: this.$t1('文本'),
37
- TextArea: this.$t1('长文本'),
38
- DateTime: this.$t1('日期时间'),
39
- Reference: this.$t1('关联表'),
40
- ReferenceLong: this.$t1('关联表(长整型)')
41
- }
31
+ Boolean: this.$t1("布尔"),
32
+ Integer: this.$t1("整数"),
33
+ Long: this.$t1("长整数"),
34
+ Decimal: this.$t1("精度小数"),
35
+ Money: this.$t1("金额"),
36
+ Text: this.$t1("文本"),
37
+ TextArea: this.$t1("长文本"),
38
+ DateTime: this.$t1("日期时间"),
39
+ Reference: this.$t1("关联表(文本)"),
40
+ ReferenceLong: this.$t1("关联表(长整型)"),
41
+ };
42
42
 
43
43
  let tableOption = {
44
44
  vue: that,
45
- tableRef: 'table-m1',
46
- tableName: 'bd_table_model_field_dialog-m1',
47
- path: USER_PREFIX + '/szTaMb/getSzTaZdMbsByTaBm',
45
+ tableRef: "table-m1",
46
+ tableName: "bd_table_model_field_dialog-m1",
47
+ path: USER_PREFIX + "/szTaMb/getSzTaZdMbsByTaBm",
48
48
  param: () => {
49
49
  return {
50
50
  taBm: this.taBm,
51
51
  enabled: true,
52
52
  searchDb: true,
53
53
  ...this.formData,
54
- ...this.param
54
+ ...this.param,
55
55
  };
56
56
  },
57
57
  columns: [
58
- {type: 'checkbox', width: 48, resizable: false, fixed: 'left'},
58
+ { type: "checkbox", width: 48, resizable: false, fixed: "left" },
59
59
  {
60
- title: this.$t1('实体字段名称'),
61
- field: 'zdEn',
62
- width: 150
60
+ title: this.$t1("实体字段名称"),
61
+ field: "zdEn",
62
+ width: 150,
63
63
  },
64
64
  {
65
- title: this.$t1('数据库表字段名'),
66
- field: 'taZdMc',
67
- width: 150
65
+ title: this.$t1("数据库表字段名"),
66
+ field: "taZdMc",
67
+ width: 150,
68
68
  },
69
69
  {
70
- title: this.$t1('字段描述'),
71
- field: 'zdCh',
72
- width: 150
70
+ title: this.$t1("字段描述"),
71
+ field: "zdCh",
72
+ width: 150,
73
73
  },
74
74
  {
75
- title: this.$t1('字段类型'), field: 'zdType', width: 150, slots: {
76
- default: ({row, rowIndex, $table}) => {
75
+ title: this.$t1("字段类型"),
76
+ field: "zdType",
77
+ width: 150,
78
+ slots: {
79
+ default: ({ row, rowIndex, $table }) => {
77
80
  return zdTypeMap[row.zdType];
78
- }
79
- }
81
+ },
82
+ },
80
83
  },
81
84
  {
82
- title: this.$t1('关联字段'),
83
- field: 'referenceZd',
84
- width: 150
85
+ title: this.$t1("关联字段"),
86
+ field: "referenceZd",
87
+ width: 150,
85
88
  },
86
89
  {
87
90
  width: 47,
88
- fixed: 'right',
89
- title: '',
90
- sortable: false
91
- }
91
+ fixed: "right",
92
+ title: "",
93
+ sortable: false,
94
+ },
92
95
  ],
93
96
  config: {
94
97
  checkboxConfig: {
95
98
  checkStrictly: true,
96
99
  showHeader: this.selectMulti,
97
- trigger: 'row'
100
+ trigger: "row",
98
101
  },
99
102
  proxyConfig: {
100
103
  props: {
101
104
  result: "objx", // 配置响应结果列表字段
102
105
  total: "objx.length", // 配置响应结果总页数字段
103
- }
104
- }
105
- }
106
+ },
107
+ },
108
+ },
106
109
  };
107
- this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
110
+ this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
108
111
  that.vxeOption = opts;
109
112
  });
110
113
  },
111
- }
114
+ },
112
115
  };
113
- export default modules
116
+ export default modules;