bri-components 1.4.90 → 1.4.91

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.90",
3
+ "version": "1.4.91",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -96,7 +96,7 @@ export default {
96
96
  return this.tableDataObj.rowspanMap || {};
97
97
  },
98
98
  allListData () {
99
- this.data.forEach(row => {
99
+ this.data.forEach((row) => {
100
100
  this.fixRowData(row);
101
101
  });
102
102
  this.initFlag = false;
@@ -125,6 +125,14 @@ export default {
125
125
  ? this.showListData
126
126
  : this.curPageShowListData;
127
127
  },
128
+ // 替换tableBaseMixin里的
129
+ changedCols () {
130
+ return this.selfShowListData.reduce((totalCols, row) => {
131
+ return [
132
+ ...new Set([...totalCols, ...(row.__changed__ || []).map(item => item.fieldKey)])
133
+ ];
134
+ }, []);
135
+ },
128
136
  footerData () {
129
137
  return this.isSearching
130
138
  ? []
@@ -682,6 +682,9 @@ export default {
682
682
  // useCampare () {
683
683
  // return !!this.compareListData.length;
684
684
  // },
685
+ changedCols () {
686
+ return [];
687
+ },
685
688
 
686
689
  /* --- 功能按钮 --- */
687
690
  baseOperationBtns () {
@@ -1267,6 +1270,8 @@ export default {
1267
1270
  _key: column.colType === "tree" ? "name" : column._key
1268
1271
  },
1269
1272
  allFormList: this.selfColumns,
1273
+ changedCols: this.changedCols,
1274
+ changedFields: (row.__changed__ || []).map(item => item.fieldKey),
1270
1275
  inTableType: this.inTableType,
1271
1276
  allListRows: this.allListData,
1272
1277
  rowIndex: rowIndex,
@@ -35,7 +35,7 @@
35
35
  <span
36
36
  v-if="changedFields.includes(formItem._key)"
37
37
  class="DshFormUnit-label-name-sign"
38
- >!有更新</span>
38
+ >!有更新</span>
39
39
  </slot>
40
40
 
41
41
  <!-- label后可自定义内容 -->
@@ -104,12 +104,6 @@
104
104
  unitMixin
105
105
  ],
106
106
  props: {
107
- changedFields: {
108
- type: Array,
109
- default () {
110
- return [];
111
- }
112
- },
113
107
  // 实际最精确值是68px(label:30px, control:32px, 上下padding各: 2px 8px,因为ivu-form-item-content里line-height: 32px导致有问题,故先74px
114
108
  height: {
115
109
  type: [String, Number],
@@ -15,6 +15,7 @@
15
15
 
16
16
  <template v-else>
17
17
  <component
18
+ :class="changedCols.includes(formItem._key) ? 'DshListUnit-control' : ''"
18
19
  :is="curComponentName"
19
20
  :canEdit="canEdit"
20
21
  :value="formData"
@@ -33,6 +34,19 @@
33
34
  @quickChange="quickChange"
34
35
  @change="change"
35
36
  ></component>
37
+
38
+ <template>
39
+ <!-- 有更新标记-->
40
+ <span
41
+ v-if="changedFields.includes(formItem._key)"
42
+ class="DshListUnit-sign"
43
+ >!有更新</span>
44
+ <!-- 占位 -制药某列的某行有,没更新也要占位,保持对齐 -->
45
+ <span
46
+ v-else-if="changedCols.includes(formItem._key)"
47
+ class="DshListUnit-sign-empty"
48
+ ></span>
49
+ </template>
36
50
  </template>
37
51
  </div>
38
52
  </template>
@@ -46,6 +60,12 @@
46
60
  unitMixin
47
61
  ],
48
62
  props: {
63
+ changedCols: {
64
+ type: Array,
65
+ default () {
66
+ return [];
67
+ }
68
+ },
49
69
  canEdit: {
50
70
  type: Boolean,
51
71
  default: false
@@ -68,6 +88,20 @@
68
88
 
69
89
  <style lang="less" scoped>
70
90
  .DshListUnit {
91
+ &-control {
92
+ display: inline-block;
93
+ width: calc(100% - 66px);
94
+ }
71
95
 
96
+ &-sign {
97
+ display: inline-block;
98
+ width: 56px;
99
+ #dsh-sign-change();
100
+
101
+ &-empty {
102
+ display: inline-block;
103
+ width: 56px;
104
+ }
105
+ }
72
106
  }
73
107
  </style>
@@ -25,6 +25,12 @@ export default {
25
25
  return [];
26
26
  }
27
27
  },
28
+ changedFields: {
29
+ type: Array,
30
+ default () {
31
+ return [];
32
+ }
33
+ },
28
34
 
29
35
  /* 表格字段内用到的 */
30
36
  inTableType: {
@@ -29,8 +29,8 @@
29
29
 
30
30
  #dsh-sign-change () {
31
31
  display: inline-block;
32
- padding: 3px 8px;
33
- margin-left: 5px;
32
+ padding: 3px 6px;
33
+ margin-left: 4px;
34
34
  border-radius: 4px;
35
35
  background-color: #f75252;
36
36
  font-size: 12px;