Quellcode durchsuchen

Revert "v0.6"

This reverts commit 71db0eeb33a24dddfde82007c419471919004674.
chenkun vor 3 Wochen
Ursprung
Commit
34d76a79fb

+ 15 - 33
src/api/document.ts

@@ -7,8 +7,8 @@ export interface DocumentItem {
   title: string
   note?: string
   content?: string // 兼容旧代码
-  source_type: 'standard' | 'construction_plan' | 'regulation'
-  table_type?: 'standard' | 'construction_plan' | 'regulation' // 兼容旧代码
+  source_type: 'basis' | 'work' | 'job'
+  table_type?: 'basis' | 'work' | 'job' // 兼容旧代码
   primary_category_id: string
   secondary_category_id: string
   year: number
@@ -47,17 +47,6 @@ export interface DocumentItem {
   level_2_classification?: string
   level_3_classification?: string
   level_4_classification?: string
-  // 补全缺失字段
-  english_name?: string
-  implementation_date?: string
-  drafting_unit?: string
-  approving_department?: string
-  engineering_phase?: string
-  participating_units?: string
-  reference_basis?: string
-  source_url?: string
-  effective_start_date?: string
-  effective_end_date?: string
 }
 
 export interface DocumentQueryParams {
@@ -66,7 +55,6 @@ export interface DocumentQueryParams {
   keyword?: string
   table_type?: string | null
   whether_to_enter?: number | null
-  conversion_status?: number | null
 }
 
 export interface ApiResponse<T = any> {
@@ -87,7 +75,7 @@ export interface PageResult<T> {
 
 // --- API 方法 ---
 
-const API_PREFIX = '/api/v1/sample'
+const prefix = '/api/v1/sample'
 
 export const documentApi = {
   // 获取文档列表
@@ -96,62 +84,56 @@ export const documentApi = {
     if (silent) {
       config.headers = { 'Skip-Error-Message': 'true' }
     }
-    return request.get(`${API_PREFIX}/documents/list`, config)
+    return request.get(`${prefix}/documents/list`, config)
   },
 
   // 获取文档详情
   getDetail(id: string): Promise<ApiResponse<DocumentItem>> {
-    return request.get(`${API_PREFIX}/documents/detail/${id}`)
+    return request.get(`${prefix}/documents/detail/${id}`)
   },
 
   // 添加文档
   add(data: Partial<DocumentItem>): Promise<ApiResponse<{ id: string }>> {
-    return request.post(`${API_PREFIX}/documents/add`, data)
+    return request.post(`${prefix}/documents/add`, data)
   },
 
   // 编辑文档
   edit(data: Partial<DocumentItem>): Promise<ApiResponse<null>> {
-    return request.post(`${API_PREFIX}/documents/edit`, data)
+    return request.post(`${prefix}/documents/edit`, data)
   },
 
   // 文档入库
   enter(id: string): Promise<ApiResponse<null>> {
-    return request.post(`${API_PREFIX}/documents/enter`, { id })
+    return request.post(`${prefix}/documents/enter`, { id })
   },
 
   // 批量入库
   batchEnter(ids: string[]): Promise<ApiResponse<null>> {
-    return request.post(`${API_PREFIX}/documents/batch-enter`, { ids })
+    return request.post(`${prefix}/documents/batch-enter`, { ids })
   },
 
   // 批量删除
   batchDelete(ids: string[]): Promise<ApiResponse<null>> {
-    return request.post(`${API_PREFIX}/documents/batch-delete`, { ids })
-  },
-
-  // 批量加入任务中心
-  batchAddToTask(ids: string[]): Promise<ApiResponse<any>> {
-    return request.post(`${API_PREFIX}/documents/batch-add-to-task`, { ids })
+    return request.post(`${prefix}/documents/batch-delete`, { ids })
   },
 
   // 启动转换
   convert(id: string, tableType?: string): Promise<ApiResponse<null>> {
-    return request.post(`${API_PREFIX}/documents/convert`, { id, table_type: tableType })
+    return request.post(`${prefix}/documents/convert`, { id, table_type: tableType })
   },
 
   // 代理查看内容
   proxyView(url: string, token?: string): Promise<any> {
-    return request.get(`${API_PREFIX}/documents/proxy-view`, {
+    return request.get(`${prefix}/documents/proxy-view`, {
       params: { url, token }
     })
   },
 
   // 获取上传预签名 URL
-  getUploadUrl(filename: string, contentType: string, prefix?: string): Promise<ApiResponse<{ upload_url: string, file_url: string }>> {
-    return request.post(`${API_PREFIX}/documents/upload-url`, {
+  getUploadUrl(filename: string, contentType: string): Promise<ApiResponse<{ upload_url: string, file_url: string }>> {
+    return request.post(`${prefix}/documents/upload-url`, {
       filename,
-      content_type: contentType,
-      prefix
+      content_type: contentType
     })
   }
 }

+ 10 - 15
src/api/image.ts

@@ -48,55 +48,50 @@ export interface PageResult<T> {
 
 // --- API 方法 ---
 
-const API_PREFIX = '/api/v1/images'
+const prefix = '/api/v1/images'
 
 export const imageApi = {
   // --- 分类管理 ---
   
   // 获取全部分类树
   getCategories(): Promise<ApiResponse<ImageCategory[]>> {
-    return request.get(`${API_PREFIX}/categories`)
+    return request.get(`${prefix}/categories`)
   },
 
   // 新增分类
   addCategory(data: Partial<ImageCategory>): Promise<ApiResponse<{ id: string }>> {
-    return request.post(`${API_PREFIX}/categories`, data)
+    return request.post(`${prefix}/categories`, data)
   },
 
   // 更新分类
   updateCategory(id: string, data: Partial<ImageCategory>): Promise<ApiResponse<null>> {
-    return request.put(`${API_PREFIX}/categories/${id}`, data)
+    return request.put(`${prefix}/categories/${id}`, data)
   },
 
   // 删除分类
   deleteCategory(id: string): Promise<ApiResponse<null>> {
-    return request.delete(`${API_PREFIX}/categories/${id}`)
+    return request.delete(`${prefix}/categories/${id}`)
   },
 
   // --- 图片管理 ---
 
   // 获取图片列表
   getList(params: ImageQueryParams): Promise<ApiResponse<PageResult<ImageItem>>> {
-    return request.get(API_PREFIX, { params })
+    return request.get(prefix, { params })
   },
 
   // 保存图片信息
   add(data: Partial<ImageItem>): Promise<ApiResponse<null>> {
-    return request.post(API_PREFIX, data)
+    return request.post(prefix, data)
   },
 
   // 删除图片
   delete(id: string): Promise<ApiResponse<null>> {
-    return request.delete(`${API_PREFIX}/${id}`)
+    return request.delete(`${prefix}/${id}`)
   },
 
   // 获取上传链接
-  getUploadUrl(filename: string, contentType: string, prefix?: string): Promise<ApiResponse<{ upload_url: string, file_url: string, object_name: string }>> {
-    return request.post(`${API_PREFIX}/upload-url`, { filename, content_type: contentType, prefix })
-  },
-
-  // 批量加入任务中心
-  batchAddToTask(ids: string[]): Promise<ApiResponse<null>> {
-    return request.post(`${API_PREFIX}/batch-add-to-task`, { ids })
+  getUploadUrl(filename: string, contentType: string): Promise<ApiResponse<{ upload_url: string, file_url: string, object_name: string }>> {
+    return request.post(`${prefix}/upload-url`, { filename, content_type: contentType })
   }
 }

+ 18 - 27
src/router/index.ts

@@ -30,33 +30,6 @@ const routes: RouteRecordRaw[] = [
     component: MainLayout,
     meta: { requiresAuth: true },
     children: [
-      {
-        path: 'admin/basic-info',
-        name: 'BasicInfo',
-        redirect: '/admin/basic-info/standard',
-        meta: { requiresAdmin: true }
-      },
-      {
-        path: 'admin/basic-info/standard',
-        name: 'BasicInfoStandard',
-        component: () => import('@/views/basic-info/Index.vue'),
-        props: { infoType: 'standard' },
-        meta: { requiresAdmin: true }
-      },
-      {
-        path: 'admin/basic-info/construction_plan',
-        name: 'BasicInfoConstructionPlan',
-        component: () => import('@/views/basic-info/Index.vue'),
-        props: { infoType: 'construction_plan' },
-        meta: { requiresAdmin: true }
-      },
-      {
-        path: 'admin/basic-info/regulation',
-        name: 'BasicInfoRegulation',
-        component: () => import('@/views/basic-info/Index.vue'),
-        props: { infoType: 'regulation' },
-        meta: { requiresAdmin: true }
-      },
       {
         path: 'dashboard',
         name: 'Dashboard',
@@ -160,6 +133,24 @@ const routes: RouteRecordRaw[] = [
         name: 'SearchEngine',
         component: () => import('@/views/documents/SearchEngine.vue'),
         meta: { requiresAdmin: true }
+      },
+      {
+        path: 'admin/basic-info/basis',
+        name: 'BasicInfoBasis',
+        component: () => import('@/views/basic-info/Index.vue'),
+        meta: { requiresAdmin: true }
+      },
+      {
+        path: 'admin/basic-info/work',
+        name: 'BasicInfoWork',
+        component: () => import('@/views/basic-info/Index.vue'),
+        meta: { requiresAdmin: true }
+      },
+      {
+        path: 'admin/basic-info/job',
+        name: 'BasicInfoJob',
+        component: () => import('@/views/basic-info/Index.vue'),
+        meta: { requiresAdmin: true }
       }
     ]
   },

+ 1 - 1
src/stores/auth.ts

@@ -19,7 +19,7 @@ export const useAuthStore = defineStore('auth', () => {
     // Check if user is superuser OR has admin/super_admin roles
     return user.value.is_superuser || 
            (user.value.roles && user.value.roles.some((role: string) => 
-             ['admin', 'super_admin', '管理员', '超级管理员'].includes(role.toLowerCase())
+             role === 'admin' || role === 'super_admin'
            ))
   })
 

+ 189 - 323
src/views/basic-info/Index.vue

@@ -11,19 +11,19 @@
           <!-- 共通字段: 名称 -->
           <el-col :span="6">
             <el-form-item :label="titleLabel">
-              <el-input v-model="searchForm.title" :placeholder="'请输入' + titleLabel" clearable @keyup.enter="handleSearch" />
+              <el-input v-model="searchForm.title" :placeholder="'请输入' + titleLabel" clearable />
             </el-form-item>
           </el-col>
           
-          <!-- Standard 专用: 标准编号 -->
-          <el-col :span="6" v-if="infoType === 'standard'">
+          <!-- Basis 专用: 标准编号 -->
+          <el-col :span="6" v-if="infoType === 'basis'">
             <el-form-item label="标准编号">
-              <el-input v-model="searchForm.standard_no" placeholder="请输入标准编号" clearable @keyup.enter="handleSearch" />
+              <el-input v-model="searchForm.standard_no" placeholder="请输入标准编号" clearable />
             </el-form-item>
           </el-col>
           
-          <!-- Standard/Regulation 专用: 文件类型 -->
-          <el-col :span="6" v-if="infoType === 'standard' || infoType === 'regulation'">
+          <!-- Basis/Job 专用: 文件类型 -->
+          <el-col :span="6" v-if="infoType === 'basis' || infoType === 'job'">
             <el-form-item label="文件类型">
               <el-select v-model="searchForm.document_type" placeholder="请选择文件类型" clearable style="width: 100%">
                 <el-option v-for="item in documentTypeOptions" :key="item" :label="item" :value="item" />
@@ -31,8 +31,8 @@
             </el-form-item>
           </el-col>
           
-          <!-- Standard 专用: 专业领域 -->
-          <el-col :span="6" v-if="infoType === 'standard'">
+          <!-- Basis 专用: 专业领域 -->
+          <el-col :span="6" v-if="infoType === 'basis'">
             <el-form-item label="专业领域">
               <el-select v-model="searchForm.professional_field" placeholder="请选择专业领域" clearable style="width: 100%">
                 <el-option v-for="item in professionalFieldOptions" :key="item" :label="item" :value="item" />
@@ -41,8 +41,8 @@
           </el-col>
 
           <!-- Row 2 -->
-          <!-- Standard 专用: 时效性 -->
-          <el-col :span="6" v-if="infoType === 'standard'">
+          <!-- Basis 专用: 时效性 -->
+          <el-col :span="6" v-if="infoType === 'basis'">
             <el-form-item label="时效性">
               <el-select v-model="searchForm.validity" placeholder="请选择时效性" clearable style="width: 100%">
                 <el-option label="现行" value="现行" />
@@ -52,7 +52,7 @@
             </el-form-item>
           </el-col>
           
-          <el-col :span="6" v-if="infoType === 'construction_plan'">
+          <el-col :span="6" v-if="infoType === 'work'">
             <el-form-item label="方案类别">
               <el-select v-model="searchForm.plan_category" placeholder="请选择方案类别" clearable style="width: 100%">
                 <el-option v-for="item in planCategoryOptions" :key="item" :label="item" :value="item" />
@@ -60,13 +60,13 @@
             </el-form-item>
           </el-col>
 
-          <el-col :span="6" v-if="infoType === 'construction_plan'">
+          <el-col :span="6" v-if="infoType === 'work'">
             <el-form-item label="一级分类">
-              <el-input v-model="searchForm.level_1_classification" placeholder="请输入一级分类" clearable @keyup.enter="handleSearch" />
+              <el-input v-model="searchForm.level_1_classification" placeholder="请输入一级分类" clearable />
             </el-form-item>
           </el-col>
 
-          <el-col :span="6" v-if="infoType === 'construction_plan'">
+          <el-col :span="6" v-if="infoType === 'work'">
             <el-form-item label="二级分类">
               <el-select v-model="searchForm.level_2_classification" placeholder="请选择二级分类" clearable style="width: 100%">
                 <el-option v-for="item in level2Options" :key="item" :label="item" :value="item" />
@@ -74,7 +74,7 @@
             </el-form-item>
           </el-col>
 
-          <el-col :span="6" v-if="infoType === 'construction_plan'">
+          <el-col :span="6" v-if="infoType === 'work'">
             <el-form-item label="三级分类">
               <el-select v-model="searchForm.level_3_classification" placeholder="请选择三级分类" clearable style="width: 100%">
                 <el-option v-for="item in level3Options" :key="item" :label="item" :value="item" />
@@ -82,7 +82,7 @@
             </el-form-item>
           </el-col>
 
-          <el-col :span="6" v-if="infoType === 'construction_plan'">
+          <el-col :span="6" v-if="infoType === 'work'">
             <el-form-item label="四级分类">
               <el-select v-model="searchForm.level_4_classification" placeholder="请选择四级分类" clearable style="width: 100%">
                 <el-option v-for="item in level4Options" :key="item" :label="item" :value="item" />
@@ -93,7 +93,7 @@
           <!-- 共通字段: 发布单位/编制单位/发布部门 -->
           <el-col :span="6">
             <el-form-item :label="authorityLabel">
-              <el-input v-model="searchForm.issuing_authority" :placeholder="'请输入' + authorityLabel" clearable @keyup.enter="handleSearch" />
+              <el-input v-model="searchForm.issuing_authority" :placeholder="'请输入' + authorityLabel" clearable />
             </el-form-item>
           </el-col>
           
@@ -132,21 +132,21 @@
     <el-card class="box-card table-card">
       <el-table :data="tableData" v-loading="loading" style="width: 100%" border stripe>
         <el-table-column prop="title" :label="titleLabel" min-width="200" show-overflow-tooltip />
-        <el-table-column prop="standard_no" label="标准编号" width="150" show-overflow-tooltip v-if="infoType === 'standard'" />
+        <el-table-column prop="standard_no" label="标准编号" width="150" show-overflow-tooltip v-if="infoType === 'basis'" />
         <el-table-column prop="issuing_authority" :label="authorityLabel" width="180" show-overflow-tooltip />
         <el-table-column prop="release_date" :label="dateLabel" width="120">
           <template #default="scope">
             {{ formatDate(scope.row.release_date) }}
           </template>
         </el-table-column>
-        <el-table-column prop="document_type" label="文档类型" width="120" v-if="infoType === 'standard' || infoType === 'regulation'" />
-        <el-table-column prop="plan_category" label="方案类别" width="120" v-if="infoType === 'construction_plan'" />
-        <el-table-column prop="level_1_classification" label="一级分类" width="120" v-if="infoType === 'construction_plan'" />
-        <el-table-column prop="level_2_classification" label="二级分类" width="120" v-if="infoType === 'construction_plan'" />
-        <el-table-column prop="level_3_classification" label="三级分类" width="120" v-if="infoType === 'construction_plan'" />
-        <el-table-column prop="level_4_classification" label="四级分类" width="120" v-if="infoType === 'construction_plan'" />
-        <el-table-column prop="professional_field" label="专业领域" width="120" v-if="infoType === 'standard'" />
-        <el-table-column label="参编单位" min-width="150" v-if="infoType === 'standard'">
+        <el-table-column prop="document_type" label="文档类型" width="120" v-if="infoType === 'basis' || infoType === 'job'" />
+        <el-table-column prop="plan_category" label="方案类别" width="120" v-if="infoType === 'work'" />
+        <el-table-column prop="level_1_classification" label="一级分类" width="120" v-if="infoType === 'work'" />
+        <el-table-column prop="level_2_classification" label="二级分类" width="120" v-if="infoType === 'work'" />
+        <el-table-column prop="level_3_classification" label="三级分类" width="120" v-if="infoType === 'work'" />
+        <el-table-column prop="level_4_classification" label="四级分类" width="120" v-if="infoType === 'work'" />
+        <el-table-column prop="professional_field" label="专业领域" width="120" v-if="infoType === 'basis'" />
+        <el-table-column label="参编单位" min-width="150" v-if="infoType === 'basis'">
           <template #default="scope">
             <template v-if="scope.row.participating_units">
               <el-popover
@@ -185,7 +185,7 @@
             <span v-else>-</span>
           </template>
         </el-table-column>
-        <el-table-column label="引用标准" min-width="150" v-if="infoType === 'standard'">
+        <el-table-column label="参考依据" min-width="150" v-if="infoType === 'basis'">
           <template #default="scope">
             <template v-if="scope.row.reference_basis">
               <el-popover
@@ -197,13 +197,13 @@
                 <template #reference>
                   <div class="tag-group">
                     <el-tag 
-                      v-for="(std, idx) in scope.row.reference_basis.split(';').slice(0, 2)" 
+                      v-for="(basis, idx) in scope.row.reference_basis.split(';').slice(0, 2)" 
                       :key="idx" 
                       size="small" 
                       type="info"
                       class="info-tag"
                     >
-                      {{ std }}
+                      {{ basis }}
                     </el-tag>
                     <el-tag v-if="scope.row.reference_basis.split(';').length > 2" size="small" type="info" class="info-tag">
                       +{{ scope.row.reference_basis.split(';').length - 2 }}
@@ -212,13 +212,13 @@
                 </template>
                 <div class="popover-tag-list">
                   <el-tag 
-                    v-for="(std, idx) in scope.row.reference_basis.split(';')" 
+                    v-for="(basis, idx) in scope.row.reference_basis.split(';')" 
                     :key="idx" 
                     size="small" 
                     type="info"
                     class="popover-info-tag"
                   >
-                    {{ std }}
+                    {{ basis }}
                   </el-tag>
                 </div>
               </el-popover>
@@ -226,7 +226,7 @@
             <span v-else>-</span>
           </template>
         </el-table-column>
-        <el-table-column prop="validity" label="时效性" width="100" v-if="infoType === 'standard'">
+        <el-table-column prop="validity" label="时效性" width="100" v-if="infoType === 'basis'">
           <template #default="scope">
             <el-tag :type="getValidityType(scope.row.validity)">
               {{ scope.row.validity || '现行' }}
@@ -273,11 +273,6 @@
                   <el-icon><Delete /></el-icon>
                 </el-button>
               </el-tooltip>
-              <el-tooltip content="入库" placement="top">
-                <el-button link type="warning" @click="handleAction('ingest', scope.row)">
-                  <el-icon><Document /></el-icon>
-                </el-button>
-              </el-tooltip>
             </div>
           </template>
         </el-table-column>
@@ -306,13 +301,13 @@
             </el-form-item>
           </el-col>
           
-          <el-col :span="12" v-if="infoType === 'standard'">
+          <el-col :span="12" v-if="infoType === 'basis'">
             <el-form-item label="英文名称">
               <el-input v-model="editForm.english_name" placeholder="请输入英文名称" />
             </el-form-item>
           </el-col>
 
-          <el-col :span="12" v-if="infoType === 'standard'">
+          <el-col :span="12" v-if="infoType === 'basis'">
             <el-form-item label="标准编号">
               <el-input v-model="editForm.standard_no" placeholder="请输入标准编号" />
             </el-form-item>
@@ -330,13 +325,13 @@
             </el-form-item>
           </el-col>
 
-          <el-col :span="12" v-if="infoType === 'standard'">
+          <el-col :span="12" v-if="infoType === 'basis'">
             <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="infoType === 'standard' || infoType === 'regulation'">
+          <el-col :span="12" v-if="infoType === 'basis' || infoType === 'job'">
             <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" />
@@ -344,7 +339,7 @@
             </el-form-item>
           </el-col>
 
-          <el-col :span="12" v-if="infoType === 'standard'">
+          <el-col :span="12" v-if="infoType === 'basis'">
             <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" />
@@ -352,7 +347,7 @@
             </el-form-item>
           </el-col>
 
-          <el-col :span="12" v-if="infoType === 'standard'">
+          <el-col :span="12" v-if="infoType === 'basis'">
             <el-form-item label="时效性">
               <el-select v-model="editForm.validity" placeholder="请选择时效性" style="width: 100%">
                 <el-option label="现行" value="现行" />
@@ -362,19 +357,19 @@
             </el-form-item>
           </el-col>
 
-          <el-col :span="12" v-if="infoType === 'standard'">
+          <el-col :span="12" v-if="infoType === 'basis'">
             <el-form-item label="起草单位">
               <el-input v-model="editForm.drafting_unit" placeholder="请输入起草单位" />
             </el-form-item>
           </el-col>
 
-          <el-col :span="12" v-if="infoType === 'standard'">
+          <el-col :span="12" v-if="infoType === 'basis'">
             <el-form-item label="批准部门">
               <el-input v-model="editForm.approving_department" placeholder="请输入批准部门" />
             </el-form-item>
           </el-col>
 
-          <el-col :span="24" v-if="infoType === 'standard'">
+          <el-col :span="24" v-if="infoType === 'basis'">
             <el-form-item label="参编单位">
               <div v-for="(unit, index) in participatingUnitsList" :key="index" class="dynamic-input-row">
                 <el-input v-model="participatingUnitsList[index]" placeholder="请输入参编单位" />
@@ -386,15 +381,15 @@
             </el-form-item>
           </el-col>
 
-          <el-col :span="12" v-if="infoType === 'standard'">
+          <el-col :span="12" v-if="infoType === 'basis'">
             <el-form-item label="工程阶段">
               <el-input v-model="editForm.engineering_phase" placeholder="请输入工程阶段" />
             </el-form-item>
           </el-col>
 
-          <el-col :span="24" v-if="infoType === 'standard'">
+          <el-col :span="24" v-if="infoType === 'basis'">
             <el-form-item label="引用依据">
-              <div v-for="(std, index) in referenceBasisList" :key="index" class="dynamic-input-row">
+              <div v-for="(basis, 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)" />
@@ -404,13 +399,13 @@
             </el-form-item>
           </el-col>
 
-          <el-col :span="12" v-if="infoType === 'standard'">
+          <el-col :span="12" v-if="infoType === 'basis'">
             <el-form-item label="来源链接">
               <el-input v-model="editForm.source_url" placeholder="请输入来源链接" />
             </el-form-item>
           </el-col>
 
-          <template v-if="infoType === 'construction_plan'">
+          <template v-if="infoType === 'work'">
             <el-col :span="12">
               <el-form-item label="项目名称">
                 <el-input v-model="editForm.project_name" placeholder="请输入项目名称" />
@@ -460,9 +455,9 @@
               </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="请输入编制依据" />
+              <el-form-item label="施工标准规范">
+                <div v-for="(basis, 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)" />
@@ -472,7 +467,7 @@
             </el-col>
           </template>
 
-          <template v-if="infoType === 'regulation'">
+          <template v-if="infoType === 'job'">
             <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%" />
@@ -491,28 +486,6 @@
             </el-form-item>
           </el-col>
 
-          <el-col :span="24">
-            <el-form-item label="上传文件" :required="!editForm.id">
-              <el-upload
-                class="upload-demo"
-                action="#"
-                :auto-upload="false"
-                :on-change="handleFileChange"
-                :on-remove="handleFileRemove"
-                :file-list="fileList"
-                :limit="1"
-                accept=".pdf,.doc,.docx,.ppt,.pptx,.png,.jpg,.jpeg,.txt"
-              >
-                <el-button type="primary">选择文件</el-button>
-                <template #tip>
-                  <div class="el-upload__tip">
-                    支持 PDF, Word, PPT, 图片, TXT 等格式
-                  </div>
-                </template>
-              </el-upload>
-            </el-form-item>
-          </el-col>
-
           <el-col :span="24">
             <el-form-item label="文件预览链接" v-if="false">
               <el-input v-model="editForm.file_url" placeholder="请输入文件预览链接 (URL)" />
@@ -530,27 +503,27 @@
     <el-dialog v-model="detailDialogVisible" title="详情信息" width="600px">
       <el-descriptions :column="1" border>
         <el-descriptions-item :label="titleLabel">{{ currentItem?.title }}</el-descriptions-item>
-        <el-descriptions-item label="标准编号" v-if="infoType === 'standard'">{{ currentItem?.standard_no || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="标准编号" v-if="infoType === 'basis'">{{ currentItem?.standard_no || '-' }}</el-descriptions-item>
         <el-descriptions-item :label="authorityLabel">{{ currentItem?.issuing_authority || '-' }}</el-descriptions-item>
         <el-descriptions-item :label="dateLabel">{{ formatDate(currentItem?.release_date) }}</el-descriptions-item>
-        <el-descriptions-item label="文档类型" v-if="infoType === 'standard' || infoType === 'regulation'">{{ currentItem?.document_type || '-' }}</el-descriptions-item>
-        <el-descriptions-item label="专业领域" v-if="infoType === 'standard'">{{ currentItem?.professional_field || '-' }}</el-descriptions-item>
-        <el-descriptions-item label="参编单位" v-if="infoType === 'standard'">
+        <el-descriptions-item label="文档类型" v-if="infoType === 'basis' || infoType === 'job'">{{ currentItem?.document_type || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="专业领域" v-if="infoType === 'basis'">{{ currentItem?.professional_field || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="参编单位" v-if="infoType === 'basis'">
           <div v-if="currentItem?.participating_units">
             <div v-for="(unit, idx) in currentItem.participating_units.split(';')" :key="idx">{{ unit }}</div>
           </div>
           <span v-else>-</span>
         </el-descriptions-item>
-        <el-descriptions-item label="引用依据" v-if="infoType === 'standard'">
+        <el-descriptions-item label="引用依据" v-if="infoType === 'basis'">
           <div v-if="currentItem?.reference_basis">
-            <div v-for="(std, idx) in currentItem.reference_basis.split(';')" :key="idx">{{ std }}</div>
+            <div v-for="(basis, idx) in currentItem.reference_basis.split(';')" :key="idx">{{ basis }}</div>
           </div>
           <span v-else>-</span>
         </el-descriptions-item>
-        <el-descriptions-item label="时效性" v-if="infoType === 'standard'">
+        <el-descriptions-item label="时效性" v-if="infoType === 'basis'">
           <el-tag :type="getValidityType(currentItem?.validity)">{{ currentItem?.validity || '现行' }}</el-tag>
         </el-descriptions-item>
-        <template v-if="infoType === 'construction_plan'">
+        <template v-if="infoType === 'work'">
           <el-descriptions-item label="项目名称">{{ currentItem?.project_name || '-' }}</el-descriptions-item>
           <el-descriptions-item label="项目标段">{{ currentItem?.project_section || '-' }}</el-descriptions-item>
           <el-descriptions-item label="方案类别">{{ currentItem?.plan_category || '-' }}</el-descriptions-item>
@@ -559,9 +532,9 @@
           <el-descriptions-item label="三级分类">{{ currentItem?.level_3_classification || '-' }}</el-descriptions-item>
           <el-descriptions-item label="四级分类">{{ currentItem?.level_4_classification || '-' }}</el-descriptions-item>
           <el-descriptions-item label="方案摘要">{{ currentItem?.plan_summary || '-' }}</el-descriptions-item>
-          <el-descriptions-item label="编制依据">
+          <el-descriptions-item label="施工标准规范">
             <div v-if="currentItem?.compilation_basis">
-              <div v-for="(planStd, idx) in currentItem.compilation_basis.split(';')" :key="idx">{{ planStd }}</div>
+              <div v-for="(basis, idx) in currentItem.compilation_basis.split(';')" :key="idx">{{ basis }}</div>
             </div>
             <span v-else>-</span>
           </el-descriptions-item>
@@ -604,33 +577,6 @@
         </div>
       </div>
     </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>
 
@@ -663,36 +609,10 @@ const previewLoading = ref(false)
 const previewUrl = ref('')
 const previewTitle = ref('')
 
-// 入库相关状态
-const ingestDialogVisible = ref(false)
-const ingesting = ref(false)
-const knowledgeBases = ref<any[]>([])
-const ingestForm = reactive({
-  kb_id: '',
-  kb_method: 'length'
-})
-
 // 动态列表字段存储
 const participatingUnitsList = ref<string[]>([''])
 const referenceBasisList = ref<string[]>([''])
 const compilationBasisList = ref<string[]>([''])
-const fileList = ref<any[]>([])
-
-const handleFileChange = (file: any, files: any[]) => {
-  fileList.value = files
-  if (file.name && !editForm.title) {
-    // 自动填充标题(去掉后缀)
-    const nameParts = file.name.split('.')
-    if (nameParts.length > 1) {
-      nameParts.pop()
-    }
-    editForm.title = nameParts.join('.')
-  }
-}
-
-const handleFileRemove = () => {
-  fileList.value = []
-}
 
 const addListItem = (list: string[]) => {
   list.push('')
@@ -721,7 +641,7 @@ const editForm = reactive<any>({
   project_section: '',
   note: '',
   file_url: '',
-  // 新增字段 - Standard
+  // 新增字段 - Basis
   english_name: '',
   implementation_date: '',
   drafting_unit: '',
@@ -730,7 +650,7 @@ const editForm = reactive<any>({
   engineering_phase: '',
   reference_basis: '',
   source_url: '',
-  // 新增字段 - Construction Plan
+  // 新增字段 - Work
   plan_summary: '',
   compilation_basis: '',
   plan_category: '',
@@ -738,7 +658,7 @@ const editForm = reactive<any>({
   level_2_classification: '',
   level_3_classification: '',
   level_4_classification: '',
-  // 新增字段 - Regulation
+  // 新增字段 - Job
   effective_start_date: '',
   effective_end_date: ''
 })
@@ -791,53 +711,53 @@ const level4Options = ['/', '挡土墙', '顶管', '断层破碎带及软弱围
 // 根据路由路径判断类型
 const infoType = computed(() => {
   const path = route.path
-  if (path.includes('/standard')) return 'standard'
-  if (path.includes('/construction_plan')) return 'construction_plan'
-  if (path.includes('/regulation')) return 'regulation'
-  return 'standard'
+  if (path.includes('/basis')) return 'basis'
+  if (path.includes('/work')) return 'work'
+  if (path.includes('/job')) return 'job'
+  return 'basis'
 })
 
 const pageTitle = computed(() => {
   switch (infoType.value) {
-    case 'standard': return '施工标准规范管理'
-    case 'construction_plan': return '施工方案管理'
-    case 'regulation': return '办公制度管理'
+    case 'basis': return '施工标准规范管理'
+    case 'work': return '施工方案管理'
+    case 'job': return '办公制度管理'
     default: return '基本信息管理'
   }
 })
 
 const moduleName = computed(() => {
   switch (infoType.value) {
-    case 'standard': return '施工标准规范'
-    case 'construction_plan': return '施工方案'
-    case 'regulation': return '办公制度'
+    case 'basis': return '施工标准规范'
+    case 'work': return '施工方案'
+    case 'job': return '办公制度'
     default: return ''
   }
 })
 
 const titleLabel = computed(() => {
   switch (infoType.value) {
-    case 'standard': return '文档名称'
-    case 'construction_plan': return '方案名称'
-    case 'regulation': return '文件名称'
+    case 'basis': return '文档名称'
+    case 'work': return '方案名称'
+    case 'job': return '文件名称'
     default: return '名称'
   }
 })
 
 const authorityLabel = computed(() => {
   switch (infoType.value) {
-    case 'standard': return '发布单位'
-    case 'construction_plan': return '编制单位'
-    case 'regulation': return '发布部门'
+    case 'basis': return '发布单位'
+    case 'work': return '编制单位'
+    case 'job': return '发布部门'
     default: return '单位'
   }
 })
 
 const dateLabel = computed(() => {
   switch (infoType.value) {
-    case 'standard': return '发布日期'
-    case 'construction_plan': return '编制日期'
-    case 'regulation': return '发布日期'
+    case 'basis': return '发布日期'
+    case 'work': return '编制日期'
+    case 'job': return '发布日期'
     default: return '日期'
   }
 })
@@ -975,7 +895,7 @@ const handleAction = async (action: string, row: any) => {
       // 处理动态列表字段
       participatingUnitsList.value = row.participating_units ? row.participating_units.split(';') : ['']
       referenceBasisList.value = row.reference_basis ? row.reference_basis.split(';') : ['']
-    compilationBasisList.value = row.compilation_basis ? row.compilation_basis.split(';') : ['']
+      compilationBasisList.value = row.compilation_basis ? row.compilation_basis.split(';') : ['']
       
       editForm.id = row.id
       formDialogVisible.value = true
@@ -986,178 +906,96 @@ const handleAction = async (action: string, row: any) => {
       }).then(async () => {
         try {
           const res = await request.post<ApiResponse>(`/api/v1/sample/basic-info/delete?type=${infoType.value}&id=${row.id}`)
-          if (res.code === 0) {
+          const resData = (res as unknown) as ApiResponse
+          if (resData.code === 0) {
             ElMessage.success('删除成功')
             loadData()
           } else {
-            ElMessage.error(res.message || '删除失败')
+            ElMessage.error(resData.message || '删除失败')
           }
         } catch (error) {
           console.error('删除失败:', error)
-          ElMessage.error('网络错误,请稍后重试')
+          ElMessage.error('网络错误')
         }
       }).catch(() => {})
       break
-    case 'ingest':
-      loadKnowledgeBases()
-      ingestDialogVisible.value = true
-      break
-  }
-}
-
-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
-  }
-  
-  if (!currentItem.value || !currentItem.value.id) {
-    ElMessage.warning('未选中有效文档')
-    return
-  }
-
-  ingesting.value = true
-  try {
-    // 统一使用 batch-enter 接口,即使是单条也通过 ids 数组传递
-    const res = await request.post<ApiResponse>('/api/v1/sample/documents/batch-enter', {
-      ids: [currentItem.value.id],
-      table_type: infoType.value,
-      kb_id: ingestForm.kb_id,
-      kb_method: ingestForm.kb_method
-    })
-    
-    if (res.code === 0) {
-      ElMessage.success(res.message || '已加入入库队列')
-      ingestDialogVisible.value = false
-      loadData() // 刷新列表状态
-    } else {
-      ElMessage.error(res.message || '入库失败')
-    }
-  } catch (error) {
-    console.error('入库失败:', error)
-    ElMessage.error('网络错误,请稍后重试')
-  } finally {
-    ingesting.value = false
   }
 }
 
 const handleAdd = () => {
   Object.keys(editForm).forEach(key => {
-    editForm[key] = ''
+    if (key === 'validity') {
+      editForm[key] = '现行'
+    } else if (key === 'level_1_classification') {
+      editForm[key] = '施工方案'
+    } else {
+      editForm[key] = ''
+    }
   })
-  editForm.id = null
-  editForm.validity = '现行'
-  editForm.level_1_classification = '施工方案'
-  
-  participatingUnitsList.value = ['']
-  referenceBasisList.value = ['']
-  compilationBasisList.value = ['']
+  // 初始化动态列表字段
+   participatingUnitsList.value = ['']
+   referenceBasisList.value = ['']
+   compilationBasisList.value = ['']
   
+  editForm.id = null
   formDialogVisible.value = true
 }
 
 const submitForm = async () => {
   if (!editForm.title) {
-    ElMessage.warning('请输入标题')
-    return
+    return ElMessage.warning('请输入名称')
   }
-
+  
+  // 提交前合并动态列表字段,过滤掉空行并用分号连接
+  editForm.participating_units = participatingUnitsList.value.filter(item => item.trim() !== '').join(';')
+  editForm.reference_basis = referenceBasisList.value.filter(item => item.trim() !== '').join(';')
+  editForm.compilation_basis = compilationBasisList.value.filter(item => item.trim() !== '').join(';')
+  
   submitting.value = true
   try {
-    // 1. 如果有待上传文件,先执行上传
-    if (fileList.value.length > 0 && fileList.value[0].raw) {
-      const file = fileList.value[0].raw
-      
-      // 获取上传预签名 URL
-      const urlRes = await request.post<ApiResponse<any>>('/api/v1/sample/documents/upload-url', {
-        filename: file.name,
-        content_type: file.type,
-        prefix: `basic-info/${infoType.value}`
-      })
-      
-      if (urlRes.code === 0) {
-        const { upload_url, file_url } = urlRes.data
-        
-        // 执行上传到 MinIO
-        await fetch(upload_url, {
-          method: 'PUT',
-          body: file,
-          headers: {
-            'Content-Type': file.type
-          }
-        })
-        
-        // 设置上传后的文件相对路径
-        editForm.file_url = file_url
-      } else {
-        throw new Error(urlRes.message || '获取上传链接失败')
-      }
-    } else if (!editForm.id && fileList.value.length === 0) {
-      ElMessage.warning('请选择要上传的文件')
-      submitting.value = false
-      return
-    }
-
-    // 2. 组合动态列表字段
-    editForm.participating_units = participatingUnitsList.value.filter(item => item.trim() !== '').join(';')
-    editForm.reference_basis = referenceBasisList.value.filter(item => item.trim() !== '').join(';')
-    editForm.compilation_basis = compilationBasisList.value.filter(item => item.trim() !== '').join(';')
-    
-    const url = editForm.id 
-      ? `/api/v1/sample/basic-info/edit?type=${infoType.value}&id=${editForm.id}`
-      : `/api/v1/sample/basic-info/add?type=${infoType.value}`
+    const isEdit = !!editForm.id
+    const url = isEdit ? `/api/v1/sample/basic-info/edit?type=${infoType.value}&id=${editForm.id}` : `/api/v1/sample/basic-info/add?type=${infoType.value}`
     
     const res = await request.post<ApiResponse>(url, editForm)
-    if (res.code === 0) {
-      ElMessage.success(editForm.id ? '修改成功' : '新增成功')
+    const resData = (res as unknown) as ApiResponse
+    
+    if (resData.code === 0) {
+      ElMessage.success(isEdit ? '更新成功' : '新增成功')
       formDialogVisible.value = false
-      fileList.value = [] // 清空文件列表
       loadData()
     } else {
-      ElMessage.error(res.message || '提交失败')
+      ElMessage.error(resData.message || '操作失败')
     }
-  } catch (error: any) {
-    console.error('提交失败:', error)
-    ElMessage.error(error.message || '网络错误,请稍后重试')
+  } catch (error) {
+    console.error('操作失败:', error)
+    ElMessage.error('网络错误')
   } finally {
     submitting.value = false
   }
 }
 
 const openInNewWindow = () => {
-  if (previewUrl.value) {
+  if (proxyPreviewUrl.value) {
     window.open(proxyPreviewUrl.value, '_blank')
   }
 }
 
-onMounted(() => {
-  loadData()
-})
-
-// 监听路由变化,切换类型时重新加载
-watch(() => infoType.value, () => {
+// 监听路由变化,切换类型时重新加载数据
+watch(() => route.path, () => {
   currentPage.value = 1
   resetSearch()
 })
+
+onMounted(() => {
+  loadData()
+})
 </script>
 
 <style scoped>
 .basic-info-container {
   padding: 20px;
+  background-color: #f5f7fa;
+  min-height: calc(100vh - 84px);
 }
 
 .search-card {
@@ -1177,36 +1015,27 @@ watch(() => infoType.value, () => {
 }
 
 .search-form {
-  margin-bottom: 0;
-}
-
-.search-buttons {
-  display: flex;
-  justify-content: flex-end;
-  margin-top: 10px;
+  padding: 0 10px;
 }
 
-.table-card {
-  margin-bottom: 20px;
+:deep(.el-form-item__label) {
+  font-weight: normal;
+  color: #606266;
+  padding-bottom: 4px;
 }
 
-.pagination-container {
+.search-buttons {
   display: flex;
   justify-content: flex-end;
-  margin-top: 20px;
-}
-
-.action-buttons {
-  display: flex;
-  justify-content: center;
-  gap: 5px;
+  gap: 10px;
+  margin-top: 10px;
 }
 
 .dynamic-input-row {
   display: flex;
-  gap: 10px;
-  margin-bottom: 10px;
   align-items: center;
+  margin-bottom: 8px;
+  width: 100%;
 }
 
 .dynamic-input-row:last-child {
@@ -1216,43 +1045,70 @@ watch(() => infoType.value, () => {
 .row-actions {
   display: flex;
   gap: 5px;
-  flex-shrink: 0;
+  margin-left: 10px;
 }
 
-.tag-group {
+.table-card {
+  padding: 10px;
+}
+
+.pagination-container {
+  margin-top: 20px;
   display: flex;
-  flex-wrap: wrap;
-  gap: 4px;
+  justify-content: flex-end;
 }
 
 .info-tag {
+  margin-right: 4px;
+  margin-bottom: 2px;
   max-width: 120px;
   overflow: hidden;
   text-overflow: ellipsis;
   white-space: nowrap;
 }
 
-.popover-tag-list {
+.tag-group {
   display: flex;
   flex-wrap: wrap;
-  gap: 8px;
+  gap: 4px;
+}
+
+.action-buttons {
+  display: flex;
+  justify-content: center;
+  gap: 4px;
+}
+
+.action-buttons .el-button {
   padding: 4px;
+  margin: 0;
+}
+
+.popover-tag-list {
+  display: flex;
+  flex-direction: column;
+  gap: 8px;
+  padding: 4px 0;
 }
 
 .popover-info-tag {
-  margin-bottom: 4px;
+  width: 100%;
+  justify-content: flex-start;
+  height: auto;
+  padding: 4px 8px;
+  white-space: normal;
+  word-break: break-all;
+  line-height: 1.4;
 }
 
-.dialog-header-custom {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-  padding-right: 30px;
+:deep(.el-table .cell) {
+  white-space: nowrap;
 }
 
-.header-actions {
-  display: flex;
-  align-items: center;
+.preview-content {
+  border: 1px solid #dcdfe6;
+  border-radius: 4px;
+  overflow: hidden;
 }
 
 .no-preview {
@@ -1260,9 +1116,19 @@ watch(() => infoType.value, () => {
   justify-content: center;
   align-items: center;
   height: 100%;
+  background-color: #f5f7fa;
 }
 
-:deep(.preview-dialog .el-dialog__body) {
-  padding: 0;
+.dialog-header-custom {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  width: 100%;
+  padding-right: 30px;
+}
+
+.header-actions {
+  display: flex;
+  gap: 10px;
 }
 </style>

+ 160 - 485
src/views/documents/Index.vue

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

+ 8 - 64
src/views/images/Index.vue

@@ -38,14 +38,6 @@
             <span class="current-category">{{ currentCategoryName }}</span>
           </div>
           <div class="header-right">
-            <el-button 
-              type="primary" 
-              :icon="Tickets" 
-              @click="handleBatchAddToTask"
-              :disabled="selectedIds.length === 0"
-            >
-              批量加入任务
-            </el-button>
             <el-upload
               ref="uploadRef"
               class="upload-btn"
@@ -56,27 +48,19 @@
               accept="image/*"
               :on-change="handleFileChange"
             >
-              <el-button type="success" :icon="Upload">新增图片</el-button>
+              <el-button type="primary" :icon="Upload">新增图片</el-button>
             </el-upload>
           </div>
         </div>
 
         <div class="image-list" v-loading="loading">
-          <el-table 
-            :data="images" 
-            style="width: 100%" 
-            height="calc(100vh - 240px)"
-            @selection-change="handleSelectionChange"
-          >
-            <el-table-column type="selection" width="55" />
+          <el-table :data="images" style="width: 100%" height="calc(100vh - 240px)">
             <el-table-column label="图片预览" width="120">
               <template #default="scope">
                 <el-image 
-                  :ref="(el: any) => imageRefs[scope.$index] = el"
                   class="table-image"
                   :src="scope.row.image_url" 
-                  :preview-src-list="previewSrcList"
-                  :initial-index="scope.$index"
+                  :preview-src-list="[scope.row.image_url]"
                   fit="cover"
                   preview-teleported
                 >
@@ -98,7 +82,7 @@
             </el-table-column>
             <el-table-column label="操作" width="120" fixed="right">
               <template #default="scope">
-                <el-button type="primary" link @click="handlePreview(scope.$index)">预览</el-button>
+                <el-button type="primary" link @click="handlePreview(scope.row)">预览</el-button>
                 <el-button type="danger" link @click="handleDeleteImage(scope.row)">删除</el-button>
               </template>
             </el-table-column>
@@ -174,7 +158,7 @@
 
 <script setup lang="ts">
 import { ref, onMounted, reactive, computed } from 'vue'
-import { Plus, Edit, Delete, Upload, Picture, Folder, FolderOpened, Tickets } from '@element-plus/icons-vue'
+import { Plus, Edit, Delete, Upload, Picture, Folder, FolderOpened } from '@element-plus/icons-vue'
 import { ElMessage, ElMessageBox } from 'element-plus'
 import { imageApi, type ImageCategory, type ImageItem } from '@/api/image'
 import axios from 'axios'
@@ -203,8 +187,6 @@ const uploadDialogVisible = ref(false)
 const uploading = ref(false)
 const uploadFileList = ref<any[]>([])
 const uploadRef = ref()
-const imageRefs = reactive<any>({})
-const selectedIds = ref<string[]>([])
 
 const categoryForm = reactive({
   id: '',
@@ -217,10 +199,6 @@ const currentCategoryName = computed(() => {
   return currentCategory.value ? currentCategory.value.type_name : '全部分类'
 })
 
-const previewSrcList = computed(() => {
-  return images.value.map(img => img.image_url).filter(url => !!url)
-})
-
 // --- 方法定义 ---
 
 const fetchCategories = async () => {
@@ -238,10 +216,6 @@ const fetchCategories = async () => {
 
 const fetchImages = async () => {
   loading.value = true
-  // 清空引用
-  for (const key in imageRefs) {
-    delete imageRefs[key]
-  }
   try {
     const res = await imageApi.getList(queryParams)
     if (res.code === 0) {
@@ -255,27 +229,6 @@ const fetchImages = async () => {
   }
 }
 
-const handleSelectionChange = (selection: ImageItem[]) => {
-  selectedIds.value = selection.map(item => item.id)
-}
-
-const handleBatchAddToTask = async () => {
-  if (selectedIds.value.length === 0) return
-  
-  try {
-    const { code, message } = await imageApi.batchAddToTask(selectedIds.value)
-    if (code === 0) {
-      ElMessage.success(message || '批量加入任务成功')
-      // 可以在此处刷新列表或清除选择
-    } else {
-      ElMessage.error(message || '操作失败')
-    }
-  } catch (error) {
-    console.error('批量加入任务失败:', error)
-    ElMessage.error('操作异常')
-  }
-}
-
 const handleCategoryClick = (data: ImageCategory) => {
   currentCategory.value = data
   queryParams.category_id = data.id === '0' ? '' : data.id
@@ -447,12 +400,9 @@ const handleDeleteImage = (row: ImageItem) => {
   })
 }
 
-const handlePreview = (index: number) => {
-  if (imageRefs[index]) {
-    // 触发 el-image 的预览
-    const el = imageRefs[index].$el.querySelector('img')
-    if (el) el.click()
-  }
+const handlePreview = (row: ImageItem) => {
+  // el-image 的预览功能已经集成在组件中了
+  // 这里可以手动触发大图预览,如果需要的话
 }
 
 const handleSizeChange = (val: number) => {
@@ -557,12 +507,6 @@ onMounted(() => {
   margin-bottom: 20px;
 }
 
-.header-right {
-  display: flex;
-  align-items: center;
-  gap: 12px;
-}
-
 .current-category {
   font-size: 18px;
   font-weight: bold;

+ 54 - 0
test_datetime_format.html

@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>DateTime Format Test</title>
+</head>
+<body>
+    <h1>DateTime Format Test</h1>
+    <div id="results"></div>
+
+    <script>
+        // 格式化日期时间函数
+        const formatDateTime = (dateTime) => {
+            if (!dateTime) return '-'
+            const date = new Date(dateTime)
+            
+            // 格式化为 YYYY-MM-DD HH:mm:ss
+            const year = date.getFullYear()
+            const month = String(date.getMonth() + 1).padStart(2, '0')
+            const day = String(date.getDate()).padStart(2, '0')
+            const hours = String(date.getHours()).padStart(2, '0')
+            const minutes = String(date.getMinutes()).padStart(2, '0')
+            const seconds = String(date.getSeconds()).padStart(2, '0')
+            
+            return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
+        }
+
+        // 测试数据
+        const testDates = [
+            '2026-01-06T17:46:31.000Z',
+            '2026-01-26T10:30:15.123Z',
+            '2025-12-25T23:59:59.999Z',
+            null,
+            undefined,
+            ''
+        ]
+
+        const resultsDiv = document.getElementById('results')
+        
+        testDates.forEach((date, index) => {
+            const formatted = formatDateTime(date)
+            const p = document.createElement('p')
+            p.innerHTML = `<strong>Test ${index + 1}:</strong> Input: ${date} → Output: ${formatted}`
+            resultsDiv.appendChild(p)
+        })
+
+        // 期望的输出格式示例
+        const expectedP = document.createElement('p')
+        expectedP.innerHTML = '<strong>Expected format:</strong> 2026-01-06 17:46:31'
+        expectedP.style.color = 'green'
+        expectedP.style.fontWeight = 'bold'
+        resultsDiv.appendChild(expectedP)
+    </script>
+</body>
+</html>