htui-yllkbz 1.3.73 → 1.3.74

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.73",
3
+ "version": "1.3.74",
4
4
  "port": "8082",
5
5
  "typings": "types/index.d.ts",
6
6
  "main": "lib/htui.common.js",
@@ -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-28 09:44:36
7
+ * @LastEditTime: 2022-11-07 14:32:25
8
8
  -->
9
9
  <!--
10
10
  * @Descripttion: 附件列表 ------没有搞完
@@ -16,52 +16,57 @@
16
16
  -->
17
17
  <template>
18
18
  <div>
19
- <el-upload class="ht-upload"
20
- v-if="!disabled"
21
- style="width:368px;height:108px"
22
- :show-file-list="false"
23
- :disabled="disabled"
24
- :on-success="onSuccess"
25
- :before-upload="beforeUpload"
26
- drag
27
- action="/files/api/filing/file/upload"
28
- multiple>
19
+ <el-upload
20
+ class="ht-upload"
21
+ v-if="!disabled"
22
+ style="width:368px;height:108px"
23
+ :show-file-list="false"
24
+ :disabled="disabled"
25
+ :on-success="onSuccess"
26
+ :before-upload="beforeUpload"
27
+ drag
28
+ action="/files/api/filing/file/upload"
29
+ multiple
30
+ >
29
31
  <!-- <i class="el-icon-upload"></i> -->
30
- <div style="margin-top:8px;font-size:12px;color:#999"
31
- class="el-upload__text">拖动文件到此处,或<br /><em>点击上传</em></div>
32
+ <div
33
+ style="margin-top:8px;font-size:12px;color:#999"
34
+ class="el-upload__text"
35
+ >
36
+ 拖动文件到此处,或<br /><em>点击上传</em>
37
+ </div>
32
38
  <!-- <div class="el-upload__tip"
33
39
  slot="tip">只能上传jpg/png文件,且不超过5M</div> -->
34
40
  </el-upload>
35
41
  <ul class="ht-ul-upload">
36
- <li :key="item.fileToken"
37
- v-for=" (item,index) in state.filesInfo">
38
- <a @click="downLoadFile(item)"><i class="le-icon el-icon-document"
39
- style="margin-right:7px"></i>{{item.fileName}}</a>
42
+ <li :key="item.fileToken" v-for="(item, index) in state.filesInfo">
43
+ <a @click="downLoadFile(item)"
44
+ ><i class="le-icon el-icon-document" style="margin-right:7px"></i
45
+ >{{ item.fileName }}</a
46
+ >
40
47
  <span>
41
-
42
- <i v-if="!disabled"
43
- class="el-icon el-icon-circle-check"></i>
44
- <i v-if="!disabled"
45
- class="el-icon el-icon-close"
46
- @click="delItem(item,index)"
47
- title="删除"></i>
48
- <i class="el-icon el-icon-download"
49
- style="margin-right:24px"
50
- @click="downLoadFile(item)"
51
- title="下载"></i>
48
+ <i v-if="!disabled" class="el-icon el-icon-circle-check"></i>
49
+ <i
50
+ v-if="!disabled"
51
+ class="el-icon el-icon-close"
52
+ @click="delItem(item, index)"
53
+ title="删除"
54
+ ></i>
55
+ <i
56
+ class="el-icon el-icon-download"
57
+ style="margin-right:24px"
58
+ @click="downLoadFile(item)"
59
+ title="下载"
60
+ ></i>
52
61
  </span>
53
-
54
62
  </li>
55
63
  </ul>
56
- <a :href="state.fileSrc"
57
- target="_blank"
58
- v-show="false"
59
- ref="download1"></a>
64
+ <a :href="state.fileSrc" target="_blank" v-show="false" ref="download1"></a>
60
65
  </div>
61
66
  </template>
