bri-components 1.3.30 → 1.3.32

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.
Files changed (28) hide show
  1. package/lib/0.bri-components.min.js +1 -1
  2. package/lib/1.bri-components.min.js +1 -1
  3. package/lib/10.bri-components.min.js +1 -0
  4. package/lib/11.bri-components.min.js +1 -0
  5. package/lib/2.bri-components.min.js +1 -1
  6. package/lib/3.bri-components.min.js +1 -1
  7. package/lib/4.bri-components.min.js +1 -1
  8. package/lib/5.bri-components.min.js +1 -1
  9. package/lib/6.bri-components.min.js +1 -1
  10. package/lib/7.bri-components.min.js +1 -0
  11. package/lib/8.bri-components.min.js +1 -0
  12. package/lib/9.bri-components.min.js +1 -0
  13. package/lib/bri-components.min.js +16 -16
  14. package/package.json +1 -1
  15. package/src/components/controls/base/BriUpload/BriUpload.vue +2 -12
  16. package/src/components/controls/base/BriUpload/uploadList.vue +35 -31
  17. package/src/components/controls/senior/cascaderTable.vue +29 -173
  18. package/src/components/controls/senior/flatTable/flatTable.vue +55 -242
  19. package/src/components/controls/senior/selectUsers/selectUsers.vue +16 -13
  20. package/src/components/form/DshDefaultSearch.vue +1 -2
  21. package/src/components/list/DshCascaderTable.vue +231 -34
  22. package/src/components/list/DshFlatTable.vue +59 -1
  23. package/src/components/list/DshTreeTable.vue +263 -87
  24. package/src/components/{controls/senior/flatTable → list/common}/flatTableImportModal.vue +1 -9
  25. package/src/components/list/mixins/flatTableMixin.js +16 -48
  26. package/src/components/list/mixins/quoteListModal.vue +215 -0
  27. package/src/components/list/mixins/tableBaseMixin.js +349 -12
  28. package/src/styles/components/list/BriTable.less +26 -7
@@ -3,6 +3,15 @@
3
3
  class="DshCasTable"
4
4
  ref="DshCascaderTable"
5
5
  >
6
+ <!-- 操作按钮 -->
7
+ <dsh-buttons
8
+ class="DshCasTable-btns"
9
+ itemClass="DshCasTable-btns-item"
10
+ :list="$getOperationList(topOperationBtns)"
11
+ @click="$dispatchEvent($event)"
12
+ ></dsh-buttons>
13
+
14
+ <!-- 表格 -->
6
15
  <div class="DshCasTable-wrap">
7
16
  <div
8
17
  class="DshCasTable-wrap-center"
@@ -192,6 +201,206 @@
192
201
  </div>
193
202
  </div>
194
203
  </div>
