bri-components 1.3.23 → 1.3.25

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,6 +1,6 @@
1
1
  {
2
2
  "name": "bri-components",
3
- "version": "1.3.23",
3
+ "version": "1.3.25",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -375,7 +375,7 @@
375
375
  margin-right: 3px;
376
376
  position: relative;
377
377
  border-radius: @borderRadius;
378
-
378
+ text-align: center;
379
379
  &:hover {
380
380
  .item-action {
381
381
  display: flex !important;
@@ -109,12 +109,16 @@
109
109
  shortcuts: [],
110
110
  disabledDate: (date) => {
111
111
  const resultObj = this.$validateComparedRule(
112
- [this.selfPropsObj],
112
+ [{
113
+ ...this.selfPropsObj,
114
+ _isCompareByParent: true
115
+ }],
113
116
  {
114
117
  ...this.value,
115
118
  [this.controlKey]: this.$transformDate(date, "/", this.subType)
116
119
  },
117
- this.allFormList
120
+ this.selfPropsObj._isCompareByParent === true ? this.parentFormList : this.allFormList,
121
+ this.selfPropsObj._isCompareByParent === true ? this.parentObj : undefined
118
122
  );
119
123
  return !resultObj.bool;
120
124
  }
@@ -16,8 +16,6 @@ export default {
16
16
  return {};
17
17
  }
18
18
  },
19
-
20
- /* 表单形式下用到的 */
21
19
  // 暂时是dshDate里在用,时间对比时需要用其他时间字段
22
20
  allFormList: {
23
21
  type: Array,
@@ -25,13 +23,26 @@ export default {
25
23
  return [];
26
24
  }
27
25
  },
28
- /* 列表形式下用到的 */
26
+
27
+ /* 内部表,层级表内的字段用到的 */
29
28
  rowIndex: Number,
30
29
  parentListData: {
31
30
  type: Array,
32
31
  default () {
33
32
  return [];
34
33
  }
34
+ },
35
+ parentFormList: {
36
+ type: Array,
37
+ default () {
38
+ return [];
39
+ }
40
+ },
41
+ parentObj: {
42
+ type: Object,
43
+ default () {
44
+ return {};
45
+ }
35
46
  }
36
47
  },
37
48
  data () {
@@ -60,11 +71,12 @@ export default {
60
71
  return this.value[this.controlKey];
61
72
  },
62
73
  set (val) {
63
- this.value[this.controlKey] = val;
64
74
  // 修复文本框clear后值为undefined,后端无法更新保存数据bug
65
75
  if (["select"].includes(this.controlType) && this.value[this.controlKey] === undefined) {
66
- this.value[this.controlKey] = "";
76
+ val = "";
67
77
  }
78
+
79
+ this.$set(this.value, this.controlKey, val);
68
80
  this.change();
69
81
  }
70
82
  },
@@ -16,14 +16,30 @@
16
16
  <template v-else>
17
17
  <!-- 配置端 设置默认值用-->
18
18
  <dsh-btn-modal v-if="propsObj._key === '_default'">
19
- <dsh-cascader-table
20
- :canEdit="finalCanEdit"
21
- :treeColumns="treeColumns"
22
- :subColumns="subColumns"
23
- :data="curVal"
24
- :propsObj="propsObj"
25
- @change="change"
26
- ></dsh-cascader-table>
19
+ <template>
20
+ <dsh-tree-table
21
+ v-if="showMode === 'treeTable'"
22
+ :canEdit="finalCanEdit"
23
+ :data="curVal.tree"
24
+ :rowDefault="curVal.rowDefault"
25
+ :columns="subForm"
26
+ :propsObj="propsObj"
27
+ :parentFormList="allFormList"
28
+ :parentObj="value"
29
+ @change="change"
30
+ ></dsh-tree-table>
31
+ <dsh-cascader-table
32
+ v-else
33
+ :canEdit="finalCanEdit"
34
+ :data="curVal"
35
+ :treeColumns="treeColumns"
36
+ :subColumns="subForm"
37
+ :propsObj="propsObj"
38
+ :parentFormList="allFormList"
39
+ :parentObj="value"
40
+ @change="change"
41
+ ></dsh-cascader-table>
42
+ </template>
27
43
  </dsh-btn-modal>
28
44
 
29
45
  <!-- 正常使用 -->
@@ -36,32 +52,65 @@
36
52
  @click="$dispatchEvent($event)"
37
53
  ></dsh-buttons>
38
54
 
39
- <dsh-cascader-table
40
- ref="dshCascaderTable"
41
- useCol
42
- :canEdit="finalCanEdit"
43
- :treeColumns="treeColumns"
44
- :subColumns="subColumns"
45
- :data="curVal"
46
- :propsObj="propsObj"
47
- @change="change"
48
- ></dsh-cascader-table>
49
-
50
- <!-- 全屏查看 -->
51
- <dsh-modal
52
- v-model="isEnlarge"
53
- mode="custom"
54
- :propsObj="modalPropsObj"
55
- >
55
+ <template>
56
+ <dsh-tree-table
57
+ v-if="showMode === 'treeTable'"
58
+ ref="table"
59
+ :canEdit="finalCanEdit"
60
+ :data="curVal.tree"
61
+ :rowDefault="curVal.rowDefault"
62
+ :columns="subForm"
63
+ :propsObj="propsObj"
64
+ :parentFormList="allFormList"
65
+ :parentObj="value"
66
+ @change="change"
67
+ ></dsh-tree-table>
56
68
  <dsh-cascader-table
69
+ v-else
70
+ ref="table"
57
71
  useCol
58
72
  :canEdit="finalCanEdit"
59
- :treeColumns="treeColumns"
60
- :subColumns="subColumns"
61
73
  :data="curVal"
74
+ :treeColumns="treeColumns"
75
+ :subColumns="subForm"
62
76
  :propsObj="propsObj"
77
+ :parentFormList="allFormList"
78
+ :parentObj="value"
63
79
  @change="change"
64
80
  ></dsh-cascader-table>
81
+ </template>
82
+
83
+ <!-- 全屏查看 -->
84
+ <dsh-modal
85
+ v-model="isEnlarge"
86
+ mode="custom"
87
+ :propsObj="modalPropsObj"
88
+ >
89
+ <template>
90
+ <dsh-tree-table
91
+ v-if="showMode === 'treeTable'"
92
+ :canEdit="finalCanEdit"
93
+ :data="curVal.tree"
94
+ :rowDefault="curVal.rowDefault"
95
+ :columns="subForm"
96
+ :propsObj="propsObj"
97
+ :parentFormList="allFormList"
98
+ :parentObj="value"
99
+ @change="change"
100
+ ></dsh-tree-table>
101
+ <dsh-cascader-table
102
+ v-else
103
+ useCol
104
+ :canEdit="finalCanEdit"
105
+ :data="curVal"
106
+ :treeColumns="treeColumns"
107
+ :subColumns="subForm"
108
+ :propsObj="propsObj"
109
+ :parentFormList="allFormList"
110
+ :parentObj="value"
111
+ @change="change"
112
+ ></dsh-cascader-table>
113
+ </template>
65
114
  </dsh-modal>
66
115
  </template>
67
116
  </template>
@@ -70,8 +119,9 @@
70
119
 
71
120
  <script>
72
121
  import controlMixin from "../mixins/controlMixin.js";
73
- import DshBtnModal from "../../small/DshBtnModal.vue";
74
122
  import DshCascaderTable from "../../list/DshCascaderTable.vue";
123
+ import DshTreeTable from "../../list/DshTreeTable.vue";
124
+ import DshBtnModal from "../../small/DshBtnModal.vue";
75
125
 
76
126
  export default {
77
127
  name: "cascaderTable",
@@ -79,8 +129,9 @@
79
129
  controlMixin
80
130
  ],
81
131
  components: {
82
- DshBtnModal,
83
- DshCascaderTable
132
+ DshCascaderTable,
133
+ DshTreeTable,
134
+ DshBtnModal
84
135
  },
85
136
  props: {},
86
137
  data () {
@@ -109,16 +160,30 @@
109
160
  };
110
161
  },
