Explorar el Código

修改项目部分并打包

yangg hace 8 meses
padre
commit
06f808e0d0

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
dist/index.html


+ 0 - 0
dist/static/js/app.2889c924.js → dist/static/js/app.a4093da4.js


+ 14 - 0
src/api/knowledge.js

@@ -589,6 +589,19 @@ export function process_model_generation(data) {
     }
   })
 }
+/* 重复处理文献 */
+export function process_model_regeneration(data) {
+  return request({
+    url: 'liter-data-auto/process_model_regeneration',
+    method: 'post',
+    headers: {
+      'Content-Type': 'application/json'
+    },
+    data: {
+      literature_ids: data // 将传入的数据作为 literature_ids 的值
+    }
+  })
+}
 
 /* 获取文献处理内容  */
 
@@ -631,6 +644,7 @@ export function delete_items(data) {
     data
   })
 }
+
 /* 更新项目 project-input/update-items */
 
 export function update_items(data) {

+ 45 - 4
src/views/middPage/list.vue

@@ -128,6 +128,11 @@
         >
           <el-table-column type="selection" width="55" />
           <el-table-column prop="id" label="ID" width="80" />
+          <el-table-column
+            prop="doc_identifier"
+            label="文献编号"
+          ></el-table-column>
+
           <el-table-column prop="name" label="名称">
             <!-- <template #default="{ row }">
               <el-link @click="handleNameClick(row)">{{ row.name }}</el-link>
@@ -173,8 +178,17 @@
                     <el-dropdown-item @click.native="handlePreview(row)">
                       <i class="el-icon-tickets"></i> 预览
                     </el-dropdown-item>
-                    <el-dropdown-item @click.native="handleSingleProcess(row)">
-                      <i class="el-icon-refresh"></i> 处理文献
+                    <el-dropdown-item
+                      @click.native="handleSingleProcess(row)"
+                      v-if="row.processing_status !== 2"
+                    >
+                      <i class="el-icon-caret-right"></i> 处理文献
+                    </el-dropdown-item>
+                    <el-dropdown-item
+                      @click.native="handleReprocess(row)"
+                      v-if="row.processing_status === 2"
+                    >
+                      <i class="el-icon-refresh"></i> 重新处理
                     </el-dropdown-item>
                     <!-- <el-dropdown-item
                       @click.native="firstHandleUpload(scope.$index, scope.row)"
@@ -279,6 +293,7 @@ import {
   edit_tags,
   search,
   process_model_generation,
+  process_model_regeneration,
 } from "@/api/knowledge";
 import axios from "axios";
 // 状态映射表
@@ -338,6 +353,32 @@ export default {
   },
 
   methods: {
+    /* 重复处理 */
+    async handleReprocess(row) {
+      try {
+        await this.$confirm("确认要重新处理该文献吗?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        });
+
+        // 调用重新处理的接口
+        const res = await process_model_regeneration([row.id]); // 添加第二个参数表示重新处理
+
+        if (res.status === 200) {
+          this.$message.success("重新处理任务已提交");
+          await this.fetchGpuList(); // 刷新列表
+        } else {
+          throw new Error(res.message || "重新处理失败");
+        }
+      } catch (error) {
+        if (error === "cancel") {
+          return;
+        }
+        this.$message.error(error.message || "重新处理提交失败");
+        console.error("重新处理错误:", error);
+      }
+    },
     // 在中添加单个处理方法
     async handleSingleProcess(row) {
       try {
@@ -567,7 +608,7 @@ export default {
         const params = {
           page: this.currentPage,
           page_size: this.pageSize,
-          doc_type_id: this.selectedType || 36,
+          doc_type_id: this.selectedType || "",
           keyword: this.searchForm.name,
           tag_names: this.searchForm.id,
         };
@@ -652,7 +693,7 @@ export default {
           console.error("轮询检查状态失败:", error);
           this.stopPolling(id); // 发生错误时停止轮询
         }
-      }, 60000); // 每分钟检查一次
+      }, 30000); // 每分钟检查一次
     },
 
     // 新增:停止轮询

+ 1 - 1
src/views/project/category/components/dataList.vue

@@ -29,7 +29,7 @@
 
       <div class="page-info">
       	<el-pagination
-      	v-model:currentPage="queryForm.page"
+      	:currentPage="queryForm.page"
       	:page-size="queryForm.pageSize"
       	:total="recordCount"
       	:page-count="pageTotal"

+ 95 - 54
src/views/project/components/dataInfo.vue

@@ -1,45 +1,25 @@
 <template>
   <div class="data-info">
     <el-card>
-      <el-form :model="dataForm" label-width="120px">
-        <el-form-item label="项目名称:">
-          <el-input v-model="dataForm.name"></el-input>
+      <el-form
+        :model="dataForm"
+        :rules="rules"
+        ref="dataFormRef"
+        label-width="120px"
+      >
+        <el-form-item label="项目名称:" prop="name" class="form-item-half">
+          <el-input v-model="dataForm.name" placeholder="请输入项目名称"></el-input>
         </el-form-item>
 
-        <el-form-item label="项目介绍:">
-          <el-input
-            rows="10"
-            type="textarea"
-            v-model="dataForm.intro"
-          ></el-input>
-        </el-form-item>
-
-        <!--<el-form-item label="所属客户:">
-          <el-select v-model="dataForm.customer_id"  placeholder="请选择客户" size="large"   style="width:100%;">
-              <el-option
-                v-for="item in customerList"
-                :key="item.id"
-                :label="item.name"
-                :value="item.id"
-              />
-            </el-select>
-        </el-form-item>
-      <el-form-item label="关联文档:">
-        <el-select v-model="dataForm.linkDoc" multiple  placeholder="请选择关联文档" size="large"   style="width:100%;">
-            <el-option
-              v-for="item in articleList"
-              :key="item.id"
-              :label="item.title"
-              :value="item.id"
-            />
-          </el-select>
-      </el-form-item>-->
-        <el-form-item label="所属分类:">
+        <el-form-item
+          label="所属分类:"
+          prop="category_id"
+          class="form-item-half"
+        >
           <el-select
             v-model="dataForm.category_id"
             placeholder="请选择所属分类"
             size="large"
-            style="width: 100%"
           >
             <el-option
               v-for="item in allCategories"
@@ -50,12 +30,11 @@
           </el-select>
         </el-form-item>
 
-        <el-form-item label="项目状态:">
+        <el-form-item label="项目状态:" prop="status" class="form-item-half">
           <el-select
             v-model="dataForm.status"
             placeholder="请选择状态"
             size="large"
-            style="width: 100%"
           >
             <el-option
               v-for="item in statusOptions"
@@ -65,6 +44,16 @@
             />
           </el-select>
         </el-form-item>
+
+        <!-- 项目介绍保持全宽 -->
+        <el-form-item label="项目介绍:" prop="intro" class="form-item-half">
+          <el-input
+            rows="3"
+            placeholder="请输入项目介绍"
+            type="textarea"
+            v-model="dataForm.intro"
+          ></el-input>
+        </el-form-item>
       </el-form>
     </el-card>
 
@@ -145,6 +134,33 @@ export default {
           name: "停用",
         },
       ],
