htui-yllkbz 1.3.3 → 1.3.4

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.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "htui-yllkbz",
3
- "version": "1.3.3",
3
+ "version": "1.3.4",
4
4
  "typings": "types/index.d.ts",
5
5
  "main": "lib/htui.common.js",
6
6
  "style": "lib/htui.css",
@@ -4,7 +4,7 @@
4
4
  * @Author: hutao
5
5
  * @Date: 2022-02-11 14:26:23
6
6
  * @LastEditors: hutao
7
- * @LastEditTime: 2022-02-15 10:14:00
7
+ * @LastEditTime: 2022-02-27 18:44:46
8
8
  -->
9
9
  <!--
10
10
  * @Descripttion: 附件列表 ------没有搞完
@@ -94,6 +94,7 @@ export default class HtUploadFiles extends Vue {
94
94
  @Prop({ default: false }) readonly?: boolean;
95
95
  /** 是否禁用 */
96
96
  @Prop() disabled?: boolean;
97
+ @Prop() filesInfo?: CreateAttachmentDto[];
97
98
  /** 数据 */
98
99
  state: State = {
99
100
  loading: false,
@@ -178,11 +179,13 @@ export default class HtUploadFiles extends Vue {
178
179
  }
179
180
  @Watch("state.filesInfo")
180
181
  onFileToken(val: CreateAttachmentDto[], old: string) {
181
- const arr: string[] = [];
182
- val.forEach((item) => {
183
- if (item.fileToken) arr.push(item.fileToken);
184
- });
185
- this.$emit("input", arr.toString());
182
+ if (!this.readonly) {
183
+ const arr: string[] = [];
184
+ val.forEach((item) => {
185
+ if (item.fileToken) arr.push(item.fileToken);
186
+ });
187
+ this.$emit("input", arr.toString());
188
+ }
186
189
  }
187
190
  @Watch("value")
188
191
  onValue(val: string) {
@@ -191,6 +194,9 @@ export default class HtUploadFiles extends Vue {
191
194
  this.getAllFileInfo();
192
195
  } else {
193
196
  this.state.fileToken = [];
197
+ if (this.filesInfo && this.filesInfo.length) {
198
+ this.state.filesInfo = this.filesInfo;
199
+ }
194
200
  }
195
201
  }
196
202
  }