204
+
205
+ <!-- 全屏查看 -->
206
+ <dsh-modal
207
+ v-model="isEnlarge"
208
+ mode="custom"
209
+ :propsObj="modalPropsObj"
210
+ >
211
+ <div
212
+ v-if="isEnlargeFlag"
213
+ class="DshCasTable-wrap"
214
+ >
215
+ <div
216
+ class="DshCasTable-wrap-center"
217
+ :style="{
218
+ maxHeight: `${contentHeight}px`,
219
+ height: `${contentHeight}px`
220
+ }"
221
+ >
222
+ <!-- 表头 -->
223
+ <div class="DshCasTable-wrap-center-top">
224
+ <div class="DshCasTable-wrap-center-top-inner">
225
+ <table
226
+ class="table"
227
+ border="1"
228
+ cellspacing="0"
229
+ bordercolor="#E7EDF8"
230
+ >
231
+ <tbody>
232
+ <tr>
233
+ <th
234
+ v-for="(column, colIndex) in columns"
235
+ :key="column._id"
236
+ class="table-th bri-table-th"
237
+ :style="getThStyle(column, 'th')"
238
+ @click="$dispatchEvent(operationMap.clickTh, column)"
239
+ >
240
+ <dsh-render :render="getHeaderRender(column)"></dsh-render>
241
+
242
+ <!-- 级联表头 的下拉 -->
243
+ <dsh-dropdown
244
+ v-if="
245
+ column.colType === 'tree' &&
246
+ column.level === treeColumns.length &&
247
+ $getOperationList(getTreeThBtns(column)).length
248
+ "
249
+ class="table-th-dropdown"
250
+ menuClass="table-th-dropdown-list"
251
+ trigger="hover"
252
+ :list="$getOperationList(getTreeThBtns(column))"
253
+ @click="$dispatchEvent($event, column, colIndex, columns)"
254
+ @click.native.stop="0"
255
+ >
256
+ <a href="javascript:void(0)">
257
+ <Icon
258
+ type="md-add-circle"
259
+ size="20"
260
+ />
261
+ </a>
262
+ </dsh-dropdown>
263
+ </th>
264
+ </tr>
265
+ </tbody>
266
+ </table>
267
+ </div>
268
+ </div>
269
+
270
+ <!-- 数据行 -->
271
+ <div class="DshCasTable-wrap-center-list">
272
+ <div class="DshCasTable-wrap-center-list-inner">
273
+ <table
274
+ class="table"
275
+ border="1"
276
+ cellspacing="0"
277
+ bordercolor="#E7EDF8"
278
+ >
279
+ <tbody>
280
+ <template v-if="rows.length">
281
+ <tr
282
+ v-for="(row, rowIndex) in rows"
283
+ :key="row._id"
284
+ class="table-row"
285
+ >
286
+ <template v-for="column in getRowColumns(row, rowIndex)">
287
+ <!-- 树节点单元格、汇总单元格 -->
288
+ <td
289
+ v-if="['tree', 'summary'].includes(column.colType)"
290
+ :key="column._key"
291
+ :class="{
292
+ [`table-td-${column.colType}`]: true,
293
+ 'bri-table-td': true , // 可以不要,为了position: relative,上面有
294
+ 'bri-table-td-edit': canEdit,
295
+ 'bri-table-td-show': !canEdit,
296
+ }"
297
+ :style="getTdStyle(column, row)"
298
+ :rowspan="geTdRowspan(column, row)"
299
+ :colspan="geTdColspan(column, row)"
300
+ @click="$dispatchEvent(operationMap.clickNode, column, row, row[column._key])"
301
+ >
302
+ <!-- 树节点单元格 -->
303
+ <template v-if="column.colType === 'tree'">
304
+ <!-- 编辑状态 -->
305
+ <Input
306
+ v-if="row[column._key].isEdit"
307
+ :ref="`${column._id}${row._id}`"
308
+ v-model="row[column._key].name"
309
+ class="textarea"
310
+ type="textarea"
311
+ :autosize="{ minRows: geTdRowspan(column, row) * 3 - 1, maxRows: 100 }"
312
+ @on-blur="$dispatchEvent(operationMap.blurNode, column, row, row[column._key])"
313
+ @on-change="$dispatchEvent(operationMap.changeNode, column, row, row[column._key])"
314
+ />
315
+
316
+ <!-- 查看状态 -->
317
+ <template v-else>
318
+ <bri-tooltip
319
+ :content="enterText(row[column._key].name)"
320
+ :transfer="true"
321
+ >
322
+ <span v-html="enterText(row[column._key].name)"></span>
323
+ </bri-tooltip>
324
+
325
+ <!-- 操作下拉 -->
326
+ <dsh-dropdown
327
+ v-if="$getOperationList(getTreeTdBtns(column, row, row[column._key])).length"
328
+ class="table-td-tree-dropdown"
329
+ menuClass="table-td-tree-dropdown-list"
330
+ trigger="hover"
331
+ :list="$getOperationList(getTreeTdBtns(column, row, row[column._key]))"
332
+ @click="$dispatchEvent($event, row, rowIndex, column)"
333
+ @click.native.stop="0"
334
+ >
335
+ <a href="javascript:void(0)">
336
+ <Icon
337
+ type="md-add-circle"
338
+ size="20"
339
+ />
340
+ </a>
341
+ </dsh-dropdown>
342
+ </template>
343
+ </template>
344
+
345
+ <!-- 汇总单元格 -->
346
+ <template v-else-if="column.colType === 'summary'">
347
+ <span>{{ getSummaryVal(column, row) }}</span>
348
+ </template>
349
+ </td>
350
+
351
+ <!-- 普通单元格 -->
352
+ <td
353
+ v-else
354
+ :key="column._key + 'data'"
355
+ :class="{
356
+ // [`table-td-${column.colType}`]: true,
357
+ 'bri-table-td': true , // 可以不要,为了position: relative,上面有
358
+ 'bri-table-td-edit': canEdit,
359
+ 'bri-table-td-show': !canEdit,
360
+ }"
361
+ :style="getTdStyle(column, row)"
362
+ >
363
+ <dsh-list-unit
364
+ :canEdit="canEdit"
365
+ :formData="row[column.nodeKey]"
366
+ :formItem="{
367
+ ...column,
368
+ _heightAuto: heightAuto
369
+ }"
370
+ :allFormList="subColumns"
371
+ :rowIndex="rowIndex"
372
+ :parentListData="rows"
373
+ :parentFormList="parentFormList"
374
+ :parentObj="parentObj"
375
+ @blur="controlBlur(null, column, row[column.nodeKey], arguments)"
376
+ @change="$dispatchEvent(operationMap.changeVal, column, row[column.nodeKey], arguments)"
377
+ ></dsh-list-unit>
378
+
379
+ <span
380
+ v-if="!getColRuleResult(column, row[column.nodeKey], rowIndex).bool"
381
+ class="bri-table-td-tip"
382
+ >
383
+ {{ getColRuleResult(column, row[column.nodeKey], rowIndex).message }}
384
+ </span>
385
+ </td>
386
+ </template>
387
+ </tr>
388
+ </template>
389
+
390
+ <!-- 无数据 -->
391
+ <tr
392
+ v-else
393
+ class="table-nodata"
394
+ >
395
+ <td :colspan="columns.length">暂无数据…</td>
396
+ </tr>
397
+ </tbody>
398
+ </table>
399
+ </div>
400
+ </div>
401
+ </div>
402
+ </div>
403
+ </dsh-modal>
195
404
  </div>