111
162
  computed: {
163
+ selfPropsObj () {
164
+ return {
165
+ _showMode: "default", // "default", "treeTable"
166
+ _subForm: [],
167
+ _treeForm: [],
168
+ _isExport: false,
169
+ ...this.propsObj
170
+ };
171
+ },
172
+ showMode () {
173
+ return this.propsObj._showMode;
174
+ },
175
+ subForm () {
176
+ return this.propsObj._subForm;
177
+ },
178
+ treeForm () {
179
+ return this.propsObj._treeForm;
180
+ },
112
181
  // 用户态的每条数据的表头配置,都是存的自己的,不用通用配置_treeForm的
113
182
  treeColumns () {
114
183
  return this.curVal && this.curVal._treeForm
115
184
  ? this.curVal._treeForm
116
- : this.propsObj._treeForm;
185
+ : this.treeForm;
117
186
  },
118
- subColumns () {
119
- return this.propsObj._subForm;
120
- },
121
-
122
187
  operationBtns () {
123
188
  return this.propsObj._isExport
124
189
  ? ["canExport", "canEnlarge"]
@@ -126,7 +191,7 @@
126
191
  },
127
192
  modalPropsObj () {
128
193
  return {
129
- title: this.propsObj._name,
194
+ title: this.controlName,
130
195
  fullscreen: true,
131
196
  showSlotClose: false,
132
197
  closable: true
@@ -141,7 +206,7 @@
141
206
  methods: {
142
207
  // 校验方法 -供外部使用
143
208
  validate () {
144
- return this.$refs.dshCascaderTable.validate();
209
+ return this.$refs.table.validate();
145
210
  },
146
211
 
147
212
  // 点击导出
@@ -24,11 +24,12 @@
24
24
  <dsh-btn-modal v-if="propsObj._key === '_default'">
25
25
  <dsh-flat-table
26
26
  :canEdit="finalCanEdit"
27
- :columns="columns"
28
27
  :data="curVal.list"
29
28
  :rowDefault="curVal.rowDefault"
30
- :parentObj="value"
29
+ :columns="columns"
31
30
  :propsObj="propsObj"
31
+ :parentFormList="allFormList"
32
+ :parentObj="value"
32
33
  @change="change"
33
34
  ></dsh-flat-table>
34
35
  </dsh-btn-modal>
@@ -46,12 +47,13 @@
46
47
  <dsh-flat-table
47
48
  ref="dshFatTable"
48
49
  :canEdit="finalCanEdit"
49
- :columns="columns"
50
50
  :data="curVal.list"
51
51
  :oldData="curVal.oldList"
52
52
  :rowDefault="curVal.rowDefault"
53
- :parentObj="value"
53
+ :columns="columns"
54
54
  :propsObj="propsObj"
55
+ :parentFormList="allFormList"
56
+ :parentObj="value"
55
57
  @change="change"
56
58
  ></dsh-flat-table>
57
59
 
@@ -63,12 +65,13 @@
63
65
  >
64
66
  <dsh-flat-table
65
67
  :canEdit="finalCanEdit"
66
- :columns="columns"
67
68
  :data="curVal.list"
68
69
  :oldData="curVal.oldList"
69
70
  :rowDefault="curVal.rowDefault"
70
- :parentObj="value"
71
+ :columns="columns"
71
72
  :propsObj="propsObj"
73
+ :parentFormList="allFormList"
74
+ :parentObj="value"
72
75
  @change="change"
73
76
  ></dsh-flat-table>
74
77
  </dsh-modal>
@@ -198,6 +201,9 @@
198
201
  },
199
202
  // 导出点击
200
203
  clickExport (operationItem) {
204
+ if (operationItem.disabled || this.timer) {
205
+ return;
206
+ }
201
207
  operationItem.disabled = true;
202
208
  this.$https({
203
209
  url: {
@@ -235,9 +241,11 @@
235
241
  callback: data => {
236
242
  if (data.status === "completed") {
237
243
  clearInterval(this.timer);
244
+ this.timer = null;
238
245
  window.location.href = data.url;
239
246
  } else if (data.status === "failed") {
240
247
  clearInterval(this.timer);
248
+ this.timer = null;
241
249
  // this.exportBtnLoading = false;
242
250
  this.$Message.info({ content: "操作失败,请稍后再试" });
243
251
  }
@@ -27,6 +27,10 @@
27
27
  :formData="formData"
28
28
  :formItem="formItem"
29
29
  :allFormList="allFormList"
30
+ :rowIndex="rowIndex"
31
+ :parentListData="parentListData"
32
+ :parentFormList="parentFormList"
33
+ :parentObj="parentObj"
30
34
  :changedFields="changedFields"
31
35
  :height="height"
32
36
  :rowStyle="rowStyle"
@@ -123,13 +127,33 @@
123
127
  return [];
124
128
  }
125
129
  },
126
-
127
130
  allFormList: {
128
131
  type: Array,
129
132
  default () {
130
133
  return [];
131
134
  }
132
135
  },
136
+
137
+ rowIndex: Number,
138
+ parentListData: {
139
+ type: Array,
140
+ default () {
141
+ return [];
142
+ }
143
+ },
144
+ parentFormList: {
145
+ type: Array,
146
+ default () {
147
+ return [];
148
+ }
149
+ },
150
+ parentObj: {
151
+ type: Object,
152
+ default () {
153
+ return {};
154
+ }
155
+ },
156
+
133
157
  changedFields: {
134
158
  type: Array,
135
159
  default () {
@@ -102,14 +102,12 @@
102
102
  }
103
103
  return className;
104
104
  },
105
-
106
105
  rowStyleOption () {
107
106
  return {
108
107
  clickHighlight: false,
109
108
  ...(this.propsObj.rowStyleOption || {})
110
109
  };
111
110
  },
112
-
113
111
  cellStyleOption () {
114
112
  return {
115
113
  headerCellClass: () => {
@@ -6,7 +6,6 @@
6
6
  ref="list"
7
7
  :data="data"
8
8
  :columns="columns"
9
- :fixTitle="fixTitle"
10
9
  :ownColumns="ownColumns"
11
10
  :operationList="dropdownOperationList"
12
11
  :extraOperationList="extraOperationList"
@@ -83,13 +82,24 @@
83
82
  return ["table", "crossTable", "panel", "card", "list", "singleData"].includes(val);
84
83
  }
85
84
  },
86
-
87
- fixTitle: {
88
- type: Boolean,
89
- default: true
85
+ data: {
86
+ type: Array,
87
+ default () {
88
+ return [];
89
+ }
90
+ },
91
+ ownColumns: {
92
+ type: Array,
93
+ default () {
94
+ return [];
95
+ }
96
+ },
97
+ columns: {
98
+ type: Array,
99
+ default () {
100
+ return [];
101
+ }
90
102
  },
91
- data: Array,
92
- columns: Array,
93
103
  changedFields: {
94
104
  type: Array,
95
105
  default () {
@@ -103,10 +113,10 @@
103
113
  }
104
114
  },
105
115
  listPropsObj: Object,
116
+
106
117
  pageMode: String,
107
118
  total: Number,
108
- pagePropsObj: Object,
109
- ownColumns: Array
119
+ pagePropsObj: Object
110
120
  },
111
121
  data () {
112
122
  return {};
@@ -141,7 +141,7 @@
141
141
 
142
142
  <!-- 操作 -->
143
143
  <div
144
- v-if="operationCol && selfPropsObj.showAction"
144
+ v-if="operationColumn && selfPropsObj.showAction"
145
145
  class="DshCrossTable-left-footer"
146
146
  >
147
147
  <table
@@ -155,7 +155,7 @@
155
155
  background: '#f4f4f4'
156
156
  }"
157
157
  >
158
- <div class="td-content">操作</div>
158
+ <div class="td-content">{{ operationColumn.title }}</div>
159
159
  </td>
160
160
  </tr>
161
161
  </table>
@@ -317,7 +317,7 @@
317
317
 
318
318
  <!-- 操作 -->
319
319
  <div
320
- v-if="operationCol && selfPropsObj.showAction"
320
+ v-if="operationColumn && selfPropsObj.showAction"
321
321
  class="DshCrossTable-right-footer"
322
322
  >
323
323
  <table
@@ -340,7 +340,7 @@
340
340
  <dsh-list-render
341
341
  :row="dataItem"
342
342
  :index="dataIndex"
343
- :render="operationCol.renderBodyCell"
343
+ :render="operationColumn.renderBodyCell"
344
344
  ></dsh-list-render>
345
345
  </div>
346
346
  </td>
@@ -422,13 +422,14 @@
422
422
  };
423
423
  },
424
424
  columnList () {
425
- return this.columns.filter(item => item.type !== "operation");
425
+ return this.columns;
426
426
  },
427
- operationCol () {
427
+ operationColumn () {
428
428
  return {
429
429
  title: "操作",
430
- _name: "操作",
431
- type: "expend",
430
+ _key: "__operation__",
431
+ key: "__operation__",
432
+ field: "__operation__",
432
433
  width: 150,
433
434
  renderBodyCell: (params, h) => {
434
435
  return this.operationList.length < 3