yangg 7 місяців тому
батько
коміт
afbfc315b5

Різницю між файлами не показано, бо вона завелика
+ 0 - 0
dist/index.html


+ 0 - 0
dist/static/css/chunk-21c68cbd.857f893e.css → dist/static/css/chunk-0678749f.857f893e.css


Різницю між файлами не показано, бо вона завелика
+ 0 - 0
dist/static/css/chunk-b144ff6a.9ad73d41.css


Різницю між файлами не показано, бо вона завелика
+ 0 - 0
dist/static/js/app.3150a46f.js


Різницю між файлами не показано, бо вона завелика
+ 0 - 0
dist/static/js/chunk-0678749f.d60a12a9.js


Різницю між файлами не показано, бо вона завелика
+ 0 - 0
dist/static/js/chunk-0eed3357.19ecb195.js


Різницю між файлами не показано, бо вона завелика
+ 0 - 0
dist/static/js/chunk-21c68cbd.6abdfa45.js


Різницю між файлами не показано, бо вона завелика
+ 0 - 0
dist/static/js/chunk-b144ff6a.bcb3a8be.js


+ 21 - 1
src/api/knowledge.js

@@ -683,4 +683,24 @@ export function rateScope(data) {
     method: 'post',
     data
   })
-}
+}
+
+
+/* 获取输入项目位置表  */
+
+export function Templatelist(data) {
+  return request({
+    url: 'project-input/Templatelist',
+    method: 'post',
+    data
+  })
+}
+
+/* 修改模版排序 project-input-temp/update */
+export function TemplateUpdate(data) {
+  return request({
+    url: 'project-input-temp/update',
+    method: 'post',
+    data
+  })
+}

+ 195 - 184
src/views/Information/index.vue

@@ -1,192 +1,203 @@
 <template>
-    <div class="information-container">
-      <!-- 添加搜索栏 -->
-      <div class="search-container">
-        <el-form :inline="true" :model="queryParams" class="demo-form-inline">
-          <el-form-item label="项目名称">
-            <el-input
-              v-model="queryParams.project_name"
-              placeholder="请输入项目名称"
-              clearable
-              @keyup.enter="handleQuery"
-            />
-          </el-form-item>
-          <el-form-item label="部门">
-            <el-input
-              v-model="queryParams.department"
-              placeholder="请输入部门"
-              clearable
-              @keyup.enter="handleQuery"
-            />
-          </el-form-item>
-          <el-form-item>
-            <el-button type="primary" @click="handleQuery">搜索</el-button>
-            <el-button @click="resetQuery">重置</el-button>
-          </el-form-item>
-        </el-form>
-      </div>
-      <el-table :data="projectList" stripe>
-        <el-table-column prop="sequence" label="序号" width="80" />
-        <el-table-column prop="project_name" label="项目名称" />
-        <el-table-column prop="name" label="文件名称" />
-        <el-table-column prop="tech_report_location" label="技术文档位置" />
-        <el-table-column prop="department" label="部门" />
-        <el-table-column prop="create_time" label="创建时间" />
-        <el-table-column prop="status" label="状态">
-          <template #default="scope">
-            <el-tag :type="getStatusType(scope.row.status)">
-              {{ getStatusText(scope.row.status) }}
-            </el-tag>
-          </template>
-        </el-table-column>
-        <!-- 添加操作列 -->
-        <el-table-column label="操作" width="150">
-          <template #default="scope">
-            <el-button type="primary" size="small" @click="handleEdit(scope.row)"
-              >编辑</el-button
-            >
-          </template>
-        </el-table-column>
-      </el-table>
-      <!-- 添加分页组件 -->
-      <div class="pagination-container">
-        <el-pagination
-          :current-page="queryParams.page"
-          :page-size="queryParams.page_size"
-          :page-sizes="[10, 20, 50, 100]"
-          :total="total"
-          layout="total, sizes, prev, pager, next, jumper"
-          @size-change="handleSizeChange"
-          @current-change="handleCurrentChange"
-        />
-      </div>
-      <el-dialog
-        :visible.sync="dialogVisible"
-        title="修改序号"
-        width="30%"
-        append-to-body
-        v-el-drag-dialog
-      >
-        <el-form :model="sequenceForm" label-width="80px">
-          <el-form-item label="序号">
-            <el-input-number
-              v-model="sequenceForm.sequence"
-              :min="0"
-              controls-position="right"
-            />
-          </el-form-item>
-        </el-form>
-        <template #footer>
-          <span class="dialog-footer">
-            <el-button @click="dialogVisible = false">取消</el-button>
-            <el-button type="primary" @click="submitSequence">确定</el-button>
-          </span>
+  <div class="information-container">
+    <!-- 添加搜索栏 -->
+    <div class="search-container">
+      <el-form :inline="true" :model="queryParams" class="demo-form-inline">
+       <!--  <el-form-item label="项目名称">
+          <el-input
+            v-model="queryParams.project_name"
+            placeholder="请输入项目名称"
+            clearable
+            @keyup.enter="handleQuery"
+          />
+        </el-form-item> -->
+        <el-form-item label="部门">
+          <el-input
+            v-model="queryParams.department"
+            placeholder="请输入部门"
+            clearable
+            @keyup.enter="handleQuery"
+          />
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" @click="handleQuery">搜索</el-button>
+          <el-button @click="resetQuery">重置</el-button>
+        </el-form-item>
+      </el-form>
+    </div>
+    <el-table :data="projectList" stripe>
+      <el-table-column prop="sequence" label="序号" width="80">
+        <template #default="scope">
+          <div style="display: flex; align-items: center">
+              <span style="margin-right: 10px">{{ scope.row.sequence }}</span>
+              <i
+                class="el-icon-edit"
+                @click="handleEdit(scope.row)"
+                style="cursor: pointer; margin-left: 5px"
+              ></i>
+            </div>
+        </template>
+      </el-table-column>
+<!--       <el-table-column prop="project_name" label="项目名称" /> -->
+      <el-table-column prop="name" label="文件名称" />
+      <el-table-column prop="tech_report_location" label="技术文档位置" />
+      <el-table-column prop="department" label="部门" />
+      <el-table-column prop="create_time" label="创建时间" />
+      <el-table-column prop="status" label="状态">
+        <template #default="scope">
+          <el-tag :type="getStatusType(scope.row.status)">
+            {{ getStatusText(scope.row.status) }}
+          </el-tag>
         </template>
