bri-components 1.3.68 → 1.3.70

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.68",
3
+ "version": "1.3.70",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -1,6 +1,10 @@
1
1
  <template>
2
2
  <div
3
3
  class="DshControlInput"
4
+ :style="{
5
+ height: heightAuto ? 'auto' : '32px',
6
+ minHeight: heightAuto ? '32px' : undefined,
7
+ }"
4
8
  @mouseenter="isHover = true"
5
9
  @mouseleave="isHover = false"
6
10
  >
@@ -11,6 +15,10 @@
11
15
  <dsh-tags
12
16
  v-if="Array.isArray(value)"
13
17
  class="overflow"
18
+ :class="{
19
+ overflow: true,
20
+ 'overflow-auto': heightAuto
21
+ }"
14
22
  :list="value"
15
23
  :propsObj="{
16
24
  disabled: disabled,
@@ -65,11 +73,16 @@
65
73
  export default {
66
74
  name: "DshControlInput",
67
75
  props: {
76
+ value: [Array, Object, String],
77
+
78
+ heightAuto: {
79
+ type: Boolean,
80
+ default: false
81
+ },
68
82
  disabled: {
69
83
  type: Boolean,
70
84
  default: false
71
85
  },
72
- value: [Array, Object, String],
73
86
  propsObj: {
74
87
  type: Object,
75
88
  default () {
@@ -101,7 +114,6 @@
101
114
 
102
115
  <style lang="less" scoped>
103
116
  .DshControlInput {
104
- height: 32px;
105
117
  padding: 0px 0px 0px 7px;
106
118
  line-height: 24px;
107
119
  .dsh-flex-row-between-center();
@@ -117,6 +129,11 @@
117
129
  overflow-x: auto;
118
130
  overflow-y: hidden;
119
131
  white-space: nowrap;
132
+
133
+ &-auto {
134
+ height: auto;
135
+ white-space: normal;
136
+ }
120
137
  }
121
138
 
122
139
  .placeholder {
@@ -88,6 +88,7 @@
88
88
  :class="commonClass"
89
89
  :value="curValNameList"
90
90
  :disabled="inputPropsObj._disabled"
91
+ :heightAuto="isHeightAuto"
91
92
  :propsObj="inputPropsObj"
92
93
  @deleteItem="clickDeleteItem"
93
94
  @clear="clickClear"
@@ -119,7 +119,7 @@
119
119
  const curDateStr = this.$transformDate(date, "/", this.subType);
120
120
 
121
121
  // 日期字段的对比
122
- const compareResult = this.$validateComparedRuleFunc(
122
+ const compareResult = this.$normalComparedFunc(
123
123
  this.selfPropsObj,
124
124
  {
125
125
  ...this.value,
@@ -14,18 +14,21 @@ export default {
14
14
  basePropsObj () {
15
15
  const _joinSymbol = this.propsObj._joinSymbol || "/";
16
16
  return {
17
+ _saveKey: "_key",
18
+ _valueKey: "code",
19
+ _nameKey: "name",
20
+
17
21
  _regionType: "default", // "default", "benji", "userIndustry"
18
22
  _showMode: "default", // "default", "custom", "simple"
19
23
  colorMap: resourceData.colorMap,
20
24
  _useColor: false,
21
- _saveKey: "_key",
22
- _valueKey: "code",
23
- _nameKey: "name",
24
25
  _filterable: true, // 是否支持搜索
25
- _data: [],
26
+ _cascaderLevel: undefined, // 级联数据取到第几级
26
27
  _reverseFilter: false, // 是否反向过滤,默认正向过滤
27
- _cascaderFilterVals: [], // 过滤的级联数据
28
+ _cascaderFilterVals: [], // 过滤的数据的第一级选项
29
+ _cascaderSelectVals: [], // 过滤的数据的级联选项
28
30
  _renderFormat: (labels) => labels.join(_joinSymbol),
31
+ _data: [],
29
32
 
30
33
  ...this.propsObj,
31
34
  ...this.commonDealPropsObj,
@@ -36,6 +39,16 @@ export default {
36
39
  _joinSymbol: _joinSymbol // 级联拼接符
37
40
  };
38
41
  },
42
+ saveKey () {
43
+ return this.selfPropsObj._saveKey;
44
+ },
45
+ valueKey () {
46
+ return this.selfPropsObj._valueKey;
47
+ },
48
+ nameKey () {
49
+ return this.selfPropsObj._nameKey;
50
+ },
51
+
39
52
  regionType () {
40
53
  return this.selfPropsObj._regionType;
41
54
  },
@@ -48,24 +61,21 @@ export default {
48
61
  useColor () {
49
62
  return this.selfPropsObj._useColor;
50
63
  },
51
- saveKey () {
52
- return this.selfPropsObj._saveKey;
53
- },
54
- valueKey () {
55
- return this.selfPropsObj._valueKey;
56
- },
57
- nameKey () {
58
- return this.selfPropsObj._nameKey;
59
- },
64
+ // filterable () {
65
+ // return this.selfPropsObj._filterable;
66
+ // },
60
67
  cascaderLevel () {
61
68
  return this.selfPropsObj._cascaderLevel;
62
69
  },
63
70
  reverseFilter () {
64
71
  return this.selfPropsObj._reverseFilter;
65
72
  },
66
- cascaderFilterVals () {
73
+ filterVals () {
67
74
  return this.selfPropsObj._cascaderFilterVals;
68
75
  },
76
+ cascaderVals () {
77
+ return this.selfPropsObj._cascaderSelectVals;
78
+ },
69
79
  renderFormat () {
70
80
  return this.selfPropsObj._renderFormat;
71
81
  },
@@ -80,51 +90,79 @@ export default {
80
90
  : this.selfPropsObj._data;
81
91
  },
82
92
  cascaderAllData () {
83
- const loop = (arr = [], level, parentKeys = [], filterVals = [], isMobile = false) => {
84
- if (filterVals.length) {
85
- arr = arr.filter(item =>
86
- this.reverseFilter
87
- ? !filterVals.includes(item[this.saveKey])
88
- : filterVals.includes(item[this.saveKey])
89
- );
90
- }
93
+ const loop = (arr = [], level, parentKeys = [], filterVals = [], cascaderVals = [], reverseFilter = false, isMobile = false, saveKey = "_key", valueKey = "code", nameKey = "name") => {
94
+ arr = cascaderVals.length
95
+ ? arr.filter(item => {
96
+ const itemKey = item[saveKey];
97
+ const keys = [...parentKeys, itemKey]; // !!此处就是用_key拼,不会用别的属性
91
98
 
92
- return arr
93
- ? arr.reduce((arr, item) => {
94
- let newItem = {
95
- keys: [...parentKeys, item[this.saveKey]], // !!此处就是用_key拼,不会用别的属性
96
- code: [...parentKeys, item._key].join(""),
97
- ...item
98
- };
99
- newItem = {
100
- ...newItem,
101
- value: newItem[this.valueKey],
102
- label: newItem[this.nameKey]
103
- };
99
+ return reverseFilter
100
+ ? !cascaderVals.some(valArr =>
101
+ keys.length < valArr.length
102
+ ? false
103
+ : valArr.every((valArrKey, index) => valArrKey === keys[index])
104
+ )
105
+ : cascaderVals.some(valArr =>
106
+ keys.length < valArr.length
107
+ ? keys.every((levelKey, index) => levelKey === valArr[index])
108
+ : valArr.every((valArrKey, index) => valArrKey === keys[index])
109
+ );
110
+ })
111
+ : filterVals.length
112
+ ? arr.filter(item => {
113
+ const itemKey = item[saveKey];
114
+
115
+ return reverseFilter
116
+ ? !filterVals.includes(itemKey)
117
+ : filterVals.includes(itemKey);
118
+ })
119
+ : arr;
120
+
121
+ return arr.reduce((newArr, item) => {
122
+ const itemKey = item[saveKey];
123
+ const keys = [...parentKeys, itemKey]; // !!此处就是用_key拼,不会用别的属性
124
+ let newItem = {
125
+ keys: keys,
126
+ code: keys.join(""),
127
+ ...item
128
+ };
129
+ newItem = {
130
+ ...newItem,
131
+ value: newItem[valueKey],
132
+ label: newItem[nameKey]
133
+ };
134
+
135
+ if (
136
+ (!level || level > newItem.level) &&
137
+ (newItem.children && newItem.children.length)
138
+ ) {
139
+ newItem.children = loop(newItem.children, level, newItem.keys, [], cascaderVals, reverseFilter, isMobile, saveKey, valueKey, nameKey);
104
140
 
105
- if (
106
- (!level || level > newItem.level) &&
107
- (newItem.children && newItem.children.length)
108
- ) {
141
+ if (newItem.children.length) {
109
142
  newItem.loading = false; // 此代码pc端在用:为了所请求的级,出现继续加载的箭头图标
110
- newItem.children = loop(newItem.children, level, newItem.keys, undefined, isMobile);
143
+ newItem.isLeaf = false;
111
144
  } else {
112
145
  newItem.children = isMobile ? undefined : [];
113
146
  newItem.isLeaf = true;
114
147
  }
115
- arr.push(newItem);
148
+ } else {
149
+ newItem.children = isMobile ? undefined : [];
150
+ newItem.isLeaf = true;
151
+ }
116
152
 
117
- return arr;
118
- }, [])
119
- : [];
153
+ return [
154
+ ...newArr,
155
+ newItem
156
+ ];
157
+ }, []);
120
158
  };
121
159
 
122
- return loop(this.originData, this.cascaderLevel, undefined, this.cascaderFilterVals, this.isMobile);
160
+ return loop(this.originData, this.cascaderLevel, [], this.filterVals, this.cascaderVals, this.reverseFilter, this.isMobile, this.saveKey, this.valueKey, this.nameKey);
123
161
  },
124
162
  cascaderData () {
125
163
  const loop = (arr = [], isMobile) => {
126
164
  return arr
127
- ? arr.reduce((arr, item) => {
165
+ ? arr.reduce((newArr, item) => {
128
166
  if (item.rm !== 1) {
129
167
  let newItem = {
130
168
  ...item
@@ -132,13 +170,20 @@ export default {
132
170
 
133
171
  if (newItem.children && newItem.children.length) {
134
172
  newItem.children = loop(newItem.children, isMobile);
173
+
174
+ if (newItem.children.length) {
175
+ // 无需处理
176
+ } else {
177
+ newItem.children = isMobile ? undefined : [];
178
+ }
135
179
  } else {
136
180
  newItem.children = isMobile ? undefined : [];
137
181
  }
138
- arr.push(newItem);
182
+
183
+ newArr.push(newItem);
139
184
  }
140
185
 
141
- return arr;
186
+ return newArr;
142
187
  }, [])
143
188
  : [];
144
189
  };
@@ -29,6 +29,9 @@
29
29
  </div>
30
30
  </div>
31
31
 
32
+ <!-- 各种模态框共用 -->
33
+ <dsh-render :render="dshRender"></dsh-render>
34
+
32
35
  <!-- 全屏查看 -->
33
36
  <dsh-modal
34
37
  class="DshCasTable-fullscreen"
@@ -24,6 +24,9 @@
24
24
  <!-- 添加行 -->
25
25
  <dsh-render :render="createOperationRender"></dsh-render>
26
26
 
27
+ <!-- 各种模态框共用 -->
28
+ <dsh-render :render="dshRender"></dsh-render>
29
+
27
30
  <!-- 全屏模式 -->
28
31
  <dsh-modal
29
32
  class="DshFlatTable-fullscreen"
@@ -56,9 +59,6 @@
56
59
  <dsh-render :render="createOperationRender"></dsh-render>
57
60
  </div>
58
61
  </dsh-modal>
59
-
60
- <!-- 各种模态框共用 -->
61
- <dsh-render :render="dshRender"></dsh-render>
62
62
  </div>
63
63
  </template>
64
64
 
@@ -24,6 +24,9 @@
24
24
  <!-- 添加行 -->
25
25
  <dsh-render :render="createOperationRender"></dsh-render>
26
26
 
27
+ <!-- 各种模态框共用 -->
28
+ <dsh-render :render="dshRender"></dsh-render>
29
+
27
30
  <!-- 全屏模式 -->
28
31
  <dsh-modal
29
32
  class="DshTreeTable-fullscreen"
@@ -56,9 +59,6 @@
56
59
  <dsh-render :render="createOperationRender"></dsh-render>
57
60
  </div>
58
61
  </dsh-modal>
59
-
60
- <!-- 各种模态框共用 -->
61
- <dsh-render :render="dshRender"></dsh-render>
62
62
  </div>
63
63
  </template>
64
64
 
@@ -170,13 +170,14 @@
170
170
  });
171
171
  },
172
172
  handleUpload () {
173
- this.loadingStatus = true;
174
173
  let formData = new FormData();
175
174
  formData.append("file_stream", this.file);
176
175
  formData.append("modKey", this.modKey);
177
- formData.append("importType", "flatTable");
178
- this.importParams._key && formData.append("_key", this.importParams._key);
179
- this.importParams._id && formData.append("_id", this.importParams._id);
176
+
177
+ Object.entries(this.importParams).forEach(arr => {
178
+ formData.append(arr[0], arr[1]);
179
+ });
180
+
180
181
  this.$https({
181
182
  url: {
182
183
  module: "sheet",
@@ -186,18 +187,17 @@
186
187
  content: {
187
188
  headers: { "Content-Type": "multipart/form-data" }
188
189
  },
190
+ loadingName: "loadingStatus",
191
+ successTip: "导入成功!",
189
192
  callback: data => {
190
- this.$Message.success("导入成功");
193
+ this.showModal = false;
191
194
  this.file = null;
192
- this.loadingStatus = false;
195
+
193
196
  this.$emit("importCb", data);
194
- this.showModal = false;
195
197
  },
196
198
  error: data => {
197
199
  this.$Message.error("导入失败:" + data.msg);
198
200
  this.file = null;
199
- this.file = null;
200
- this.loadingStatus = false;
201
201
  }
202
202
  });
203
203
  },
@@ -7,7 +7,7 @@ export default {
7
7
  },
8
8
  computed: {
9
9
  allListData () {
10
- console.log("allListData");
10
+ // console.log("allListData");
11
11
  this.data.forEach(item => {
12
12
  !item._id && this.$set(item, "_id", this.$ObjectID().str);
13
13
 
@@ -20,7 +20,6 @@ export default {
20
20
  item.__isSearchShow__ = false;
21
21
  });
22
22
 
23
- console.log(this.initFlag);
24
23
  this.initFlag = false;
25
24
  return this.data;
26
25
  },
@@ -22,31 +22,31 @@ export default {
22
22
  },
23
23
 
24
24
  allTreeData () {
25
- console.log("allTreeData");
25
+ // console.log("allTreeData");
26
26
  return this.getCalcuedTree(this.data, this.columns);
27
27
  },
28
28
  allListData () {
29
- console.log("allListData");
29
+ // console.log("allListData");
30
30
  return this.$getTreeFlatArr(this.allTreeData);
31
31
  },
32
32
  footerData () {
33
- console.log("footerData");
33
+ // console.log("footerData");
34
34
  return this.isSearching
35
35
  ? []
36
36
  : this.useSummary && this.allListData.length
37
37
  ? [
38
- this.filterColumns.reduce((obj, col) => {
38
+ this.filterColumns.reduce((obj, column) => {
39
39
  return {
40
40
  ...obj,
41
- [col._key]: col._type === "number" && ![undefined, null, "", "no"].includes(col._summaryType)
41
+ [column._key]: column._type === "number" && ![undefined, null, "", "no"].includes(column._summaryType)
42
42
  ? this.$calNumList(
43
43
  this.allListData
44
44
  .filter(item => item.level === 1)
45
- .map(item => item[col._key]),
46
- col._summaryType,
47
- { ...col, _defaultDigit: 2 }
45
+ .map(item => item[column._key]),
46
+ column._summaryType,
47
+ { ...column, _defaultDigit: 2 }
48
48
  )
49
- : (obj[col._key] || "--")
49
+ : (obj[column._key] || "--")
50
50
  };
51
51
  }, {
52
52
  _id: this.$ObjectID().str,
@@ -76,11 +76,11 @@ export default {
76
76
  ? row.__isSearchShow__ === false
77
77
  ? " bri-table-td-hide"
78
78
  : ""
79
- : row.__isShow__ === false
80
- ? " bri-table-td-hide"
81
- : this.isExpandAction
79
+ : row.__isShow__ === true
80
+ ? this.isExpandAction
82
81
  ? " bri-table-td-visible"
83
82
  : ""
83
+ : " bri-table-td-hide"
84
84
  }` +
85
85
  `${["__isExpand__"].includes(column._key)
86
86
  ? " bri-table-td-expand"
@@ -155,7 +155,7 @@ export default {
155
155
  return [
156
156
  h("div", {
157
157
  style: {
158
- paddingLeft: `${(row.level - 1) * 18}px`,
158
+ paddingLeft: `${(row.level - 1) * 18} px`,
159
159
  fontWeight: "500"
160
160
  }
161
161
  }, row.__treeIndex__),
@@ -214,7 +214,6 @@ export default {
214
214
  // 展开/隐藏节点
215
215
  toggleExpand (row, bool = true) {
216
216
  this.isExpandAction = true;
217
- // row.__isExpand__ = bool;
218
217
  this.$set(row, "__isExpand__", bool);
219
218
 
220
219
  this.toggleDescendantsShow(row, bool);
@@ -268,21 +267,18 @@ export default {
268
267
  getCalcuedTree (treeData = [], columns = []) {
269
268
  const loop = (list = [], parentRow) =>
270
269
  list.forEach((row) => {
271
- // 递归到叶子节点前 从上往下要处理的
272
- columns.reduce((newRow, col) => {
273
- const isNumberSummary = col._type === "number" && ![undefined, null, "", "no"].includes(col._summaryType);
274
- const isDateSummary = col._type === "date" && ![undefined, null, ""].includes(col._writeSort);
275
-
276
- if (isNumberSummary || isDateSummary) {
277
- const val = isNumberSummary
278
- ? newRow[col._key]
279
- : ["downToUp"].includes(col._writeSort)
280
- ? newRow[col._key]
281
- : !parentRow || parentRow[col._key]
282
- ? newRow[col._key]
283
- : undefined;
270
+ // 递归到叶子节点前 从上往下执行 要处理的
271
+ columns.reduce((newRow, column) => {
272
+ if (
273
+ ["number", "date"].includes(column._type) &&
274
+ ["upToDown"].includes(column._writeSort)
275
+ ) {
276
+ // 第一级的和父级有值的,否则置空
277
+ const val = parentRow && !parentRow[column._key]
278
+ ? this.$deepCopy(this.initDftValMap[column._type])
279
+ : newRow[column._key];
284
280
 
285
- this.$set(newRow, col._key, val);
281
+ this.$set(newRow, column._key, val);
286
282
  }
287
283
 
288
284
  return newRow;
@@ -292,34 +288,54 @@ export default {
292
288
  row.isLeaf = false;
293
289
  loop(row.children, row);
294
290
 
295
- // 递归到叶子节点后 从下往上要处理的
296
- columns.reduce((newRow, col) => {
297
- const isNumberSummary = col._type === "number" && ![undefined, null, "", "no"].includes(col._summaryType);
298
- const isDateSummary = col._type === "date" && ![undefined, null, ""].includes(col._writeSort);
291
+ // 递归到叶子节点后到 从下往上执行 要处理的(非叶子节点)
292
+ columns.reduce((newRow, column) => {
293
+ // if (
294
+ // ["number", "date"].includes(column._type) &&
295
+ // ["downToUp"].includes(column._writeSort)
296
+ // ) {
297
+ // // 第一级的和父级有值的,否则置空
298
+ // const val = newRow[column._key];
299
+
300
+ // this.$set(newRow, column._key, val);
301
+ // }
299
302
 
300
- if (isNumberSummary || isDateSummary) {
301
- const val = isNumberSummary
303
+ if (
304
+ ["number", "date"].includes(column._type) &&
305
+ ![undefined, null, "", "no"].includes(column._summaryType)
306
+ ) {
307
+ const val = ["number"].includes(column._type)
302
308
  ? this.$calNumList(
303
- newRow.children.map(subRow => subRow[col._key]),
304
- col._summaryType,
305
- { ...col, _defaultDigit: 2 },
309
+ newRow.children.map(subRow => subRow[column._key]),
310
+ column._summaryType,
311
+ { ...column, _defaultDigit: 2 },
306
312
  false
307
313
  )
308
- : ["downToUp"].includes(col._writeSort)
309
- ? this.$calDateList(
310
- newRow.children.map(subRow => subRow[col._key]),
311
- col._compareOperator,
312
- col._dateType
313
- )
314
- : newRow[col._key];
314
+ : this.$calDateList(
315
+ newRow.children.map(subRow => subRow[column._key]),
316
+ column._summaryType,
317
+ column._dateType
318
+ );
315
319
 
316
- this.$set(newRow, col._key, val);
320
+ this.$set(newRow, column._key, val);
317
321
  }
318
322
 
319
323
  return newRow;
320
324
  }, row);
321
325
  } else {
322
326
  row.isLeaf = true;
327
+
328
+ // 递归到叶子节点前 从上往下执行 要处理的(叶子节点)
329
+ columns.reduce((newRow, column) => {
330
+ if (
331
+ ["number", "date"].includes(column._type) &&
332
+ ![undefined, null, "", "no"].includes(column._summaryType)
333
+ ) {
334
+ this.$set(newRow, column._key, newRow[column._key]);
335
+ }
336
+
337
+ return newRow;
338
+ }, row);
323
339
  }
324
340
 
325
341
  // 初次进来把前端存的状态值全部清除(除了__readonly__)
@@ -329,6 +345,7 @@ export default {
329
345
  });
330
346
 
331
347
  row.__old__ = true; // 老的数据都打上标记 尽管不一定会用
348
+
332
349
  // row.__isExpand__ = false;
333
350
  // row.__isSearchShow__ = false;
334
351
  // 第一级的需要显示出来
@@ -282,6 +282,9 @@ export default {
282
282
  hideColKeys () {
283
283
  return this.selfPropsObj._hideColKeys || [];
284
284
  },
285
+ searchLabelWidth () {
286
+ return this.selfPropsObj._searchLabelWidth;
287
+ },
285
288
  searchList () {
286
289
  return this.selfPropsObj._searchList || []; // 级联表切层级表时 值会undefined覆盖selfPropsObj默认的[]
287
290
  },
@@ -291,6 +294,14 @@ export default {
291
294
  searchListFields () {
292
295
  return this.searchList.map(searchItem => searchItem._key);
293
296
  },
297
+ searchFormList () {
298
+ return this.$filterList(this.searchListFields, this.columns).map(formItem => ({
299
+ ...formItem,
300
+ ...this.searchListMap[formItem._key],
301
+ _name: formItem._name
302
+ }));
303
+ },
304
+
294
305
  tableAdvSearch () {
295
306
  return this.$transformAdvSearch(this.selfPropsObj._tableAdvSearch, this.allFormList, this.parentObj);
296
307
  },
@@ -316,16 +327,6 @@ export default {
316
327
  isSearching () {
317
328
  return this.$isAdvSearching(this.finalTableAdvSearch);
318
329
  },
319
- searchFormList () {
320
- return this.$filterList(this.searchListFields, this.columns).map(formItem => ({
321
- ...formItem,
322
- ...this.searchListMap[formItem._key],
323
- _name: formItem._name
324
- }));
325
- },
326
- searchLabelWidth () {
327
- return this.selfPropsObj._searchLabelWidth;
328
- },
329
330
  rowsNum () {
330
331
  return this.isSearching
331
332
  ? this.showListData.length
@@ -336,7 +337,7 @@ export default {
336
337
  },
337
338
 
338
339
  renderedListData () {
339
- console.log("renderedListData");
340
+ // console.log("renderedListData");
340
341
  return this.allListData.filter(row => {
341
342
  if (this.isSearching) {
342
343
  const bool = this.$isAdvRelyAccord(this.finalTableAdvSearch, row);
@@ -353,7 +354,7 @@ export default {
353
354
  });
354
355
  },
355
356
  showListData () {
356
- console.log("showListData");
357
+ // console.log("showListData");
357
358
  return this.renderedListData.filter(row =>
358
359
  this.isSearching
359
360
  ? !!row.__isSearchShow__
@@ -444,16 +445,19 @@ export default {
444
445
  importParams () {
445
446
  return {
446
447
  _id: this.parentDataId,
447
- _key: this.controlKey
448
+ _key: this.controlKey,
449
+ importType: this.controlType === "cascaderTable" && ["treeTable"].includes(this.selfPropsObj._showMode)
450
+ ? this.selfPropsObj._showMode
451
+ : this.controlType
448
452
  };
449
453
  },
450
454
 
451
455
  filterColumns () {
452
- console.log("filterColumns");
456
+ // console.log("filterColumns");
453
457
  return this.columns.filter(col => this.$isAdvRelyShow(col, this.allListData, this.parentObj, true));
454
458
  },
455
459
  contentColumns () {
456
- console.log("contentColumns");
460
+ // console.log("contentColumns");
457
461
  return this.filterColumns.map(colItem => ({
458
462
  filter: undefined,
459
463
  sortBy: undefined,
@@ -714,15 +718,26 @@ export default {
714
718
  // 引用回调
715
719
  quoteCb (dataObj) {
716
720
  if (dataObj) {
717
- const cb = () => {
718
- this.$Message.success("引用成功!");
719
- this.reset();
720
- this.selfReset && this.selfReset();
721
+ const fieldVal = dataObj[this.controlKey];
722
+ const isEmpty = this.$isEmptyData(fieldVal) || (
723
+ ["flatTable"].includes(this.controlType)
724
+ ? !fieldVal.list || !fieldVal.list.length
725
+ : ["cascaderTable"].includes(this.controlType)
726
+ ? !fieldVal.tree || !fieldVal.tree.length
727
+ : false
728
+ );
721
729
 
730
+ if (isEmpty) {
731
+ this.$Modal.confirm({
732
+ title: "提示",
733
+ content: "该数据下此内容为空,无法引用!",
734
+ onOk: () => { }
735
+ });
736
+ } else {
722
737
  if (["flatTable"].includes(this.controlType)) {
723
738
  this.parentObj[this.controlKey] = {
724
- ...dataObj[this.controlKey],
725
- list: dataObj[this.controlKey].list.map(item => ({
739
+ ...fieldVal,
740
+ list: fieldVal.list.map(item => ({
726
741
  ...item,
727
742
  __isQuote__: true
728
743
  }))
@@ -740,28 +755,15 @@ export default {
740
755
  };
741
756
 
742
757
  this.parentObj[this.controlKey] = {
743
- ...dataObj[this.controlKey],
744
- tree: transformData(dataObj[this.controlKey].tree)
758
+ ...fieldVal,
759
+ tree: transformData(fieldVal.tree)
745
760
  };
746
761
  }
747
762
 
763
+ this.$Message.success("引用成功!");
764
+ this.reset();
765
+ this.selfReset && this.selfReset();
748
766
  this.change("quote");
749
- };
750
-
751
- const isEmpty = this.$isEmptyData(dataObj[this.controlKey]) ||
752
- (["flatTable"].includes(this.controlType)
753
- ? !dataObj[this.controlKey].list || !dataObj[this.controlKey].list.length
754
- : ["cascaderTable"].includes(this.controlType)
755
- ? !dataObj[this.controlKey].tree || !dataObj[this.controlKey].tree.length
756
- : false);
757
- if (isEmpty) {
758
- this.$Modal.confirm({
759
- title: "提示",
760
- content: "该数据下此内容为空,无法引用!",
761
- onOk: () => { }
762
- });
763
- } else {
764
- cb();
765
767
  }
766
768
  } else {
767
769
  this.$Message.error("未选择引用数据!");
@@ -781,7 +783,7 @@ export default {
781
783
  props: {
782
784
  value: this.showImportModal,
783
785
  propsObj: this.propsObj,
784
- listParams: this.importParams
786
+ importParams: this.importParams
785
787
  },
786
788
  on: {
787
789
  input: bool => {
@@ -1017,22 +1019,14 @@ export default {
1017
1019
  // 列本身是否可编辑
1018
1020
  getColCanEdit (col, row) {
1019
1021
  return (
1020
- ["cascaderTable"].includes(this.controlType)
1021
- ? (
1022
- // 树形表格 -“需要计算的数字列 且 不是叶子行的”不可编辑(必须用isLeaf !== false判断,因为牵扯内部表格也在用)
1023
- ["number"].includes(col._type) && ![undefined, null, "", "no"].includes(col._summaryType)
1024
- ? row.isLeaf === true
1025
- : true
1026
- ) && (
1027
- // 树形表格 -“需要限制的日期列 且 不是叶子行的”不可编辑(必须用isLeaf !== false判断,因为牵扯内部表格也在用)
1028
- ["date"].includes(col._type)
1029
- ? ["downToUp"].includes(col._writeSort)
1030
- ? row.isLeaf === true
1031
- : ["upToDown"].includes(col._writeSort)
1032
- ? row.level === 1 || !!this.getParentNode(row, this.allTreeData)[col._key]
1033
- : true
1022
+ ["cascaderTable"].includes(this.controlType) && ["number", "date"].includes(col._type)
1023
+ ? ![undefined, null, "", "no"].includes(col._summaryType)
1024
+ ? row.isLeaf === true
1025
+ // : ["downToUp"].includes(col._writeSort)
1026
+ // ? row.isLeaf === true
1027
+ : ["upToDown"].includes(col._writeSort)
1028
+ ? row.level === 1 || !!this.getParentNode(row, this.allTreeData)[col._key]
1034
1029
  : true
1035
- )
1036
1030
  : true
1037
1031
  ) &&
1038
1032
  (col._oldReadonly ? row.__old__ !== true : true) && // 老数据行里某些列不可编辑