Bladeren bron

专利导入

zhuliu 1 jaar geleden
bovenliggende
commit
ee429f5a2e

+ 2 - 0
src/api/index.js

@@ -34,6 +34,7 @@ import common from "./newApi/common"
 import newReport from "./newApi/report"
 import patentMining from "./newApi/patentMining"
 import task2 from "./newApi/task"
+import importAndExport from './newApi/importAndExport'
 
 export default {
   ...report,
@@ -68,4 +69,5 @@ export default {
   ...newReport,
   ...patentMining,
   ...task2,
+  ...importAndExport
 }

+ 2 - 0
src/api/newApi/common.js

@@ -118,4 +118,6 @@ export default {
   deleteCustomOption(data) {
     return axios.post("/xiaoshi/customOption/deleteCustomOption", data);
   },
+
+  
 };

+ 22 - 0
src/api/newApi/importAndExport.js

@@ -0,0 +1,22 @@
+import axios from '@/utils/axios'
+//导入导出
+export default {
+    /**
+    * 获取导入来源
+    */
+    getExcelConfig(data) {
+        return axios.get('/xiaoshi/common/getExcelConfig', {data})
+    },
+    /**
+    * 添加导入任务
+    */
+    addImportTask(data) {
+        return axios.post('/xiaoshi/importTask/addImportTask', data)
+    },
+    /**
+    * 查询导入任务
+    */
+    queryImportTask(data) {
+        return axios.post('/xiaoshi/importTask/queryImportTask', data)
+    },
+}

+ 13 - 4
src/utils/common.js

@@ -1,4 +1,5 @@
 import api from '@/api'
+import router from '../router'
 export default {
   //object转字符串
   objectToString(val) {
@@ -117,8 +118,16 @@ export default {
       }else{
         return '--'
       }
-      
-    }else{
+    }else if(field.type == 'Object'){
+      if(!row[field.value]){
+        return '--'
+      }
+      if(prop){
+        return row[field.value][prop]
+      }
+      return row[field.value].name
+    }
+    else{
       if(data){
         if(data.data.constructor == Array){
           var dataProp = data.prop || {
@@ -250,9 +259,9 @@ export default {
     var types={
       1:'/import',
       2:'/PatentNoImport',
-      3:'/conditionImport'
+      4:'/conditionImport'
     }
-    this.$router.push(
+    router.push(
       {
         path:types[type],
         query:{

+ 0 - 310
src/views/components/import/PatentNoImport/download.vue

@@ -1,310 +0,0 @@
-<template>
-    <div style="background: white;padding: 20px;height: 100%;">
-      <div style="float:right" v-if="downloadId==9">
-        <el-button type="primary" @click="settingUser">账号配置</el-button>
-      </div>
-      <div style="width: 800px;margin: 0 auto;">
-        <div v-if="downloadId==9" >
-          <el-form :inline="true" :model="queryParams" :rules="rules" ref="from" class="demo-form-inline" style="display: flex;justify-content: space-between;">
-            <el-form-item label="来源网站" prop="configId">
-              <el-select v-model="queryParams.configId" placeholder="请选择网站" >
-                  <el-option v-for="item in website"
-                    :key="item.id"
-                    :label="item.webName"
-                    :value="item.id">
-                  </el-option>
-              </el-select>
-            </el-form-item>
-            <el-form-item label="下载内容" prop="configCells">
-              <el-select v-model="queryParams.configCells"  multiple collapse-tags placeholder="请选择下载内容" style="width: 100%;">
-                  <el-option v-for="item in download"
-                    :key="Number(item.cellValue)"
-                    :label="item.cellName"
-                    :value="Number(item.cellValue)">
-                  </el-option>
-              </el-select>
-            </el-form-item>
-            <el-form-item label="是否更新" prop="taskType">
-              <el-switch v-model="queryParams.taskType" :active-value="1" :inactive-value="0" active-color="#13ce66" inactive-color="#ff4949" @change="change3">  </el-switch>
-            </el-form-item>
-          </el-form>
-          <div v-show="queryParams.taskType"  >
-            <el-form :inline="true" ref="from" :model="queryParams" :rules="rules" class="demo-form-inline" style="display: flex;justify-content: space-between;">
-              <el-form-item label="更新间隔" prop="dateType">
-                <el-select v-model="queryParams.dateType" @change="getDateType" clearable placeholder="请选择更新时间间隔" style="margin-right: 20px;">
-                  <el-option v-for="item in options"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value">
-                  </el-option>
-                </el-select>
-              </el-form-item>
-              <el-form-item label="选择更新具体时间" v-if="queryParams.dateType" >
-                <myTimeChoose :type="queryParams.dateType" @value="handleData" :cron="queryParams.crons" style="width:300px"></myTimeChoose>
-              </el-form-item>
-            </el-form>
-          </div>
-          </div>
-          <!-- <div style="display: flex;margin-bottom: 10px;" v-if="queryParams.configType==2">
-            <p style="width:150px;margin-right:10px;margin-bottom: 10px;">数据库:</p>
-            <div>
-              <el-checkbox-group v-model="queryParams.database">
-                <el-checkbox v-for="item in database" :key="item.value" :label="item.value" style="margin:5px">{{ item.label }}</el-checkbox>
-              </el-checkbox-group>
-            </div>
-          </div> -->
-          <!-- 搜索 -->
-          <div style="display: flex;justify-content: center;width: 100%;align-items:center">
-            <span style="width: 100%;">
-               <el-input v-model="queryParams.conditions" :placeholder="downloadId==9?'请输入检索信息':'请输入专利号(多个专利号同时添加中间请用符号“|”隔开)'" ></el-input>
-            </span>
-            <span style="margin-left:8px" v-if="queryParams.configType==2">
-              <el-tooltip class="item" effect="dark" content="检索说明" placement="top">
-                <i class="el-icon-question" style="font-size:28px" @click="checkConceal(3)" ></i>
-              </el-tooltip>
-            </span>
-              <el-button @click="imports" type="primary" icon="el-icon-upload el-icon--right" style="margin-left:20px"> 导入 </el-button>
-          </div>  
-      </div>
-      
-      <div>
-         <SystemTask :form="9" :reportId="reportId" :productId="productId" :projectId="projectId"></SystemTask> 
-      </div>
-    </div>
-</template>
-
-<script>
-import SystemTask from "@/views/task/index.vue";
-import { cron } from "@/utils/model/time/mixins";
-
-export default {
-  mixins:[cron],
-  props:['reportId','downloadId','asCompare','productId','projectId'],
-  components: {
-    SystemTask,
-  },
-  data() {
-    const dateTypeRule = (rule, value, callback) => {
-      // console.log(value)
-      if (this.queryParams.taskType == 1) {
-        if (value) {
-          callback()
-        } else {
-          callback(new Error('请选择更新周期'))
-        }
-      } else {
-        callback()
-      }
-    }
-    return {
-      database:[
-        {
-          label:'中国发明专利',
-          value:'FMZL'
-        },
-        {
-          label:'中国发明授权',
-          value:'FMSQ'
-        },
-        {
-          label:'中国实用新型',
-          value:'SYXX'
-        },
-        {
-          label:'中国外观专利',
-          value:'WGZL'
-        },
-        {
-          label:'美国',
-          value:'USPATENT'
-        },
-        {
-          label:'英国',
-          value:'GBPATENT'
-        },
-        {
-          label:'法国',
-          value:'FRPATENT'
-        },
-        {
-          label:'德国',
-          value:'DEPATENT'
-        },
-        {
-          label:'瑞士',
-          value:'CHPATENT'
-        },
-        {
-          label:'日本',
-          value:'JPPATENT'
-        },
-        {
-          label:'俄罗斯',
-          value:'RUPATENT'
-        },
-        {
-          label:'韩国',
-          value:'KRPATENT'
-        },
-        {
-          label:'欧洲专利局',
-          value:'EPPATENT'
-        },
-        {
-          label:'世界知识产权组织',
-          value:'WOPATENT'
-        },
-
-      ],
-      website:[],//选择网站
-      download: [],//选择下载内容
-      options: [
-        {label:'每天',value:'day'},
-        {label:'每周',value:'week'},
-        {label:'每月',value:'month'},
-        {label:'每年',value:'year'},
-      ],
-      queryParams: {
-        database:[],
-        reportId: this.reportId,
-        productId: this.productId,
-        projectId: this.projectId,
-        crons:'',
-        conditions:'',//搜索条件
-        configId: '',//网站
-        configType:'',
-        configCells: [],//下载内容
-        dateType:'',
-        dates: '',
-        taskType:0,//0普通任务1定时任务
-        taskState:0,//任务状态 0等待1进行2成功3失败
-      },
-      isGetList:false,
-      rules: {
-        configId: [{ required: true, message: '请选择来源网站', trigger: 'change' },],
-        configCells: [{ required: true, message: '请选择下载内容', trigger: 'change' },],
-        taskType: [{ required: true, message: '请选择', trigger: 'change' },],
-        dateType: [{ required: true,  validator:dateTypeRule, trigger: 'change' },],
-      },
-    }
-  },
-  created() {
-
-  },
-  watch: {
-    'queryParams.configId'(val) {//更换网站
-      let a= this.website.filter(item => {
-        return item.id==val
-      })
-      this.queryParams.configType = a[0].webType
-      this.downloads()
-    },
-
-  },
-  mounted() {
-    // this.getList()
-  },
-  methods: {
-    checkConceal(id) {
-      const router = this.$router.resolve({
-        path: '/agreeConceal',
-        query: {
-          id:id
-        }
-      })
-      window.open(router.href, '_blank')
-      // const router1 = this.$router.resolve({
-      //   path: '/downPatentList',
-        
-      // })
-      // window.open(router1.href, '_blank')
-    },
-    //打开账号配置
-    settingUser(){
-      this.$refs.settingUser.open(this.website)
-    },
-    change3(val) {
-      // console.log(val);
-    },
-    getDateType(val) {
-      // console.log(val)
-      this.queryParams.crons = ''
-    },
-    // 获取时间
-    handleData(val) {
-      if (this.queryParams.dateType=='') {
-        this.$message.error('请先选择更新周期')
-        return false
-      }
-      this.queryParams.crons=val
-    },
-    // 请求全部网站
-    getList() {
-      this.$api.getAllConfig({}).then(res => {
-        if (res.code==200) {
-          this.website = res.data
-        }
-      })
-    },
-    // 请求当前网站可下载项
-    async downloads() {
-      await this.$api.getConfigCell({type:this.queryParams.configType}).then(res => {
-        if (res.code==200) {
-          this.download = res.data
-          this.queryParams.configCells=this.download.map(item=>{ return Number(item.cellValue) })
-        }
-      })
-    },
-    // 导入
-    imports() {
-      if (this.queryParams.conditions == '') {
-        if (this.downloadId == 9) {
-          this.$message.error('请输入检索信息')
-        } else {
-          this.$message.error('请输入专利号')
-        }
-        return false
-      }
-      if (this.downloadId == 8) {
-        this.queryParams.patentNo = this.queryParams.conditions
-        this.queryParams.conditions = ''
-        this.queryParams.asCompare=this.asCompare
-        this.$api.importByNos(this.queryParams).then(res => {
-          // console.log(res.code);
-          if (res.code == 200) {
-            if (res.data && res.data.length > 0) {
-              // if (!res.data.includes('')) {
-              // this.alterMessage(res.data)
-              // }
-            } else {
-              this.$message.success('创建任务完成,正在导入!')
-            }
-           
-            this.queryParams.patentNo = ''
-            // this.getList()
-          }
-        }).catch(error => {
-        })
-        return false
-      }
-      this.$refs.from.validate((valid) => {
-        if (valid) {
-          this.$api.addTask(this.queryParams).then(res => {
-            if (res.code==200) {
-              this.$message.success('创建任务完成,正在导入!')
-              this.queryParams.conditions = ''
-              this.isGetList=!this.isGetList
-            }
-          })
-        }
-        
-      })
-     
-    },
-  },
-}
-</script>
-
-<style lang="scss" scoped>
-
-</style>

+ 7 - 18
src/views/components/import/PatentNoImport/index.vue

@@ -1,14 +1,14 @@
 <template>
   <div>
-    <download :reportId="reportId" :downloadId="option" :asCompare="asCompare" :productId="productId" :projectId="projectId"></download>
+    <importPatent :importData="importData"></importPatent>
   </div>
 </template>
 
 <script>
-import download from "./download.vue";
+import importPatent from '../components/importPatent.vue'
 export default {
   components: {
-    download
+    importPatent
   },
   data() {
     return {
@@ -16,25 +16,14 @@ export default {
     }
   },
   computed: {
-    reportId() {
-      return this.$route.query.reportId
-    },
-    projectId() {
-      return this.$route.query.projectId
-    },
-    productId() {
-      return this.$route.query.productId
-    },
-    option() {
-      return this.$route.query.option
-    },
-    asCompare() {
-      return this.$route.query.asCompare
+    importData() {
+      return this.$route.query
     }
   },
-  methods: {
+  mounted() {
 
   },
+  methods: {},
 }
 </script>
 

+ 188 - 0
src/views/components/import/components/importPatent.vue

@@ -0,0 +1,188 @@
+<template>
+    <div class="import-patent">
+    <el-container>
+        <el-header>
+            <el-button size="small" type="primary" @click="handleManage">自定义栏位管理</el-button>
+        </el-header>
+        <el-container>
+            <el-aside width="450px">
+                <div class="import-patent-action-main" v-loading="loading">
+                    <el-form :model="form"> 
+                        <el-form-item label="专利号:" v-if="[2,3].indexOf(form.type) != -1">
+                            <el-input v-model="queryParams.conditions" placeholder="请输入专利号(多个专利号同时添加中间请用符号“|”隔开)"></el-input>
+                        </el-form-item>
+                    <el-form-item label="选择需要关联的标引与分类">
+                        <div style="margin-top:50px">
+                            <span>栏位:</span>
+                            <span>
+                                <el-select v-model="customFieldId" @change="changeCustomField">
+                                    <el-option v-for="item in customField" :key="item.name" :value="item.keyValue">{{ item.name }} </el-option>
+                                </el-select>
+                            </span>
+                        </div>
+                        <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:300px;border:0;outline:none" name="" id="" v-model="form.sourceId">
+                        <option value="">请选择数据来源</option>
+                        <option v-for="item in ExcelConfig" :key="item.name" :value="item.id">{{item.name}}</option>
+                        </select>
+                        <el-divider ></el-divider>
+                    </el-form-item>
+
+                    <template v-if="form.type != 1">
+                        <div>
+                            <el-form-item label="是否更新" prop="ifUpdate">
+                                <el-switch v-model="form.ifUpdate" :active-value="true" :inactive-value="false" active-color="#13ce66" inactive-color="#ff4949">  </el-switch>
+                            </el-form-item>
+                            <template>
+                                <div>
+                                    <el-form-item label="更新间隔" prop="dateType">
+                                        <el-select v-model="form.dateType" @change="getDateType" clearable placeholder="请选择更新时间间隔" style="margin-right: 20px;">
+                                        <el-option v-for="item in $constants.updateCycle"
+                                            :key="item.value"
+                                            :label="item.label"
+                                            :value="item.value">
+                                        </el-option>
+                                        </el-select>
+                                    </el-form-item>
+                                    <el-form-item label="选择更新具体时间" v-if="form.dateType" >
+                                        <myTimeChoose :type="form.dateType" @value="handleData" :cron="form.crons" style="width:300px"></myTimeChoose>
+                                    </el-form-item>
+                                </div>
+                            </template>
+                        </div>
+                    </template>
+
+                        <el-form-item label="选择需要上传的文件" style="height: 230px;">
+                            <myUpload @on-change="onChange" :autoUpload="true"></myUpload>
+                        </el-form-item>
+                    </el-form>
+                    <el-button v-if="form.type !=1" type="primary" size="small" @click="handleConfirm" style="float:right;width:80px" > 导入</el-button>
+                </div>
+            </el-aside>
+            <el-main style="padding: 0 20px !important;">
+                <systemTask ref="systemTask" :importToId="form.importToId"></systemTask>
+            </el-main>
+        </el-container>
+    </el-container>
+    <Field-Drawer ref="FieldDrawer" @close="closeFieldDrawer"></Field-Drawer>
+
+  </div>
+</template>
+
+<script>
+import mixins from '../mixins/index'
+export default {
+    mixins:[mixins],
+  data() {
+    return {
+      
+      loading:false,
+    }
+  },
+  computed: {},
+  mounted() {
+  },
+  methods: {
+
+    onChange(file, fileList) {
+        if(file.guid){
+            this.form.fileGuid = file.guid
+            this.handleConfirm()
+        }
+    },
+    handleConfirm() {
+        if(this.form.type == 1){
+            if (!this.form.fileGuid) {
+                this.$message.error('请选择文件')
+                return false
+            }
+            if (!this.form.sourceId) {
+                this.$message.error('请选择数据类型')
+                return false
+            }
+        }else{
+            if (!this.form.fileGuid) {
+                this.form.type = 2
+                this.$message.error('请输入专利号或者上传文件')
+                return false
+            }else{
+                this.form.type = 3
+            }
+            
+        }
+        this.addImportTask(this.form)
+      
+    }
+  },
+}
+</script>
+
+<style lang="scss">
+.el-divider--horizontal{
+  margin:0
+}
+.import-patent {
+    height: 100%;
+    .import-patent-action-main{
+        padding: 10px;
+    }
+}
+</style>

+ 0 - 181
src/views/components/import/excelImport/importPatent.vue

@@ -1,181 +0,0 @@
-<template>
-    <div class="import-patent">
-    <el-container class="import-patent">
-      <el-aside class="import-patent-main" style="width:450px">
-        <el-container class="import-patent-action">
-          <el-main class="import-patent-action-main" v-loading="loading">
-            <el-form :model="form" > 
-              <el-form-item label="数据来源:">
-                <select style="width:300px;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>
-
-        
-      </el-aside>
-      <el-main>
-        <systemTask ref="systemTask" :form="1" :reportId="reportId" :productId="productId" :projectId="projectId"></systemTask>
-      </el-main>
-    </el-container>
-  </div>
-</template>
-
-<script>
-// import systemTask from './systemTask.vue'
-import systemTask from '@/views/task/index.vue'
-export default {
-  props:['reportId','asCompare','productId','projectId'],
-  components: {
-    systemTask
-  },
-  data() {
-    return {
-      form: {},
-      sourceId: '',
-      customField: [],
-      loading:false,
-    }
-  },
-  computed: {},
-  mounted() {
-    this.getCustomField()
-  },
-  methods: {
-    getCustomField() {
-      this.$api.getCustomField({ projectId: 0, patentTotal: false }).then(response => {
-        this.customField = response.data
-      })
-    },
-    getQueueList() {
-      this.$refs.systemTask.getQueueList()
-    },
-    onChange(file, fileList) {
-      this.form.file = file.raw
-      this.handleConfirm()
-    },
-    handleConfirm() {
-      const json = JSON.parse(JSON.stringify(this.form))
-      const refs = this.$refs
-     
-      let data = {
-        reportId: this.reportId,
-        productId: this.productId,
-        projectId: this.projectId,
-        sourceId:this.sourceId,
-        fieldList: [],
-        folderIds: refs.folderTree ? refs.folderTree.getCheckedKeys() : [],
-        asCompare:this.asCompare
-      }
-      for (let uid in json.field) {
-        const field = json.field[uid]
-        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('file', this.form.file)
-      formData.append('json', JSON.stringify(data))
-      this.btnLoading = true
-      this.loading = true
-      // console.log(formData)
-      this.$api.importProjectPatent(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 {
-    overflow-x: hidden;
-    padding: 0;
-    height: 100%;
-    background: #fff;
-  }
-  .import-patent-action {
-    width: 450px;
-    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>

+ 4 - 13
src/views/components/import/excelImport/index.vue

@@ -1,11 +1,11 @@
 <template>
   <div>
-    <importPatent :reportId="reportId" :asCompare="asCompare" :productId="productId" :projectId="projectId"></importPatent>
+    <importPatent :importData="importData"></importPatent>
   </div>
 </template>
 
 <script>
-import importPatent from './importPatent.vue'
+import importPatent from '../components/importPatent.vue'
 export default {
   components: {
     importPatent
@@ -16,17 +16,8 @@ export default {
     }
   },
   computed: {
-    reportId() {
-      return this.$route.query.reportId
-    },
-    projectId() {
-      return this.$route.query.projectId
-    },
-    productId() {
-      return this.$route.query.productId
-    },
-    asCompare() {
-      return this.$route.query.asCompare
+    importData() {
+      return this.$route.query
     }
   },
   mounted() {

+ 137 - 0
src/views/components/import/mixins/index.js

@@ -0,0 +1,137 @@
+import systemTask from "../task/components/index.vue"
+import FieldDrawer from '@/views/components/drawer/Field.vue'
+export default{
+    components: {
+        systemTask,
+        FieldDrawer
+      },
+    props:{
+        importData:{}
+    },
+    data() {
+        return {
+            tableData: [
+                {
+                    name: '标引',
+                    field: 'index'
+                }, {
+                    name: '分类',
+                    field: 'classify'
+                }
+            ],
+            form:this.importData,
+            customField: [],
+            customFieldId:'',
+            ExcelConfig:[],
+            projectDetails:{}
+        }
+    },
+    mounted() {
+        if(this.form.type == 1){
+            this.getExcelConfig()
+        }
+        //获取所有栏位
+        this.getAllCustomField()
+    },
+    methods: {
+        //修改选择的栏位
+        changeCustomField(val){
+            // var obj = this.customField
+        },
+        //获取所有栏位
+        async getAllCustomField(){
+            const [project,product] = await Promise.allSettled([this.getProjectField(),this.getProjectDetails()])
+            var projectField = chartData.status =='fulfilled'?chartData.value:[]
+            this.projectDetails= companyAndArea.status =='fulfilled'?companyAndArea.value:{}
+            if(this.projectDetails.productOrCategory){
+                projectField.push(
+                    {
+                        id:this.projectDetails.productOrCategory.id,
+                        name:this.projectDetails.productOrCategory.name,
+                        type:6,
+                        isProduct:this.projectDetails.productOrCategory.type,
+                    }
+                )
+            }
+            this.customField = projectField.forEach((item,index)=>{
+                item.keyValue = index
+            })
+        },
+        //获取自定义栏位
+        async getProjectField(){
+            var params = {
+                searchQuery:`projectId=${this.form.importToId}`,
+                orderDTOList: [
+                    {   
+                        "orderBy": "type",
+                        "orderType": 1
+                    }
+                ],
+              }
+              return await this.$api.queryCustomField(params).then( async response=>await response.data.data)
+        },
+        //获取项目信息
+        async getProjectDetails(){
+            var params = {
+                searchQuery: `id=${this.form.importToId}`,//检索条件
+                orderDTOList: [],//排序
+              }
+              return await this.$api.queryPatentProject(params).then( async response=>await response.data.data[0])
+        },
+        // //获取产品架构
+        // getProduct(){
+        //     let params = {
+        //         name: this.productName,//名称
+        //         type: this.row.type,//类型:1产品类别,2产品,3技术分类,4自定义树
+        //         typeId: this.row.id,//产品或类别id
+        //       }
+        //     this.$api.queryTreeNodeTree(params).then(res => {
+        //         if (res.code == 200) {
+        //           this.treeData = res.data.data
+        //         }
+        //       }).catch(err => {
+        //         this.$message.error(err.message)
+        //       })
+        // },
+        getExcelConfig() {
+            this.$api.getExcelConfig().then(response => {
+              this.ExcelConfig = response.data.data
+            })
+        },
+        handleManage(){
+            this.$refs.FieldDrawer.open(this.form.importToId)
+        },
+        closeFieldDrawer(){
+
+        },
+        //添加导入任务
+        addImportTask(form){
+            this.btnLoading = true
+            this.loading = true
+            this.$api.addImportTask(form).then(response => {
+                this.$message.success('任务创建成功')
+                this.form.fileGuid = null
+                this.btnLoading = false
+                this.loading = false
+                this.getQueueList()
+            }).catch(error => {
+                this.btnLoading = false
+                this.loading = false
+            })
+        },
+        getQueueList() {
+            this.$refs.systemTask.getList()
+        },
+        // 获取时间
+        handleData(val) {
+            if (this.form.dateType=='') {
+            this.$message.error('请先选择更新周期')
+            return false
+            }
+            this.form.crons=val
+        },
+        getDateType(val) {
+            this.form.crons = ''
+          },
+    },
+}

+ 237 - 0
src/views/components/import/task/components/index.vue

@@ -0,0 +1,237 @@
+<template>
+  <div class="height_100">
+    <el-container v-if="showView">
+        <el-header>
+            <div id="step1">
+                <mySearch style="width: 500px" :SearchFields="searchFiled" @search="search" :searchValue="searchOption"></mySearch>
+            </div>
+        </el-header>
+        <el-main>
+            <el-table v-loading="loading" :data="tableData" border header-row-class-name="custom-table-header" @sort-change="sortChange" :maxHeight="tableHeight - 220">
+                <el-table-column label="#" type="index" align="center" width="55">
+                <template slot-scope="scope">
+                    <span>{{ (scope.$index + 1) + ((queryParams.current - 1) * queryParams.size) }}</span>
+                </template>
+                </el-table-column>
+            <el-table-column v-for="item in columnList.filter(item=>!item.ifHidden)" :key="item.value" :label="item.name" :prop="item.value" align="center" sortable="custom">
+                <template slot-scope="scope">
+                    <div v-if="item.value == 'type'" v-html="$commonJS.getColumnData(scope.row, item,null,{data:importType})"></div>
+                    <div v-else-if="item.value == 'state'" v-html="$commonJS.getColumnData(scope.row, item,null,{data:state})"></div>
+                    <div v-else  v-html="$commonJS.getColumnData(scope.row, item)"></div>
+                </template>
+            </el-table-column>
+            
+            <el-table-column label="操作" align="center" width="150">
+              <template slot-scope="scope" >
+                <div  class="operate">
+                  <el-link type="primary" @click.native="handleDownload(scope.row)" v-if="$permission('/workspace/common/taskDownload') && ((scope.row.type == 1 || scope.row.type == 2) && (scope.row.status !== 0 || scope.row.status !== 1))">
+                    <el-tooltip class="item" effect="dark" content="下载" placement="top">
+                      <i class="iconfont icon-xiazai"></i>
+                    </el-tooltip>  
+                  </el-link>
+                 
+                  <el-link class="margin-left_10" type="primary"  @click="handleSuspend(scope.row)" v-if="scope.row.status==1 || scope.row.status==4">
+                    <el-tooltip class="item" effect="dark" content="暂停" placement="top">
+                      <i class="iconfont icon-zanting1" v-if="scope.row.status==1"></i>
+                    </el-tooltip>
+                    <el-tooltip class="item" type="primary" effect="dark" content="继续" placement="top">
+                      <i class="iconfont icon-zanting" v-if="scope.row.status==4"></i> 
+                    </el-tooltip>
+                  </el-link>
+                  
+                  <el-link class="margin-left_10" type="primary"  v-if="scope.row.taskType == 1" @click="updateLog(scope.row)">
+                      <el-tooltip class="item" effect="dark" content="更新记录" placement="top">
+                        <i class="iconfont icon-banbengengxinjilu" style="font-size:18px"></i>
+                      </el-tooltip>
+                    </el-link>
+                    <el-link class="margin-left_10" type="danger" @click.native="cancel(scope.row)" v-if="(scope.row.status!=2 && scope.row.status!=5) || scope.row.taskType == 1" >
+                    <el-tooltip class="item" effect="dark" content="取消" placement="top">
+                      <i class="iconfont icon-quxiaorenwu1"></i>
+                    </el-tooltip> 
+                  </el-link>
+                </div>
+              </template>
+            </el-table-column>
+          </el-table>
+        </el-main>
+        <el-footer class="pagination">
+            <el-pagination :current-page.sync="queryParams.current" :page-size="queryParams.size" :total="total" @current-change="handleCurrentChange" layout="total, prev, pager, next, jumper" background></el-pagination>
+        </el-footer>
+    </el-container>
+  </div>
+</template>
+
+<script>
+export default {
+  components: {},
+  props: {
+    
+  },
+  data() {
+    return {
+        //检索字段
+        searchFiled: [],
+        //检索条件
+        searchOption: {},
+         //加载中
+        loading: false,
+        //任务的数据集合
+        tableData: [],
+        //分页信息
+        queryParams: {
+            current: 1,
+            size: 10
+        },
+        //总条数
+        total: 0,
+        //排序
+        sort: [
+            {
+                "orderBy": "createTime",
+                "orderType": 1
+            }
+        ],
+        columnList:[],//搜索的栏位
+        showView:false,
+
+
+    };
+  },
+  watch: {},
+  computed: {
+    importType(){
+        var a = this.$store.state.dictMessage.dictMessage.IMPORT_TASK_TYPE || []
+        if(a.length>0){
+            var obj = this.searchFiled.find(item=>{
+                return item.value == 'type'
+            })
+            if(obj){
+                obj.options = a
+            } 
+        }
+        return this.$store.state.dictMessage.dictMessage.IMPORT_TASK_TYPE || []
+    },
+    state(){
+        var a = this.$store.state.dictMessage.dictMessage.IMPORT_TASK_TYPE || []
+        if(a.length>0){
+            var obj = this.searchFiled.find(item=>{
+                return item.value == 'state'
+            })
+            if(obj){
+                obj.options = a
+            } 
+        }
+        return this.$store.state.dictMessage.dictMessage.IMPORT_TASk_STATE
+    }
+  },
+  created() {},
+  async mounted() {
+    this.columnList = await this.$commonJS.getCustomField('importTask')
+    //获取table栏位及分组字段
+    await this.getColumn()
+    this.getList()
+  },
+  methods: {
+    //显示视图?
+    showViews() {
+      this.showView = false
+      this.$nextTick(() => {
+        this.showView = true
+      })
+    },
+    //获取table栏位及分组字段、检索字段
+    async getColumn() {
+      let params = ['importTask']
+      await this.$api.getParamsCommon(params).then(res => {
+        if (res.code == 200) {
+          let conditionDTOList= JSON.parse(JSON.stringify(res.data[0].conditionDTOList))
+          // 搜索字段
+          this.searchFiled = this.$commonJS.getField(conditionDTOList,(u)=> u.ifSearch == true ,{
+            label: 'name',
+            value: 'value',
+            type:'type',
+          })
+          var options = ['type','state']
+          options.forEach(item=>{
+            this.getOption(item)
+          })
+          
+        }
+      })
+      this.showViews()
+    },
+    getOption(type){
+        var obj = this.searchFiled.find(item=>{
+            return item.value == type
+        })
+        if(!obj){
+           return false
+        }
+        switch(type){
+            case 'type':
+                obj.options = this.importType
+                break;
+            case 'state':
+                obj.options = this.state
+                break;
+        }
+    },
+    //获取检索条件检索
+    search(val) {
+      let params = {}
+      val.forEach(item => {
+        if (item.type == 3) {
+          params[item.value]=item.searchValue.map(itemValue => {
+            return itemValue.value
+          })
+        } else {
+          params[item.value]=item.searchValue.label
+        }
+      })
+      // 返回条件对象
+      this.searchOption=params
+      // 调用查询接口
+      this.queryParams.current=1
+      this.getList()
+    },
+    //获取任务
+    getList(){
+        var params = {
+            ...this.queryParams,
+            searchQuery:this.$commonJS.objectToString(this.searchOption || {}),
+            orderDTOList:this.sort
+        }
+        this.$api.queryImportTask(params).then(res => {
+            if (res.code == 200) {
+                this.tableData = res.data.data
+                this.total=res.data.total
+            }
+        }).catch(err => {
+            this.tableData = []
+            this.total=0
+        })
+    },
+    //分页
+    handleCurrentChange(val){
+        this.queryParams.current = val 
+        this.getList()
+    },
+    sortChange({ column, prop, order }) {
+      //如需要多个字段排序,则不需要清空
+      var params = {
+        sort:this.sort,
+        column,
+        prop,
+        order,
+      }
+      this.sort = this.$commonJS.getSortData(params)
+      this.params.current = 0
+      this.disabled = false
+      this.tableData=[]
+      this.getList()
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+</style>

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


+ 1 - 1
src/views/home/index.vue

@@ -29,7 +29,7 @@
             <span class="title">知识产权风控与组织记忆系统</span>
           </div>
           <div class="bei">
-            <el-link :underline="false" class="elLink">粤<span class="en">IPC</span>备010101010101</el-link>
+            <el-link :underline="false" class="elLink">粤<span class="en">IPC</span>备2023063530</el-link>
           </div>
         </div>
         <div>

+ 12 - 1
src/views/project/index.vue

@@ -405,7 +405,7 @@ export default {
           this.patentImport(row,2)
           break
         case '2'://检索条件导入
-          this.patentImport(row,3)
+          this.patentImport(row,4)
           break
         case '3'://任务清单
           this.handleFile(row, 0)
@@ -428,6 +428,17 @@ export default {
           break
       }
     },
+    //专利导入
+    patentImport(row,type){
+      var form = {
+        importToId:row.id,
+        importToType:0,
+        type:type,
+        ifUpdate:row.ifUpdate,
+        crons:row.crons
+      }
+      this.$commonJS.toImportParent(form,type)
+    },
     //获取删除的id
     deletes(row,isLast) {
       this.deletePatentProject([row.id],isLast)

+ 1 - 1
src/views/project/patentCollection/index.vue

@@ -120,7 +120,7 @@
 
 <script>
 import { downLoad2, getTreeDataList, getTreeLastChildren, getPatentCountry } from "@/utils"
-import FieldDrawer from '@/views/components/drawer/Field.vue'
+  import FieldDrawer from '@/views/components/drawer/Field.vue'
 // import PatentAbstractListView from './components/views/Abstract'
 import PatentTableListView from './components/views/Table'
 // import PatentPictureListView from './components/views/Picture'