ZaiZai 2 anni fa
parent
commit
29e7d3c29c
3 ha cambiato i file con 16 aggiunte e 6 eliminazioni
  1. 4 3
      pages/image/form.vue
  2. 10 1
      pages/image/info.vue
  3. 2 2
      pages/image/view.vue

+ 4 - 3
pages/image/form.vue

@@ -108,8 +108,7 @@ const pdfList = ref([])
 const dateEnd = ref(dayjs().format("YYYY-MM-DD"));
 
 //页面启动
-onLoad((options) => {
-    const {id, node} = getObjValue(options)
+onLoad(({id, node}) => {
     dataId.value = id ?? '';
     if (id) {
         uni.setNavigationBarTitle({title: '编辑声像文件'})
@@ -127,7 +126,6 @@ onLoad((options) => {
             shootingTimeStr: dateEnd.value,
             shootingUser: real_name
         }
-        console.log(nodes.type)
         if (nodes.type === 1) {
             getFileTitleNamedata(nodes.treeId)
         }
@@ -291,6 +289,9 @@ const updateImageData = async () => {
     uni.hideLoading();
     if (!error && code === 200) {
         successToast('保存成功')
+        setTimeout(() => {
+            uni.navigateBack()
+        }, 1500)
     } else {
         errorToast('保存失败: ' + msg)
     }

+ 10 - 1
pages/image/info.vue

@@ -57,14 +57,16 @@
 
 <script setup>
 import {ref} from "vue";
-import {onLoad} from '@dcloudio/uni-app'
+import {onLoad, onShow} from '@dcloudio/uni-app'
 import mainApi from '~api/image/index';
 import {getObjValue, isString} from "js-fast-way";
 import {errorToast, toPdfPreview} from "@/utils/tools";
 
+//初始变量
 const dataId = ref('');
 const dataInfo = ref({})
 const imageList = ref([])
+const isNodes = ref(false)
 
 //页面启动
 onLoad(({id}) => {
@@ -72,6 +74,12 @@ onLoad(({id}) => {
     getInfoApi()
 })
 
+onShow(() => {
+    if (isNodes.value) {
+        getInfoApi()
+    }
+})
+
 //获取详情
 const getInfoApi = async () => {
     dataInfo.value = {}
@@ -88,6 +96,7 @@ const getInfoApi = async () => {
     console.log(res)
     dataInfo.value = res
     imageList.value = res.imageUrl.toString().split(',')
+    isNodes.value = true
     uni.hideLoading();
 }
 

+ 2 - 2
pages/image/view.vue

@@ -133,6 +133,7 @@ const setPagingStyle = async () => {
 
 //条件搜索
 const searchClick = () => {
+    imageList.value = []
     pageRef.value?.reload()
 }
 
@@ -163,7 +164,7 @@ const getDataList = async (pageNo, pageSize) => {
         contractId: contractId.value,
         classifyId: id,
         current: pageNo,
-        size: 10,
+        size: pageSize,
         isApp: 1,
     })
     //处理数据
@@ -198,7 +199,6 @@ const setImageList = (data) => {
     }
 }
 
-
 //批量删除
 const isDelete = ref(false)
 const deleteTap = () => {