+      // 添加校验规则
+      rules: {
+        name: [
+          { required: true, message: "请输入项目名称", trigger: "blur" },
+          {
+            min: 1,
+            max: 50,
+            message: "长度在 1 到 50 个字符之间",
+            trigger: "blur",
+          },
+        ],
+        /* intro: [
+          { required: true, message: "请输入项目介绍", trigger: "blur" },
+          {
+            min: 1,
+            max: 500,
+            message: "长度在 1 到 500 个字符之间",
+            trigger: "blur",
+          },
+        ], */
+        category_id: [
+          { required: true, message: "请选择所属分类", trigger: "change" },
+        ],
+        status: [
+          { required: true, message: "请选择项目状态", trigger: "change" },
+        ],
+      },
     };
   },
 
@@ -153,7 +169,7 @@ export default {
     _this.uploadUrl = process.env.VUE_APP_BASE_API + "/upload";
     _this.initAllCategory();
     this.initCustomer();
-    this.initDocList();
+    /*  this.initDocList(); */
   },
   methods: {
     initDocList() {
@@ -174,24 +190,30 @@ export default {
     btnSave(e) {
       let _this = this;
 
-      if (_this.dataForm.title == "") {
-        _this.$alert("产品标题不能为空");
-        return;
-      }
-      /* _this.dataForm.links=JSON.stringify(_this.dataForm.linkDoc); */
-      if (_this.dataForm.id > 0) {
-        updateProject(_this.dataForm).then((res) => {
-          if (res.status !== 200) return;
-          _this.$alert("项目信息更新成功");
-          _this.$emit("onClose");
-        });
-      } else {
-        createProject(_this.dataForm).then((res) => {
-          if (res.status !== 200) return;
-          _this.$alert("项目信息创建成功");
-          _this.$emit("onClose");
-        });
-      }
+      _this.$refs.dataFormRef.validate((valid) => {
+        if (!valid) {
+          return false;
+        }
+
+        const savePromise =
+          _this.dataForm.id > 0
+            ? updateProject(_this.dataForm)
+            : createProject(_this.dataForm);
+
+        savePromise
+          .then((res) => {
+            if (res.status !== 200) return;
+            _this.$message.success(
+              _this.dataForm.id > 0 ? "项目信息更新成功" : "项目信息创建成功"
+            );
+            setTimeout(() => {
+              _this.$emit("onClose", true);
+            }, 0);
+          })
+          .catch((error) => {
+            console.error("Save failed:", error);
+          });
+      });
     },
 
     //产品详情
@@ -245,4 +267,23 @@ export default {
 
 <style lang="scss">
 @import "./dataInfo.scss";
+.data-info {
+  // 添加半宽表单项的样式
+  .form-item-half {
+    width: 50%;
+
+    // 确保 select 和 input 占满容器宽度
+    .el-input,
+    .el-select {
+      width: 100%;
+    }
+  }
+
+  // 可选:添加一些响应式布局
+  @media screen and (max-width: 768px) {
+    .form-item-half {
+      width: 100%;
+    }
+  }
+}
 </style>

+ 193 - 142
src/views/project/components/dataList.vue

@@ -1,162 +1,213 @@
 <template>
   <div class="data-list">
-
-
-      <el-table :data="dataList" style="width: 100%" header-row-class-name="headerBg" empty-text="没有项目信息">
-        <el-table-column prop="id" label="ID" align="center" width="80"/>
-       <el-table-column prop="categoryId" label="所属分类" align="left" min-width="180"/>
-         <!-- <el-table-column prop="customer.name" label="所属客户" align="left" min-width="180"/> -->
-        <el-table-column prop="name" label="项目名称" align="left" min-width="180"/>
-        <el-table-column prop="createTime" label="创建时间" align="center" width="180"/>
-        <el-table-column prop="statusName" label="项目状态" align="center" width="180">
-          <template #default="scope">
-              <div v-if="scope.row.status==5">启用</div>
-              <div v-if="scope.row.status==6">停用</div>
-          </template>
-        </el-table-column>
-        <el-table-column label="操作" align="center"  fixed="right" width="200">
-          <template #default="scope">
-            <div class="btns">
-              <el-button type="primary" size="small" @click="btnEdit(scope.row)"><svg-icon icon-class="edit"/>编辑</el-button>
-              <el-button type="danger" size="small" @click="btnDelete(scope.row.id)"><svg-icon icon-class="delete"/>删除</el-button>
-            </div>
-          </template>
-        </el-table-column>
-      </el-table>
-
-
-
-      <div class="page-info">
-      	<el-pagination
-      	:currentPage="queryForm.page"
-      	:page-size="queryForm.pageSize"
-      	:total="recordCount"
-      	:page-count="pageTotal"
-      	 background
-      	 layout="prev, pager, next"
-      	 @current-change="ChangePage"
-      	 >
-      	 </el-pagination>
-      </div>
-
-     <el-dialog  :visible.sync="dialogVisible" append-to-body v-el-drag-dialog  width="80%" custom-class="prod-verify" title="创建项目信息">
-
-          <dataInfo :id="currentDataId" @onClose="onClose"></dataInfo>
-      </el-dialog>
-
+    <el-table
+      :data="dataList"
+      style="width: 100%"
+      header-row-class-name="headerBg"
+      empty-text="没有项目信息"
+    >
+      <el-table-column prop="id" label="ID" align="center" width="80" />
+      <el-table-column
+        prop="categoryId"
+        label="所属分类"
+        align="left"
+        min-width="180"
+      >
+        <template #default="scope">
+          <span>{{ getCategoryName(scope.row.categoryId) }}</span>
+        </template>
+      </el-table-column>
+      <!-- <el-table-column prop="customer.name" label="所属客户" align="left" min-width="180"/> -->
+      <el-table-column
+        prop="name"
+        label="项目名称"
+        align="left"
+        min-width="180"
+      />
+      <el-table-column
+        prop="createTime"
+        label="创建时间"
+        align="center"
+        width="180"
+      />
+      <el-table-column
+        prop="statusName"
+        label="项目状态"
+        align="center"
+        width="180"
+      >
+        <template #default="scope">
+          <div v-if="scope.row.status == 5">启用</div>
+          <div v-if="scope.row.status == 6">停用</div>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" fixed="right" width="200">
+        <template #default="scope">
+          <div class="btns">
+            <el-button type="primary" size="small" @click="btnEdit(scope.row)"
+              ><svg-icon icon-class="edit" />编辑</el-button
+            >
+            <el-button
+              type="danger"
+              size="small"
+              @click="btnDelete(scope.row.id)"
+              ><svg-icon icon-class="delete" />删除</el-button
+            >
+          </div>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <div class="page-info">
+      <el-pagination
+        :currentPage="queryForm.page"
+        :page-size="queryForm.pageSize"
+        :total="recordCount"
+        :page-count="pageTotal"
+        background
+        layout="prev, pager, next"
+        @current-change="ChangePage"
+      >
+      </el-pagination>
+    </div>
+
+    <el-dialog
+      :visible.sync="dialogVisible"
+      append-to-body
+      v-el-drag-dialog
+      custom-class="prod-verify"
+      title="创建项目信息"
+    >
+      <dataInfo :id="currentDataId" @onClose="onClose"></dataInfo>
+    </el-dialog>
   </div>
-
-
 </template>
 
 <script>
-  import{searchProject,deleteProject} from'@/api/project';
-  import dataInfo from './dataInfo.vue';
-  import elDragDialog from '@/directive/el-drag-dialog'
-  export default{
-    components:{
-      dataInfo,
-    },
-    directives: { elDragDialog },
-    props:{
-      queryForm:{
-        type:Object,
-        default:()=>{
-          return {
-            page:1,
-            pageSize:10,
-            name:'',
-            category_id:'',
-            status:'',
-          }
-        }
-      }
+import { searchProject, deleteProject, searchCategory } from "@/api/project";
+import dataInfo from "./dataInfo.vue";
+import elDragDialog from "@/directive/el-drag-dialog";
+export default {
+  components: {
+    dataInfo,
+  },
+  directives: { elDragDialog },
+  props: {
+    queryForm: {
+      type: Object,
+      default: () => {
+        return {
+          page: 1,
+          pageSize: 10,
+          name: "",
+          category_id: "",
+          status: "",
+        };
+      },
     },
-    watch:{
-
-        'queryForm': {
-          handler: function(val) {
-            this.search();
-          },
-          // immediate: true,//立即执行
-          deep: true
-
-        },
+  },
+  watch: {
+    queryForm: {
+      handler: function (val) {
+        this.search();
+      },
+      // immediate: true,//立即执行
+      deep: true,
     },
-    data(){
-      return{
-        dialogVisible:false,//控制产品审核
-        currentDataId:0,
-        recordCount:0,
-        pageTotal:1,
-        dataList:[],
-        currentData:{},
-      }
+  },
+  data() {
+    return {
+      dialogVisible: false, //控制产品审核
+      currentDataId: 0,
+      recordCount: 0,
+      pageTotal: 1,
+      dataList: [],
+      currentData: {},
+      categoryList: [],
+    };
+  },
+  mounted() {
+    this.search();
+    this.init();
+  },
+  methods: {
+    getCategoryName(categoryId) {
+      const category = this.categoryList.find((item) => item.id === categoryId);
+      return category ? category.name : categoryId;
     },
-    mounted() {
-      this.search();
+    searchData() {
+      let _this = this;
+      _this.dialogVisible = false;
+      _this.search();
     },
-    methods:{
-
 
-      searchData(){
-        let _this=this;
-        _this.dialogVisible=false;
-        _this.search();
-      },
-
-      btnDelete(e){
-        let _this=this;
-        let par={
-          id:e,
-        }
-        _this.$confirm("您是否确认删除该记录?","提示",{
-          confirmButtonText: '确认',
-          cancelButtonText: '取消',
-          type: 'warning',
-        }).then((res)=>{
+    btnDelete(e) {
+      let _this = this;
+      let par = {
+        id: e,
+      };
+      _this
+        .$confirm("您是否确认删除该记录?", "提示", {
+          confirmButtonText: "确认",
+          cancelButtonText: "取消",
+          type: "warning",
+        })
+        .then((res) => {
           // console.log("AAA")
-             deleteProject(par).then(res=>{
-               _this.search();
-             })
-        }).catch(()=>{
+          deleteProject(par).then((res) => {
+            _this.search();
+          });
         })
-      },
+        .catch(() => {});
+    },
 
-      //编辑
-      btnEdit(e){
-        let _this=this;
-        _this.currentDataId=e.id;
-        _this.dialogVisible=true;
-      },
+    //编辑
+    btnEdit(e) {
+      let _this = this;
+      _this.currentDataId = e.id;
+      _this.dialogVisible = true;
+    },
 
-      onClose(){
-        let _this=this;
-        _this.currentDataId=0;
-        _this.dialogVisible=false;
-        _this.search();
-      },
+    onClose(needRefresh) {
+      console.log("onClose triggered with needRefresh:", needRefresh); // 添加调试日志
+      this.currentDataId = 0;
+      this.dialogVisible = false;
+      if (needRefresh) {
+        this.search();
+      }
+    },
 
-      //搜索
-      search(){
-        let _this=this;
-         searchProject(_this.queryForm).then(res=>{
-           if(!res)return;
-           _this.dataList=res.data.dataList;
-          _this.recordCount=res.data.totalRecord;
-          _this.pageTotal=res.data.totalPage;
-         })
-      },
-      //修改分页
-      ChangePage(e){
-      	let _this=this;
-      	_this.queryForm.page=e;
-      	_this.search();
-      },
-    }
-  }
+    handleUpdate() {
+      this.search(); // 添加额外的更新处理方法
+    },
+
+    //搜索
+    search() {
+      console.log("search triggered"); // 添加调试日志
+      let _this = this;
+      searchProject(_this.queryForm).then((res) => {
+        if (!res) return;
+        _this.dataList = res.data.dataList;
+        _this.recordCount = res.data.totalRecord;
+        _this.pageTotal = res.data.totalPage;
+      });
+    },
+    //修改分页
+    ChangePage(e) {
+      let _this = this;
+      _this.queryForm.page = e;
+      _this.search();
+    },
+    init() {
+      searchCategory().then((res) => {
+        if (res.status !== 200) return;
+        this.categoryList = res.data.dataList;
+      });
+    },
+  },
+};
 </script>
 
 <style lang="scss">
-@import './dataList.scss';
+@import "./dataList.scss";
 </style>

+ 1 - 1
src/views/project/components/dataSearch.vue

@@ -33,7 +33,7 @@
 
 
 
-    <el-dialog  :visible.sync="dialogVisible" append-to-body v-el-drag-dialog  width="80%" custom-class="prod-verify" title="创建新项目">
+    <el-dialog  :visible.sync="dialogVisible" append-to-body v-el-drag-dialog   custom-class="prod-verify" title="创建新项目">
          <dataInfo  @onClose="onClose"></dataInfo>
      </el-dialog>
 

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio