From ef9f19192df89a5ec2dea8425d0fac0fd7eff6e6 Mon Sep 17 00:00:00 2001 From: zhouwx <1175765986@qq.com> Date: 星期一, 17 三月 2025 16:25:50 +0800 Subject: [PATCH] 接口对接 --- src/views/templateManage/components/createSign.vue | 5 +- src/views/templateManage/index.vue | 4 + src/views/signProject/index.vue | 7 ++- src/views/templateManage/components/templateDialog.vue | 28 ++++++++++++-- src/views/signProject/components/viewPdf.vue | 38 ++++++++---------- src/views/signProject/components/circulation.vue | 5 +- src/api/system/dept.js | 2 7 files changed, 55 insertions(+), 34 deletions(-) diff --git a/src/api/system/dept.js b/src/api/system/dept.js index 1984d5d..a2d59e4 100644 --- a/src/api/system/dept.js +++ b/src/api/system/dept.js @@ -37,7 +37,7 @@ // 新增部门 export function addDept(data) { return request({ - url: '/system/dept/add', + url: '/system/dept', method: 'post', data: data }) diff --git a/src/views/signProject/components/circulation.vue b/src/views/signProject/components/circulation.vue index 7b0be49..3c309e4 100644 --- a/src/views/signProject/components/circulation.vue +++ b/src/views/signProject/components/circulation.vue @@ -148,12 +148,13 @@ } const getUserList = async (val,deptId)=>{ if(deptId == '' || deptId == null){ - ElMessage.warning("请选择部门!") + // ElMessage.warning("请选择部门!") return; } if(val != ""){ const queryParams = { - name: val, + deptId: deptId, + nickName: val, } const res = await listUser(queryParams) if (res.code == 200) { diff --git a/src/views/signProject/components/viewPdf.vue b/src/views/signProject/components/viewPdf.vue index 84ae76d..eacc044 100644 --- a/src/views/signProject/components/viewPdf.vue +++ b/src/views/signProject/components/viewPdf.vue @@ -2,13 +2,20 @@ <div class="notice"> <el-dialog v-model="dialogVisible" - title="流转记录" - width="500px" + width="50%" + title="文件预览" :before-close="handleClose" :close-on-press-escape="false" :close-on-click-modal="false" > - <iframe :src="state.pdfUrl" width="100%" height="600px" sandbox="allow-scripts"></iframe> + <div style="width: 100%;height: auto;"> + <iframe + :src="state.iframeSrc" + width="100%" + height="750px" + class="custom-iframe" + ></iframe> + </div> </el-dialog> </div> </template> @@ -20,13 +27,12 @@ const emit = defineEmits(["getList"]); const state = reactive({ - pdfUrl: '' + iframeSrc: '' }) const openDialog = async (value) => { - state.pdfUrl = import.meta.env.VITE_APP_BASE_API +value.itemFile - console.log('11',state.pdfUrl) + state.iframeSrc = import.meta.env.VITE_APP_BASE_API + value.itemFile dialogVisible.value = true; } @@ -36,7 +42,7 @@ emit("getList") } const reset = () => { -state.pdfUrl = '' +state.iframeSrc = '' } defineExpose({ @@ -47,20 +53,10 @@ <style scoped lang="scss"> .notice{ - /* 针对 iframe 的滚动条 */ - iframe::-webkit-scrollbar { - width: 12px; /* 滚动条宽度 */ - } - iframe::-webkit-scrollbar-track { - background: #f1f1f1; /* 滚动条轨道背景 */ - border-radius: 10px; - } - iframe::-webkit-scrollbar-thumb { - background: #888; /* 滚动条滑块颜色 */ - border-radius: 10px; - } - iframe::-webkit-scrollbar-thumb:hover { - background: #555; /* 鼠标悬停时滑块颜色 */ + .custom-iframe { + border: 1px solid #9b9999; + /* 隐藏原生滚动条 */ + overflow: hidden; } } </style> diff --git a/src/views/signProject/index.vue b/src/views/signProject/index.vue index c3a7b6e..895f808 100644 --- a/src/views/signProject/index.vue +++ b/src/views/signProject/index.vue @@ -59,7 +59,7 @@ /> <circulation ref="circulationRef" @getList="getList"></circulation> <timeRecord ref="timeRecordRef" @getList="getList"></timeRecord> -<!-- <view-p ref="viewPRef" @getList="getList"></view-p>--> + <view-p ref="viewPRef" @getList="getList"></view-p> </div> </template> @@ -144,8 +144,9 @@ circulationRef.value.openDialog(value) } const view = (val) => { - const url =import.meta.env.VITE_APP_BASE_API +val.itemFile - window.open(url) + // const url =import.meta.env.VITE_APP_BASE_API +val.itemFile + // window.open(url) + viewPRef.value.openDialog(val) } const archiveBtn = (val) => { ElMessageBox.confirm( diff --git a/src/views/templateManage/components/createSign.vue b/src/views/templateManage/components/createSign.vue index 099f818..6c898d2 100644 --- a/src/views/templateManage/components/createSign.vue +++ b/src/views/templateManage/components/createSign.vue @@ -149,12 +149,13 @@ } const getUserList = async (val,deptId)=>{ if(deptId == '' || deptId == null){ - ElMessage.warning("请选择部门!") + // ElMessage.warning("请选择部门!") return; } if(val != ""){ const queryParams = { - name: val, + deptId: deptId, + nickName: val, } const res = await listUser(queryParams) if (res.code == 200) { diff --git a/src/views/templateManage/components/templateDialog.vue b/src/views/templateManage/components/templateDialog.vue index a1f70b9..de7e3c9 100644 --- a/src/views/templateManage/components/templateDialog.vue +++ b/src/views/templateManage/components/templateDialog.vue @@ -58,9 +58,14 @@ </el-form-item> </el-col> </el-row> - <el-form-item label="签署效果预览:" style="display: flex;flex-direction: column;align-items: flex-start"> - <div style="width: 500px;height: 100px;margin-left: 50px"> - + <el-form-item label="签署效果预览:" style="display: flex;flex-direction: column;align-items: flex-start;width: 100%"> + <div style="width: 100%;height: auto;margin-left: 50px"> + <iframe + :src="state.iframeSrc" + width="100%" + height="750px" + class="custom-iframe" + ></iframe> </div> </el-form-item> </el-form> @@ -103,6 +108,7 @@ header: { Authorization: getToken() }, + iframeSrc: '', deptName: '', typeList: [], limit: 1, @@ -126,6 +132,8 @@ url : import.meta.env.VITE_APP_BASE_API + state.form.filePath } state.form.fileList = [obj] + state.iframeSrc = import.meta.env.VITE_APP_BASE_API + state.form.filePath + console.log('xx',state.iframeSrc) }else { state.form.fileList = [] } @@ -204,8 +212,10 @@ typeId:null, deptId: null, filePath: '', - fileList: [] + fileList: [], + } + state.iframeSrc = '' } const handleRemove = (file) => { @@ -213,6 +223,7 @@ const newFileList = state.form.fileList.slice() newFileList.splice(index, 1) state.form.fileList = newFileList; + state.iframeSrc = '' } const f = ref() const handleChange = (file,fileList) => { @@ -231,6 +242,7 @@ // message: '文件上传成功' // }) state.form.filePath = res.fileName + state.iframeSrc = import.meta.env.VITE_APP_BASE_API + state.form.filePath }else { state.form.fileList = [] ElMessage({ @@ -250,10 +262,18 @@ :deep(.el-form .el-form-item__label) { font-size: 15px; } + :deep(.el-form-item__content) { + width: 100%; + } .file { display: flex; flex-direction: column; align-items: flex-start; } + .custom-iframe { + border: 1px solid #9b9999; + /* 隐藏原生滚动条 */ + overflow: hidden; + } } </style> diff --git a/src/views/templateManage/index.vue b/src/views/templateManage/index.vue index b2f4f6b..005cea7 100644 --- a/src/views/templateManage/index.vue +++ b/src/views/templateManage/index.vue @@ -1,10 +1,12 @@ <template> <div class="app-container"> - <div style="display: flex;justify-content: space-between;margin-bottom: 20px"> + <div style="display: flex;justify-content: space-between;margin-bottom: 10px"> <el-form :inline="true" style="display: flex;align-items: center;flex-wrap: wrap;" > <el-form-item> <el-button type="primary" + plain + icon="Plus" @click="addProject('add',{})" > 新增模板 -- Gitblit v1.9.2