jobsys-explore 4.7.8 → 4.7.9

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,6 @@
1
1
  import { computed, defineComponent, inject, onMounted, reactive, watch } from "vue"
2
2
  import { Button, showToast, Uploader } from "vant"
3
- import { every, findIndex, isArray, isEqual, isFunction, map, pick, random } from "lodash-es"
3
+ import { every, findIndex, isArray, isEqual, isFunction, isObject, map, pick, random } from "lodash-es"
4
4
  import { STATUS, useFetch } from "../../hooks"
5
5
  import { EX_UPLOADER } from "../provider/ExProvider.jsx"
6
6
 
@@ -175,10 +175,8 @@ export default defineComponent({
175
175
 
176
176
  watch(
177
177
  () => props.modelValue,
178
- (fileList) => {
179
- if (fileList && !isArray(fileList)) {
180
- fileList = [fileList]
181
- }
178
+ (newFileList) => {
179
+ let fileList = newFileList && !isArray(newFileList) ? [newFileList] : newFileList
182
180
  fileList = fileList.filter((item) => item[urlKey] || item[pathKey])
183
181
  //有时会由于种种原因丢失初始化后的信息,有异常的话再次初始化
184
182
  //异常情况包括:1. 文件列表不一致了, 2. 文件类型标识不见了 ...有后有其它的再加
@@ -187,6 +185,9 @@ export default defineComponent({
187
185
  !every(fileList, (item) => item._type === "file")
188
186
  ) {
189
187
  prepareFileList(fileList)
188
+ } else if (isObject(newFileList) && fileList.length === 0) {
189
+ //如果是对象,并且没有文件,那么就认为是文件改变了,需要更新文件列表
190
+ prepareFileList(newFileList)
190
191
  }
191
192
  },
192
193
  )