zhuliu před 1 rokem
rodič
revize
3a10c7c0e7

+ 2 - 1
src/router/index.js

@@ -511,7 +511,8 @@ const routes = [
         name:"conditionImport",
         meta:{
           title: '专利检索',
-          sign:'conditionImport'
+          sign:'conditionImport',
+          belong:'conditionImport'
         },
         component:() => import('@/views/components/import/conditionImport'),
       },

+ 29 - 2
src/utils/common.js

@@ -48,7 +48,13 @@ export default {
     return str
   },
 
-  //获取字段列表
+  /**
+   * 获取字段列表
+   * @param {Array} array 
+   * @param {Function} fun 
+   * @param {Object} props 
+   * @returns 
+   */
   getField(array,fun,props){
     var type = {
       'Array':'3',
@@ -163,7 +169,7 @@ export default {
 
   /**
    * 获取排序字段(sortProp:{order})
-   * @param {*} param0
+   * @param {Object} param0 {sort,column, prop, order,sortProp,defaultValue,multiple}
    * @returns 
    */
   getSortData({sort,column, prop, order,sortProp,defaultValue,multiple}){
@@ -234,4 +240,25 @@ export default {
       )
       ]
   },
+
+  /**
+   * 跳转到导入专利界面
+   * @param {Object} data 参数
+   * @param {*} type 导入类型
+   */
+  toImportParent(data,type){
+    var types={
+      1:'/import',
+      2:'/PatentNoImport',
+      3:'/conditionImport'
+    }
+    this.$router.push(
+      {
+        path:types[type],
+        query:{
+          ...data
+        }
+      }
+    )
+  },
 }

+ 21 - 1
src/utils/constants.js

@@ -221,5 +221,25 @@ showType:[
     value:3
   },
 ],
-sourceId:process.env.NODE_ENV === 'production'?3:1
+sourceId:process.env.NODE_ENV === 'production'?3:1,
+
+//更新周期
+updateCycle:[
+  {
+    label:'每天',
+    value:'day'
+  },
+  {
+    label:'每周',
+    value:'week'
+  },
+  {
+    label:'每月',
+    value:'month'
+  },
+  {
+    label:'每年',
+    value:'year'
+  },
+],
 }

+ 1 - 1
src/views/components/import/conditionImport/FormSearch.vue

@@ -1,6 +1,6 @@
 <template>
     <div class="formSearch">
-        <el-form :model="form" label-width="120px" size="small" label-position="right">
+        <el-form :model="form" label-width="140px" size="small" label-position="right">
             <template  v-for="item in constants.searchField" >
                 <div :key="item.label" v-if="(dbType ==2 && item.value!='typeAndStatus')||dbType !=2 ">
                     <div>

+ 2 - 1
src/views/components/import/conditionImport/index.vue

@@ -29,7 +29,8 @@ export default {
     
   },
   created() {},
-  mounted() {},
+  mounted() {
+  },
   methods: {},
 };
 </script>

+ 2 - 2
src/views/components/import/conditionImport/search.vue

@@ -1,7 +1,7 @@
 <template>
     <div style="background:white">
         <div class="head">
-            <div class="menu">
+            <div class="search-menu">
                 <span class="type">
                     <el-radio-group v-model="DBType">
                         <el-radio label="CN">中国专利检索</el-radio>
@@ -122,7 +122,7 @@ export default {
     line-height: 50px;
     text-align: center;
 }
