bri-components 1.4.2 → 1.4.3

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.4.2",
3
+ "version": "1.4.3",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -352,7 +352,8 @@
352
352
  if (
353
353
  ruleConfig.type &&
354
354
  (!ruleConfig.fields || Object.entries(ruleConfig.fields).every(arr => !arr[1].transform)) &&
355
- (!["date"].includes(formItem._type) || !["daterange", "datetimerange"].includes(formItem._dateType))
355
+ (!["date"].includes(formItem._type) || !["daterange", "datetimerange"].includes(formItem._dateType)) &&
356
+ (!["select", "checkbox"].includes(formItem._type)) // 考虑到选项用数字类型时,应该type: "number"
356
357
  ) {
357
358
  rules.push({
358
359
  message: `${formItem._name}数据格式有错!`,
@@ -38,10 +38,10 @@
38
38
  ></dsh-form>
39
39
 
40
40
  <dsh-icons
41
- v-if="$getOperationList(['canCreate', 'canDelete']).length"
41
+ v-if="$getOperationList(['canInsert', 'canDelete']).length"
42
42
  class="item-icons"
43
43
  itemClass="item-icons-item"
44
- :list="$getOperationList(['canCreate', 'canDelete'])"
44
+ :list="$getOperationList(['canInsert', 'canDelete'])"
45
45
  @click="$dispatchEvent($event, row, rowIndex)"
46
46
  ></dsh-icons>
47
47
  </div>
@@ -199,16 +199,14 @@ export default {
199
199
  on: {
200
200
  mouseenter: (event) => {
201
201
  this.$set(this.hoverRecordMap, `${row._id}`, true);
202
- // this.$set(this.hoverRecordMap, `${row._id}dsh${column._key}`, true);
203
202
  },
204
203
  mouseleave: (event) => {
205
204
  this.$set(this.hoverRecordMap, `${row._id}`, false);
206
- // this.$set(this.hoverRecordMap, `${row._id}dsh${column._key}`, false);
207
205
  }
208
206
  }
209
207
  },
210
208
  column.colType === "summary"
211
- ? h("span", this.getSummaryTdVal(row, rowIndex, column))
209
+ ? this.getSummaryTdVal(row, rowIndex, column)
212
210
  : column.colType === "operation"
213
211
  ? this.operationTdCellRender(h, { row, rowIndex, column })
214
212
  : this.contentTdCellRender(h, { row, rowIndex, column })
@@ -326,7 +324,7 @@ export default {
326
324
  colType: "data"
327
325
  })),
328
326
  ...(
329
- !this.isSearching && this.$getOperationList(["canDelete"]).length
327
+ !this.isSearching && this.rowOperationList.length
330
328
  ? [{
331
329
  ...this.operationColumn,
332
330
  nodeKey: treeForm[treeForm.length - 1]._key,
@@ -53,11 +53,7 @@ export default {
53
53
  ...(this.useSelection === true ? [this.selectionColumn] : []),
54
54
  ...(this.useIndex === true ? [this.indexColumn] : []),
55
55
  ...this.$transformToColumns(this.contentColumns),
56
- ...(
57
- !this.isSearching && this.$getOperationList(["canDelete"]).length
58
- ? [this.operationColumn]
59
- : []
60
- )
56
+ ...(!this.isSearching && this.rowOperationList.length ? [this.operationColumn] : [])
61
57
  ];
62
58
  },
63
59
  indexColumn () {
@@ -90,8 +86,9 @@ export default {
90
86
  const list = this.data;
91
87
  const newRow = this.getNewRowData();
92
88
 
93
- // 处理单元格合并相关(当前列是合并列,则该列之前的合并列,要复制这一行对应列的值;当前列是普通列,按该列前的最后合并列的操作处理)
89
+ // 处理单元格合并相关
94
90
  if (col) {
91
+ // 当前列是合并列,则该列之前的合并列,要复制这一行对应列的值;
95
92
  if (this.mergeRowColKeys.includes(col._key)) {
96
93
  const newList = this.allListData.slice(rowIndex); // 从该行开始截取
97
94
  const nextRowIndex = this.$isEmptyData(row[col._key])
@@ -110,9 +107,13 @@ export default {
110
107
  : obj;
111
108
  }, newRow);
112
109
  }
110
+ // 当前列是非合并列,按该列前的最后合并列的操作处理(操作列时,colIndex < 0)
113
111
  else {
114
112
  const colIndex = this.selfColumns.findIndex(column => column._key === col._key);
115
- const mergeRowColumns = this.selfColumns.filter((column, columnIndex) => columnIndex < colIndex && this.mergeRowColKeys.includes(column._key));
113
+ const mergeRowColumns = this.selfColumns.filter((column, columnIndex) =>
114
+ (colIndex < 0 ? true : columnIndex <= colIndex) &&
115
+ this.mergeRowColKeys.includes(column._key)
116
+ );
116
117
  mergeRowColumns.slice(0, mergeRowColumns.length - 1).reduce((obj, column) => {
117
118
  return Object.assign(obj, {
118
119
  [column._key]: this.$deepCopy(row[column._key])
@@ -140,33 +141,33 @@ export default {
140
141
  });
141
142
  },
142
143
 
144
+ /* ----------- 方法 ---------- */
143
145
  bodyCellSpan ({ row, rowIndex, column }) {
146
+ rowIndex = this.showListData.findIndex(dataItem => dataItem._id === row._id);
147
+
144
148
  // 合并单元格(单元格值为空时不合并)
145
- if (this.mergeRowColKeys.includes(column._key)) {
146
- if (this.$isEmptyData(row[column._key])) {
149
+ if (
150
+ this.mergeRowColKeys.includes(column._key) &&
151
+ rowIndex > -1 &&
152
+ !this.$isEmptyData(row[column._key])
153
+ ) {
154
+ if (
155
+ rowIndex !== 0 &&
156
+ row[column._key] === this.showListData[rowIndex - 1][column._key]
157
+ ) {
158
+ return {
159
+ rowspan: 0,
160
+ colspan: 0
161
+ };
162
+ } else {
163
+ const newList = this.showListData.slice(rowIndex);
164
+ const newIndex = newList.findIndex(rowItem => row[column._key] !== rowItem[column._key]);
165
+
147
166
  return {
148
- rowspan: 1,
167
+ rowspan: newIndex === -1 ? newList.length : newIndex,
149
168
  colspan: 1
150
169
  };
151
170
  }
152
- else {
153
- if (
154
- rowIndex !== 0 &&
155
- row[column._key] === this.showListData[rowIndex - 1][column._key]
156
- ) {
157
- return {
158
- rowspan: 0,
159
- colspan: 0
160
- };
161
- } else {
162
- const newList = this.showListData.slice(rowIndex);
163
- const newIndex = newList.findIndex(rowItem => row[column._key] !== rowItem[column._key]);
164
- return {
165
- rowspan: newIndex === -1 ? newList.length : newIndex,
166
- colspan: 1
167
- };
168
- }
169
- }
170
171
  }
171
172
  }
172
173
  }
@@ -52,11 +52,7 @@ export default {
52
52
  this.expandColumn,
53
53
  ...(this.useIndex === true ? [this.indexColumn] : []),
54
54
  ...this.$transformToColumns(this.contentColumns),
55
- ...(
56
- !this.isSearching && this.$getOperationList(["canDelete"]).length
57
- ? [this.operationColumn]
58
- : []
59
- )
55
+ ...(!this.isSearching && this.rowOperationList.length ? [this.operationColumn] : [])
60
56
  ];
61
57
  },
62
58
  expandColumn () {
@@ -100,7 +96,7 @@ export default {
100
96
  _key: "__treeIndex__",
101
97
  key: "__treeIndex__",
102
98
  field: "__treeIndex__",
103
- width: 28 + 16 + (this.maxLevel - 1) * 38,
99
+ width: 28 + 16 + (this.maxLevel - 1) * 36,
104
100
  align: "left",
105
101
  fixed: "left",
106
102
  renderBodyCell: ({ row, rowIndex, column }, h) => {
@@ -105,17 +105,28 @@ export default {
105
105
  baseOperationMap: {
106
106
  canCreate: {
107
107
  name: "添加一行",
108
+ tip: "添加一行",
108
109
  type: "canCreate",
109
110
  btnType: "default",
110
111
  icon: "md-add",
111
112
  size: "default",
112
- color: "#3DB8C5",
113
113
  long: true,
114
114
  disabled: false,
115
115
  event: "clickCreate"
116
116
  },
117
+ canInsert: {
118
+ name: "插入一行",
119
+ tip: "插入一行",
120
+ type: "canInsert",
121
+ btnType: "primaryText",
122
+ icon: "md-add",
123
+ size: "small",
124
+ disabled: false,
125
+ event: "clickCreate"
126
+ },
117
127
  canDelete: {
118
128
  name: "删除",
129
+ tip: "删除该行",
119
130
  type: "canDelete",
120
131
  btnType: "errorText",
121
132
  icon: "md-trash",
@@ -501,8 +512,8 @@ export default {
501
512
  align: "center",
502
513
  _fixed: "right",
503
514
  fixed: "right",
504
- _width: 100,
505
- width: 100,
515
+ _width: 210,
516
+ width: 210,
506
517
  renderBodyCell: ({ row, rowIndex, column }, h) => {
507
518
  return this.operationTdCellRender(h, { row, rowIndex, column });
508
519
  }
@@ -619,8 +630,23 @@ export default {
619
630
  ...this.baseOperationMap.canCreate,
620
631
  name: this.showMode === "form"
621
632
  ? this.baseOperationMap.canCreate.name.replace("行", "条")
622
- : this.baseOperationMap.canCreate.name
623
- // disabled: !!this.disabledCreateBtn
633
+ : this.baseOperationMap.canCreate.name,
634
+ tip: this.showMode === "form"
635
+ ? this.baseOperationMap.canCreate.tip.replace("行", "条")
636
+ : this.baseOperationMap.canCreate.tip
637
+ },
638
+ canInsert: {
639
+ ...this.baseOperationMap.canInsert,
640
+ name: this.showMode === "form"
641
+ ? this.baseOperationMap.canInsert.name.replace("行", "条")
642
+ : this.baseOperationMap.canInsert.name,
643
+ tip: this.showMode === "form"
644
+ ? this.baseOperationMap.canInsert.tip.replace("行", "条")
645
+ : this.baseOperationMap.canInsert.tip,
646
+ color: this.appColor
647
+ // style: {
648
+ // color: this.appColor
649
+ // }
624
650
  },
625
651
  canHideOrShow: {
626
652
  ...this.topOperationMap.canHideOrShow,
@@ -651,6 +677,9 @@ export default {
651
677
  ...(this.hideColKeys.length ? ["canHideOrShow"] : [])
652
678
  ]
653
679
  );
680
+ },
681
+ rowOperationList () {
682
+ return this.$getOperationList(["canInsert", "canDelete"]);
654
683
  }
655
684
  },
656
685
  watch: {
@@ -1122,9 +1151,11 @@ export default {
1122
1151
  ];
1123
1152
  },
1124
1153
  operationTdCellRender (h, { row, rowIndex, column }) {
1125
- const operationList = this.$getOperationList(["canDelete"]).map(btnItem => ({
1154
+ const operationList = this.rowOperationList.map(btnItem => ({
1126
1155
  ...btnItem,
1127
- disabled: !this.getRowDelBtnCanEdit(row, rowIndex)
1156
+ disabled: btnItem.type === "canDelete"
1157
+ ? !this.getRowDelBtnCanEdit(row, rowIndex)
1158
+ : btnItem.disabled
1128
1159
  }));
1129
1160
 
1130
1161
  return [
@@ -1134,7 +1165,7 @@ export default {
1134
1165
  },
1135
1166
  on: {
1136
1167
  click: (operationItem) => {
1137
- this.$dispatchEvent(operationItem, row, rowIndex);
1168
+ this.$dispatchEvent(operationItem, row, rowIndex, column);
1138
1169
  }
1139
1170
  }
1140
1171
  })
@@ -1142,151 +1173,75 @@ export default {
1142
1173
  },
1143
1174
  operationIconRender (h, { row, rowIndex, column }, iconSize = 14) {
1144
1175
  const baseBool = !this.isSearching &&
1145
- (this.showCreateBtnColKeys.length ? this.showCreateBtnColKeys.includes(column._key) : ["__index__", "__treeIndex__"].includes(column._key)) &&
1146
- this.hoverRecordMap[`${row._id}`];
1147
- // this.hoverRecordMap[`${row._id}dsh${column._key}`]
1176
+ (this.showCreateBtnColKeys.length ? this.showCreateBtnColKeys.includes(column._key) : ["__index__", "__treeIndex__"].includes(column._key));
1177
+ // this.hoverRecordMap[`${row._id}`];
1148
1178
 
1149
1179
  return [
1150
1180
  // 插入一行图标
1151
- (this.operationMap.canCreate && this.operationMap.canCreate.disabled !== true) &&
1152
- baseBool
1153
- ? h("div", {
1154
- style: {
1155
- position: "absolute",
1156
- bottom: "0px",
1157
- right: "0px",
1158
- width: `${iconSize + 2}px`,
1159
- height: `${iconSize + 2}px`,
1160
- border: `1px solid ${this.appColor}`,
1161
- borderRadius: "2px",
1162
- backgroundColor: "#ffffff",
1163
- lineHeight: `${iconSize - 2}px`,
1164
- cursor: "pointer",
1165
- verticalAlign: "middle",
1166
- transition: "color .2s ease-in-out,border-color .2s ease-in-out"
1167
- }
1168
- }, [
1169
- h("Tooltip", {
1170
- props: {
1171
- content: "插入一行",
1172
- maxWidth: "250",
1173
- transfer: true
1174
- }
1175
- }, [
1176
- h("Icon", {
1177
- style: {
1178
- fontWeight: "500",
1179
- color: this.appColor
1180
- },
1181
- props: {
1182
- type: this.operationMap.canCreate.icon,
1183
- size: iconSize
1184
- },
1185
- on: {
1186
- click: () => {
1187
- this.$dispatchEvent(this.operationMap.canCreate, row, rowIndex, column);
1188
- }
1189
- }
1190
- })
1191
- ])
1192
- ])
1181
+ baseBool
1182
+ ? this.getOperationIconRender(h, { row, rowIndex, column }, "canInsert", iconSize)
1193
1183
  : h("span", ""),
1194
1184
 
1195
1185
  // 添加一行下级图标
1196
- (this.operationMap.canCreateChild && this.operationMap.canCreateChild.disabled !== true) &&
1197
- baseBool &&
1186
+ baseBool &&
1198
1187
  row.level < this.maxLevel &&
1199
1188
  !["cascaderTable"].includes(this.inTableType) // 老版级联表格类型不要“添加下级”图标
1200
- ? h("div", {
1201
- style: {
1202
- position: "absolute",
1203
- bottom: "0px",
1204
- right: `${iconSize + 3}px`,
1205
- display: "inline-block",
1206
- width: `${iconSize + 2}px`,
1207
- height: `${iconSize + 2}px`,
1208
- border: `1px solid ${this.appColor}`,
1209
- borderRadius: "2px",
1210
- backgroundColor: "#ffffff",
1211
- lineHeight: `${iconSize - 2}px`,
1212
- cursor: "pointer",
1213
- verticalAlign: "middle",
1214
- transition: "color .2s ease-in-out,border-color .2s ease-in-out"
1215
- }
1216
- }, [
1217
- h("Tooltip", {
1218
- props: {
1219
- content: "添加下级",
1220
- maxWidth: "250",
1221
- transfer: true
1222
- }
1223
- }, [
1224
- h("Icon", {
1225
- style: {
1226
- fontWeight: "500",
1227
- color: this.appColor
1228
- },
1229
- props: {
1230
- type: this.operationMap.canCreateChild.icon,
1231
- size: iconSize
1232
- },
1233
- on: {
1234
- click: () => {
1235
- this.$dispatchEvent(this.operationMap.canCreateChild, row, rowIndex);
1236
- }
1237
- }
1238
- })
1239
- ])
1240
- ])
1189
+ ? this.getOperationIconRender(h, { row, rowIndex, column }, "canCreateChild", iconSize, true)
1241
1190
  : h("span", ""),
1242
1191
 
1243
1192
  // 删除该行图标
1244
- (this.operationMap.canDelete && this.operationMap.canDelete.disabled !== true) &&
1245
- baseBool &&
1193
+ baseBool &&
1246
1194
  this.getRowDelBtnCanEdit(row, rowIndex) &&
1247
1195
  ["cascaderTable"].includes(this.inTableType)
1248
- ? h("div", {
1249
- style: {
1250
- position: "absolute",
1251
- bottom: "0px",
1252
- right: `${iconSize + 3}px`,
1253
- width: `${iconSize + 2}px`,
1254
- height: `${iconSize + 2}px`,
1255
- border: `1px solid ${this.operationMap.canDelete.color}`,
1256
- borderRadius: "2px",
1257
- backgroundColor: "#ffffff",
1258
- lineHeight: `${iconSize - 2}px`,
1259
- cursor: "pointer",
1260
- verticalAlign: "middle",
1261
- transition: "color .2s ease-in-out,border-color .2s ease-in-out"
1196
+ ? this.getOperationIconRender(h, { row, rowIndex, column }, "canDelete", iconSize, true)
1197
+ : h("span", "")
1198
+ ];
1199
+ },
1200
+ getOperationIconRender (h, { row, rowIndex, column }, operationType, iconSize = 14, isLeft = false) {
1201
+ const operationItem = this.operationMap[operationType];
1202
+
1203
+ return operationItem && operationItem.disabled !== true
1204
+ ? h("div", {
1205
+ style: {
1206
+ position: "absolute",
1207
+ bottom: "0px",
1208
+ right: isLeft ? `${iconSize + 3}px` : "0px",
1209
+ width: `${iconSize + 2}px`,
1210
+ height: `${iconSize + 2}px`,
1211
+ border: `1px solid ${operationItem.color}`,
1212
+ borderRadius: "2px",
1213
+ backgroundColor: "#ffffff",
1214
+ lineHeight: `${iconSize - 2}px`,
1215
+ cursor: "pointer",
1216
+ verticalAlign: "middle",
1217
+ transition: "color .2s ease-in-out,border-color .2s ease-in-out"
1218
+ }
1219
+ }, [
1220
+ h("Tooltip", {
1221
+ props: {
1222
+ content: operationItem.tip,
1223
+ maxWidth: "250",
1224
+ transfer: true
1262
1225
  }
1263
1226
  }, [
1264
- h("Tooltip", {
1227
+ h("Icon", {
1228
+ style: {
1229
+ fontWeight: "500",
1230
+ color: operationItem.color
1231
+ },
1265
1232
  props: {
1266
- content: "删除该行",
1267
- maxWidth: "250",
1268
- transfer: true
1269
- }
1270
- }, [
1271
- h("Icon", {
1272
- style: {
1273
- fontWeight: "500",
1274
- color: this.operationMap.canDelete.color
1275
- },
1276
- props: {
1277
- type: this.operationMap.canDelete.icon,
1278
- size: iconSize
1279
- },
1280
- on: {
1281
- click: () => {
1282
- this.$dispatchEvent(this.operationMap.canDelete, row, rowIndex, column);
1283
- }
1233
+ type: operationItem.icon,
1234
+ size: iconSize
1235
+ },
1236
+ on: {
1237
+ click: () => {
1238
+ this.$dispatchEvent(operationItem, row, rowIndex, column);
1284
1239
  }
1285
- })
1286
- ])
1240
+ }
1241
+ })
1287
1242
  ])
1288
- : h("span", "")
1289
- ];
1243
+ ])
1244
+ : h("span", "");
1290
1245
  },
1291
1246
  bodyCellClass ({ row, rowIndex, column }) {
1292
1247
  return "bri-table-td" +
@@ -1326,11 +1281,9 @@ export default {
1326
1281
  },
1327
1282
  mouseenter: (event) => {
1328
1283
  this.$set(this.hoverRecordMap, `${row._id}`, true);
1329
- // this.$set(this.hoverRecordMap, `${row._id}dsh${column._key}`, true);
1330
1284
  },
1331
1285
  mouseleave: (event) => {
1332
1286
  this.$set(this.hoverRecordMap, `${row._id}`, false);
1333
- // this.$set(this.hoverRecordMap, `${row._id}dsh${column._key}`, false);
1334
1287
  }
1335
1288
  };
1336
1289
  },
@@ -1389,10 +1342,9 @@ export default {
1389
1342
  },
1390
1343
  // 行按钮是否可操作(删除按钮可编辑 不代表行内容是可编辑的)
1391
1344
  getRowDelBtnCanEdit (row, rowIndex) {
1392
- return this.canEdit && // 是编辑状态
1345
+ return row.__readonly__ !== true && // 不能为只读数据
1393
1346
  (this.disabledDeleteDftRow ? row.__isDefault__ !== true : true) && // 默认数据可删除
1394
- (this.disabledDeleteOldRow ? row.__old__ !== true : true) && // 老数据可删除
1395
- row.__readonly__ !== true; // 不能为只读数据
1347
+ (this.disabledDeleteOldRow ? row.__old__ !== true : true); // 老数据可删除
1396
1348
  },
1397
1349
  // 行内容是否可编辑
1398
1350
  getRowCanEdit (row, rowIndex) {
@@ -1444,28 +1396,28 @@ export default {
1444
1396
  },
1445
1397
  // 列本身是否可编辑
1446
1398
  getColCanEdit (row, rowIndex, col) {
1447
- return (
1448
- ["treeTable"].includes(this.inTableType) && ["number", "date"].includes(col._type)
1449
- ? col._summaryType
1450
- ? row.isLeaf === true
1451
- : ["downToUp", "upToDown"].includes(col._writeSort)
1452
- ? col._noLimitWrite === true
1453
- ? true
1454
- : ["downToUp"].includes(col._writeSort)
1455
- ? !(row.children && row.children.length) || row.children.every(sonRow => !this.$isEmptyData(sonRow[col._key]))
1456
- : row.level === 1 || !this.$isEmptyData(this.getParentRow(row, this.data)[col._key])
1457
- : true
1458
- : true
1459
- ) &&
1460
- !(["cascaderTable"].includes(this.controlType) && ["level", "children"].includes(col._key)) && // 层级表格的固定字段不可编辑
1461
- (col._oldReadonly ? row.__old__ !== true : true) && // 某些列在老数据行里不可编辑
1399
+ return (col._oldReadonly ? row.__old__ !== true : true) && // 某些列在老数据行里不可编辑
1462
1400
  (this.getIsDftRow(row) ? !this.dftReadonlyColKeys.includes(col._key) : true) && // 默认行的某列是否可编辑
1463
1401
  (row.__old__ === true ? !this.oldReadonlyColKeys.includes(col._key) : true) && // 老数据行里某些列不可编辑
1464
1402
  (row.__isQuote__ ? !this.quoteReadonlyColKeys.includes(col._key) : true) && // 引用过来的数据是否可编辑
1465
- !["calculate"].includes(col._enterType) && // 计算的不可编辑
1403
+ (!this.getTypeColCanEdit || this.getTypeColCanEdit(row, rowIndex, col)) &&
1404
+ (
1405
+ ["treeTable"].includes(this.inTableType) && ["number", "date"].includes(col._type)
1406
+ ? col._summaryType
1407
+ ? row.isLeaf === true
1408
+ : ["downToUp", "upToDown"].includes(col._writeSort)
1409
+ ? col._noLimitWrite === true
1410
+ ? true
1411
+ : ["downToUp"].includes(col._writeSort)
1412
+ ? !(row.children && row.children.length) || row.children.every(sonRow => !this.$isEmptyData(sonRow[col._key]))
1413
+ : row.level === 1 || !this.$isEmptyData(this.getParentRow(row, this.data)[col._key])
1414
+ : true
1415
+ : true
1416
+ ) &&
1417
+ !(["cascaderTable"].includes(this.controlType) && ["level", "children"].includes(col._key)) && // 层级表格的固定字段不可编辑
1418
+ col._enterType !== "calculate" && // 计算的不可编辑
1466
1419
  col._readonly !== true && // 只读
1467
- col.canEdit !== false && // 字段本身编辑权限 考虑为undefined时候
1468
- (!this.getTypeColCanEdit || this.getTypeColCanEdit(row, rowIndex, col));
1420
+ col.canEdit !== false; // 字段本身编辑权限 考虑为undefined时候
1469
1421
  },
1470
1422
  // 单元格最终编辑状态
1471
1423
  getUnitCanEdit (row, rowIndex, col) {
@@ -10,12 +10,12 @@ export default {
10
10
 
11
11
  baseOperationMap: {
12
12
  canCreateChild: {
13
- name: "添加一行下级",
13
+ name: "添加下级",
14
+ tip: "添加一行下级",
14
15
  type: "canCreateChild",
15
- btnType: "default",
16
+ btnType: "primaryText",
16
17
  icon: "md-add-circle",
17
- size: "default",
18
- color: "#3DB8C5",
18
+ size: "small",
19
19
  disabled: false,
20
20
  event: "clickCreateChild"
21
21
  }
@@ -70,8 +70,14 @@ export default {
70
70
  ...this.baseOperationMap.canCreateChild,
71
71
  name: this.showMode === "form"
72
72
  ? this.baseOperationMap.canCreateChild.name.replace("行", "条")
73
- : this.baseOperationMap.canCreateChild.name
74
- // disabled: !!this.disabledCreateBtn
73
+ : this.baseOperationMap.canCreateChild.name,
74
+ tip: this.showMode === "form"
75
+ ? this.baseOperationMap.canCreateChild.tip.replace("行", "条")
76
+ : this.baseOperationMap.canCreateChild.tip,
77
+ color: this.appColor
78
+ // style: {
79
+ // color: this.appColor
80
+ // }
75
81
  }
76
82
  };
77
83
  }
@@ -12,7 +12,7 @@
12
12
  :accordion="listItem._accordion"
13
13
  :simple="listItem._simple === false ? false : true"
14
14
  :hide-arrow="true"
15
- :value="listItem.expansion && [listItem._key]"
15
+ :value="listItem.expansion ? [listItem._key] : []"
16
16
  >
17
17
  <Panel :name="listItem._key">
18
18
  <div
@@ -70,7 +70,10 @@
70
70
  {{ listItem._simpleDescription }}
71
71
  </span>
72
72
  </Tooltip>
73
- <span v-else class="BriCollapseTree-listItem-rightText">{{ listItem._simpleDescription }}</span>
73
+ <span
74
+ v-else
75
+ class="BriCollapseTree-listItem-rightText"
76
+ >{{ listItem._simpleDescription }}</span>
74
77
  </div>
75
78
  </div>
76
79
  </li>