196
405
  </template>
197
406
 
@@ -234,7 +443,7 @@
234
443
  widthMap: this.$getModFieldPropertyMap("width"),
235
444
  boxWidth: 0,
236
445
 
237
- allOperationMap: {
446
+ baseOperationMap: {
238
447
  clickTh: {
239
448
  name: "点击列的表头",
240
449
  type: "clickTh",
@@ -309,12 +518,6 @@
309
518
  type: "clearChildNodes",
310
519
  icon: "md-trash",
311
520
  event: "clearChildNodes"
312
- },
313
-
314
- changeVal: {
315
- name: "改变输入框值",
316
- type: "changeVal",
317
- event: "changeVal"
318
521
  }
319
522
  }
320
523
  };
@@ -327,7 +530,8 @@
327
530
  return this.transformRows();
328
531
  },
329
532
  listData () {
330
- return this.rows;
533
+ // return rows;
534
+ return this.$getTreeFlatArr(this.data.tree, node => !(node.children && node.children.length));
331
535
  },
332
536
 
333
537
  selfPropsObj () {
@@ -339,9 +543,7 @@
339
543
  },
340
544
 
341
545
  filterColumns () {
342
- return this.subColumns
343
- .filter(col => col.colType === "data")
344
- .filter(col => this.$isAdvRelyShow(col, this.listData, this.parentObj, true));
546
+ return this.subColumns.filter(column => this.$isAdvRelyShow(column, this.listData, this.parentObj, true));
345
547
  },
346
548
  columns () {
347
549
  return this.transformColumns(this.treeColumns);
@@ -349,16 +551,6 @@
349
551
  // 供表格渲染行使用的columns的数组集合, 每一行columns不一样,组成二重数组
350
552
  rowColumnsArr () {
351
553
  return this.transformRowColumnsArr();
352
- },
353
- operationMap () {
354
- return this.canEdit
355
- ? this.$categoryMapToMap(
356
- this.allOperationMap,
357
- undefined,
358
- undefined,
359
- this.disabledBtns ? ["changeVal"] : undefined
360
- )
361
- : {};
362
554
  }
363
555
  },
364
556
  created () {
@@ -395,13 +587,10 @@
395
587
  };
396
588
  loop(this.data.tree);
397
589
  },
398
- // 整行校验结果
399
- getRowRuleResult (row, rowIndex) {
400
- return this.filterColumns.every(column => this.getColRuleResult(column, row[column.nodeKey], rowIndex).bool);
401
- },
402
590
  // 单元格校验结果