-      </el-dialog>
+      </el-table-column>
+      <!-- 添加操作列 -->
+     <!--  <el-table-column label="操作" width="150">
+        <template #default="scope">
+          <el-button type="primary" size="small" @click="handleEdit(scope.row)"
+            >编辑</el-button
+          >
+        </template>
+      </el-table-column> -->
+    </el-table>
+    <!-- 添加分页组件 -->
+    <div class="pagination-container">
+      <el-pagination
+        :current-page="queryParams.page"
+        :page-size="queryParams.page_size"
+        :page-sizes="[10, 20, 50, 100]"
+        :total="total"
+        layout="total, sizes, prev, pager, next, jumper"
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+      />
     </div>
-  </template>
-    
-    <script>
-  import { projectList, sequence } from "@/api/knowledge";
-  import elDragDialog from "@/directive/el-drag-dialog";
-  export default {
-    directives: { elDragDialog },
-    name: "Information",
-    data() {
-      return {
-        projectList: [],
-        total: 0,
-        queryParams: {
-          sort_field:'sequence',
-          sort_order:"asc",
-          page: 1,
-          page_size: 10,
-          project_name: "", // 添加搜索参数
-          department: "", // 添加搜索参数
-        },
-        dialogVisible: false,
-        sequenceForm: {
-          sequence: 1,
-          id: null,
-        },
-      };
-    },
-    methods: {
-      async getProjectList() {
-        try {
-          // 修改请求,添加分页参数
-          const response = await projectList(this.queryParams);
-          this.projectList = response.data.list;
-          this.total = response.data.total; // 假设后端返回总数
-        } catch (error) {
-          console.error("获取项目列表失败:", error);
-        }
-      },
-      // 添加分页处理方法
-      handleSizeChange(val) {
-        this.queryParams.page_size = val;
-        this.getProjectList();
-      },
-      handleCurrentChange(val) {
-        this.queryParams.page = val;
-        this.getProjectList();
-      },
-      // 获取状态标签类型
-      getStatusType(status) {
-        const statusMap = {
-          5: "success",
-          // 可以根据实际状态码添加更多映射
-        };
-        return statusMap[status] || "info";
-      },
-      // 获取状态文本
-      getStatusText(status) {
-        const statusMap = {
-          5: "正常",
-          // 可以根据实际状态码添加更多映射
-        };
-        return statusMap[status] || "未知状态";
-      },
-      // 添加搜索相关方法
-      handleQuery() {
-        this.queryParams.page = 1;
-        this.getProjectList();
-      },
-      resetQuery() {
-        this.queryParams.project_name = "";
-        this.queryParams.department = "";
-        this.handleQuery();
-      },
-      // 打开编辑序号对话框
-      handleEdit(row) {
-        this.sequenceForm.sequence = row.sequence;
-        this.sequenceForm.id = row.id;
-        this.dialogVisible = true;
-      },
+    <el-dialog
+      :visible.sync="dialogVisible"
+      title="修改序号"
+      width="30%"
+      append-to-body
+      v-el-drag-dialog
+    >
+      <el-form :model="sequenceForm" label-width="80px">
+        <el-form-item label="序号">
+          <el-input-number
+            v-model="sequenceForm.sequence"
+            :min="0"
+            controls-position="right"
+          />
+        </el-form-item>
+      </el-form>
+      <template #footer>
+        <span class="dialog-footer">
+          <el-button @click="dialogVisible = false">取消</el-button>
+          <el-button type="primary" @click="submitSequence">确定</el-button>
+        </span>
+      </template>
+    </el-dialog>
+  </div>
+</template>
   
-      // 提交序号修改
-      async submitSequence() {
-        try {
-          await sequence({
-            id: this.sequenceForm.id,
-            new_sequence: this.sequenceForm.sequence,
-          });
-          this.$message.success("修改序号成功");
-          this.dialogVisible = false;
-          this.getProjectList(); // 刷新列表
-        } catch (error) {
-          this.$message.error("修改序号失败:" + error.message);
-        }
+  <script>
+import { projectList, sequence,Templatelist,TemplateUpdate } from "@/api/knowledge";
+import elDragDialog from "@/directive/el-drag-dialog";
+export default {
+  directives: { elDragDialog },
+  name: "Information",
+  data() {
+    return {
+      projectList: [],
+      total: 0,
+      queryParams: {
+        sort_field:'sequence',
+        sort_order:"asc",
+        page: 1,
+        page_size: 10,
+        project_name: "", // 添加搜索参数
+        department: "", // 添加搜索参数
       },
+      dialogVisible: false,
+      sequenceForm: {
+        sequence: 1,
+        id: null,
+      },
+    };
+  },
+  methods: {
+    async getProjectList() {
+      try {
+        // 修改请求,添加分页参数
+        const response = await Templatelist(this.queryParams);
+        this.projectList = response.data.list;
+        this.total = response.data.total; // 假设后端返回总数
+      } catch (error) {
+        console.error("获取项目列表失败:", error);
+      }
+    },
+    // 添加分页处理方法
+    handleSizeChange(val) {
+      this.queryParams.page_size = val;
+      this.getProjectList();
     },
-    created() {
+    handleCurrentChange(val) {
+      this.queryParams.page = val;
       this.getProjectList();
     },
-  };
-  </script>
-    
-    <style lang="scss" scoped>
-  .information-container {
-    padding: 20px;
-  }
-  </style>
+    // 获取状态标签类型
+    getStatusType(status) {
+      const statusMap = {
+        5: "success",
+        // 可以根据实际状态码添加更多映射
+      };
+      return statusMap[status] || "info";
+    },
+    // 获取状态文本
+    getStatusText(status) {
+      const statusMap = {
+        5: "正常",
+        // 可以根据实际状态码添加更多映射
+      };
+      return statusMap[status] || "未知状态";
+    },
+    // 添加搜索相关方法
+    handleQuery() {
+      this.queryParams.page = 1;
+      this.getProjectList();
+    },
+    resetQuery() {
+      this.queryParams.project_name = "";
+      this.queryParams.department = "";
+      this.handleQuery();
+    },
+    // 打开编辑序号对话框
+    handleEdit(row) {
+      this.sequenceForm.sequence = row.sequence;
+      this.sequenceForm.id = row.id;
+      this.dialogVisible = true;
+    },
+
+    // 提交序号修改
+    async submitSequence() {
+      try {
+        await TemplateUpdate({
+          id: this.sequenceForm.id,
+          new_sequence: this.sequenceForm.sequence,
+        });
+        this.$message.success("修改序号成功");
+        this.dialogVisible = false;
+        this.getProjectList(); // 刷新列表
+      } catch (error) {
+        this.$message.error("修改序号失败:" + error.message);
+      }
+    },
+  },
+  created() {
+    this.getProjectList();
+  },
+};
+</script>
+  
+  <style lang="scss" scoped>
+.information-container {
+  padding: 20px;
+}
+</style>

+ 29 - 19
src/views/customer/components/dataList.vue

@@ -40,9 +40,9 @@
     <el-table :data="dataList" style="width: 100%; margin-top: 20px">
       <el-table-column prop="code" label="客户编码" />
       <el-table-column prop="name" label="客户名称" />
-      <el-table-column prop="enName" label="英文名称" />
-      <el-table-column prop="mobile" label="手机号码" />
       <el-table-column prop="contact" label="联系人" />
+      <el-table-column prop="contactPosition" label="联系人职位" />
+      <el-table-column prop="mobile" label="手机号码" />
       <el-table-column prop="address" label="地址" />
       <el-table-column prop="other" label="其他信息" />
       <el-table-column prop="createTime" label="创建时间" />
@@ -92,28 +92,29 @@
             class="w_input"
           />
         </el-form-item>
-        <el-form-item label="英文名称" required>
+        <el-form-item label="联系人">
           <el-input
-            v-model="customerForm.en_name"
-            placeholder="请输入英文名称"
+            v-model="customerForm.contact"
+            placeholder="请输入联系人"
             class="w_input"
           />
         </el-form-item>
-        <el-form-item label="手机号码" required>
+        <el-form-item label="联系人职位" required>
           <el-input
-            v-model="customerForm.mobile"
-            placeholder="请输入手机号码"
+            v-model="customerForm.contact_position"
+            placeholder="请输入联系人职位"
             class="w_input"
           />
         </el-form-item>
-        <el-form-item label="联系人" required>
+        <el-form-item label="手机号码">
           <el-input
-            v-model="customerForm.contact"
-            placeholder="请输入联系人"
+            v-model="customerForm.mobile"
+            placeholder="请输入手机号码"
             class="w_input"
           />
         </el-form-item>
-        <el-form-item label="地址" required>
+
+        <el-form-item label="地址">
           <el-input
             v-model="customerForm.address"
             placeholder="请输入地址"
@@ -139,7 +140,13 @@
 </template>
 
 <script>
-import { searchCustomer, syncCustomer, createCustomer, updateCustomer,deleteCustomer } from "@/api/customer";
+import {
+  searchCustomer,
+  syncCustomer,
+  createCustomer,
+  updateCustomer,
+  deleteCustomer,
+} from "@/api/customer";
 /* import dataInfo from "./dataInfo.vue"; */
 import elDragDialog from "@/directive/el-drag-dialog";
 export default {
@@ -194,11 +201,12 @@ export default {
       customerForm: {
         code: "",
         name: "",
-        en_name: "",
+        contact_position: "",
         mobile: "",
         contact: "",
         address: "",
         other: "",
+        status:5
       },
       tableData: [], // Add tableData
       isEdit: false, // Add flag for edit mode
@@ -211,7 +219,7 @@ export default {
     // 处理创建/更新客户
     handleEdit(row) {
       this.isEdit = true;
-      this.customerForm = { ...row,en_name:row.enName };
+      this.customerForm = { ...row, contact_position: row.contactPosition };
       this.dialogVisible = true;
     },
 
@@ -221,10 +229,10 @@ export default {
         cancelButtonText: "取消",
         type: "warning",
       }).then(() => {
-        deleteCustomer({id:row.id})
+        deleteCustomer({ id: row.id })
           .then(() => {
             this.$message.success("删除成功");
-            this.search()
+            this.search();
           })
           .catch(() => {
             this.$message.error("删除失败");
@@ -253,11 +261,12 @@ export default {
       this.customerForm = {
         code: "",
         name: "",
-        en_name: "",
+        contact_position: "",
         mobile: "",
         contact: "",
         address: "",
         other: "",
+        status:5
       };
       this.dialogVisible = true;
     },
@@ -267,11 +276,12 @@ export default {
       this.customerForm = {
         code: "",
         name: "",
-        en_name: "",
+        contact_position: "",
         mobile: "",
         contact: "",
         address: "",
         other: "",
+        status:5
       };
     },
     // 搜索提交

+ 27 - 7
src/views/knowledgeMenu/category/knowledgeSet.vue

@@ -112,12 +112,9 @@
           />
           <el-table-column prop="run" label="解析状态" align="center">
             <template #default="scope">
-              <div v-if="scope.row.run == 0">未解析</div>
-              <div v-if="scope.row.run == 1">解析中</div>
-              <div v-if="scope.row.run == 3">成功</div>
-              <div v-if="scope.row.run == 4">失败</div>
-              <div v-if="scope.row.run == 5">待处理</div>
-              <div v-if="scope.row.run == 6">文件异常</div>
+              <el-tag :type="getStatusType(scope.row.run)" size="small">
+                {{ getStatusText(scope.row.run) }}
+              </el-tag>
             </template>
           </el-table-column>
           <el-table-column
@@ -526,6 +523,30 @@ export default {
           break;
       }
     },
+    /* 状态展示 */
+    getStatusType(status) {
+      const statusMap = {
+        0: "info", // 未解析
+        1: "warning", // 解析中
+        3: "success", // 成功
+        4: "danger", // 失败
+        5: "warning", // 待处理
+        6: "danger", // 文件异常
+      };
+      return statusMap[status] || "info";
+    },
+
+    getStatusText(status) {
+      const statusMap = {
+        0: "未解析",
+        1: "解析中",
+        3: "成功",
+        4: "失败",
+        5: "待处理",
+        6: "文件异常",
+      };
+      return statusMap[status] || "未知状态";
+    },
     /* 判断类名 */
     getFileCountClass(id) {
       const isSpecialFolder = id === 0 || id === "001";
@@ -883,7 +904,6 @@ export default {
 
       // Set the status to "解析中" (1) immediately
       this.$set(row, "run", 1);
-
       const analysisConfig = {
         document_ids: JSON.stringify([row.id]),
         start_page: row.start_page ?? 0, // 使用空值合并运算符

+ 245 - 25
src/views/project/ProjectInput.vue

@@ -75,12 +75,13 @@
           <!-- 添加内容状态筛选 -->
           <el-form-item label="内容状态">
             <el-select
-              v-model="gsprSearchForm.hasContent"
+              v-model="gsprSearchForm.content_empty"
               placeholder="请选择"
               clearable
             >
-              <el-option label="有内容" :value="true" />
-              <el-option label="无内容" :value="false" />
+              <!-- <el-option label="请选择状态" value="null" /> -->
+              <el-option label="有内容" :value="false" />
+              <el-option label="无内容" :value="true" />
             </el-select>
           </el-form-item>
           <el-form-item>
@@ -103,7 +104,18 @@
           label="排序"
           sortable="custom"
           width="80"
-        />
+        >
+          <template slot-scope="scope">
+            <div style="display: flex; align-items: center">
+              <span style="margin-right: 10px">{{ scope.row.sequence }}</span>
+              <i
+                class="el-icon-edit"
+                @click="handleEditSequence(scope.row)"
+                style="cursor: pointer; margin-left: 5px"
+              ></i>
+            </div>
+          </template>
+        </el-table-column>
         <el-table-column prop="name" label="项目名称" sortable="custom" />
         <el-table-column prop="tech_report_location" label="技术报告位置" />
         <el-table-column prop="department" label="部门" sortable="custom" />
@@ -130,6 +142,18 @@
             />
           </template>
         </el-table-column>
+        <el-table-column label="备注">
+          <template slot-scope="scope">
+            <div style="display: flex; align-items: center">
+              <span style="margin-right: 10px">{{ scope.row.remarks }}</span>
+              <i
+                class="el-icon-edit"
+                @click="handleEditRemark(scope.row)"
+                style="cursor: pointer; margin-left: 5px"
+              ></i>
+            </div>
+          </template>
+        </el-table-column>
         <el-table-column label="操作" width="200">
           <template slot-scope="scope">
             <el-button type="primary" @click="handleEditGspr(scope.row)"
@@ -142,7 +166,7 @@
         </el-table-column>
       </el-table>
 
-      <div class="pagination-container">
+     <!--  <div class="pagination-container">
         <el-pagination
           @size-change="handleGsprSizeChange"
           @current-change="handleGsprCurrentChange"
@@ -152,7 +176,7 @@
           layout="total, sizes, prev, pager, next, jumper"
           :total="gsprTotal"
         />
-      </div>
+      </div> -->
 
       <!-- GSPR表单弹窗 -->
       <el-dialog
@@ -273,6 +297,51 @@
       </span>
     </el-dialog>
     <!-- 其余第一个tab的内容... -->
+    <!-- 修改序号 -->
+    <el-dialog
+      :visible.sync="dialogVisible"
+      title="修改序号"
+      width="30%"
+      append-to-body
+      v-el-drag-dialog
+    >
+      <el-form :model="sequenceForm" label-width="80px">
+        <el-form-item label="序号">
+          <el-input-number
+            v-model="sequenceForm.sequence"
+            :min="0"
+            controls-position="right"
+          />
+        </el-form-item>
+      </el-form>
+      <template #footer>
+        <span class="dialog-footer">
+          <el-button @click="dialogVisible = false">取消</el-button>
+          <el-button type="primary" @click="submitSequence">确定</el-button>
+        </span>
+      </template>
+    </el-dialog>
+    <!-- 添加备注编辑对话框 -->
+    <el-dialog
+      title="编辑备注"
+      :visible.sync="remarkDialogVisible"
+      width="500px"
+    >
+      <el-form :model="remarkForm">
+        <el-form-item label="备注">
+          <el-input
+            type="textarea"
+            v-model="remarkForm.remarks"
+            :rows="4"
+            placeholder="请输入备注"
+          />
+        </el-form-item>
+      </el-form>
+      <div slot="footer">
+        <el-button @click="remarkDialogVisible = false">取消</el-button>
+        <el-button type="primary" @click="handleRemarkSubmit">确定</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
   
@@ -287,15 +356,18 @@ import {
   delete_items,
   update_items,
   rateScope,
+  sequence,
 } from "@/api/knowledge";
-import { searchProject, exportItems } from "@/api/project";
+import { searchProject, exportItems, getProjectInfo } from "@/api/project";
 import { mapState } from "vuex";
 import CKEditor from "ckeditor4-vue";
 import axios from "axios";
+import elDragDialog from "@/directive/el-drag-dialog";
 export default {
   compnents: {
     ckeditor: CKEditor.component,
   },
+  directives: { elDragDialog },
   data() {
     // 自定义验证规则
     const validateDeleteConfirm = (rule, value, callback) => {
@@ -336,16 +408,18 @@ export default {
         department: "",
         project_id: null,
         dateRange: [], // 添加时间范围
-        hasContent: null, // 添加内容状态
+        content_empty: null, // 添加内容状态
       },
       gsprPageForm: {
         page: 1,
         page_size: 30,
+        /*  sort_field:'sequence',
+        sort_order:"asc", */
       },
       gsprTotal: 0,
       departList: [],
-      sort_field: "name",
-      sort_order: "desc",
+      sort_field: "sequence",
+      sort_order: "asc",
       hasExistingData: false,
       gsprDialogVisible: false,
       gsprDialogTitle: "",
@@ -359,7 +433,7 @@ export default {
       },
       gsprPageForm: {
         page: 1,
-        page_size: 30,
+        page_size: 999,
       },
       gsprTotal: 0,
       gsprRules: {
@@ -396,6 +470,20 @@ export default {
         language: "zh-cn",
         height: "300px",
       },
+      dialogVisible: false,
+      sequenceForm: {
+        sequence: 1,
+        id: null,
+      },
+      remarkDialogVisible: false,
+      remarkForm: {
+        id: "",
+        remarks: "",
+      },
+      /* 已绑定项目 */
+      documentIds: [],
+      templateLocations: [], // 存储传递过来的位置信息
+      matchedContents: {}, // 存储技术报告位置匹配的内容
     };
   },
   mounted() {
@@ -407,9 +495,115 @@ export default {
         this.handleProjectConfirm();
       }
     });
+
+    // 获取并处理传递过来的模板位置数据
+    const projectDataStr = this.$route.query.projectData;
+    if (projectDataStr) {
+      try {
+        const projectData = JSON.parse(decodeURIComponent(projectDataStr));
+        this.templateLocations = projectData.locations;
+
+        // 创建位置到内容的映射
+        this.matchedContents = this.templateLocations.reduce((acc, loc) => {
+          if (loc.type === "template_location") {
+            // 移除位置标记中的括号以便匹配
+            const cleanLocation = loc.tech_report_location;
+            acc[cleanLocation] = loc;
+          }
+
+          return acc;
+        }, {});
+      } catch (error) {
+        console.error("解析项目数据失败:", error);
+      }
+    }
   },
 
   methods: {
+    // 修改现有的 handleEditRemark 方法
+    handleEditRemark(row) {
+      // 只复制需要的字段
+      this.remarkForm = {
+        id: row.id,
+        remarks: row.remarks || "",
+        sequence: row.sequence,
+        project: row.project,
+        content: row.content,
+        status: row.status,
+        // 保留其他必要字段,但不包含 score
+        name: row.name,
+        tech_report_location: row.tech_report_location,
+        department: row.department,
+        content: row.content,
+      };
+      this.remarkDialogVisible = true;
+    },
+
+    // 修改备注提交方法
+    async handleRemarkSubmit() {
+      try {
+        // 只更新必要的字段
+        const updateData = {
+          ...this.remarkForm,
+          remarks: this.remarkForm.remarks,
+        };
+
+        await projectUpdate(updateData);
+        this.$message.success("备注更新成功");
+        this.remarkDialogVisible = false;
+        this.fetchGsprData();
+      } catch (error) {
+        this.$message.error("备注更新失败");
+      }
+    },
+    /* 修改评分 */
+    async rateScope(value, row) {
+      try {
+        const response = await rateScope({
+          id: row.id,
+          score: value,
+        });
+
+        if (response.status === 200) {
+          this.$message.success("评分更新成功");
+          // 更新本地数据
+          const index = this.gsprTableData.findIndex(
+            (item) => item.id === row.id
+          );
+          if (index !== -1) {
+            this.gsprTableData[index].score = value;
+          }
+        } else {
+          throw new Error(response.message || "评分更新失败");
+        }
+      } catch (error) {
+        this.$message.error(error.message || "评分更新失败");
+        // 恢复原始评分
+        row.score = row.score || 0;
+      }
+    },
+    /* 修改序号 */
+    handleEditSequence(row) {
+      this.sequenceForm.sequence = row.sequence;
+      this.sequenceForm.id = row.id;
+      this.dialogVisible = true;
+    },
+    // 提交序号修改
+    async submitSequence() {
+      try {
+        await sequence({
+          id: this.sequenceForm.id,
+          new_sequence: this.sequenceForm.sequence,
+        });
+        this.$message.success("修改序号成功");
+        this.dialogVisible = false;
+        // 重新加载数据
+        this.fetchGsprData();
+      } catch (error) {
+        this.$message.error("修改序号失败:" + error.message);
+      }
+    },
+
     /* 项目导出 */
     async handleExport() {
       const loading = this.$loading({
@@ -421,13 +615,12 @@ export default {
         const response = await axios({
           url: `${process.env.VUE_APP_BASE_API}/project-input/export`,
           method: "post",
-          data: {project_id: this.selectedProjectId},
+          data: { project_id: this.selectedProjectId },
           headers: {
             "Content-Type": "application/json",
             Authorization: "Bearer " + localStorage.getItem("token"), // 根据实际token获取方式调整
           },
         });
-        console.log(response);
         // 检查响应数据
         if (
           !response.data ||
@@ -508,7 +701,6 @@ export default {
     handleEditGspr(row) {
       this.gsprDialogTitle = "编辑文献项目";
       this.gsprForm = { ...row };
-      console.log(this.gsprForm);
       this.gsprDialogVisible = true;
     },
     // 修改编辑内容显示方法
@@ -523,6 +715,7 @@ export default {
       );
 
       this.contentForm = {
+        sequence: row.sequence,
         project: selectedProject.id,
         project_name: selectedProject.name,
         id: row.id,
@@ -786,7 +979,6 @@ export default {
         this.$message.warning("请先选择一个项目");
         return;
       }
-      console.log(this.selectedProjectId);
       const selectedProject = this.projectOptions.find(
         (p) => p.id === this.selectedProjectId
       );
@@ -965,10 +1157,10 @@ export default {
       });
     },
 
-    // 数据获取与分页
+    // 修改获取数据的方法
     async fetchGsprData() {
       if (!this.selectedProjectId) {
-        return; // 如果没有选择项目,直接返回
+        return;
       }
 
       const loading = this.$loading({
@@ -985,20 +1177,41 @@ export default {
           project_id: this.selectedProjectId,
           ...this.gsprPageForm,
           ...this.gsprSearchForm,
-          // 处理日期范围
           start_date: this.gsprSearchForm.dateRange?.[0] || null,
           end_date: this.gsprSearchForm.dateRange?.[1] || null,
         };
-        // 删除原始dateRange参数
         delete params.dateRange;
+
         const response = await projectList(params);
+
         if (response.status === 200) {
-          this.gsprTableData = response.data.list.map((item) => ({
-            ...item,
-            score: item.score || 0,
-          }));
-          this.gsprTotal = response.data.total;
+          // 只保留匹配的数据
+          this.gsprTableData = response.data.list
+            .filter((item) => {
+              // 移除括号以进行匹配
+              const cleanLocation = item.tech_report_location;
+              return this.matchedContents[cleanLocation];
+            })
+            .map((item) => {
+              const cleanLocation = item.tech_report_location;
+              const matchedContent = this.matchedContents[cleanLocation];
+              return {
+                ...item,
+                score: typeof item.score === "number" ? item.score : 0,
+                matched_content: matchedContent?.content || null,
+                raw_content: matchedContent?.raw_content || null,
+                input_items: matchedContent?.input_items || [],
+              };
+            });
+          // 更新总数为过滤后的数量
+          this.gsprTotal = this.gsprTableData.length;
           this.hasExistingData = this.gsprTotal > 0;
+
+          // 如果当前页没有数据但总数大于0,回到第一页
+          if (this.gsprTableData.length === 0 && this.gsprTotal > 0) {
+            this.gsprPageForm.page = 1;
+            this.fetchGsprData();
+          }
         }
       } catch (error) {
         console.error("获取数据失败:", error);
@@ -1008,6 +1221,13 @@ export default {
       }
     },
 
+    // 添加一个辅助方法来检查位置是否匹配
+    isLocationMatched(location) {
+      if (!location) return false;
+      const cleanLocation = location.replace(/[\[\]【】]/g, "");
+      return !!this.matchedContents[cleanLocation];
+    },
+
     handleGsprSizeChange(val) {
       this.gsprPageForm.page_size = val;
       this.fetchGsprData();
@@ -1030,7 +1250,7 @@ export default {
         department: "",
         project_id: this.selectedProjectId,
         dateRange: [], // 重置时间范围
-        hasContent: null, // 重置内容状态
+        content_empty: null, // 重置内容状态
       };
       this.handleGsprSearch();
     },

+ 147 - 15
src/views/project/components/dataList.vue

@@ -7,7 +7,7 @@
       empty-text="没有项目信息"
     >
       <el-table-column prop="id" label="项目编号" align="center" width="80" />
-      <el-table-column prop="customer_id" label="客户名称" align="left" >
+      <el-table-column prop="customer_id" label="客户名称" align="left">
         <template #default="scope">
           <span>{{ getCusomName(scope.row.customer_id) }}</span>
         </template>
@@ -82,11 +82,6 @@
             </span>
             <template #dropdown>
               <el-dropdown-menu>
-                <el-dropdown-item
-                  :command="{ type: 'viewTemplates', row: scope.row }"
-                >
-                  已绑定模版
-                </el-dropdown-item>
                 <el-dropdown-item
                   :command="{ type: 'template', row: scope.row }"
                   >选择模版</el-dropdown-item
@@ -94,6 +89,14 @@
                 <el-dropdown-item :command="{ type: 'enter', row: scope.row }"
                   >输入项目</el-dropdown-item
                 >
+                <el-dropdown-item
+                  :command="{ type: 'viewTemplates', row: scope.row }"
+                  v-if="
+                    scope.row.documentIds && scope.row.documentIds.length > 0
+                  "
+                >
+                  已绑定模版
+                </el-dropdown-item>
                 <el-dropdown-item :command="{ type: 'edit', row: scope.row }">
                   <svg-icon icon-class="edit" />编辑
                 </el-dropdown-item>
@@ -341,18 +344,22 @@ export default {
   },
   methods: {
     /* 客户名称 */
-    getCusomName(phaseId){
+    getCusomName(phaseId) {
       const product = this.customList.find((item) => item.id === phaseId);
       return product ? product.name : "未知客户";
     },
     /* 当前阶段 */
     getPhaseName(phaseId) {
-      const product = this.currentPhaseList.find((item) => item.value === phaseId);
+      const product = this.currentPhaseList.find(
+        (item) => item.value === phaseId
+      );
       return product ? product.label : "未知阶段";
     },
 
     getPhaseType(phaseId) {
-      const product = this.currentPhaseList.find((item) => item.value === phaseId);
+      const product = this.currentPhaseList.find(
+        (item) => item.value === phaseId
+      );
       if (!product) return "info";
 
       // 根据不同阶段返回不同的类型
@@ -431,7 +438,7 @@ export default {
     viewBoundTemplates(row) {
       this.currentData = row;
       this.boundTemplateLoading = true;
-      searchTemplateList({ ids: row.documentIds.join(",") })
+      searchTemplateList({ ids: row.documentIds.join(",") || 0 })
         .then((res) => {
           if (res.status === 200) {
             this.boundTemplateList = res.data;
@@ -1282,13 +1289,138 @@ export default {
     },
     /* 输入项目 */
     enterPro(row) {
-      this.$router.push({
-        path: "/project/ProjectInput",
-        query: { id: row.id },
-      });
+      if (row.documentIds.length == 0) {
+        this.$message.warning("请先绑定模版!");
+        return;
+      }
+
+      // 获取已绑定模版的替换位置信息
+      searchTemplateList({ ids: row.documentIds.join(",") || 0 })
+        .then(async (res) => {
+          if (res.status === 200) {
+            const templates = res.data;
+            const locations = [];
+
+            // 遍历所有模版,提取替换位置
+            templates.forEach((template) => {
+              if (template.data) {
+                const templateData = JSON.parse(template.data);
+                templateData.forEach((item) => {
+                  const tempDiv = document.createElement("div");
+                  tempDiv.innerHTML = item.content;
+                  const plainText = tempDiv.textContent || tempDiv.innerText;
+
+                  const patterns = [
+                    /【([A-Z]{1,4}[0-9]{0,2})-([A-Z]{1,4}[0-9]{0,2})-([0-9]{2})-([0-9]{2,3})】/g,
+                    /\[([A-Z]{1,4}[0-9]{0,2})-([A-Z]{1,4}[0-9]{0,2})-([0-9]{2})-([0-9]{2,3})\]/g,
+                  ];
+
+                  patterns.forEach((pattern) => {
+                    let match;
+                    while ((match = pattern.exec(plainText)) !== null) {
+                      locations.push({
+                        template_id: template.id,
+                        template_title: template.title,
+                        location: match[0],
+                        type: this.getDocumentType(match[0]),
+                      });
+                    }
+                  });
+                });
+              }
+            });
+
+            try {
+              // 按类型分组位置信息
+              const params = {
+                template_location: [],
+                middle_layer_location: [],
+                tech_report_location: [],
+                other_location: [],
+              };
+
+              // 遍历所有位置并分类
+              locations.forEach((loc) => {
+                Object.keys(params).forEach((key) => {
+                  if (loc.type === key) {
+                    params[key].push(loc.location.replace(/[\[\]【】]/g, "")); // 清除括号
+                  } else {
+                    params[key].push("");
+                  }
+                });
+              });
+
+              // 获取替换内容
+              const response = await axios.post(
+                `${process.env.VUE_APP_BASE_API}/project-raw-data/batch-content`,
+                params,
+                {
+                  headers: {
+                    "Content-Type": "application/json",
+                  },
+                }
+              );
+
+              if (response.status === 200 && response.data) {
+                const replacementContents = response.data.data.matched_data;
+
+                // 将位置信息和对应的替换内容组合
+                const enrichedLocations = locations.map((loc, index) => ({
+                  ...loc,
+                  content: replacementContents[index]?.content || null,
+                  template_location:
+                    replacementContents[index]?.template_location || null,
+                  tech_report_location:
+                    replacementContents[index]?.tech_report_location || [],
+                }));
+
+                // 对整个 enrichedLocations 进行去重
+                const uniqueEnrichedLocations = enrichedLocations.reduce(
+                  (acc, current) => {
+                    const isDuplicate = acc.find(
+                      (item) =>
+                        item.template_id === current.template_id &&
+                        item.location === current.location
+                    );
+
+                    if (!isDuplicate) {
+                      // 如果不是重复项,则添加到结果数组中
+                      return [...acc, current];
+                    }
+                    return acc;
+                  },
+                  []
+                );
+                // 使用去重后的数据
+                this.$router.push({
+                  path: "/project/ProjectInput",
+                  query: {
+                    id: row.id,
+                    projectData: encodeURIComponent(
+                      JSON.stringify({
+                        locations: uniqueEnrichedLocations, // 使用去重后的数据
+                        templates: templates.map((t) => ({
+                          id: t.id,
+                          title: t.title,
+                        })),
+                      })
+                    ),
+                  },
+                });
+              }
+            } catch (error) {
+              console.error("获取替换内容失败:", error);
+              this.$message.error("获取替换内容失败");
+            }
+          }
+        })
+        .catch((error) => {
+          console.error("获取模版位置信息失败:", error);
+          this.$message.error("获取模版位置信息失败");
+        });
     },
     /* 产品分类名称 */
-    getCategoryTypeName(categoryId){
+    getCategoryTypeName(categoryId) {
       const category = this.productList.find((item) => item.id === categoryId);
       return category ? category.category.name : categoryId;
     },

Деякі файли не було показано, через те що забагато файлів було змінено