Browse Source

文件分割判断

CzRger 1 year ago
parent
commit
e1d0e799a2
2 changed files with 32 additions and 8 deletions
  1. 22 0
      src/api/modules/seat.ts
  2. 10 8
      src/views/system/notice-announcement/detail.vue

+ 22 - 0
src/api/modules/seat.ts

@@ -0,0 +1,22 @@
+import { handle } from '../index'
+
+const suffix = 'api'
+
+//  日志管理 > 列表
+export const getDailyReportList = (params: any) => handle({
+  url: `/${suffix}/daily/report/list`,
+  method: 'post',
+  params
+})
+//  日志管理 > 新增
+export const addDailyReportSave = (params: any) => handle({
+  url: `/${suffix}/daily/report/save`,
+  method: 'post',
+  params
+})
+//  日志管理 > 编辑
+export const editDailyReportEdit = (params: any) => handle({
+  url: `/${suffix}/daily/report/edit`,
+  method: 'put',
+  params
+})

+ 10 - 8
src/views/system/notice-announcement/detail.vue

@@ -91,14 +91,16 @@ export default defineComponent({
           that.$api.getNoticeSearch({id: props.transfer.detail.id}).then((res) => {
             if (res.code === 200) {
               state.cusDetail = res.data
-              const urlArr = state.cusDetail.fileUrl.split(',')
-              const nameArr = state.cusDetail.fileName.split(',')
-              state.fileList = urlArr.map((v, i) => {
-                return {
-                  name: nameArr?.[i] || v,
-                  url: v
-                }
-              })
+              if (state.cusDetail.fileUrl) {
+                const urlArr = state.cusDetail.fileUrl.split(',')
+                const nameArr = state.cusDetail.fileName.split(',')
+                state.fileList = urlArr.map((v, i) => {
+                  return {
+                    name: nameArr?.[i] || v,
+                    url: v
+                  }
+                })
+              }
               emit('onView')
             } else {
               ElMessage.error(res.message)