imeik-bizui 1.6.9 → 1.7.0

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.
@@ -1,6 +1,9 @@
1
1
  <template>
2
2
  <div :class="!attrs.isView ? 'w-full' : 'inline'">
3
- <span v-if="attrs.isView" :title="myValueName">{{ myValueName || '-' }}</span>
3
+ <div v-if="attrs.isView">
4
+ <ImDiffText v-if="showDiff" :show-diff="showDiff" :old-value="myValueName" :no-absolute="true" :new-value="newMyValueName" />
5
+ <span v-else :title="myValueName">{{ myValueName || '-' }}</span>
6
+ </div>
4
7
  <el-cascader
5
8
  v-else
6
9
  :key="keyValue"
@@ -54,6 +57,12 @@ export default {
54
57
  }
55
58
  },
56
59
  computed: {
60
+ showDiff() {
61
+ return this.attrs.showDiff || false
62
+ },
63
+ diffValue() {
64
+ return this.attrs.diffValue || undefined
65
+ },
57
66
  dicValue() {
58
67
  return this.$bizui.userInfo.departmentCode
59
68
  },
@@ -85,6 +94,20 @@ export default {
85
94
  return this.myValue ? this.getAllLabel(this.options, this.myValue) : ''
86
95
  }
87
96
  },
97
+ newMyValueName() {
98
+ if (this.attrs.multiple) {
99
+ return this.diffValue && this.diffValue.length
100
+ ? this.diffValue
101
+ .map((item) => {
102
+ return this.getLabel(this.options, item)
103
+ })
104
+ .join(',')
105
+ : ''
106
+ } else {
107
+ // 如果是单选 就获取全部路径的值
108
+ return this.diffValue ? this.getAllLabel(this.options, this.diffValue) : ''
109
+ }
110
+ },
88
111
  myValueOrgCode() {
89
112
  if (this.attrs.multiple) {
90
113
  return this.myValue && this.myValue.length