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

@ -61,3 +61,24 @@ export const delDrawing = (id: string | number | Array<string | number>) => {
method: 'delete'
});
};
/**
* 查阅
* @param id
*/
export const volumeFileViewer = (data) => {
return request({
url: '/design/volumeFileViewer',
method: 'post',
data
});
};
/**
* 查阅记录列表
* @param id
*/
export const volumeFileViewerList = (id) => {
return request({
url: '/design/volumeFileViewer/list?volumeFileId=' + id,
method: 'get'
});
};

View File

@ -1,5 +1,5 @@
<template>
<div class="p-6 bg-gray-50 condition">
<div class="p-6 bg-gray-50 Professional">
<transition>
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="never">
@ -206,7 +206,7 @@ onMounted(() => {
</script>
<style lang="scss">
.condition {
.Professional {
.el-tabs__header {
height: 84vh !important;
}

View File

@ -62,13 +62,11 @@ const props = defineProps({
type: Number
}
});
const uploadParams = computed(() => {
return {
catalogueId: props.catalogueId,
projectId: currentProject.value?.id
};
});
const uploadParams = ref({
catalogueId: '',
projectId: currentProject.value?.id
});
const total = ref(0);
const data = reactive({
queryParams: {
@ -85,7 +83,7 @@ const data = reactive({
changeReason: undefined,
status: undefined,
params: {},
catalogueId: props.catalogueId
catalogueId: undefined
}
});
const { queryParams } = toRefs(data);
@ -153,6 +151,14 @@ const onExport = (fileUrl) => {
onMounted(() => {
getList();
});
const getInfo = (id) => {
queryParams.value.catalogueId = id;
uploadParams.value.catalogueId = id;
getList();
};
defineExpose({
getInfo
});
</script>
<style lang="scss">

View File

@ -1,40 +1,58 @@
<template>
<div class="p-6 bg-gray-50 condition">
<el-tabs v-model="activeName" type="border-card" :tab-position="tabPosition" class="demo-tabs" @tab-click="handleClick">
<el-tab-pane :label="item.catalogueName" :name="item.id" v-for="(item, i) of FolderList" :key="i">
<div style="height: 80vh; background: #f0f8ff9e">
<filePage :catalogueId="item.id"></filePage>
<div class="file-category">
<span style="color: #757575; display: inline-block; margin-bottom: 15px">文件分类</span>
<!-- 优化了图标与文字的对齐和间距 -->
<div v-for="(item, i) of FolderList" :key="i" :class="{ active: currentActive === i }" @click="handleClick(item, i)" class="category-item">
<el-icon :size="20" class="folder-icon">
<Folder />
</el-icon>
<span class="folder-name">
{{ item.catalogueName }}
</span>
</div>
</div>
<div class="boxs">
<filePage :catalogueId="catalogueId" ref="filePageRef"></filePage>
</div>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script setup name="DataCollectionForm" lang="ts">
import { ref, reactive, computed, onMounted } from 'vue';
import { ref, computed, onMounted } from 'vue';
import { useUserStoreHook } from '@/store/modules/user';
import type { TabsPaneContext, TabsInstance } from 'element-plus';
import { collectCatalogueList } from '@/api/design/condition';
import filePage from './comm/filePage.vue';
const tabPosition = ref<TabsInstance['tabPosition']>('left');
const filePageRef = ref<typeof filePage | null>(null);
const activeName = ref('');
// 获取用户 store
const userStore = useUserStoreHook();
// 从 store 中获取当前选中的项目
const currentProject = computed(() => userStore.selectedProject);
const FolderList = ref([]);
const handleClick = (tab: TabsPaneContext, event: Event) => {
console.log(tab, event);
};
const catalogueId = ref(0);
// 查询收资清单目录列表
const getList = async () => {
let res = await collectCatalogueList({ projectId: currentProject.value?.id });
if (res.code == 200) {
FolderList.value = res.rows;
activeName.value = res.rows[0].id; //默认第一个
catalogueId.value = res.rows[0].id; //默认第一个
nextTick(() => {
filePageRef.value?.getInfo(catalogueId.value); //重新加载当前页
});
}
};
// 当前激活项的索引
const currentActive = ref(0);
// 点击事件处理函数
const handleClick = (item, index) => {
currentActive.value = index;
catalogueId.value = item.id;
nextTick(() => {
filePageRef.value?.getInfo(item.id); //重新加载当前页
});
};
// 页面挂载时初始化数据
onMounted(() => {
getList();
@ -43,8 +61,96 @@ onMounted(() => {
<style lang="scss">
.condition {
display: flex;
.el-tabs__header {
height: 84vh !important;
height: 90vh !important;
}
.file-category {
width: 200px;
display: flex;
flex-direction: column;
/* 移除固定宽度,让容器根据内容自适应 */
background-color: #ffffff;
padding: 10px;
border-radius: 6px;
/* 限制最大宽度,防止内容过长 */
/* max-width: 200px; */
margin-right: 10px;
}
.file-category > div {
cursor: pointer;
padding: 8px 12px;
margin-bottom: 4px;
border-radius: 4px;
display: flex;
/* 文本不换行,确保宽度由内容决定 */
white-space: nowrap;
transition: all 0.2s ease;
> span {
margin-left: 6px;
/* color: #676767;
font-size: 18px; */
}
}
.file-category {
width: 200px;
display: flex;
flex-direction: column;
background-color: #ffffff;
padding: 10px;
border-radius: 8px;
margin-right: 10px;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
// 分类项样式优化
.category-item {
cursor: pointer;
padding: 10px 12px;
margin-bottom: 4px;
border-radius: 6px;
display: inline-flex;
align-items: center; /* 垂直居中对齐 */
white-space: nowrap;
transition: all 0.25s ease;
font-size: 14px;
color: #334155;
line-height: 1; /* 确保行高一致 */
&:hover {
background-color: #f1f5f9;
transform: translateX(2px);
}
}
// 图标样式
.folder-icon {
color: #94a3b8;
transition: color 0.25s ease;
}
// 文件夹名称样式
.folder-name {
margin-left: 8px; /* 增加图标与文字间距 */
overflow: hidden;
text-overflow: ellipsis;
max-width: calc(100% - 30px); /* 限制最大宽度,防止溢出 */
}
// 活跃状态样式
.category-item.active {
background-color: #eff6ff;
color: #2563eb;
font-weight: 500;
.folder-icon {
color: #2563eb;
}
}
.boxs {
width: calc(100% - 220px);
}
}
</style>

View File

@ -79,7 +79,7 @@
</el-table-column>
<el-table-column label="变更内容" align="center" prop="changeContent" width="150" />
<el-table-column label="备注" align="center" prop="remark" width="150" />
<el-table-column label="操作" fixed="right" width="340">
<el-table-column label="操作" fixed="right" width="300">
<template #default="scope">
<el-button type="primary" link icon="Upload" @click="handleAddChange(scope.row)" v-if="!scope.row.fileId">上传</el-button>
<el-button type="success" link icon="View" v-if="scope.row.status != 'draft'" @click="handleViewInfo(scope.row)">查看</el-button>
@ -94,7 +94,7 @@
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card>
<wordDetial ref="wordDetialRef"></wordDetial>
<el-dialog title="文件列表" v-model="viewVisible" width="500px">
<el-dialog draggable title="文件列表" v-model="viewVisible" width="500px">
<el-table v-if="fileList.length > 0" :data="fileList" style="width: 100%" border>
<el-table-column prop="fileName" label="文件名称" align="center">
<template #default="scope">

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 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);

View File

@ -172,7 +172,7 @@
</el-form>
</el-dialog>
<!-- 查看文件列表 -->
<el-dialog title="文件列表" v-model="viewVisible" width="45%">
<el-dialog draggable title="文件列表" v-model="viewVisible" width="45%">
<el-table v-if="fileList.length > 0" :data="fileList" style="width: 100%" border>
<el-table-column prop="fileName" label="文件" align="center">
<template #default="scope">
@ -210,7 +210,7 @@
</span>
</template>
</el-dialog>
<el-dialog title="单据" v-model="dialogHistory" width="800px">
<el-dialog draggable title="单据" v-model="dialogHistory" width="800px">
<histroy ref="histroyRef"></histroy>
</el-dialog>
</div>

View File

@ -92,6 +92,14 @@
<el-dialog :title="dialog.title" v-model="dialog.visible" width="800px" append-to-body>
<el-form ref="materialReceiveFormRef" :model="form" :rules="rules" label-width="110px">
<el-row>
<el-col :span="12">
<el-form-item label="材料来源" prop="materialSource">
<el-select v-model="form.materialSource" filterable placeholder="请选择材料来源" style="width: 100%">
<el-option label="甲供材料" value="1"></el-option>
<el-option label="已供材料" value="2"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="表单编号" prop="formCode">
<el-input v-model="form.formCode" placeholder="请输入表单编号" />