62
- <script lang='ts'>
63
- import { _axios } from "vue-kst-auth";
64
- import { Component, Prop, Vue, Watch } from "vue-property-decorator";
67
+ <script lang="ts">
68
+ import { _axios } from 'vue-kst-auth';
69
+ import { Component, Prop, Vue, Watch } from 'vue-property-decorator';
65
70
  interface State {
66
71
  /** 数据状态 */
67
72
  loading: boolean;
@@ -86,10 +91,10 @@ interface CreateAttachmentDto {
86
91
  sortNum?: number;
87
92
  }
88
93
  @Component({
89
- name: "HtUploadFiles",
94
+ name: 'HtUploadFiles',
90
95
  })
91
96
  export default class HtUploadFiles extends Vue {
92
- @Prop() value!: string;
97
+ @Prop() value!: string | string[];
93
98
  /* 是否只读 */
94
99
  @Prop({ default: false }) readonly?: boolean;
95
100
  /** 是否禁用 */
@@ -101,14 +106,14 @@ export default class HtUploadFiles extends Vue {
101
106
  /** 数据 */
102
107
  state: State = {
103
108
  loading: false,
104
- fileSrc: "",
109
+ fileSrc: '',
105
110
  fileToken: [],
106
111
  filesInfo: [],
107
112
  dialogVisible: false,
108
113
  };
109
114
  /** 生命周期 */
110
115
  created() {
111
- this.onValue(this.value);
116
+ //this.onValue(this.value);
112
117
  }
113
118
  /** 方法 */
114
119
  /** 上传文件前验证 */
@@ -116,11 +121,11 @@ export default class HtUploadFiles extends Vue {
116
121
  /** 附件上传之前的判断 */
117
122
  beforeUpload(file: File) {
118
123
  const isLt10MB = file.size / 1024 / 1024 < 5;
119
- const arr = ["jpg", "png", "xlsx", "lsx", "doc", "pdf"];
120
- const lastArr = file.name.split(".");
124
+ const arr = ['jpg', 'png', 'xlsx', 'lsx', 'doc', 'pdf'];
125
+ const lastArr = file.name.split('.');
121
126
  const type = lastArr[lastArr.length - 1];
122
127
  if (!isLt10MB) {
123
- this.$message.error("大小不能超过 5MB!");
128
+ this.$message.error('大小不能超过 5MB!');
124
129
  }
125
130
  if (arr.includes(type)) {
126
131
  return true;
@@ -145,7 +150,7 @@ export default class HtUploadFiles extends Vue {
145
150
  }
146
151
  /** 获取到的附件列表详情 */
147
152
  getFileInfo(id: string) {
148
- _axios.get("/files/api/filing/file/" + id).then((res) => {
153
+ _axios.get('/files/api/filing/file/' + id).then((res) => {
149
154
  this.state.filesInfo.push(res.data);
150
155
  });
151
156
  }
@@ -168,7 +173,7 @@ export default class HtUploadFiles extends Vue {
168
173
  ) < 0
169
174
  ) {
170
175
  await _axios
171
- .get("/files/api/filing/file/" + fileToken[i])
176
+ .get('/files/api/filing/file/' + fileToken[i])
172
177
  .then((res) => {
173
178
  this.state.filesInfo.push(res.data);
174
179
  });
@@ -180,30 +185,35 @@ export default class HtUploadFiles extends Vue {
180
185
  get fileList() {
181
186
  return [];
182
187
  }
183
- @Watch("state.filesInfo")
188
+ @Watch('state.filesInfo')
184
189
  onFileToken(val: CreateAttachmentDto[], old: string) {
185
190
  if (!this.readonly && !this.isArray) {
186
191
  const arr: string[] = [];
187
192
  val.forEach((item) => {
188
193
  if (item.fileToken) arr.push(item.fileToken);
189
194
  });
190
- this.$emit("input", arr.toString());
191
- this.$emit("change", arr.toString());
195
+ this.$emit('input', arr.toString());
196
+ this.$emit('change', arr.toString());
192
197
  }
193
198
  if (this.isArray) {
194
- this.$emit("change", val);
199
+ this.$emit('change', val);
195
200
  }
196
201
  }
197
- @Watch("filesInfo", { immediate: true })
202
+ @Watch('filesInfo', { immediate: true })
198
203
  onArrValue(val: CreateAttachmentDto[]) {
199
204
  if (this.isArray) {
200
205
  this.state.filesInfo = val || [];
201
206
  }
202
207
  }
203
- @Watch("value")
204
- onValue(val: string) {
208
+ @Watch('value', { immediate: true })
209
+ onValue(val: string | string[]) {
205
210
  if (val && !this.isArray) {
206
- this.state.fileToken = val.split(",");
211
+ if (Array.isArray(val)) {
212
+ this.state.fileToken = val;
213
+ } else {
214
+ this.state.fileToken = val.split(',');
215
+ }
216
+
207
217
  this.getAllFileInfo();
208
218
  } else {
209
219
  this.state.fileToken = [];
@@ -214,7 +224,7 @@ export default class HtUploadFiles extends Vue {
214
224
  }
215
225
  }
216
226
  </script>
217
- <style lang='scss' scoped>
227
+ <style lang="scss" scoped>
218
228
  .ht-ul-upload {
219
229
  li {
220
230
  width: 100%;
@@ -250,4 +260,4 @@ export default class HtUploadFiles extends Vue {
250
260
  }
251
261
  }
252
262
  }
253
- </style>
263
+ </style>