This commit is contained in:
2025-08-14 18:53:50 +08:00
parent a6c2df39e2
commit 9184fe6974
9 changed files with 203 additions and 144 deletions

View File

@ -1,32 +1,6 @@
<template>
<el-table v-loading="loading" :data="drawingList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="版本号" align="center" prop="versionNumber" width="100" />
<el-table-column label="文件名称" align="center" prop="fileName">
<template #default="scope">
<span style="color: #409eff" @click="handleView(scope.row)">{{ scope.row.fileName }}</span>
</template>
</el-table-column>
<el-table-column label="图纸类型" align="center" prop="fileType" width="100">
<template #default="scope">
<dict-tag :options="drawing_file_type" :value="scope.row.fileType" />
</template>
</el-table-column>
<el-table-column label="原文件名" align="center" prop="originalName" />
<el-table-column label="是否最新" align="center" prop="newest">
<template #default="scope">
<div>
<el-tag type="primary" v-if="scope.row.newest == '1'"></el-tag>
<el-tag type="success" v-else></el-tag>
</div>
</template>
</el-table-column>
<el-table-column align="center" label="流程状态" min-width="70">
<template #default="scope">
<dict-tag :options="wf_business_status" :value="scope.row.status"></dict-tag>
</template>
</el-table-column>
<el-table-column label="上传时间" align="center" prop="createTime" /> -->
<el-table v-loading="loading" :data="drawingList">
<el-table-column type="index" label="序号" width="80" align="center" />
<el-table-column label="子项名称" align="center" prop="designSubitem" />
<el-table-column label="专业" align="center" prop="specialty">
<template #default="scope">
@ -43,39 +17,33 @@
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding " width="240">
<template #default="scope">
<el-col :span="1.5">
<el-button v-hasPermi="['design:drawing:remove']" size="small" type="primary" icon="Download" @click="handleDownload(scope.row)"
>下载</el-button
>
</el-col>
<!-- <el-row :gutter="10" class="mb8">
<el-col :span="1.5" v-if="scope.row.status === 'draft' || scope.row.status === 'cancel' || scope.row.status === 'back'">
<el-button v-hasPermi="['design:drawing:edit']" size="small" type="primary" icon="Edit" @click="handleUpdate(scope.row)">修改</el-button>
</el-col>
<el-col :span="1.5" v-if="scope.row.status === 'draft' || scope.row.status === 'cancel' || scope.row.status === 'back'">
<el-button v-hasPermi="['design:drawing:remove']" size="small" type="primary" icon="Delete" @click="handleDelete(scope.row)"
>删除</el-button
>
</el-col>
</el-row>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" size="small" icon="View" v-if="scope.row.status != 'draft'" @click="handleViewInfo(scope.row)">查看</el-button>
</el-col>
<el-col :span="1.5" v-if="scope.row.status === 'waiting'">
<el-button size="small" type="primary" icon="Notification" @click="handleCancelProcessApply(scope.row.id)">撤销</el-button>
</el-col>
</el-row> -->
<el-button v-hasPermi="['design:drawing:remove']" size="small" type="primary" icon="Download" @click="handleDownload(scope.row)"
>下载</el-button
>
<el-button size="small" type="primary" icon="view" @click="handleViewHis(scope.row)">查阅记录</el-button>
</template>
</el-table-column>
</el-table>
<el-dialog draggable title="文件列表" v-model="viewVisible" width="500px">
<el-table :data="histroyList" style="width: 100%" border>
<el-table-column type="index" label="序号" align="center" width="80"> </el-table-column>
<el-table-column prop="userName" label="用户名称" align="center"> </el-table-column>
<el-table-column prop="createTime" label="查阅时间" align="center"> </el-table-column>
</el-table>
<template #footer>
<span>
<el-button type="primary" @click="viewVisible = false">关闭</el-button>
</span>
</template>
</el-dialog>
</template>
<script setup lang="ts">
import { ref, defineProps, defineEmits } from 'vue';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
import { volumeFileViewer, volumeFileViewerList } from '@/api/design/drawing';
const { design_state, wf_business_status, des_user_major } = toRefs(proxy?.useDict('design_state', 'wf_business_status', 'des_user_major'));
const { des_user_major } = toRefs(proxy?.useDict('des_user_major'));
const props = defineProps({
drawingList: {
@ -95,6 +63,8 @@ const props = defineProps({
required: true
}
});
const viewVisible = ref(false);
const histroyList = ref([]);
const emits = defineEmits(['selection-change', 'view', 'update', 'delete', 'view-info', 'cancel-process-apply']);
@ -121,8 +91,19 @@ const handleViewInfo = (row) => {
const handleCancelProcessApply = (id) => {
emits('cancel-process-apply', id);
};
const handleViewHis = async (row) => {
viewVisible.value = true;
let res = await volumeFileViewerList(row.volumeFileId);
if (res.code == 200) {
histroyList.value = res.rows;
}
};
const handleDownload = (row) => {
getCheck(row);
proxy?.$download.oss(row.fileUrl);
};
// 调用查阅接口
const getCheck = async (row) => {
volumeFileViewer({ volumeFileId: row.volumeFileId });
};
</script>

View File

@ -7,11 +7,6 @@
<el-form-item label="文件名称" prop="fileName">
<el-input v-model="queryParams.fileName" placeholder="请输入文件名称" clearable @keyup.enter="handleQuery" />
</el-form-item>
<!-- <el-form-item label="文件类型" prop="fileType">
<el-select v-model="queryParams.fileType" placeholder="请选择文件类型" clearable>
<el-option v-for="dict in drawing_file_type" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item> -->
<el-form-item label="原文件名" prop="originalName">
<el-input v-model="queryParams.originalName" placeholder="请输入原文件名" clearable @keyup.enter="handleQuery" />
</el-form-item>
@ -32,56 +27,9 @@
<el-card shadow="never">
<template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['design:drawing:add']">上传图纸</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
</template>
<!-- <el-tabs type="border-card" v-model="activeName" class="demo-tabs" @tab-click="handleClick">
<el-tab-pane label="过程图纸" name="1">
<DrawingTable
:drawingList="drawingList"
:loading="loading"
:drawing_file_type="drawing_file_type"
:wf_business_status="wf_business_status"
@selection-change="handleSelectionChange"
@view="handleView"
@update="handleUpdate"
@delete="handleDelete"
@view-info="handleViewInfo"
@cancel-process-apply="handleCancelProcessApply"
/>
</el-tab-pane>
<el-tab-pane label="蓝图" name="2">
<DrawingTable
:drawingList="drawingList"
:loading="loading"
:drawing_file_type="drawing_file_type"
:wf_business_status="wf_business_status"
@selection-change="handleSelectionChange"
@view="handleView"
@update="handleUpdate"
@delete="handleDelete"
@view-info="handleViewInfo"
@cancel-process-apply="handleCancelProcessApply"
/>
</el-tab-pane>
<el-tab-pane label="变更图纸" name="3">
<DrawingTable
:drawingList="drawingList"
:loading="loading"
:drawing_file_type="drawing_file_type"
:wf_business_status="wf_business_status"
@selection-change="handleSelectionChange"
@view="handleView"
@update="handleUpdate"
@delete="handleDelete"
@view-info="handleViewInfo"
@cancel-process-apply="handleCancelProcessApply"
/>
</el-tab-pane>
</el-tabs> -->
<DrawingTable
:drawingList="drawingList"
:loading="loading"
@ -168,17 +116,6 @@ const handleSelectionChange = (selection: DrawingVO[]) => {
multiple.value = !selection.length;
};
/** 新增按钮操作 */
const handleAdd = () => {
proxy.$tab.closePage(proxy.$route);
proxy.$router.push({
path: `/design-management/drawing/indexEdit`,
query: {
type: 'add'
}
});
};
/** 修改按钮操作 */
const handleUpdate = async (row?: DrawingVO) => {
proxy.$tab.closePage(proxy.$route);