htui-yllkbz 1.3.2 → 1.3.5

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.2",
3
+ "version": "1.3.5",
4
4
  "typings": "types/index.d.ts",
5
5
  "main": "lib/htui.common.js",
6
6
  "style": "lib/htui.css",
@@ -5,7 +5,7 @@
5
5
  * @Author: hutao
6
6
  * @Date: 2021-11-11 11:23:24
7
7
  * @LastEditors: hutao
8
- * @LastEditTime: 2022-02-20 17:54:42
8
+ * @LastEditTime: 2022-02-20 18:02:39
9
9
  -->
10
10
  <template>
11
11
  <div v-loading="state.loading"
@@ -376,6 +376,7 @@ export default class HtTable extends Vue {
376
376
  }
377
377
  resetColumn() {
378
378
  this.creatInitColumnKey(this.columns || []);
379
+ this.state.visibleFilter = false;
379
380
  if (this.uuId) {
380
381
  window.localStorage.setItem(
381
382
  "table_" + this.uuId,
@@ -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-28 09:44:36
8
8
  -->
9
9
  <!--
10
10
  * @Descripttion: 附件列表 ------没有搞完
@@ -94,6 +94,10 @@ export default class HtUploadFiles extends Vue {
94
94
  @Prop({ default: false }) readonly?: boolean;
95
95
  /** 是否禁用 */
96
96
  @Prop() disabled?: boolean;
97
+ /** 启动数组传值 */
98
+ @Prop({ default: false }) isArray?: boolean;
99
+
100
+ @Prop() filesInfo?: CreateAttachmentDto[];
97
101
  /** 数据 */
98
102
  state: State = {
99
103
  loading: false,
@@ -178,19 +182,34 @@ export default class HtUploadFiles extends Vue {
178
182
  }
179
183
  @Watch("state.filesInfo")
180
184
  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());
185
+ if (!this.readonly && !this.isArray) {
186
+ const arr: string[] = [];
187
+ val.forEach((item) => {
188
+ if (item.fileToken) arr.push(item.fileToken);
189
+ });
190
+ this.$emit("input", arr.toString());
191
+ this.$emit("change", arr.toString());
192
+ }
193
+ if (this.isArray) {
194
+ this.$emit("change", val);
195
+ }
196
+ }
197
+ @Watch("filesInfo", { immediate: true })
198
+ onArrValue(val: CreateAttachmentDto[]) {
199
+ if (this.isArray) {
200
+ this.state.filesInfo = val || [];
201
+ }
186
202
  }
187
203
  @Watch("value")
188
204
  onValue(val: string) {
189
- if (val) {
205
+ if (val && !this.isArray) {
190
206
  this.state.fileToken = val.split(",");
191
207
  this.getAllFileInfo();
192
208
  } else {
193
209
  this.state.fileToken = [];
210
+ if (this.filesInfo && this.filesInfo.length) {
211
+ this.state.filesInfo = this.filesInfo;
212
+ }
194
213
  }
195
214
  }
196
215
  }