Browse Source

修改上传模型传参判断

木星 1 month ago
parent
commit
b75808972b
1 changed files with 9 additions and 1 deletions
  1. 9 1
      src/views/Resource/ResourceManage.vue

+ 9 - 1
src/views/Resource/ResourceManage.vue

@@ -34,6 +34,8 @@ defineOptions({
34
   name: 'TemplateManage'
34
   name: 'TemplateManage'
35
 })
35
 })
36
 
36
 
37
+const compare = ref('')
38
+
37
 const { tableRegister, tableState, tableMethods } = useTable({
39
 const { tableRegister, tableState, tableMethods } = useTable({
38
   fetchDataApi: async () => {
40
   fetchDataApi: async () => {
39
     const { currentPage, pageSize } = tableState
41
     const { currentPage, pageSize } = tableState
@@ -250,6 +252,7 @@ const edittab = async (data: TableSlotDefault) => {
250
   formData.categoryName = data.row.categoryName
252
   formData.categoryName = data.row.categoryName
251
   formData.compressFileName = data.row.compressFileName
253
   formData.compressFileName = data.row.compressFileName
252
   formData.compressFilePath = data.row.compressFilePath
254
   formData.compressFilePath = data.row.compressFilePath
255
+  compare.value = data.row.compressFilePath
253
   formData.icon = data.row.icon.replace(PATH_URL, '')
256
   formData.icon = data.row.icon.replace(PATH_URL, '')
254
   imageUrl.value = data.row.icon
257
   imageUrl.value = data.row.icon
255
   formData.categoryId = data.row.categoryId
258
   formData.categoryId = data.row.categoryId
@@ -265,7 +268,11 @@ const signIn = async () => {
265
   const formRef = await getElFormExpose()
268
   const formRef = await getElFormExpose()
266
   const formData = await getFormData()
269
   const formData = await getFormData()
267
   console.log('lplplp', formData.compressFilePath)
270
   console.log('lplplp', formData.compressFilePath)
268
-  if (formData.compressFilePath) {
271
+  if (
272
+    formData.compressFilePath !== compare.value &&
273
+    formData.compressFilePath !== '' &&
274
+    formData.compressFilePath
275
+  ) {
269
     formData.uploadCompress = true
276
     formData.uploadCompress = true
270
   } else {
277
   } else {
271
     formData.uploadCompress = false
278
     formData.uploadCompress = false
@@ -325,6 +332,7 @@ const tianjia = async () => {
325
   isedit.value = '添加'
332
   isedit.value = '添加'
326
   schema[2].componentProps.fileList = []
333
   schema[2].componentProps.fileList = []
327
   dialogVisible.value = true
334
   dialogVisible.value = true
335
+  compare.value = ''
328
 }
336
 }
329
 </script>
337
 </script>
330
 
338