ZaiZai 1 éve
szülő
commit
41552556a3

+ 2 - 1
src/renderer/src/components/query/file-pdf.vue

@@ -44,6 +44,8 @@ defineOptions({
     name: 'QueryFilePdf',
 })
 
+const tableRef = ref(null)
+
 //项目信息
 const store = useAppStore()
 const projectInfo = ref(store.projectInfo)
@@ -109,7 +111,6 @@ const setPdfPath = (row) => {
 }
 
 //表格数据
-const tableRef = ref(null)
 const tableColumn = ref([{ key: 'title', name: '卷内文件名称' }])
 
 //表格行被点击

+ 40 - 12
src/renderer/src/views/query.vue

@@ -30,9 +30,9 @@
                             <el-form-item label="保管期限">
                                 <el-checkbox :checked="isDuration" @change="isDurationChange">不限</el-checkbox>
                                 <el-checkbox-group v-model="duration" class="ml-6" :disabled="isDuration" @change="durationChange">
-                                    <el-checkbox label="3">永久</el-checkbox>
-                                    <el-checkbox label="2">30年</el-checkbox>
-                                    <el-checkbox label="1">10年</el-checkbox>
+                                    <el-checkbox value="3">永久</el-checkbox>
+                                    <el-checkbox value="2">30年</el-checkbox>
+                                    <el-checkbox value="1">10年</el-checkbox>
                                 </el-checkbox-group>
                             </el-form-item>
                             <el-form-item label="案卷档号">
@@ -55,9 +55,9 @@
             <template #extra>
                 <el-button hc-btn @click="toHomePage">返回主页</el-button>
             </template>
-            <hc-table :column="tableColumn" :datas="tableData" :loading="tableLoading" :is-index="false" is-new>
+            <hc-table :column="tableColumn" :datas="tableData" :loading="tableLoading" :is-index="false" is-new @row-click="tableRowClick">
                 <template #title="{ row }">
-                    <el-link type="primary" :underline="false" @click="tableRowTitle(row)" @dblclick="tableRowClick(row)">{{ row?.title }}</el-link>
+                    <div @click.stop="tableRowTitle(row)">{{ row?.title }}</div>
                 </template>
             </hc-table>
             <template #action>
@@ -68,6 +68,10 @@
         <hc-new-drawer v-model="isFileRollDrawer" to-id="hc-layout-main" direction="btt" modal-class="hc-query-file-roll-drawer">
             <QueryFileRoll :datas="fileRollRow" @close="fileRollDrawerClose" />
         </hc-new-drawer>
+        <!-- 预览PDF -->
+        <hc-new-drawer v-model="isFilePdfDrawer" to-id="hc-layout-main" direction="btt">
+            <QueryFilePdf :datas="fileRollPdfData" :rows="fileRollPdfRow" @close="filePdfDrawerClose" />
+        </hc-new-drawer>
     </hc-body>
 </template>
 
@@ -77,6 +81,7 @@ import { useAppStore } from '~src/store'
 import { sql_count, sql_table } from '../utils/dbConnect'
 import { getArrValue, isNullES } from 'js-fast-way'
 import QueryFileRoll from '../components/query/file-roll.vue'
+import QueryFilePdf from '../components/query/file-pdf.vue'
 import { toPage } from '../utils/tools'
 
 //初始组合式
@@ -225,10 +230,38 @@ const getTableData = async () => {
     tableLoading.value = false
 }
 
-//表格行点击
+//案卷题名被点击
+const isFilePdfDrawer = ref(false)
+const fileRollPdfData = ref([])
+const fileRollPdfRow = ref({})
+const tableRowTitle = async (row) => {
+    //查询表格数据
+    const sql = `select id,file_number as number,file_name as title,pdf_file_url as url,file_time as startime,duty_user as dutyUser from u_archive_file where archive_id = '${row.id}'`
+    const { code, data } = await sql_table(sql)
+    const res = code === 200 ? getArrValue(data) : []
+    if (res.length <= 0) {
+        fileRollPdfRow.value = {}
+    } else {
+        fileRollPdfRow.value = res[0]
+    }
+    fileRollPdfData.value = res
+    await nextTick(() => {
+        isFilePdfDrawer.value = true
+    })
+}
+
+//关闭抽屉
+const filePdfDrawerClose = () => {
+    isFilePdfDrawer.value = false
+    fileRollPdfRow.value = {}
+    fileRollPdfData.value = []
+}
+
+
+//单击行
 const isFileRollDrawer = ref(false)
 const fileRollRow = ref({})
-const tableRowTitle = (row) => {
+const tableRowClick = ({ row }) => {
     fileRollRow.value = row
     isFileRollDrawer.value = true
 }
@@ -243,11 +276,6 @@ const fileRollDrawerClose = () => {
 const toHomePage = () => {
     toPage({ page: '/home' })
 }
-
-//双击行
-const tableRowClick = (row) => {
-    console.log(row)
-}
 </script>
 
 <style lang="scss">