浏览代码

成绩报表管理修改

bzkf30 1 年之前
父节点
当前提交
ade8e926d9

+ 1 - 1
src/components/PreviewAttach/index.vue

@@ -38,7 +38,7 @@ export default {
       this.suffix = this.showUrl.substr(this.showUrl.lastIndexOf(".") + 1);
     },
     lookDetail() {
-      window.open(this.showUrl);
+      window.open(`${this.showUrl}/${this.filename}`);
     }
   }
 }

+ 42 - 30
src/pages/xdjx/xypjgl/bbtj/detail.vue

@@ -1,12 +1,11 @@
 <script setup lang="ts">
 import { ref } from "vue";
-import request, { download } from '~/utils/request';
-import { handleImageUrl } from '~/utils/index';
-
+import request, { download } from "~/utils/request";
+import { handleImageUrl } from "~/utils/index";
 
 // #region (constant)
-const TABLE_KEY = 'xxbg_id'
-const URL_CUT = '/xdjx/xypjgl_bbgl'
+const TABLE_KEY = "xxbg_id";
+const URL_CUT = "/xdjx/xypjgl_bbgl";
 const commonUrl = ref("");
 const filename = ref("");
 // #endregion
@@ -14,52 +13,62 @@ const filename = ref("");
 // #region (type)
 type TYPE_TABLE_FIELD = {
   [TABLE_KEY]: string;
-  'xxbg_bbmc': string; // 报表名称
-  'xxbg_cjr': string; // 创建人
-  'xxbg_cjsj': string; // 创建时间
-  'xxbg_bbsj_json': string; // 报表数据JSON
-  'xxbg_bbsz_json': string; // 报表设置JSON
-  'xxbg_bbfj': string
-}
+  xxbg_bbmc: string; // 报表名称
+  xxbg_cjr: string; // 创建人
+  xxbg_cjsj: string; // 创建时间
+  xxbg_bbsj_json: string; // 报表数据JSON
+  xxbg_bbsz_json: string; // 报表设置JSON
+  xxbg_bbfj: string;
+};
 // #endregion
 
 // #region (variable)
-const loading = ref(true)
+const loading = ref(true);
 // #endregion
 
 // #region (props)
 const props = defineProps<{
-  aid: string,
-}>()
+  aid: string;
+}>();
 // #endregion
 
 function detailApi(_id: string) {
   return request({
-    url: URL_CUT + '/detail',
+    url: URL_CUT + "/detail",
     data: {
       [TABLE_KEY]: _id,
-    }
-  })
+    },
+  });
 }
 
-const detail_Data = ref<TYPE_TABLE_FIELD>()
+const detail_Data = ref<TYPE_TABLE_FIELD>();
+
+let fileData = ref([]);
 
 // #region (page init)
 async function init() {
-  const res = await detailApi(props.aid)
-  detail_Data.value = (res.data.one_info)
+  const res = await detailApi(props.aid);
+  detail_Data.value = res.data.one_info;
   // let url = handleImageUrl(detail_Data.value.xxbg_bbfj)
 
-  let arr = detail_Data.value.xxbg_bbfj.split("|");
-  if (arr[0] && arr[1]) {
-    commonUrl.value = arr[0];
-    filename.value = arr[1];
+  let arr = detail_Data.value.xxbg_bbfj.split(";");
+  for (let i = 0; i < arr.length; i++) {
+    let ar = arr[i].split("|");
+    fileData.value.push({
+      commonUrl: ar[0],
+      filename: ar[1],
+    });
   }
-  loading.value = false
+
+  // let arr = detail_Data.value.xxbg_bbfj.split("|");
+  // if (arr[0] && arr[1]) {
+  //   commonUrl.value = arr[0];
+  //   filename.value = arr[1];
+  // }
+  loading.value = false;
 }
-init()
+init();
 // #endregion
-
 </script>
 
 <template>
@@ -67,7 +76,7 @@ init()
     <template v-if="detail_Data">
       <div class="flex mb-2">
         <!-- <div>报表名称</div> -->
-        <div class="text-2xl" >{{ detail_Data.xxbg_bbmc }}</div>
+        <div class="text-2xl">{{ detail_Data.xxbg_bbmc }}</div>
       </div>
       <!-- <div class="flex">
         <div>创建人</div><div>{{detail_Data.xxbg_cjr}}</div>
@@ -84,7 +93,10 @@ init()
       <!-- <iframe class="w-full h-700px"
         :src="`https://view.officeapps.live.com/op/view.aspx?src=${handleImageUrl(detail_Data.xxbg_bbfj)}`"
         frameborder="0"></iframe> -->
-      <preview-attach class="w-full mt-4" :commonUrl="commonUrl" :filename="filename"></preview-attach>
+      <div v-for="(item, index) in fileData" :key="index">
+        <preview-attach class="w-full mt-4" :commonUrl="item.commonUrl" :filename="item.filename"></preview-attach>
+      </div>
+      <!-- <preview-attach class="w-full mt-4" :commonUrl="commonUrl" :filename="filename"></preview-attach> -->
     </template>
   </div>
 

+ 2 - 2
src/pages/xdjx/xypjgl/bbtj/index.vue

@@ -361,8 +361,8 @@ init();
     </el-form>
     <div class="divider"></div>
     <div>
-      <import-button @success="queryApi" :url="URL_CUT_REF"></import-button>
-      <el-button @click="handleTableRowBtn_export" type="primary">导出</el-button>
+      <!-- <import-button @success="queryApi" :url="URL_CUT_REF"></import-button>
+      <el-button @click="handleTableRowBtn_export" type="primary">导出</el-button> -->
       <el-button @click="handleTableRowBtn_add" type="primary">新增</el-button>
       <el-button @click="handleTableRowBtn_delete" type="danger">删除</el-button>
     </div>

+ 3 - 3
src/router/routes/xdjx.ts

@@ -1095,7 +1095,7 @@ export default <RouteRecordDetailRaw[]>[
           "hidden": false,
           "breadcrumb": false,
           "sort": 5,
-          "title": "报表统计"
+          "title": "成绩报表管理"
         },
         "component": () => import('~/pages/xdjx/xypjgl/bbtj.vue'),
         "children": [
@@ -1107,7 +1107,7 @@ export default <RouteRecordDetailRaw[]>[
               "hidden": false,
               "breadcrumb": false,
               "sort": 0,
-              "title": "报表统计"
+              "title": "成绩报表管理"
             },
             "component": () => import('~/pages/xdjx/xypjgl/bbtj/index.vue'),
             "redirect": null
@@ -1120,7 +1120,7 @@ export default <RouteRecordDetailRaw[]>[
               "hidden": true,
               "breadcrumb": false,
               "sort": 1,
-              "title": "报表统计详情"
+              "title": "成绩报表管理详情"
             },
             "component": () => import('~/pages/xdjx/xypjgl/bbtj/detail.vue'),
             "redirect": null