-.menu{
+.search-menu{
     width:70%;
     margin:0 auto;
     position: relative;

+ 0 - 344
src/views/components/import/index.vue

@@ -1,344 +0,0 @@
-<template>
-  <div class="import-patent">
-    <el-container class="import-patent">
-      <el-main class="import-patent-main">
-        <el-container class="import-patent-action">
-          <!-- <el-header>
-            <el-form :inline="true" class="import-patent-action-form">
-              <el-form-item>
-                <el-button size="small" type="primary" @click="handleManage" :disabled="!($permission('/workspace/common/customField') && $r(projectId,[1,2]))">自定义栏位管理</el-button>
-                <el-button size="small" type="success" @click="handleFolder" :disabled="!($permission('/workspace/common/folder_manage') && $r(projectId,[1,2]))">文件夹管理</el-button>
-              </el-form-item>
-            </el-form>
-          </el-header> -->
-          <el-main class="import-patent-action-main" v-loading="loading">
-            <el-form :model="form">
-              <!-- <el-form-item label="选择需要关联的标引与分类">
-                <el-table :data="tableData" :show-header="false">
-                  <el-table-column type="expand">
-                    <template slot-scope="props">
-                      <el-form label-position="top" class="custom-field-form">
-                        
-                        <template v-if="props.row.field === 'folder'">
-                          <el-tree
-                              ref="folderTree"
-                              :data="customField.folder"
-                              check-strictly
-                              :default-checked-keys="form.json.field.folder"
-                              show-checkbox
-                              node-key="id"
-                              :props="defaultProps"
-                          ></el-tree>
-                        </template>
-                        <template v-else v-for="(item, index) in customField[props.row.field]">
-                          <el-form-item :label="`${index + 1}. ${item.name}`">
-                            <template v-if="item.type === 0 || item.type === 2">
-                              <el-input v-model="form.json.field[item.id].value" placeholder="请输入内容" size="small"></el-input>
-                            </template>
-                            <template v-if="item.type === 1">
-                              <el-date-picker v-model="form.json.field[item.id].value" value-format="yyyy-MM-dd" type="date" size="small" placeholder="选择日期" style="width: 100%;"></el-date-picker>
-                            </template>
-                            <template v-if="item.type === 3">
-                              <el-select v-model="form.json.field[item.id].value" size="small" placeholder="请选择" class="width_100">
-                                <el-option v-for="option in item.option" :value="option.id" :label="option.name"></el-option>
-                              </el-select>
-                            </template>
-                            <template v-if="item.type === 4">
-                              <el-radio-group v-model="form.json.field[item.id].value">
-                                <el-radio v-for="option in item.option" :label="option.id">{{ option.name }}</el-radio>
-                              </el-radio-group>
-                            </template>
-                            <template v-if="item.type === 5">
-                              <el-checkbox-group v-model="form.json.field[item.id].value">
-                                <el-checkbox v-for="option in item.option" :label="option.id">{{ option.name }}</el-checkbox>
-                              </el-checkbox-group>
-                            </template>
-                            <template v-if="item.type === 6">
-                              <el-tree
-                                  :ref="item.id"
-                                  :data="item.option"
-                                  check-strictly
-                                  :default-checked-keys="form.json.field[item.id].value"
-                                  show-checkbox
-                                  node-key="id"
-                                  :props="defaultProps"
-                              ></el-tree>
-                            </template>
-                          </el-form-item>
-                        </template>
-                      </el-form>
-                    </template>
-                  </el-table-column>
-                  <el-table-column prop="name" show-overflow-tooltip></el-table-column>
-                </el-table>
-              
-              </el-form-item>
-              <el-form-item label="数据来源:">
-                <select style="width:390px;border:0;outline:none" name="" id="" v-model="sourceId">
-                  <option value="">请选择数据来源</option>
-                  <option v-for="item in customField.dataType" :value="item.id">{{item.name}}</option>
-                </select>
-                <el-divider ></el-divider>
-              </el-form-item>  -->
-              
-              <el-form-item label="选择需要上传的专利信息导入文件">
-                <el-upload class="upload-file" drag action="#" :auto-upload="false" :show-file-list="false" :on-change="onChange">
-                  <i :class="!form.file ? 'el-icon-upload' : 'el-icon-refresh'"></i>
-                  <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
-                  <div class="el-upload__tip" slot="tip"></div>
-                </el-upload>
-              </el-form-item>
-            </el-form>
-          </el-main>
-        </el-container>
-
-        <system-task ref="systemTask" :form="1" :reportId="reportId" />
-      </el-main>
-<!--      <el-footer class="import-folder-button">-->
-<!--        <el-button @click="handleClose">关 闭</el-button>-->
-<!--        <el-button type="primary" @click="handleConfirm" :loading="btnLoading">确 定</el-button>-->
-<!--      </el-footer>-->
-    </el-container>
-
-    <!-- <project-field-drawer @close="handleClose2" ref="projectFieldDrawer" />
-
-    <project-folder-dialog @close="updateFolder" ref="projectFolderDialog" /> -->
-  </div>
-</template>
-
-<script>
-// import ProjectFieldDrawer from "../../layout/components/field.vue";
-// import ProjectFolderDialog from "../common/Folder.vue";
-import SystemTask from '../task/index1.vue'
-import { mapGetters } from "vuex";
-
-export default {
-  components: {
-    // ProjectFieldDrawer,
-    // ProjectFolderDialog,
-    SystemTask
-  },
-  data() {
-    return {
-      sourceId: '',
-      reportId: this.$route.query.id,
-      asCompare:this.$route.query.asCompare,
-      title: '',
-      customField: {},
-      loading: false,
-      btnLoading: false,
-      total: 0,
-      tableData2: [],
-      form: {
-        file: null,
-        json: {
-          projectId: 0,
-          field: [],
-          folder: {}
-        }
-      },
-      fieldTypeObj: {
-        0: '数字',
-        1: '日期',
-        2: '文本',
-        3: '下拉框',
-        4: '单选',
-        5: '多选',
-        6: '树',
-      },
-      tableData: [
-        {
-          name: '标引',
-          field: 'index'
-        }, {
-          name: '分类',
-          field: 'classify'
-        }, {
-          name: '文件夹',
-          field: 'folder'
-        }],
-      defaultProps: {
-        children: 'children',
-        label: 'name'
-      },
-    }
-  },
-  computed: {
-    ...mapGetters(['webSocket', 'userinfo'])
-  },
-  mounted() {
-
-    this.reportId = this.$route.query.id
-    this.asCompare = this.$route.query.asCompare
-    // this.getCustomField()
-  },
-  // watch:{
-  //   sourceId(val){
-  //     console.log(val)
-  //   }
-  // },
-  methods: {
-
-    getQueueList() {
-      this.$refs.systemTask.getQueueList()
-    },
-    cancel() {
-      this.dialogVisible = false
-    },
-    updateFolder() {
-      this.$api.getProjectFolderList({ projectId: this.projectId, patentTotal: false }).then(response => {
-        this.customField.folder = response.data
-      })
-    },
-    handleManage() {
-      this.$refs.projectFieldDrawer.open(this.projectId)
-    },
-    handleFolder() {
-      this.$refs.projectFolderDialog.open(this.projectId)
-    },
-    onChange(file, fileList) {
-      this.form.file = file.raw
-      this.handleConfirm()
-    },
-    handleClose() {
-
-    },
-    handleClose2() {
-      this.getCustomField()
-    },
-    getCustomField() {
-      this.$api.getCustomField({ projectId: this.projectId }).then(response => {
-        this.customField = response.data;
-        ['index', 'classify'].map(key => {
-          this.customField[key].map(item => {
-            let value = null
-            if (item.type === 5 || item.type === 6) {
-              value = []
-            }
-            this.$set(this.form.json.field, item.id, { type: item.type, value })
-          })
-        })
-        // console.log(this.customField);
-      })
-    },
-    handleConfirm() {
-      // const json = JSON.parse(JSON.stringify(this.form.json))
-      // const refs = this.$refs
-
-      // let data = {
-      //   projectId: this.projectId,
-      //   sourceId: this.sourceId,
-      //   fieldList: [],
-      //   folderIds: refs.folderTree ? refs.folderTree.getCheckedKeys() : []
-      // }
-      // for (let id in json.field) {
-      //   const field = json.field[id]
-      //   if (!field) {
-      //     continue;
-      //   }
-      //   const type = field.type
-      //   const value = field.value
-      //   if (value) {
-      //     if (type === 5) {
-      //       value.map(option => {
-      //         data.fieldList.push({
-      //           fieldId: parseInt(id),
-      //           type: type,
-      //           optionId: option
-      //         })
-      //       })
-      //     } else if (type === 6) {
-      //       const tree = refs[id]
-      //       if (tree) {
-      //         const treeNode = tree[0].getCheckedKeys()
-      //         treeNode.map(node => {
-      //           data.fieldList.push({
-      //             fieldId: parseInt(id),
-      //             type: type,
-      //             optionId: node
-      //           })
-      //         })
-      //       }
-      //     } else {
-      //       data.fieldList.push({
-      //         fieldId: parseInt(id),
-      //         type: type,
-      //         optionId: [0, 1, 2].indexOf(type) === -1 ? value : 0,
-      //         text: value
-      //       })
-      //     }
-      //   }
-      // }
-      if (!this.form.file) {
-        this.$message.error('请选择文件')
-        return false
-      }
-      // if (!this.sourceId) {
-      //   this.$message.error('请选择数据类型')
-      //   return false
-      // }
-      let formData = new FormData()
-      formData.append('reportId', this.reportId)
-      if(this.asCompare){
-        formData.append('asCompare',this.asCompare)
-      }
-      
-      formData.append('file', this.form.file)
-      // formData.append('json', JSON.stringify(data))
-      this.btnLoading = true
-      this.loading = true
-      // console.log(formData)
-      this.$api.import(formData).then(response => {
-        this.$message.success('任务创建成功')
-        this.form.file = null
-        this.btnLoading = false
-        this.loading = false
-        // this.handleClose()
-        this.getQueueList()
-      }).catch(error => {
-        this.btnLoading = false
-        this.loading = false
-      })
-    }
-  }
-}
-</script>
-<style lang="scss">
-.el-divider--horizontal {
-  margin: 0
-}
-
-.import-patent {
-  height: 100%;
-
-  .import-patent-main {
-    padding: 0;
-    height: 100%;
-    background: #fff;
-  }
-
-  .import-patent-action {
-    width: 500px;
-    height: 100%;
-    border-right: 1px solid #d2d2d2;
-    float: left;
-
-    .custom-field-form .el-form-item__label {
-      font-weight: bold !important;
-    }
-
-    .import-patent-action-form {
-      margin-left: 20px;
-    }
-
-    .import-patent-action-main {
-      padding: 10px;
-    }
-  }
-
-  .import-patent-button {
-    height: 70px !important;
-    text-align: right;
-  }
-}
-</style>

+ 1 - 1
src/views/layout/components/UserBar.vue

@@ -3,7 +3,7 @@
     <div class="menu">
       <el-link :underline="true" v-for="item in menu" :key="item.path" @click="changePage(item.path)" :type="item.belong==belong?'primary':'default'">{{ item.label }}</el-link>
       <el-dropdown @command="importPatent">
-        <el-link :underline="true" :type="belong == 'conditionImport'?'danger':'default'" class="el-dropdown-link">
+        <el-link :underline="true" :type="belong == 'conditionImport'?'primary':'default'" class="el-dropdown-link">
           专利检索<i class="el-icon-arrow-down el-icon--right"></i>
           </el-link>
         <el-dropdown-menu slot="dropdown">

+ 9 - 5
src/views/project/components/drawer/form.vue

@@ -127,10 +127,7 @@
               <el-col :span="12" v-if="ruleForm.ifUpdate">
                 <el-form-item label="更新周期" required>
                   <el-select v-model="ruleForm.updateTime" @change="getDateType" placeholder="请选择更新周期" class="width_100">
-                    <el-option value="day" label="每天"></el-option>
-                    <el-option value="week" label="每周"></el-option>
-                    <el-option value="month" label="每月"></el-option>
-                    <el-option value="year" label="每年"></el-option>
+                    <el-option v-for="item in $constants.updateCycle" :key="item.value" :value="item.value" :label="item.label"></el-option>
                   </el-select>
                 </el-form-item>
               </el-col>
@@ -174,13 +171,15 @@ import ClientTable from '@/views/client'
 import { mapGetters } from 'vuex';
 
 import product from '@/views/product/components/index.vue'
-import addEvent from '@/views/event/components/dialog/addEvent.vue';
+import addEvent from '@/views/event/components/dialog/addEvent.vue'; 
+import { cron } from "@/utils/model/time/mixins";
 export default {
   components: {
     ClientTable,
     product,
     addEvent
   },
+  mixins:[cron],
   props: {
     commonData: Array
   },
@@ -334,6 +333,11 @@ export default {
       }
       //获取人员列表
       this.getPersonnelList()
+
+      if(this.ruleForm.crons){
+        this.ruleForm.updateTime = this.getType(this.ruleForm.crons)
+      }
+
       this.title = title
       this.drawer = true
     },

+ 4 - 3
src/views/project/index.vue

@@ -399,12 +399,13 @@ export default {
     handleOption({ option, row ,isLast}) {
       switch (option) {
         case '0'://Excel导入
-          this.handleExcelImport(row)
+          this.patentImport(row,1)
           break
         case '1'://专利号导入
+          this.patentImport(row,2)
           break
         case '2'://检索条件导入
-          this.handleFile(row, 1)
+          this.patentImport(row,3)
           break
         case '3'://任务清单
           this.handleFile(row, 0)
@@ -455,7 +456,7 @@ export default {
     handleEdit(row) {
       this.$refs.projectFormDrawer.open(JSON.parse(JSON.stringify(row)), '编辑专利数据库')
     },
-
+    
   },
 };
 </script>