403
591
  getColRuleResult (col, row, rowIndex) {
404
592
  col = this.$transformFieldProperty(col, row, this.parentObj);
593
+
405
594
  if ((this.ruleRecordMap[`${row._id}dsh${col._key}`] || {}).showRuleMessage || this.showRuleMessage) {
406
595
  return this.$getFieldRuleResult({
407
596
  ...col,
@@ -569,15 +758,13 @@
569
758
  );
570
759
  }, [])
571
760
  .concat(
572
- subForm
573
- .filter(subFormItem => subFormItem._displayType !== "hide")
574
- .map(subFormItem => (
575
- {
576
- ...subFormItem,
577
- nodeKey: treeForm[treeForm.length - 1]._key,
578
- colType: "data"
579
- }
580
- ))
761
+ subForm.map(subFormItem => (
762
+ {
763
+ ...subFormItem,
764
+ nodeKey: treeForm[treeForm.length - 1]._key,
765
+ colType: "data"
766
+ }
767
+ ))
581
768
  );
582
769
  },
583
770
  // 转化树数据
@@ -861,6 +1048,16 @@
861
1048
  .DshCasTable {
862
1049
  width: 100%;
863
1050
 
1051
+ &-btns {
1052
+ margin-bottom: 3px;
1053
+ text-align: right;
1054
+ color: @textColor;
1055
+
1056
+ &-item {
1057
+
1058
+ }
1059
+ }
1060
+
864
1061
  &-wrap {
865
1062
  width: 100%;
866
1063
 
@@ -1,5 +1,14 @@
1
1
  <template>
2
2
  <div class="DshFlatTable">
3
+ <!-- 操作按钮 -->
4
+ <dsh-buttons
5
+ class="DshFlatTable-btns"
6
+ itemClass="DshFlatTable-btns-item"
7
+ :list="$getOperationList(topOperationBtns)"
8
+ @click="$dispatchEvent($event)"
9
+ ></dsh-buttons>
10
+
11
+ <!-- 表格 -->
3
12
  <bri-table
4
13
  class="DshFlatTable-main"
5
14
  :columns="showColumns"
@@ -16,12 +25,49 @@
16
25
  :list="$getOperationList(['canCreate'])"
17
26
  @click="$dispatchEvent($event, null, null, listData)"
18
27
  ></dsh-buttons>
28
+
29
+ <!-- 全屏查看 -->
30
+ <dsh-modal
31
+ v-model="isEnlarge"
32
+ mode="custom"
33
+ :propsObj="modalPropsObj"
34
+ >
35
+ <template v-if="isEnlargeFlag">
36
+ <!-- 表格 -->
37
+ <bri-table
38
+ class="DshFlatTable-main"
39
+ :columns="showColumns"
40
+ :data="listData"
41
+ :footer-data="footerData"
42
+ :propsObj="tablePropsObj"
43
+ @changeSelect="changeSelect"
44
+ @selectAll="changeSelect"
45
+ ></bri-table>
46
+
47
+ <!-- 添加行 -->
48
+ <dsh-buttons
49
+ class="DshFlatTable-create"
50
+ :list="$getOperationList(['canCreate'])"
51
+ @click="$dispatchEvent($event, null, null, listData)"
52
+ ></dsh-buttons>
53
+ </template>
54
+ </dsh-modal>
55
+
56
+ <!-- 导入模态框 -->
57
+ <flat-table-import-modal
58
+ v-if="showImportModal"
59
+ v-model="showImportModal"
60
+ :propsObj="propsObj"
61
+ :importParams="importParams"
62
+ @importCb="importCb"
63
+ ></flat-table-import-modal>
19
64
  </div>
20
65
  </template>
21
66
 
22
67
  <script>
23
68
  import tableBaseMixin from "./mixins/tableBaseMixin.js";
24
69
  import flatTableMixin from "./mixins/flatTableMixin.js";
70
+ import flatTableImportModal from "./common/flatTableImportModal.vue";
25
71
 
26
72
  export default {
27
73
  name: "DshFlatTable",
@@ -29,7 +75,9 @@
29
75
  tableBaseMixin,
30
76
  flatTableMixin
31
77
  ],
32
- components: {},
78
+ components: {
79
+ flatTableImportModal
80
+ },
33
81
  props: {},
34
82
  data () {
35
83
  return {};
@@ -42,6 +90,16 @@
42
90
 
43
91
  <style lang="less" scoped>
44
92
  .DshFlatTable {
93
+ &-btns {
94
+ margin-bottom: 3px;
95
+ text-align: right;
96
+ color: @textColor;
97
+
98
+ &-item {
99
+
100
+ }
101
+ }
102
+
45
103
  &-main {
46
104
  width: 100%;
47
105
  height: auto;