|
@@ -1,483 +1,367 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <el-dialog title="导入到报告" :visible.sync="dialogVisible" width="500px" :before-close="handleClose">
|
|
|
- <div>
|
|
|
- <el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
|
|
- <!-- <el-form-item label="任务名称">
|
|
|
- <div>
|
|
|
- <el-input v-model="form.taskName" placeholder="请输入任务名称"></el-input>
|
|
|
- </div>
|
|
|
- </el-form-item> -->
|
|
|
- <el-form-item label="选择报告" prop="reportId">
|
|
|
- <div class="selectButton">
|
|
|
- <el-select v-model="form.reportId" filterable remote clearable @change="changeProjectId" placeholder="请选择报告" :loading="loading" v-SelectLazyLoading="lazyLoading" :remote-method="remoteMethod">
|
|
|
- <el-option
|
|
|
- v-for="item in reportList"
|
|
|
- :key="item.id"
|
|
|
- :label="item.name"
|
|
|
- :value="item.id"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- <!-- <el-button @click="addProject"><i class="el-icon-plus"></i></el-button> -->
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
- <!-- <template v-if="form.reportId" >
|
|
|
- <div style="margin:10px 0;">
|
|
|
- <p>选择需要关联的标引与分类</p>
|
|
|
- <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"
|
|
|
- @check-change="changeFolder"
|
|
|
- ></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"
|
|
|
- @check-change="changeField(item.id)"
|
|
|
- ></el-tree>
|
|
|
- </template>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-form>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="name" show-overflow-tooltip>
|
|
|
- <template slot-scope="scope">
|
|
|
- <div style="display:flex;justify-content: space-between;align-items:center">
|
|
|
- <span>{{ scope.row.name }}</span>
|
|
|
- <span v-if="scope.row.field === 'folder'"><el-button type="primary" size="small" @click="handleFolder(form.reportId)" :disabled="!($permission('/workspace/common/folder_manage') && $r(form.reportId,[1,2]))">文件夹管理</el-button></span>
|
|
|
- <span v-else><el-button type="primary" size="small" @click="handleManage(form.reportId)" :disabled="!($permission('/workspace/common/customField') && $r(form.reportId,[1,2]))">自定义栏位管理</el-button></span>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- </div>
|
|
|
- </template> -->
|
|
|
- <el-form-item label="作为对比文件">
|
|
|
+ <el-dialog
|
|
|
+ :title="title"
|
|
|
+ :visible.sync="dialogVisible"
|
|
|
+ width="500px"
|
|
|
+ :before-close="handleClose"
|
|
|
+ >
|
|
|
+ <div>
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" >
|
|
|
+ <el-form-item label="导入到:">
|
|
|
+ <el-select v-model="form.importToType" clearable @change="changeImportToType" placeholder="请选择">
|
|
|
+ <el-option
|
|
|
+ v-for="(item,key) in importToTypes"
|
|
|
+ :key="item"
|
|
|
+ :label="item"
|
|
|
+ :value="key"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item v-if="form.importToType || form.importToType == 0 " :label="'选择' + (importToTypes[form.importToType]?importToTypes[form.importToType]:'')" prop="importToId">
|
|
|
+ <div >
|
|
|
+ <el-select v-model.number="form.importToId" filterable remote clearable @change="changeProjectId" placeholder="请选择" v-SelectLazyLoading="lazyLoading" :remote-method="remoteMethod">
|
|
|
+ <el-option
|
|
|
+ v-for="item in ods.data"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="parseInt(item.id)"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <!-- <el-button @click="addProject"><i class="el-icon-plus"></i></el-button> -->
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ <!-- <el-form-item label="作为对比文件">
|
|
|
<el-switch
|
|
|
v-model="form.asCompare"
|
|
|
active-value="1"
|
|
|
active-text="是"
|
|
|
inactive-text="否">
|
|
|
</el-switch>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="下载内容">
|
|
|
- <el-select v-model="form.configCells" multiple collapse-tags style="width:100%">
|
|
|
- <el-option v-for="item in patentField"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="定期更新" prop="taskType">
|
|
|
- <el-switch v-model="form.taskType" :active-value="1" :inactive-value="0" active-color="#13ce66" inactive-color="#ff4949" @change="changeTaskType"></el-switch>
|
|
|
- </el-form-item>
|
|
|
- <template>
|
|
|
- <div v-show="form.taskType">
|
|
|
- <el-form-item label="更新间隔" prop="dateType">
|
|
|
- <el-select v-model="form.dateType" @change="getDateType" clearable placeholder="请选择更新时间间隔" style="width:100%">
|
|
|
- <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="form.dateType" style="width:100%">
|
|
|
- <timeChoose :type="form.dateType" @value="handleData" :cron="form.crons"></timeChoose>
|
|
|
- </el-form-item>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-form>
|
|
|
- <div class="button">
|
|
|
- <el-button type="primary" size="small" @click="onSubmit" :loading="btnLoading">导入</el-button>
|
|
|
- <el-button size="small" @click="handleClose">取消</el-button>
|
|
|
+ </el-form-item> -->
|
|
|
+ <el-form-item label="选择需要关联的标引与分类" v-if="form.importToId">
|
|
|
+ <div style="margin-top: 50px" v-if="form.importToType!=2">
|
|
|
+ <span>栏位:</span>
|
|
|
+ <span>
|
|
|
+ <el-select
|
|
|
+ v-model="customFieldId"
|
|
|
+ @change="changeCustomField"
|
|
|
+ placeholder="请选择"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in customField"
|
|
|
+ :key="item.name"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.keyValue"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </span>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
-
|
|
|
-<!--
|
|
|
- <project-form-drawer @submit="submitProjectForm" :common-data="commonData" ref="projectFormDrawer"/>
|
|
|
+ <div style="margin-top: 40px" v-if="customFieldId">
|
|
|
+ <template v-if="choseField.type === 0 || choseField.type === 2">
|
|
|
+ <el-input
|
|
|
+ v-model="choseField.fieldValue"
|
|
|
+ placeholder="请输入内容"
|
|
|
+ size="small"
|
|
|
+ @change="changeValue"
|
|
|
+ ></el-input>
|
|
|
+ </template>
|
|
|
+ <template v-if="choseField.type === 1">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="choseField.fieldValue"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ type="date"
|
|
|
+ size="small"
|
|
|
+ placeholder="选择日期"
|
|
|
+ style="width: 100%"
|
|
|
+ @change="changeValue"
|
|
|
+ ></el-date-picker>
|
|
|
+ </template>
|
|
|
+ <template v-if="choseField.type === 4">
|
|
|
+ <el-radio-group v-model="choseField.fieldValue">
|
|
|
+ <el-radio
|
|
|
+ v-for="option in choseField.options"
|
|
|
+ :key="option.name"
|
|
|
+ :label="option.id"
|
|
|
+ @input="changeValue(option.id, option)"
|
|
|
+ >{{ option.name }}</el-radio
|
|
|
+ >
|
|
|
+ </el-radio-group>
|
|
|
+ </template>
|
|
|
+ <template v-if="choseField.type === 5">
|
|
|
+ <el-checkbox-group v-model="choseField.fieldValue">
|
|
|
+ <el-checkbox
|
|
|
+ v-for="option in choseField.options"
|
|
|
+ :key="option.name"
|
|
|
+ :label="option.id"
|
|
|
+ @change="changeValue(option.id, option)"
|
|
|
+ >{{ option.name }}</el-checkbox
|
|
|
+ >
|
|
|
+ </el-checkbox-group>
|
|
|
+ </template>
|
|
|
+ <template v-if="choseField.type === 6">
|
|
|
+ <el-tree
|
|
|
+ :ref="choseField.id"
|
|
|
+ :data="choseField.options"
|
|
|
+ node-key="id"
|
|
|
+ :props="treeProp"
|
|
|
+ :expand-on-click-node="false"
|
|
|
+ :default-expand-all="true"
|
|
|
+ >
|
|
|
+ <span class="custom-tree-node" slot-scope="{ node, data }">
|
|
|
+ <el-checkbox-group v-model="choseField.fieldValue">
|
|
|
+ <el-checkbox
|
|
|
+ :label="data.id"
|
|
|
+ @change="changeValue(data.id, data)"
|
|
|
+ >{{ data.name }}</el-checkbox
|
|
|
+ >
|
|
|
+ </el-checkbox-group>
|
|
|
+ </span>
|
|
|
+ </el-tree>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ <div v-if="assoImportTaskFieldVOS.length > 0">
|
|
|
+ <el-tag
|
|
|
+ v-for="(item, index) in assoImportTaskFieldVOS"
|
|
|
+ :key="item.fieldValueId"
|
|
|
+ >{{ item.fieldName }} = {{ item.fieldValueStr }}
|
|
|
+ <span
|
|
|
+ ><i @click="del(index, item)" class="el-icon-error"></i></span
|
|
|
+ ></el-tag>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
|
|
|
- <project-field-drawer @close="handleClose2" ref="projectFieldDrawer" />
|
|
|
|
|
|
- <project-folder-dialog @close="updateFolder" ref="projectFolderDialog" /> -->
|
|
|
+ <el-form-item label="下载内容">
|
|
|
+ <el-select
|
|
|
+ v-model="importContent"
|
|
|
+ multiple
|
|
|
+ collapse-tags
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in importContents"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <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 v-if="form.ifUpdate">
|
|
|
+ <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>
|
|
|
+ </el-form>
|
|
|
+ <div class="button">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ @click="onSubmit"
|
|
|
+ :loading="btnLoading"
|
|
|
+ >导入</el-button
|
|
|
+ >
|
|
|
+ <el-button size="small" @click="handleClose">取消</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import timeChoose from "@/views/workspace/components/common/timeChoose.vue";
|
|
|
+import mixins from "../../mixins";
|
|
|
export default {
|
|
|
- components: {
|
|
|
- timeChoose,
|
|
|
- },
|
|
|
+ components: {},
|
|
|
+ mixins: [mixins],
|
|
|
props: [],
|
|
|
data() {
|
|
|
return {
|
|
|
- isLazy:true,
|
|
|
- loading:false,
|
|
|
- btnLoading:false,
|
|
|
- customField:{},
|
|
|
- tableData:[
|
|
|
- {
|
|
|
- name: '标引',
|
|
|
- field: 'index'
|
|
|
- },
|
|
|
- {
|
|
|
- name: '分类',
|
|
|
- field: 'classify'
|
|
|
- },
|
|
|
- {
|
|
|
- name: '文件夹',
|
|
|
- field: 'folder'
|
|
|
- }
|
|
|
- ],
|
|
|
- defaultProps: {
|
|
|
- children: 'children',
|
|
|
- label: 'name'
|
|
|
- },
|
|
|
- dialogVisible:false,
|
|
|
- form: {},
|
|
|
- queryParams:{
|
|
|
- size:10,
|
|
|
- current:1
|
|
|
- },
|
|
|
- reportList: [],
|
|
|
- commonData:{},
|
|
|
- options: [
|
|
|
- {label:'每天',value:'day'},
|
|
|
- {label:'每周',value:'week'},
|
|
|
- {label:'每月',value:'month'},
|
|
|
- {label:'每年',value:'year'},
|
|
|
- ],
|
|
|
- // /1.著录项目 2.权要 3.说明书文本 4.说明书pdf 6.摘要附图
|
|
|
- patentField:[
|
|
|
- {
|
|
|
- value:'1',
|
|
|
- label:'著录项目'
|
|
|
+ title: "",
|
|
|
+ btnLoading: false,
|
|
|
+ dialogVisible: false,
|
|
|
+ importToTypes:{
|
|
|
+ 0: "专题库",
|
|
|
+ 1: "报告",
|
|
|
+ 2: "产品",
|
|
|
},
|
|
|
- {
|
|
|
- value:'2',
|
|
|
- label:'权利要求'
|
|
|
- },
|
|
|
- {
|
|
|
- value:'3',
|
|
|
- label:'说明书文本'
|
|
|
- },
|
|
|
- {
|
|
|
- value:'4',
|
|
|
- label:'说明书pdf'
|
|
|
- },
|
|
|
- {
|
|
|
- value:'6',
|
|
|
- label:'摘要附图'
|
|
|
- },
|
|
|
- ],
|
|
|
- rules: {
|
|
|
- reportId: [
|
|
|
- { required: true, message: '请选择报告', trigger: 'change' }
|
|
|
- ],
|
|
|
- }
|
|
|
+ ods:{
|
|
|
+ data:[],
|
|
|
+ queryParams:{
|
|
|
+ current:1,
|
|
|
+ size:10
|
|
|
+ },
|
|
|
+ loading:false,
|
|
|
+ },
|
|
|
+ rules:{}
|
|
|
};
|
|
|
},
|
|
|
watch: {},
|
|
|
computed: {},
|
|
|
created() {},
|
|
|
mounted() {
|
|
|
- // this.$api.getCommonData({ keys: 'QUERY_GROUP,ENTERPRISE_APPLICATION_SCENARIO,INVESTIGATION_TYPE' }).then(response => {
|
|
|
- // this.commonData = response.data
|
|
|
- // })
|
|
|
- this.getReportList();
|
|
|
},
|
|
|
methods: {
|
|
|
- open(form){
|
|
|
- this.form = {
|
|
|
- ...form,
|
|
|
- configCells:['1','2','3','4','6'],
|
|
|
- taskType2:4,
|
|
|
- taskType:0,
|
|
|
- configId:2,
|
|
|
- json: {
|
|
|
- reportId: 0,
|
|
|
- field: [],
|
|
|
- folder: {}
|
|
|
- }
|
|
|
- }
|
|
|
- if(this.form.reportId){
|
|
|
- this.$set(this.form,'reportId',Number(this.form.reportId))
|
|
|
- this.queryParams = {
|
|
|
- current:1,
|
|
|
- size:10,
|
|
|
- reportId:this.form.reportId
|
|
|
- }
|
|
|
- var index = this.reportList.findIndex(item=>{
|
|
|
- return item.id == this.form.reportId
|
|
|
- })
|
|
|
- if(index==-1){
|
|
|
- this.$api.QueryReport(this.queryParams).then(response=>{
|
|
|
- if(response.code == 200){
|
|
|
- this.loading = false;
|
|
|
- this.reportList = [...this.reportList, ...response.data];
|
|
|
- this.queryParams.reportId = null
|
|
|
- }
|
|
|
- }).catch(error=>{
|
|
|
- this.loading = false;
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- this.dialogVisible=true
|
|
|
- },
|
|
|
- //关闭弹窗
|
|
|
- handleClose(){
|
|
|
- this.$refs.form.resetFields()
|
|
|
- this.dialogVisible=false
|
|
|
- },
|
|
|
- //导入
|
|
|
- onSubmit(){
|
|
|
- this.$refs.form.validate((valid) => {
|
|
|
- if (valid) {
|
|
|
-
|
|
|
- this.form.fieldList = []
|
|
|
- this.form.folderIds = this.form.json.field.folder
|
|
|
- for (let id in this.form.json.field) {
|
|
|
- const field = this.form.json.field[id]
|
|
|
- if (!field) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- const type = field.type
|
|
|
- const value = field.value
|
|
|
- if (value) {
|
|
|
- if (type === 5 || type === 6) {
|
|
|
- value.map(option => {
|
|
|
- this.form.fieldList.push({
|
|
|
- fieldId: parseInt(id),
|
|
|
- type: type,
|
|
|
- optionId: option
|
|
|
- })
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.form.fieldList.push({
|
|
|
- fieldId: parseInt(id),
|
|
|
- type: type,
|
|
|
- optionId: [0, 1, 2].indexOf(type) === -1 ? value : 0,
|
|
|
- text: value
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if(!this.form.asCompare){
|
|
|
- this.form.asCompare = 0
|
|
|
- }
|
|
|
- this.btnLoading = true
|
|
|
- this.$api.addTask(this.form).then(response=>{
|
|
|
- if(response.code == 200){
|
|
|
- this.$message.success(response.data)
|
|
|
- this.btnLoading = false
|
|
|
- this.handleClose()
|
|
|
- this.getConfirm()
|
|
|
- }
|
|
|
- }).catch(error=>{
|
|
|
- this.loading = false;
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- //弹窗
|
|
|
- getConfirm() {
|
|
|
- const h = this.$createElement;
|
|
|
- this.$msgbox({
|
|
|
- title: '提示',
|
|
|
- message: h('p', null, [
|
|
|
- h('span', null, '任务正在导入,查看任务进度请前往 '),
|
|
|
- h('span', {
|
|
|
- class:'MessageBoxClass' ,on: {
|
|
|
- click:()=>{
|
|
|
- this.toTaskList()
|
|
|
- // 通过close关闭消息弹窗,this.$confirm就是this.$confirm.close(false),其他同理
|
|
|
- this.$msgbox.close(false)
|
|
|
- }
|
|
|
- }},'任务清单',)
|
|
|
- ]),
|
|
|
- type: 'warning',
|
|
|
- showConfirmButton: false,
|
|
|
- }).then(action => {
|
|
|
-
|
|
|
- });
|
|
|
-
|
|
|
- },
|
|
|
- //跳转到任务清单
|
|
|
- toTaskList() {
|
|
|
- // 传专题库id是查到当前专题库的导入任务,不传是查看所有导入任务
|
|
|
- const router = this.$router.resolve({
|
|
|
- path: '/taskList',
|
|
|
- })
|
|
|
- window.open(router.href,'_blank')
|
|
|
- },
|
|
|
- //切换专题库
|
|
|
- changeProjectId(val){
|
|
|
- // if(val){
|
|
|
- // this.getCustomField(val)
|
|
|
- // }
|
|
|
-
|
|
|
- },
|
|
|
- //获取标引类型
|
|
|
- getCustomField(reportId) {
|
|
|
- this.$api.getCustomField({ reportId: reportId }).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 })
|
|
|
- })
|
|
|
- })
|
|
|
- })
|
|
|
- },
|
|
|
- //打开自定义栏位弹窗
|
|
|
- handleManage(reportId) {
|
|
|
- this.$refs.projectFieldDrawer.open(reportId)
|
|
|
- },
|
|
|
- //关闭自定义栏位弹窗并更新自定义栏位数据
|
|
|
- handleClose2(reportId) {
|
|
|
- this.getCustomField(reportId)
|
|
|
+ open(form) {
|
|
|
+ this.form = {
|
|
|
+ ...form,
|
|
|
+ };
|
|
|
+ if (this.form.importToType) {
|
|
|
+ this.title = `导入到${this.importToTypes[this.form.importToType]}`;
|
|
|
+ } else [(this.title = `导入专利`)];
|
|
|
+ if (this.form.importToId) {
|
|
|
+
|
|
|
+ }
|
|
|
+ this.dialogVisible = true;
|
|
|
},
|
|
|
- //获取选中的分类节点
|
|
|
- changeField(id){
|
|
|
- this.form.json.field[id].value = this.$refs[id][0].getCheckedKeys()
|
|
|
+ changeImportToType(val){
|
|
|
+ this.ods = {
|
|
|
+ name:'',
|
|
|
+ data:[],
|
|
|
+ queryParams:{
|
|
|
+ current:1,
|
|
|
+ size:10
|
|
|
+ },
|
|
|
+ loading:false,
|
|
|
+ }
|
|
|
+ this.$set(this.form,'importToId','')
|
|
|
+ this.getData(val)
|
|
|
},
|
|
|
- //打开文件夹管理弹窗
|
|
|
- handleFolder(reportId) {
|
|
|
- this.$refs.projectFolderDialog.open(reportId)
|
|
|
+ getData(val){
|
|
|
+ var val1 = Number(val)
|
|
|
+ switch(val1){
|
|
|
+ case 0:
|
|
|
+ this.getProject()
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ this.getReport()
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ this.getProduct()
|
|
|
+ break;
|
|
|
+ }
|
|
|
},
|
|
|
- //关闭文件夹弹窗并更新数据
|
|
|
- updateFolder(reportId) {
|
|
|
- this.$api.getProjectFolderList({ reportId: reportId, patentTotal: false }).then(response => {
|
|
|
- this.customField.folder = response.data
|
|
|
+ //获取专题库数据
|
|
|
+ async getProject(){
|
|
|
+ var obj = this.ods
|
|
|
+ obj.loading = true;
|
|
|
+ let params = {
|
|
|
+ ...obj.queryParams,//分页信息
|
|
|
+ searchQuery:obj.name?`name=${obj.name}`:'',//检索条件
|
|
|
+ orderDTOList: [
|
|
|
+ {
|
|
|
+ orderBy: "createTime",
|
|
|
+ orderType: 1
|
|
|
+ },
|
|
|
+ ]//排序
|
|
|
+ }
|
|
|
+ await this.$api.queryPatentProject(params).then(response => {
|
|
|
+ if(response.code == 200){
|
|
|
+ obj.loading = false;
|
|
|
+ obj.data.push(...response.data.data)
|
|
|
+ obj.queryParams.total = response.data.total
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
- //获取选中的文件夹
|
|
|
- changeFolder(data, checked, indeterminate){
|
|
|
- this.form.json.field.folder = this.$refs.folderTree.getCheckedKeys()
|
|
|
- },
|
|
|
- //获取更新周期
|
|
|
- getDateType(val) {
|
|
|
- this.form.crons = ''
|
|
|
- },
|
|
|
- //是否定期更新
|
|
|
- changeTaskType(val){
|
|
|
- if(!val){
|
|
|
- this.form.dateType = ''
|
|
|
- this.form.crons = ''
|
|
|
+ //获取报告
|
|
|
+ async getReport(){
|
|
|
+ var obj = this.ods
|
|
|
+ obj.loading = true;
|
|
|
+ let params = {
|
|
|
+ ...obj.queryParams,//分页信息
|
|
|
+ searchQuery:obj.name?`name=${obj.name}`:'',//检索条件
|
|
|
+ orderDTOList: [
|
|
|
+ {
|
|
|
+ orderBy: "createTime",
|
|
|
+ orderType: 1
|
|
|
+ },
|
|
|
+ ]//排序
|
|
|
+ }
|
|
|
+ await this.$api.queryReportProject(params).then(response => {
|
|
|
+ if(response.code == 200){
|
|
|
+ obj.loading = false;
|
|
|
+ obj.data.push(...response.data.data)
|
|
|
+ obj.queryParams.total = response.data.total
|
|
|
}
|
|
|
+ })
|
|
|
},
|
|
|
- // 获取时间
|
|
|
- handleData(val) {
|
|
|
- if (this.form.dateType=='') {
|
|
|
- this.$message.error('请先选择更新周期')
|
|
|
- return false
|
|
|
+ //获取产品
|
|
|
+ async getProduct(){
|
|
|
+ var obj = this.ods
|
|
|
+ obj.loading = true;
|
|
|
+ let params = {
|
|
|
+ ...obj.queryParams,//分页信息
|
|
|
+ searchQuery:obj.name?`product_name=${obj.name}`:'',//检索条件
|
|
|
+ orderDTOList: [
|
|
|
+ {
|
|
|
+ orderBy: "createTime",
|
|
|
+ orderType: 1
|
|
|
+ },
|
|
|
+ ]//排序
|
|
|
}
|
|
|
- this.form.crons=val
|
|
|
+ await this.$api.queryProduct(params).then(response => {
|
|
|
+ if(response.code == 200){
|
|
|
+ obj.loading = false;
|
|
|
+ obj.data.push(...response.data.data)
|
|
|
+ obj.queryParams.total = response.data.total
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
-
|
|
|
- // 下拉框懒加载
|
|
|
- lazyLoading() {
|
|
|
- if(!this.isLazy){
|
|
|
+
|
|
|
+ //懒加载事件
|
|
|
+ lazyLoading(){
|
|
|
+ var obj = this.ods
|
|
|
+ if(obj.queryParams.current * obj.queryParams.size>=obj.queryParams.total){
|
|
|
return false
|
|
|
}
|
|
|
- this.queryParams.current++;
|
|
|
- this.getReportList();
|
|
|
+ obj.queryParams.current += 1
|
|
|
+ this.getData(this.form.importToType)
|
|
|
},
|
|
|
//远程搜索
|
|
|
- remoteMethod(query) {
|
|
|
- this.isLazy = true
|
|
|
- if (query !== '') {
|
|
|
- this.loading = true;
|
|
|
- this.queryParams = {
|
|
|
- current:1,
|
|
|
- size:10,
|
|
|
- name:query
|
|
|
- }
|
|
|
- this.$api.QueryReport(this.queryParams).then(response=>{
|
|
|
- if(response.code == 200){
|
|
|
- this.loading = false;
|
|
|
- this.reportList = response.data
|
|
|
- }
|
|
|
- }).catch(error=>{
|
|
|
- this.loading = false;
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.queryParams.name = null
|
|
|
- this.reportList = [];
|
|
|
- this.getReportList()
|
|
|
- }
|
|
|
- },
|
|
|
- //查询报告列表
|
|
|
- getReportList() {
|
|
|
- if(!this.isLazy){
|
|
|
- return false
|
|
|
- }
|
|
|
- this.$api.QueryReport(this.queryParams).then(response=>{
|
|
|
- if(response.code == 200){
|
|
|
- if(response.data && response.data.length == 0){
|
|
|
- this.isLazy = false
|
|
|
- }
|
|
|
- if(this.form.reportId){
|
|
|
- var index = response.data.findIndex(item=>{
|
|
|
- return item.id == this.form.reportId
|
|
|
- })
|
|
|
- if(index!=-1){
|
|
|
- response.data.splice(index,1)
|
|
|
- }
|
|
|
- }
|
|
|
- this.reportList = [...this.reportList, ...response.data];
|
|
|
- }
|
|
|
- }).catch(error=>{
|
|
|
- })
|
|
|
+ remoteMethod(query){
|
|
|
+ var obj = this.ods
|
|
|
+ obj.data=[]
|
|
|
+ obj.queryParams.current = 1
|
|
|
+ obj.name = query
|
|
|
+ this.getData(this.form.importToType)
|
|
|
},
|
|
|
+
|
|
|
//打开新增专题库弹窗
|
|
|
addProject() {
|
|
|
this.$refs.projectFormDrawer.open(
|
|
@@ -492,10 +376,96 @@ export default {
|
|
|
"新增专题库"
|
|
|
);
|
|
|
},
|
|
|
- //更新列表
|
|
|
- submitProjectForm(type) {
|
|
|
- this.getReportList()
|
|
|
+
|
|
|
+ //关闭弹窗
|
|
|
+ handleClose() {
|
|
|
+ this.$refs.form.resetFields();
|
|
|
+ this.dialogVisible = false;
|
|
|
},
|
|
|
+ //导入
|
|
|
+ onSubmit() {
|
|
|
+ this.$refs.form.validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ var importContent = []
|
|
|
+ this.importContents.forEach(item => {
|
|
|
+ var index = this.importContent.indexOf(item.value)
|
|
|
+ if(index != -1){
|
|
|
+ importContent.push(1)
|
|
|
+ }else{
|
|
|
+ importContent.push(0)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.form.importContent = Number(importContent.join(''))
|
|
|
+ this.form.assoImportTaskFieldVOS = this.assoImportTaskFieldVOS
|
|
|
+ console.log(this.form)
|
|
|
+ // this.addImportTask(this.form)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //弹窗
|
|
|
+ getConfirm() {
|
|
|
+ const h = this.$createElement;
|
|
|
+ this.$msgbox({
|
|
|
+ title: "提示",
|
|
|
+ message: h("p", null, [
|
|
|
+ h("span", null, "任务正在导入,查看任务进度请前往 "),
|
|
|
+ h(
|
|
|
+ "span",
|
|
|
+ {
|
|
|
+ class: "MessageBoxClass",
|
|
|
+ on: {
|
|
|
+ click: () => {
|
|
|
+ this.toTaskList();
|
|
|
+ // 通过close关闭消息弹窗,this.$confirm就是this.$confirm.close(false),其他同理
|
|
|
+ this.$msgbox.close(false);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ "任务清单"
|
|
|
+ ),
|
|
|
+ ]),
|
|
|
+ type: "warning",
|
|
|
+ showConfirmButton: false,
|
|
|
+ }).then((action) => {});
|
|
|
+ },
|
|
|
+ //跳转到任务清单
|
|
|
+ toTaskList() {
|
|
|
+ // 传专题库id是查到当前专题库的导入任务,不传是查看所有导入任务
|
|
|
+ const router = this.$router.resolve({
|
|
|
+ path: "/taskList",
|
|
|
+ });
|
|
|
+ window.open(router.href, "_blank");
|
|
|
+ },
|
|
|
+ //切换项目
|
|
|
+ changeProjectId(val) {
|
|
|
+ if(this.form.importToId && this.form.importToType != 2){
|
|
|
+ this.customFieldId = ''
|
|
|
+ //获取所有栏位
|
|
|
+ this.getAllCustomField()
|
|
|
+ }else{
|
|
|
+ var obj = this.ods.data.find(item=>{
|
|
|
+ return item.id == val
|
|
|
+ })
|
|
|
+ this.choseField = {
|
|
|
+ id:obj.id,
|
|
|
+ name:obj.name,
|
|
|
+ type:6,
|
|
|
+ isProduct:2,
|
|
|
+ fieldValue:[]
|
|
|
+ }
|
|
|
+ this.customFieldId = val
|
|
|
+ this.getProductTree()
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ //打开自定义栏位弹窗
|
|
|
+ handleManage(reportId) {
|
|
|
+ this.$refs.projectFieldDrawer.open(reportId);
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
@@ -503,15 +473,15 @@ export default {
|
|
|
@import "@/assets/css/selectButton.scss";
|
|
|
</style>
|
|
|
<style lang="scss" scoped>
|
|
|
-.MessageBoxClass{
|
|
|
+.MessageBoxClass {
|
|
|
color: red;
|
|
|
}
|
|
|
-.MessageBoxClass:hover{
|
|
|
- cursor:pointer;
|
|
|
- border-bottom:1px solid red ;
|
|
|
+.MessageBoxClass:hover {
|
|
|
+ cursor: pointer;
|
|
|
+ border-bottom: 1px solid red;
|
|
|
}
|
|
|
-.button{
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
+.button {
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
}
|
|
|
</style>
|