From 7339b8a9ccf09e6262cb71ac6c9b724cdfa6fe22 Mon Sep 17 00:00:00 2001 From: zhangwei <1504152376@qq.com> Date: 星期五, 15 八月 2025 16:43:32 +0800 Subject: [PATCH] 'pdf预览'’’ --- src/views/system/dept/utils/hook.tsx | 61 ++++++++++++++++-------------- 1 files changed, 32 insertions(+), 29 deletions(-) diff --git a/src/views/system/dept/utils/hook.tsx b/src/views/system/dept/utils/hook.tsx index 0608031..7e7a9d7 100644 --- a/src/views/system/dept/utils/hook.tsx +++ b/src/views/system/dept/utils/hook.tsx @@ -1,4 +1,4 @@ -import dayjs from "dayjs"; +// import dayjs from "dayjs"; import editForm from "../form.vue"; import { handleTree } from "@/utils/tree"; import { message } from "@/utils/message"; @@ -15,22 +15,18 @@ caigourenDelete, caigourenBatchDelete } from "@/api/item/index"; -import { usePublicHooks } from "../../hooks"; +// import { usePublicHooks } from "../../hooks"; import { addDialog } from "@/components/ReDialog"; -import { type Ref, reactive, ref, onMounted, h, computed } from "vue"; +import { type Ref, reactive, ref, onMounted, h } from "vue"; import type { FormItemProps } from "./types"; -import { - cloneDeep, - isAllEmpty, - deviceDetection, - getKeyList -} from "@pureadmin/utils"; -import { useUserStoreHook } from "@/store/modules/user"; +import { cloneDeep, deviceDetection, getKeyList } from "@pureadmin/utils"; +// import { useUserStoreHook } from "@/store/modules/user"; import type { PaginationProps } from "@pureadmin/table"; -const nowRole = computed(() => { - return useUserStoreHook().nowRole; -}); +import pdfPreview from "../../component/pdfPreview.vue"; +// const nowRole = computed(() => { +// return useUserStoreHook().nowRole; +// }); const selectedNum = ref(0); export function useDept(tableRef: Ref) { @@ -102,7 +98,7 @@ const formRef = ref(); const dataList = ref([]); const loading = ref(true); - const { tagStyle } = usePublicHooks(); + // const { tagStyle } = usePublicHooks(); const getOrderStatus = row => { const res = state.orderStatusList.find(item => { return row.orderStatus == item.status; @@ -131,7 +127,7 @@ label: "椤圭洰杩涘害", prop: "orderStatus", minWidth: 70, - cellRenderer: ({ row, props }) => getOrderStatus(row) + cellRenderer: ({ row }) => getOrderStatus(row) }, { label: "鎶ュ悕璐�", @@ -157,15 +153,13 @@ label: "璐ㄧ枒", prop: "zhiyi", minWidth: 100, - cellRenderer: ({ row, props }) => ( - <span>{row.status === 1 ? "鏈�" : "鏃�"}</span> - ) + cellRenderer: ({ row }) => <span>{row.status === 1 ? "鏈�" : "鏃�"}</span> }, { label: "鎶曡瘔", prop: "tousu", minWidth: 100, - cellRenderer: ({ row, props }) => ( + cellRenderer: ({ row }) => ( // <el-tag size={props.size} style={tagStyle.value(row.status)}> <span>{row.status === 1 ? "鏈�" : "鏃�"}</span> // </el-tag> @@ -200,7 +194,7 @@ label: "椤圭洰杩涘害", prop: "orderStatus", minWidth: 70, - cellRenderer: ({ row, props }) => getOrderStatus(row) + cellRenderer: ({ row }) => getOrderStatus(row) }, { label: "鎶ュ悕璐�", @@ -226,15 +220,13 @@ label: "璐ㄧ枒", prop: "zhiyi", minWidth: 100, - cellRenderer: ({ row, props }) => ( - <span>{row.status === 1 ? "鏈�" : "鏃�"}</span> - ) + cellRenderer: ({ row }) => <span>{row.status === 1 ? "鏈�" : "鏃�"}</span> }, { label: "鎶曡瘔", prop: "tousu", minWidth: 100, - cellRenderer: ({ row, props }) => ( + cellRenderer: ({ row }) => ( // <el-tag size={props.size} style={tagStyle.value(row.status)}> <span>{row.status === 1 ? "鏈�" : "鏃�"}</span> // </el-tag> @@ -295,9 +287,22 @@ } function resetForm(formEl) { - if (!formEl) return; - formEl.resetFields(); - onSearch(); + // if (!formEl) return; + // formEl.resetFields(); + // onSearch(); + + addDialog({ + title: `棰勮pdf`, + props: {}, + width: "60%", + draggable: true, + fullscreen: deviceDetection(), + fullscreenIcon: true, + sureBtnLoading: true, + closeOnClickModal: false, + contentRenderer: () => h(pdfPreview, { ref: formRef, formInline: null }) + // jsx 璇硶 锛堟敞鎰忓湪.vue鏂囦欢鍚敤jsx璇硶锛岄渶瑕佸湪script寮�鍚痩ang="tsx"锛� + }); } const checkboxAsRadio = data => { if (data.length > 1) { @@ -340,8 +345,6 @@ } function openDialog(title = "鏂板", row?: FormItemProps) { - console.log(row, "-"); - addDialog({ title: `${title}椤圭洰`, props: { -- Gitblit v1.9.1