|
|
@@ -25,9 +25,6 @@
|
|
|
<el-button type="warning" :disabled="selectedIds.length === 0" @click="handleBatchEnter">
|
|
|
<el-icon><CircleCheck /></el-icon> 批量入库
|
|
|
</el-button>
|
|
|
- <el-button type="primary" :disabled="selectedIds.length === 0" @click="handleBatchAddToTask">
|
|
|
- <el-icon><Tickets /></el-icon> 批量加入任务
|
|
|
- </el-button>
|
|
|
<el-button type="success" class="upload-btn" @click="handleUpload">
|
|
|
<el-icon><Upload /></el-icon> 上传文档
|
|
|
</el-button>
|
|
|
@@ -53,25 +50,17 @@
|
|
|
<div class="filter-group">
|
|
|
<el-select v-model="searchQuery.table_type" placeholder="所属知识库" clearable class="filter-select">
|
|
|
<el-option label="全部知识库" :value="null" />
|
|
|
- <el-option label="施工标准规范知识库" value="standard" />
|
|
|
- <el-option label="施工方案知识库" value="construction_plan" />
|
|
|
- <el-option label="办公制度知识库" value="regulation" />
|
|
|
+ <el-option label="施工标准规范知识库" value="basis" />
|
|
|
+ <el-option label="施工方案知识库" value="work" />
|
|
|
+ <el-option label="办公制度知识库" value="job" />
|
|
|
</el-select>
|
|
|
|
|
|
<el-select v-model="searchQuery.whether_to_enter" placeholder="入库状态" clearable class="filter-select">
|
|
|
- <el-option label="全部入库状态" :value="null" />
|
|
|
+ <el-option label="全部状态" :value="null" />
|
|
|
<el-option label="未入库" :value="0" />
|
|
|
<el-option label="已入库" :value="1" />
|
|
|
</el-select>
|
|
|
|
|
|
- <el-select v-model="searchQuery.conversion_status" placeholder="解析状态" clearable class="filter-select">
|
|
|
- <el-option label="全部解析状态" :value="null" />
|
|
|
- <el-option label="未转换" :value="0" />
|
|
|
- <el-option label="转换中" :value="1" />
|
|
|
- <el-option label="转换成功" :value="2" />
|
|
|
- <el-option label="转换失败" :value="3" />
|
|
|
- </el-select>
|
|
|
-
|
|
|
<el-button type="primary" @click="handleSearch" class="search-btn">
|
|
|
<el-icon><Filter /></el-icon> 检索
|
|
|
</el-button>
|
|
|
@@ -227,18 +216,6 @@
|
|
|
<el-icon><Delete /></el-icon>
|
|
|
</el-button>
|
|
|
</el-tooltip>
|
|
|
-
|
|
|
- <el-tooltip content="入库" placement="top">
|
|
|
- <el-button
|
|
|
- link
|
|
|
- type="warning"
|
|
|
- @click="handleSingleEnter(scope.row)"
|
|
|
- :disabled="isEntered(scope.row.whether_to_enter)"
|
|
|
- class="action-btn-icon"
|
|
|
- >
|
|
|
- <el-icon><CircleCheck /></el-icon>
|
|
|
- </el-button>
|
|
|
- </el-tooltip>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
@@ -316,9 +293,9 @@
|
|
|
<el-form :model="uploadForm" label-width="100px">
|
|
|
<el-form-item label="所属知识库" required>
|
|
|
<el-select v-model="uploadForm.table_type" placeholder="请选择知识库">
|
|
|
- <el-option label="施工标准规范知识库" value="standard" />
|
|
|
- <el-option label="施工方案知识库" value="construction_plan" />
|
|
|
- <el-option label="办公制度知识库" value="regulation" />
|
|
|
+ <el-option label="施工标准规范知识库" value="basis" />
|
|
|
+ <el-option label="施工方案知识库" value="work" />
|
|
|
+ <el-option label="办公制度知识库" value="job" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="文档标题" required>
|
|
|
@@ -356,130 +333,72 @@
|
|
|
</el-dialog>
|
|
|
|
|
|
<!-- 编辑文档对话框 -->
|
|
|
- <el-dialog v-model="editDialogVisible" :title="formTitle" width="800px">
|
|
|
- <el-form :model="editForm" label-width="110px">
|
|
|
- <el-row :gutter="20">
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item :label="titleLabel" required>
|
|
|
- <el-input v-model="editForm.title" :placeholder="'请输入' + titleLabel" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
-
|
|
|
- <el-col :span="12" v-if="editForm.table_type === 'standard'">
|
|
|
- <el-form-item label="英文名称">
|
|
|
- <el-input v-model="editForm.english_name" placeholder="请输入英文名称" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
-
|
|
|
- <el-col :span="12" v-if="editForm.table_type === 'standard'">
|
|
|
- <el-form-item label="标准编号">
|
|
|
- <el-input v-model="editForm.standard_no" placeholder="请输入标准编号" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
-
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item :label="authorityLabel">
|
|
|
- <el-input v-model="editForm.issuing_authority" :placeholder="'请输入' + authorityLabel" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
-
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item :label="dateLabel">
|
|
|
- <el-date-picker v-model="editForm.release_date" type="date" placeholder="选择日期" value-format="YYYY-MM-DD" style="width: 100%" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
-
|
|
|
- <el-col :span="12" v-if="editForm.table_type === 'standard'">
|
|
|
- <el-form-item label="实施日期">
|
|
|
- <el-date-picker v-model="editForm.implementation_date" type="date" placeholder="选择实施日期" value-format="YYYY-MM-DD" style="width: 100%" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
-
|
|
|
- <el-col :span="12" v-if="editForm.table_type === 'standard' || editForm.table_type === 'regulation'">
|
|
|
- <el-form-item label="文件类型">
|
|
|
- <el-select v-model="editForm.document_type" placeholder="请选择文件类型" style="width: 100%">
|
|
|
- <el-option v-for="item in documentTypeOptions" :key="item" :label="item" :value="item" />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
-
|
|
|
- <el-col :span="12" v-if="editForm.table_type === 'standard'">
|
|
|
- <el-form-item label="专业领域">
|
|
|
- <el-select v-model="editForm.professional_field" placeholder="请选择专业领域" style="width: 100%">
|
|
|
- <el-option v-for="item in professionalFieldOptions" :key="item" :label="item" :value="item" />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
-
|
|
|
- <el-col :span="12" v-if="editForm.table_type === 'standard'">
|
|
|
- <el-form-item label="时效性">
|
|
|
- <el-select v-model="editForm.validity" placeholder="请选择时效性" style="width: 100%">
|
|
|
- <el-option label="现行" value="现行" />
|
|
|
- <el-option label="已废止" value="已废止" />
|
|
|
- <el-option label="被替代" value="被替代" />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
-
|
|
|
- <el-col :span="12" v-if="editForm.table_type === 'standard'">
|
|
|
- <el-form-item label="起草单位">
|
|
|
- <el-input v-model="editForm.drafting_unit" placeholder="请输入起草单位" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
-
|
|
|
- <el-col :span="12" v-if="editForm.table_type === 'standard'">
|
|
|
- <el-form-item label="批准部门">
|
|
|
- <el-input v-model="editForm.approving_department" placeholder="请输入批准部门" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
-
|
|
|
- <el-col :span="24" v-if="editForm.table_type === 'standard'">
|
|
|
- <el-form-item label="参编单位">
|
|
|
- <div v-for="(unit, index) in participatingUnitsList" :key="index" class="dynamic-input-row">
|
|
|
- <el-input v-model="participatingUnitsList[index]" placeholder="请输入参编单位" />
|
|
|
- <div class="row-actions">
|
|
|
- <el-button :icon="Plus" circle size="small" @click="addListItem(participatingUnitsList)" />
|
|
|
- <el-button :icon="Minus" circle size="small" type="danger" @click="removeListItem(participatingUnitsList, index)" v-if="participatingUnitsList.length > 1" />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
-
|
|
|
- <el-col :span="12" v-if="editForm.table_type === 'standard'">
|
|
|
- <el-form-item label="工程阶段">
|
|
|
- <el-input v-model="editForm.engineering_phase" placeholder="请输入工程阶段" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
-
|
|
|
- <el-col :span="24" v-if="editForm.table_type === 'standard'">
|
|
|
- <el-form-item label="引用依据">
|
|
|
- <div v-for="(std, index) in referenceBasisList" :key="index" class="dynamic-input-row">
|
|
|
- <el-input v-model="referenceBasisList[index]" placeholder="请输入引用依据" />
|
|
|
- <div class="row-actions">
|
|
|
- <el-button :icon="Plus" circle size="small" @click="addListItem(referenceBasisList)" />
|
|
|
- <el-button :icon="Minus" circle size="small" type="danger" @click="removeListItem(referenceBasisList, index)" v-if="referenceBasisList.length > 1" />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
-
|
|
|
- <el-col :span="12" v-if="editForm.table_type === 'standard'">
|
|
|
- <el-form-item label="来源链接">
|
|
|
- <el-input v-model="editForm.source_url" placeholder="请输入来源链接" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
+ <el-dialog v-model="editDialogVisible" title="编辑文档" width="700px">
|
|
|
+ <el-form :model="editForm" label-width="120px">
|
|
|
+ <el-divider content-position="left">基础信息</el-divider>
|
|
|
+ <el-form-item label="所属知识库" required>
|
|
|
+ <el-select v-model="editForm.table_type" disabled placeholder="请选择知识库" style="width: 100%">
|
|
|
+ <el-option label="施工标准规范知识库" value="basis" />
|
|
|
+ <el-option label="施工方案知识库" value="work" />
|
|
|
+ <el-option label="办公制度知识库" value="job" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="文档标题" required>
|
|
|
+ <el-input v-model="editForm.title" placeholder="请输入文档标题" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="文档链接" v-if="false">
|
|
|
+ <el-input v-model="editForm.file_url" placeholder="请输入文档链接 (URL)" />
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-divider content-position="left">专业属性补全</el-divider>
|
|
|
+
|
|
|
+ <!-- 施工标准规范特有字段 -->
|
|
|
+ <template v-if="editForm.table_type === 'basis'">
|
|
|
+ <el-form-item label="标准编号">
|
|
|
+ <el-input v-model="editForm.standard_no" placeholder="如:GB/T 50001-2017" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="发布单位">
|
|
|
+ <el-input v-model="editForm.issuing_authority" placeholder="请输入发布单位" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="发布日期">
|
|
|
+ <el-date-picker v-model="editForm.release_date" type="date" placeholder="选择日期" value-format="YYYY-MM-DD" style="width: 100%" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="文件类型">
|
|
|
+ <el-input v-model="editForm.document_type" placeholder="如:国家标准" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="时效性">
|
|
|
+ <el-select v-model="editForm.validity" placeholder="请选择" style="width: 100%">
|
|
|
+ <el-option label="现行" value="现行" />
|
|
|
+ <el-option label="已废止" value="已废止" />
|
|
|
+ <el-option label="被替代" value="被替代" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-form-item label="专业领域">
|
|
|
+ <el-input v-model="editForm.professional_field" placeholder="如:建筑工程" />
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
|
|
|
- <template v-if="editForm.table_type === 'construction_plan'">
|
|
|
+ <!-- 施工方案特有字段 -->
|
|
|
+ <template v-else-if="editForm.table_type === 'work'">
|
|
|
+ <el-row :gutter="20">
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="项目名称">
|
|
|
+ <el-form-item label="工程名称">
|
|
|
<el-input v-model="editForm.project_name" placeholder="请输入项目名称" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="项目标段">
|
|
|
+ <el-form-item label="工程标段">
|
|
|
<el-input v-model="editForm.project_section" placeholder="请输入项目标段" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="20">
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="方案类别">
|
|
|
<el-select v-model="editForm.plan_category" placeholder="请选择方案类别" style="width: 100%">
|
|
|
@@ -492,6 +411,8 @@
|
|
|
<el-input v-model="editForm.level_1_classification" disabled />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="20">
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="二级分类">
|
|
|
<el-select v-model="editForm.level_2_classification" placeholder="请选择二级分类" style="width: 100%">
|
|
|
@@ -506,6 +427,8 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="20">
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="四级分类">
|
|
|
<el-select v-model="editForm.level_4_classification" placeholder="请选择四级分类" style="width: 100%">
|
|
|
@@ -513,47 +436,48 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="方案摘要">
|
|
|
- <el-input v-model="editForm.plan_summary" type="textarea" :rows="3" placeholder="请输入方案摘要" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="编制依据">
|
|
|
- <div v-for="(planStd, index) in compilationBasisList" :key="index" class="dynamic-input-row">
|
|
|
- <el-input v-model="compilationBasisList[index]" placeholder="请输入编制依据" />
|
|
|
- <div class="row-actions">
|
|
|
- <el-button :icon="Plus" circle size="small" @click="addListItem(compilationBasisList)" />
|
|
|
- <el-button :icon="Minus" circle size="small" type="danger" @click="removeListItem(compilationBasisList, index)" v-if="compilationBasisList.length > 1" />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </template>
|
|
|
-
|
|
|
- <template v-if="editForm.table_type === 'regulation'">
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="生效日期">
|
|
|
- <el-date-picker v-model="editForm.effective_start_date" type="date" placeholder="选择生效日期" value-format="YYYY-MM-DD" style="width: 100%" />
|
|
|
+ <el-form-item label="编制单位">
|
|
|
+ <el-input v-model="editForm.issuing_authority" placeholder="请输入编制单位" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="20">
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="失效日期">
|
|
|
- <el-date-picker v-model="editForm.effective_end_date" type="date" placeholder="选择失效日期" value-format="YYYY-MM-DD" style="width: 100%" />
|
|
|
+ <el-form-item label="编制日期">
|
|
|
+ <el-date-picker v-model="editForm.release_date" type="date" placeholder="选择日期" value-format="YYYY-MM-DD" style="width: 100%" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- </template>
|
|
|
+ </el-row>
|
|
|
+ <el-form-item label="方案摘要">
|
|
|
+ <el-input v-model="editForm.plan_summary" type="textarea" :rows="3" placeholder="请输入方案摘要" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="施工标准规范">
|
|
|
+ <el-input v-model="editForm.compilation_basis" type="textarea" :rows="3" placeholder="请输入施工标准规范,多个依据请用逗号分隔" />
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <!-- 办公制度特有字段 -->
|
|
|
+ <template v-else-if="editForm.table_type === 'job'">
|
|
|
+ <el-form-item label="发布部门">
|
|
|
+ <el-input v-model="editForm.issuing_authority" placeholder="请输入发布部门" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="制度类型">
|
|
|
+ <el-input v-model="editForm.document_type" placeholder="如:行政管理" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="发布日期">
|
|
|
+ <el-date-picker v-model="editForm.release_date" type="date" placeholder="选择日期" value-format="YYYY-MM-DD" style="width: 100%" />
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="备注">
|
|
|
- <el-input v-model="editForm.note" type="textarea" :rows="2" placeholder="请输入备注" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
+ <el-divider content-position="left">文档备注</el-divider>
|
|
|
+ <el-form-item label="文档备注">
|
|
|
+ <el-input v-model="editForm.note" type="textarea" :rows="6" placeholder="请输入文档备注" />
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
|
<template #footer>
|
|
|
<el-button @click="editDialogVisible = false">取消</el-button>
|
|
|
- <el-button type="primary" @click="submitEdit" :loading="submitting">确定</el-button>
|
|
|
+ <el-button type="primary" @click="submitEdit" :loading="submitting">确定保存</el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
|
|
|
@@ -575,38 +499,9 @@
|
|
|
<div class="content-preview">{{ currentDoc?.note || '暂无备注' }}</div>
|
|
|
</el-descriptions-item>
|
|
|
|
|
|
- <!-- 施工标准规范特有详情 -->
|
|
|
- <template v-if="currentDoc?.source_type === 'standard'">
|
|
|
- <el-descriptions-item label="标准编号">{{ currentDoc?.standard_no || '-' }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="英文名称">{{ currentDoc?.english_name || '-' }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="发布单位">{{ currentDoc?.issuing_authority || '-' }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="发布日期">{{ formatDate(currentDoc?.release_date) }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="实施日期">{{ formatDate(currentDoc?.implementation_date) }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="起草单位">{{ currentDoc?.drafting_unit || '-' }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="批准部门">{{ currentDoc?.approving_department || '-' }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="文件类型">{{ currentDoc?.document_type || '-' }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="专业领域">{{ currentDoc?.professional_field || '-' }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="时效性">{{ currentDoc?.validity || '-' }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="参编单位">
|
|
|
- <div v-if="currentDoc?.participating_units">
|
|
|
- <div v-for="(unit, idx) in currentDoc.participating_units.split(';')" :key="idx">{{ unit }}</div>
|
|
|
- </div>
|
|
|
- <span v-else>-</span>
|
|
|
- </el-descriptions-item>
|
|
|
- <el-descriptions-item label="引用依据">
|
|
|
- <div v-if="currentDoc?.reference_basis">
|
|
|
- <div v-for="(std, idx) in currentDoc.reference_basis.split(';')" :key="idx">{{ std }}</div>
|
|
|
- </div>
|
|
|
- <span v-else>-</span>
|
|
|
- </el-descriptions-item>
|
|
|
- <el-descriptions-item label="来源 URL">{{ currentDoc?.source_url || '-' }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="工程阶段">{{ currentDoc?.engineering_phase || '-' }}</el-descriptions-item>
|
|
|
- </template>
|
|
|
-
|
|
|
<!-- 施工方案特有详情 -->
|
|
|
- <template v-else-if="currentDoc?.source_type === 'construction_plan'">
|
|
|
+ <template v-if="currentDoc?.source_type === 'work'">
|
|
|
<el-descriptions-item label="工程名称">{{ currentDoc?.project_name || '-' }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="英文名称">{{ currentDoc?.english_name || '-' }}</el-descriptions-item>
|
|
|
<el-descriptions-item label="工程标段">{{ currentDoc?.project_section || '-' }}</el-descriptions-item>
|
|
|
<el-descriptions-item label="方案类别">{{ currentDoc?.plan_category || '-' }}</el-descriptions-item>
|
|
|
<el-descriptions-item label="一级分类">{{ currentDoc?.level_1_classification || '-' }}</el-descriptions-item>
|
|
|
@@ -618,23 +513,10 @@
|
|
|
<el-descriptions-item label="方案摘要">
|
|
|
<div class="content-preview">{{ currentDoc?.plan_summary || '-' }}</div>
|
|
|
</el-descriptions-item>
|
|
|
- <el-descriptions-item label="编制依据">
|
|
|
- <div v-if="currentDoc?.compilation_basis">
|
|
|
- <div v-for="(planStd, idx) in currentDoc.compilation_basis.split(';')" :key="idx">{{ planStd }}</div>
|
|
|
- </div>
|
|
|
- <span v-else>-</span>
|
|
|
+ <el-descriptions-item label="施工标准规范">
|
|
|
+ <div class="content-preview">{{ currentDoc?.compilation_basis || '-' }}</div>
|
|
|
</el-descriptions-item>
|
|
|
</template>
|
|
|
-
|
|
|
- <!-- 办公制度特有详情 -->
|
|
|
- <template v-else-if="currentDoc?.source_type === 'regulation'">
|
|
|
- <el-descriptions-item label="发布部门">{{ currentDoc?.issuing_authority || '-' }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="英文名称">{{ currentDoc?.english_name || '-' }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="制度类型">{{ currentDoc?.document_type || '-' }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="发布日期">{{ formatDate(currentDoc?.release_date) }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="生效日期">{{ formatDate(currentDoc?.effective_start_date) }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="失效日期">{{ formatDate(currentDoc?.effective_end_date) }}</el-descriptions-item>
|
|
|
- </template>
|
|
|
</el-descriptions>
|
|
|
<template #footer>
|
|
|
<div class="detail-footer">
|
|
|
@@ -660,40 +542,13 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
-
|
|
|
- <!-- 入库确认对话框 -->
|
|
|
- <el-dialog v-model="ingestDialogVisible" title="文档入库" width="450px">
|
|
|
- <el-form :model="ingestForm" label-width="100px">
|
|
|
- <el-form-item label="选择知识库" required>
|
|
|
- <el-select v-model="ingestForm.kb_id" placeholder="请选择知识库" style="width: 100%">
|
|
|
- <el-option
|
|
|
- v-for="item in knowledgeBases"
|
|
|
- :key="item.id"
|
|
|
- :label="item.name"
|
|
|
- :value="item.id"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="切分方式" required>
|
|
|
- <el-radio-group v-model="ingestForm.kb_method">
|
|
|
- <el-radio label="length">按长度切分</el-radio>
|
|
|
- <el-radio label="symbol">按符号切分</el-radio>
|
|
|
- <el-radio label="parent_child">父子段切分</el-radio>
|
|
|
- </el-radio-group>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- <template #footer>
|
|
|
- <el-button @click="ingestDialogVisible = false">取消</el-button>
|
|
|
- <el-button type="primary" @click="confirmIngest" :loading="ingesting">确认入库</el-button>
|
|
|
- </template>
|
|
|
- </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
import { ref, reactive, onMounted, onUnmounted, computed } from 'vue'
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
-import { Search, Filter, Upload, CircleCheck, Delete, Document, Warning, TopRight, Grid, DataAnalysis, Link, View, Switch, Edit, User, Download, Plus, Minus, Tickets } from '@element-plus/icons-vue'
|
|
|
+import { Search, Filter, Upload, CircleCheck, Delete, Document, Warning, TopRight, Grid, DataAnalysis, Link, View, Switch, Edit, User, Download } from '@element-plus/icons-vue'
|
|
|
import request from '@/api/request'
|
|
|
import axios from 'axios'
|
|
|
import { downloadFile } from '@/utils/download'
|
|
|
@@ -716,16 +571,6 @@ const previewLoading = ref(false)
|
|
|
const previewTitle = ref('')
|
|
|
const previewUrl = ref('')
|
|
|
const previewDocType = ref('') // 'original' or 'md'
|
|
|
-
|
|
|
-// 入库相关状态
|
|
|
-const ingestDialogVisible = ref(false)
|
|
|
-const ingesting = ref(false)
|
|
|
-const knowledgeBases = ref<any[]>([])
|
|
|
-const ingestForm = reactive({
|
|
|
- kb_id: '',
|
|
|
- kb_method: 'length'
|
|
|
-})
|
|
|
-
|
|
|
const isOfficeDoc = ref(false)
|
|
|
const total = ref(0)
|
|
|
const statistics = ref({
|
|
|
@@ -740,7 +585,7 @@ const editForm = reactive({
|
|
|
id: '',
|
|
|
title: '',
|
|
|
note: '',
|
|
|
- table_type: 'standard' as 'standard' | 'construction_plan' | 'regulation',
|
|
|
+ table_type: 'basis' as 'basis' | 'work' | 'job',
|
|
|
year: new Date().getFullYear(),
|
|
|
// 扩展字段 (子表特有属性)
|
|
|
standard_no: '',
|
|
|
@@ -758,85 +603,23 @@ const editForm = reactive({
|
|
|
level_4_classification: '',
|
|
|
plan_summary: '',
|
|
|
compilation_basis: '',
|
|
|
- file_url: '',
|
|
|
- // 补全缺失字段
|
|
|
- english_name: '',
|
|
|
- implementation_date: '',
|
|
|
- drafting_unit: '',
|
|
|
- approving_department: '',
|
|
|
- engineering_phase: '',
|
|
|
- participating_units: '',
|
|
|
- reference_basis: '',
|
|
|
- source_url: '',
|
|
|
- effective_start_date: '',
|
|
|
- effective_end_date: ''
|
|
|
+ file_url: ''
|
|
|
})
|
|
|
|
|
|
-const participatingUnitsList = ref<string[]>([''])
|
|
|
-const referenceBasisList = ref<string[]>([''])
|
|
|
-const compilationBasisList = ref<string[]>([''])
|
|
|
-
|
|
|
const planCategoryOptions = ['超危大方案', '超危大方案较大II级', '超危大方案特大IV级', '超危大方案一般I级', '超危大方案重大III级', '危大方案', '一般方案']
|
|
|
const level2Options = ['临建工程', '路基工程', '其他', '桥梁工程', '隧道工程']
|
|
|
const level3Options = ['/', 'TBM施工', '拌和站安、拆施工', '不良地质隧道施工', '常规桥梁', '挡土墙工程类', '辅助坑道施工', '复杂洞口工程施工', '钢筋加工场安、拆', '钢栈桥施工', '拱桥', '涵洞工程类', '滑坡体处理类', '路堤', '路堑', '其他', '深基坑', '隧道总体施工', '特殊结构隧道', '斜拉桥', '悬索桥']
|
|
|
const level4Options = ['/', '挡土墙', '顶管', '断层破碎带及软弱围岩', '钢筋砼箱涵', '高填路堤', '抗滑桩', '其他', '软岩大变形隧道', '上部结构', '深基坑开挖与支护', '深挖路堑', '隧道TBM', '隧道进洞', '隧道竖井', '隧道斜井', '特种设备', '瓦斯隧道', '下部结构', '小净距隧道', '岩爆隧道', '岩溶隧道', '涌水突泥隧道', '桩基础']
|
|
|
-const documentTypeOptions = ['国家标准', '行业标准', '地方标准', '企业标准', '团体标准', '国际标准', '其他']
|
|
|
-const professionalFieldOptions = ['通用标准', '勘察钻探', '地基基础', '路基路面', '桥梁工程', '隧道工程', '交通工程', '港口航道', '铁路工程', '市政工程', '房建工程', '水利电力', '信息化', '试验检测', '安全环保']
|
|
|
-
|
|
|
-// 列表项管理
|
|
|
-const addListItem = (list: string[]) => {
|
|
|
- list.push('')
|
|
|
-}
|
|
|
-
|
|
|
-const removeListItem = (list: string[], index: number) => {
|
|
|
- if (list.length > 1) {
|
|
|
- list.splice(index, 1)
|
|
|
- } else {
|
|
|
- list[0] = ''
|
|
|
- }
|
|
|
-}
|
|
|
|
|
|
const currentTitle = computed(() => {
|
|
|
return '文档管理中心'
|
|
|
})
|
|
|
-
|
|
|
-const formTitle = computed(() => {
|
|
|
- const typeMap: Record<string, string> = {
|
|
|
- standard: '施工标准规范',
|
|
|
- construction_plan: '施工方案',
|
|
|
- regulation: '办公制度'
|
|
|
- }
|
|
|
- return `编辑${typeMap[editForm.table_type] || ''}`
|
|
|
-})
|
|
|
-
|
|
|
-const titleLabel = computed(() => {
|
|
|
- if (editForm.table_type === 'standard') return '标准名称'
|
|
|
- if (editForm.table_type === 'construction_plan') return '方案名称'
|
|
|
- if (editForm.table_type === 'regulation') return '制度名称'
|
|
|
- return '文档名称'
|
|
|
-})
|
|
|
-
|
|
|
-const authorityLabel = computed(() => {
|
|
|
- if (editForm.table_type === 'standard') return '发布单位'
|
|
|
- if (editForm.table_type === 'construction_plan') return '编制单位'
|
|
|
- if (editForm.table_type === 'regulation') return '发布部门'
|
|
|
- return '发布机构'
|
|
|
-})
|
|
|
-
|
|
|
-const dateLabel = computed(() => {
|
|
|
- if (editForm.table_type === 'standard') return '发布日期'
|
|
|
- if (editForm.table_type === 'construction_plan') return '编制日期'
|
|
|
- if (editForm.table_type === 'regulation') return '发布日期'
|
|
|
- return '日期'
|
|
|
-})
|
|
|
-
|
|
|
const selectedIds = ref<string[]>([])
|
|
|
|
|
|
const searchQuery = reactive({
|
|
|
keyword: '',
|
|
|
table_type: null as string | null,
|
|
|
whether_to_enter: null as number | null,
|
|
|
- conversion_status: null as number | null,
|
|
|
page: 1,
|
|
|
size: 10
|
|
|
})
|
|
|
@@ -845,7 +628,7 @@ const uploadForm = reactive({
|
|
|
title: '',
|
|
|
note: '',
|
|
|
file_url: '',
|
|
|
- table_type: 'standard' as 'standard' | 'construction_plan' | 'regulation',
|
|
|
+ table_type: 'basis' as 'basis' | 'work' | 'job',
|
|
|
year: new Date().getFullYear()
|
|
|
})
|
|
|
|
|
|
@@ -894,27 +677,27 @@ const getFileIconClass = (row: DocumentItem) => {
|
|
|
|
|
|
const getKnowledgeBaseName = (sourceType: string | null | undefined) => {
|
|
|
const names: Record<string, string> = {
|
|
|
- standard: '施工标准规范知识库',
|
|
|
- construction_plan: '施工方案知识库',
|
|
|
- regulation: '办公制度知识库'
|
|
|
+ basis: '施工标准规范知识库',
|
|
|
+ work: '施工方案知识库',
|
|
|
+ job: '办公制度知识库'
|
|
|
}
|
|
|
return names[sourceType || ''] || '未知知识库'
|
|
|
}
|
|
|
|
|
|
const getKnowledgeBaseShortName = (sourceType: string | null | undefined) => {
|
|
|
const names: Record<string, string> = {
|
|
|
- standard: '施工标准规范',
|
|
|
- construction_plan: '施工方案',
|
|
|
- regulation: '办公制度'
|
|
|
+ basis: '施工标准规范',
|
|
|
+ work: '施工方案',
|
|
|
+ job: '办公制度'
|
|
|
}
|
|
|
return names[sourceType || ''] || '未知'
|
|
|
}
|
|
|
|
|
|
const getKBTagType = (sourceType: string | null | undefined) => {
|
|
|
const types: Record<string, string> = {
|
|
|
- standard: 'primary',
|
|
|
- construction_plan: 'success',
|
|
|
- regulation: 'warning'
|
|
|
+ basis: 'primary',
|
|
|
+ work: 'success',
|
|
|
+ job: 'warning'
|
|
|
}
|
|
|
return types[sourceType || ''] || 'info'
|
|
|
}
|
|
|
@@ -933,108 +716,67 @@ const handleSelectionChange = (selection: DocumentItem[]) => {
|
|
|
selectedIds.value = selection.map(item => item.id)
|
|
|
}
|
|
|
|
|
|
-const loadKnowledgeBases = async () => {
|
|
|
- try {
|
|
|
- const res = await request.get<ApiResponse<any[]>>('/api/v1/sample/knowledge-base/list')
|
|
|
- if (res.code === 0) {
|
|
|
- knowledgeBases.value = res.data
|
|
|
- if (knowledgeBases.value.length > 0 && !ingestForm.kb_id) {
|
|
|
- ingestForm.kb_id = knowledgeBases.value[0].id
|
|
|
- }
|
|
|
- }
|
|
|
- } catch (error) {
|
|
|
- console.error('获取知识库失败:', error)
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-const confirmIngest = async () => {
|
|
|
- if (!ingestForm.kb_id) {
|
|
|
- ElMessage.warning('请选择知识库')
|
|
|
- return
|
|
|
- }
|
|
|
+const handleBatchEnter = async () => {
|
|
|
+ if (selectedIds.value.length === 0) return
|
|
|
|
|
|
- if (selectedIds.value.length === 0) {
|
|
|
- ElMessage.warning('请先选择要入库的文档')
|
|
|
- return
|
|
|
- }
|
|
|
+ const ids = [...selectedIds.value]
|
|
|
|
|
|
- ingesting.value = true
|
|
|
try {
|
|
|
- // 统一使用 batch-enter 接口
|
|
|
- const res = await request.post<ApiResponse>('/api/v1/sample/documents/batch-enter', {
|
|
|
- ids: selectedIds.value,
|
|
|
- kb_id: ingestForm.kb_id,
|
|
|
- kb_method: ingestForm.kb_method,
|
|
|
- table_type: searchQuery.table_type // 传递当前的表类型上下文
|
|
|
- })
|
|
|
-
|
|
|
+ const res = await documentApi.batchEnter(ids)
|
|
|
if (res.code === 0) {
|
|
|
- ElMessage.success(res.message || '已加入入库队列')
|
|
|
- ingestDialogVisible.value = false
|
|
|
- // 入库成功后清空选择并刷新列表
|
|
|
- selectedIds.value = []
|
|
|
+ // 如果有详细详情(换行符标识),使用 MessageBox 显示
|
|
|
+ if (res.message && res.message.includes('\n')) {
|
|
|
+ ElMessageBox.alert(res.message, '入库结果', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ customStyle: { 'white-space': 'pre-wrap' },
|
|
|
+ type: res.message.includes('失败') || res.message.includes('跳过') ? 'warning' : 'success'
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ ElMessage.success(res.message || '入库成功')
|
|
|
+ }
|
|
|
fetchDocuments()
|
|
|
} else {
|
|
|
- ElMessage.error(res.message || '入库失败')
|
|
|
+ ElMessageBox.alert(res.message || '入库失败', '操作失败', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
}
|
|
|
} catch (error) {
|
|
|
- console.error('入库失败:', error)
|
|
|
- ElMessage.error('网络错误,请稍后重试')
|
|
|
- } finally {
|
|
|
- ingesting.value = false
|
|
|
+ console.error('批量入库失败:', error)
|
|
|
+ ElMessage.error('网络连接异常,请稍后重试')
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-const handleBatchEnter = async () => {
|
|
|
- if (selectedIds.value.length === 0) {
|
|
|
- ElMessage.warning('请先选择要入库的文档')
|
|
|
- return
|
|
|
- }
|
|
|
- loadKnowledgeBases()
|
|
|
- ingestDialogVisible.value = true
|
|
|
-}
|
|
|
-
|
|
|
-const handleBatchAddToTask = async () => {
|
|
|
- if (selectedIds.value.length === 0) {
|
|
|
- ElMessage.warning('请先选择要加入任务的文档')
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
+const handleSingleEnter = async (doc: DocumentItem | null) => {
|
|
|
+ if (!doc) return
|
|
|
+
|
|
|
try {
|
|
|
- await ElMessageBox.confirm(
|
|
|
- `确定要将选中的 ${selectedIds.value.length} 份文档加入任务中心吗?`,
|
|
|
- '批量加入任务',
|
|
|
- {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'info',
|
|
|
- }
|
|
|
- )
|
|
|
-
|
|
|
- const res = await documentApi.batchAddToTask(selectedIds.value)
|
|
|
-
|
|
|
+ const res = await documentApi.batchEnter([doc.id])
|
|
|
if (res.code === 0) {
|
|
|
- ElMessage.success(res.message || '操作成功')
|
|
|
- selectedIds.value = []
|
|
|
+ // 无论成功失败,只要有详细消息就弹出提示框
|
|
|
+ if (res.message && (res.message.includes('\n') || res.message.includes('失败') || res.message.includes('跳过'))) {
|
|
|
+ ElMessageBox.alert(res.message, '入库结果', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ customStyle: { 'white-space': 'pre-wrap' },
|
|
|
+ type: res.message.includes('失败') || res.message.includes('跳过') ? 'warning' : 'success'
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ ElMessage.success(res.message || '入库成功')
|
|
|
+ }
|
|
|
+ detailDialogVisible.value = false
|
|
|
fetchDocuments()
|
|
|
} else {
|
|
|
- ElMessage.error(res.message || '操作失败')
|
|
|
- }
|
|
|
- } catch (error: any) {
|
|
|
- if (error !== 'cancel') {
|
|
|
- console.error('批量加入任务失败:', error)
|
|
|
- ElMessage.error('操作失败')
|
|
|
+ ElMessageBox.alert(res.message || '入库失败', '操作失败', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
}
|
|
|
+ } catch (error) {
|
|
|
+ console.error('入库失败:', error)
|
|
|
+ ElMessage.error('入库异常,请检查网络连接')
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-const handleSingleEnter = async (doc: DocumentItem | null) => {
|
|
|
- if (!doc) return
|
|
|
- selectedIds.value = [doc.id]
|
|
|
- loadKnowledgeBases()
|
|
|
- ingestDialogVisible.value = true
|
|
|
-}
|
|
|
-
|
|
|
const handleDelete = async (row: DocumentItem) => {
|
|
|
try {
|
|
|
await ElMessageBox.confirm(
|
|
|
@@ -1211,7 +953,7 @@ const customUpload = async (options: any) => {
|
|
|
const { file, onSuccess, onError } = options
|
|
|
try {
|
|
|
// 1. 获取预签名 URL
|
|
|
- const res = await documentApi.getUploadUrl(file.name, file.type || 'application/octet-stream', uploadForm.table_type)
|
|
|
+ const res = await documentApi.getUploadUrl(file.name, file.type || 'application/octet-stream')
|
|
|
|
|
|
if (res.code !== 0) {
|
|
|
throw new Error(res.message || '获取上传链接失败')
|
|
|
@@ -1299,38 +1041,6 @@ const handleEdit = async (row: DocumentItem) => {
|
|
|
editForm.compilation_basis = data.compilation_basis || ''
|
|
|
editForm.file_url = data.file_url || ''
|
|
|
|
|
|
- // 填充新补全的字段
|
|
|
- editForm.english_name = data.english_name || ''
|
|
|
- editForm.implementation_date = data.implementation_date || ''
|
|
|
- editForm.drafting_unit = data.drafting_unit || ''
|
|
|
- editForm.approving_department = data.approving_department || ''
|
|
|
- editForm.engineering_phase = data.engineering_phase || ''
|
|
|
- editForm.source_url = data.source_url || ''
|
|
|
- editForm.effective_start_date = data.effective_start_date || ''
|
|
|
- editForm.effective_end_date = data.effective_end_date || ''
|
|
|
-
|
|
|
- // 处理列表字段
|
|
|
- if (data.participating_units) {
|
|
|
- participatingUnitsList.value = data.participating_units.split(';').filter((i: string) => i.trim())
|
|
|
- if (participatingUnitsList.value.length === 0) participatingUnitsList.value = ['']
|
|
|
- } else {
|
|
|
- participatingUnitsList.value = ['']
|
|
|
- }
|
|
|
-
|
|
|
- if (data.reference_basis) {
|
|
|
- referenceBasisList.value = data.reference_basis.split(';').filter((i: string) => i.trim())
|
|
|
- if (referenceBasisList.value.length === 0) referenceBasisList.value = ['']
|
|
|
- } else {
|
|
|
- referenceBasisList.value = ['']
|
|
|
- }
|
|
|
-
|
|
|
- if (data.compilation_basis) {
|
|
|
- compilationBasisList.value = data.compilation_basis.split(';').filter((i: string) => i.trim())
|
|
|
- if (compilationBasisList.value.length === 0) compilationBasisList.value = ['']
|
|
|
- } else {
|
|
|
- compilationBasisList.value = ['']
|
|
|
- }
|
|
|
-
|
|
|
editDialogVisible.value = true
|
|
|
} else {
|
|
|
ElMessage.error(res.message || '获取文档详情失败')
|
|
|
@@ -1347,20 +1057,7 @@ const submitEdit = async () => {
|
|
|
}
|
|
|
submitting.value = true
|
|
|
try {
|
|
|
- // 将列表字段合并为分号分隔的字符串
|
|
|
- const payload: any = {
|
|
|
- ...editForm,
|
|
|
- source_type: editForm.table_type
|
|
|
- }
|
|
|
-
|
|
|
- if (editForm.table_type === 'standard') {
|
|
|
- payload.participating_units = participatingUnitsList.value.filter(i => i.trim()).join(';')
|
|
|
- payload.reference_basis = referenceBasisList.value.filter(i => i.trim()).join(';')
|
|
|
- } else if (editForm.table_type === 'construction_plan') {
|
|
|
- payload.compilation_basis = compilationBasisList.value.filter(i => i.trim()).join(';')
|
|
|
- }
|
|
|
-
|
|
|
- const res = await documentApi.edit(payload)
|
|
|
+ const res = await documentApi.edit(editForm)
|
|
|
if (res.code === 0) {
|
|
|
ElMessage.success('更新成功')
|
|
|
editDialogVisible.value = false
|
|
|
@@ -1803,28 +1500,6 @@ onUnmounted(() => {
|
|
|
justify-content: flex-end;
|
|
|
}
|
|
|
|
|
|
-.dynamic-input-row {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- margin-bottom: 8px;
|
|
|
- width: 100%;
|
|
|
-}
|
|
|
-
|
|
|
-.dynamic-input-row :deep(.el-input) {
|
|
|
- flex: 1;
|
|
|
-}
|
|
|
-
|
|
|
-.dynamic-input-row:last-child {
|
|
|
- margin-bottom: 0;
|
|
|
-}
|
|
|
-
|
|
|
-.row-actions {
|
|
|
- display: flex;
|
|
|
- gap: 5px;
|
|
|
- margin-left: 10px;
|
|
|
- flex-shrink: 0;
|
|
|
-}
|
|
|
-
|
|
|
/* 文件信息单元格布局 */
|
|
|
.file-info-cell {
|
|
|
display: flex;
|