imeik-bizui 1.6.1 → 1.6.2

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,10 @@
1
1
  <template>
2
2
  <span>
3
- <span v-if="attrs.isView">{{ formatedValue || '-' }}</span>
3
+ <div v-if="attrs.isView">
4
+ {{ showDiff }}
5
+ <ImDiffText v-if="showDiff" :show-diff="showDiff" :old-value="formatedValue" :no-absolute="true" :new-value="newFormatedValue" />
6
+ <span v-else>{{ formatedValue || '-' }}</span>
7
+ </div>
4
8
  <el-date-picker
5
9
  v-else
6
10
  v-bind="attrs"
@@ -137,11 +141,28 @@ export default {
137
141
  return 'yyyy-MM-dd'
138
142
  }
139
143
  },
144
+ showDiff() {
145
+ return this.attrs.showDiff || false
146
+ },
147
+ diffValue() {
148
+ return this.attrs.diffValue || undefined
149
+ },
140
150
 
141
151
  /**
142
152
  * 格式化后的值
143
153
  */
144
154
  formatedValue() {
155
+ if (Array.isArray(this.diffValue)) {
156
+ return this.diffValue.map((item) => moment(item).format(this.momentFormat)).join('~')
157
+ } else {
158
+ if (this.diffValue) {
159
+ return moment(this.diffValue).format(this.momentFormat)
160
+ } else {
161
+ return '-'
162
+ }
163
+ }
164
+ },
165
+ newFormatedValue() {
145
166
  if (Array.isArray(this.myValue)) {
146
167
  return this.myValue.map((item) => moment(item).format(this.momentFormat)).join('~')
147
168
  } else {