htui-yllkbz 1.3.3 → 1.3.6

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.6",
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 18:02:39
8
+ * @LastEditTime: 2022-03-02 14:38:49
9
9
  -->
10
10
  <template>
11
11
  <div v-loading="state.loading"
@@ -69,8 +69,14 @@
69
69
 
70
70
  </slot>
71
71
  </template>
72
- <template slot-scope="scope">
73
- {{(state.pageInfo.currentPage-1)*state.pageInfo.pageSize+(scope.$index+1)}}
72
+ <template slot-scope="{row,column,rowIndex}">
73
+ <slot name="body_order"
74
+ :row="row"
75
+ :column="column"
76
+ :rowIndex="rowIndex">
77
+ {{(state.pageInfo.currentPage-1)*state.pageInfo.pageSize+(scope.$index+1)}}
78
+ </slot>
79
+
74
80
  </template>
75
81
  </el-table-column>
76
82
  <template v-for="(item,index) in state.showColumns">
@@ -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
  }