|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <el-dialog title="导入到专题库" :visible.sync="dialogVisible" width="500px" :before-close="handleClose">
|
|
|
+ <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="任务名称">
|
|
@@ -8,24 +8,23 @@
|
|
|
<el-input v-model="form.taskName" placeholder="请输入任务名称"></el-input>
|
|
|
</div>
|
|
|
</el-form-item> -->
|
|
|
- <el-form-item label="选择报告" prop="projectId">
|
|
|
+ <el-form-item label="选择报告" prop="reportId">
|
|
|
<div class="selectButton">
|
|
|
- <el-select v-model="form.projectId" filterable clearable @change="changeProjectId" placeholder="请选择专题库" >
|
|
|
+ <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 projectList"
|
|
|
+ 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>
|
|
|
+ <!-- <el-button @click="addProject"><i class="el-icon-plus"></i></el-button> -->
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
- <template v-if="form.projectId" >
|
|
|
+ <!-- <template v-if="form.reportId" >
|
|
|
<div style="margin:10px 0;">
|
|
|
<p>选择需要关联的标引与分类</p>
|
|
|
- <!-- <el-form-item label="选择需要关联的标引与分类"> -->
|
|
|
<el-table :data="tableData" :show-header="false">
|
|
|
<el-table-column type="expand">
|
|
|
<template slot-scope="props">
|
|
@@ -86,15 +85,22 @@
|
|
|
<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.projectId)" :disabled="!($permission('/workspace/common/folder_manage') && $r(form.projectId,[1,2]))">文件夹管理</el-button></span>
|
|
|
- <span v-else><el-button type="primary" size="small" @click="handleManage(form.projectId)" :disabled="!($permission('/workspace/common/customField') && $r(form.projectId,[1,2]))">自定义栏位管理</el-button></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>
|
|
|
- <!-- </el-form-item> -->
|
|
|
</div>
|
|
|
- </template>
|
|
|
+ </template> -->
|
|
|
+ <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"
|
|
@@ -125,37 +131,33 @@
|
|
|
</template>
|
|
|
</el-form>
|
|
|
<div class="button">
|
|
|
- <el-button type="primary" size="small" @click="onSubmit">导入</el-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>
|
|
|
|
|
|
-
|
|
|
+<!--
|
|
|
<project-form-drawer @submit="submitProjectForm" :common-data="commonData" ref="projectFormDrawer"/>
|
|
|
|
|
|
<project-field-drawer @close="handleClose2" ref="projectFieldDrawer" />
|
|
|
|
|
|
- <project-folder-dialog @close="updateFolder" ref="projectFolderDialog" />
|
|
|
+ <project-folder-dialog @close="updateFolder" ref="projectFolderDialog" /> -->
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import ProjectFormDrawer from "@/views/workspace/components/drawer/Form.vue";
|
|
|
-import timeChoose from "@/views/workspace/components/common/timeChoose.vue";
|
|
|
-
|
|
|
-import ProjectFieldDrawer from "@/views/workspace/components/drawer/Field";
|
|
|
-import ProjectFolderDialog from "@/views/workspace/components/dialog/Folder";
|
|
|
+import timeChoose from "@/views/components/common/components/timeChoose.vue";
|
|
|
export default {
|
|
|
components: {
|
|
|
- ProjectFormDrawer,
|
|
|
timeChoose,
|
|
|
- ProjectFieldDrawer,
|
|
|
- ProjectFolderDialog
|
|
|
},
|
|
|
props: [],
|
|
|
data() {
|
|
|
return {
|
|
|
+ isLazy:true,
|
|
|
+ loading:false,
|
|
|
+ btnLoading:false,
|
|
|
customField:{},
|
|
|
tableData:[
|
|
|
{
|
|
@@ -177,7 +179,11 @@ export default {
|
|
|
},
|
|
|
dialogVisible:false,
|
|
|
form: {},
|
|
|
- projectList: [],
|
|
|
+ queryParams:{
|
|
|
+ size:10,
|
|
|
+ current:1
|
|
|
+ },
|
|
|
+ reportList: [],
|
|
|
commonData:{},
|
|
|
options: [
|
|
|
{label:'每天',value:'day'},
|
|
@@ -209,8 +215,8 @@ export default {
|
|
|
},
|
|
|
],
|
|
|
rules: {
|
|
|
- projectId: [
|
|
|
- { required: true, message: '请选择专题库', trigger: 'change' }
|
|
|
+ reportId: [
|
|
|
+ { required: true, message: '请选择报告', trigger: 'change' }
|
|
|
],
|
|
|
}
|
|
|
};
|
|
@@ -219,10 +225,10 @@ export default {
|
|
|
computed: {},
|
|
|
created() {},
|
|
|
mounted() {
|
|
|
- this.$api.getCommonData({ keys: 'QUERY_GROUP,ENTERPRISE_APPLICATION_SCENARIO,INVESTIGATION_TYPE' }).then(response => {
|
|
|
- this.commonData = response.data
|
|
|
- })
|
|
|
- this.getProjectList();
|
|
|
+ // this.$api.getCommonData({ keys: 'QUERY_GROUP,ENTERPRISE_APPLICATION_SCENARIO,INVESTIGATION_TYPE' }).then(response => {
|
|
|
+ // this.commonData = response.data
|
|
|
+ // })
|
|
|
+ this.getReportList();
|
|
|
},
|
|
|
methods: {
|
|
|
open(form){
|
|
@@ -233,13 +239,32 @@ export default {
|
|
|
taskType:0,
|
|
|
configId:2,
|
|
|
json: {
|
|
|
- projectId: 0,
|
|
|
+ reportId: 0,
|
|
|
field: [],
|
|
|
folder: {}
|
|
|
}
|
|
|
}
|
|
|
- if(this.form.projectId){
|
|
|
- this.$set(this.form,'projectId',Number(this.form.projectId))
|
|
|
+ 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.dialogVisible=true
|
|
|
},
|
|
@@ -281,26 +306,63 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ 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=>{
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ //弹窗
|
|
|
+ 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)
|
|
|
- }
|
|
|
+ // if(val){
|
|
|
+ // this.getCustomField(val)
|
|
|
+ // }
|
|
|
|
|
|
},
|
|
|
//获取标引类型
|
|
|
- getCustomField(projectId) {
|
|
|
- this.$api.getCustomField({ projectId: projectId }).then(response => {
|
|
|
+ getCustomField(reportId) {
|
|
|
+ this.$api.getCustomField({ reportId: reportId }).then(response => {
|
|
|
this.customField = response.data;
|
|
|
['index', 'classify'].map(key => {
|
|
|
this.customField[key].map(item => {
|
|
@@ -314,24 +376,24 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
//打开自定义栏位弹窗
|
|
|
- handleManage(projectId) {
|
|
|
- this.$refs.projectFieldDrawer.open(projectId)
|
|
|
+ handleManage(reportId) {
|
|
|
+ this.$refs.projectFieldDrawer.open(reportId)
|
|
|
},
|
|
|
//关闭自定义栏位弹窗并更新自定义栏位数据
|
|
|
- handleClose2(projectId) {
|
|
|
- this.getCustomField(projectId)
|
|
|
+ handleClose2(reportId) {
|
|
|
+ this.getCustomField(reportId)
|
|
|
},
|
|
|
//获取选中的分类节点
|
|
|
changeField(id){
|
|
|
this.form.json.field[id].value = this.$refs[id][0].getCheckedKeys()
|
|
|
},
|
|
|
//打开文件夹管理弹窗
|
|
|
- handleFolder(projectId) {
|
|
|
- this.$refs.projectFolderDialog.open(projectId)
|
|
|
+ handleFolder(reportId) {
|
|
|
+ this.$refs.projectFolderDialog.open(reportId)
|
|
|
},
|
|
|
//关闭文件夹弹窗并更新数据
|
|
|
- updateFolder(projectId) {
|
|
|
- this.$api.getProjectFolderList({ projectId: projectId, patentTotal: false }).then(response => {
|
|
|
+ updateFolder(reportId) {
|
|
|
+ this.$api.getProjectFolderList({ reportId: reportId, patentTotal: false }).then(response => {
|
|
|
this.customField.folder = response.data
|
|
|
})
|
|
|
},
|
|
@@ -358,21 +420,60 @@ export default {
|
|
|
}
|
|
|
this.form.crons=val
|
|
|
},
|
|
|
- //查询专题库列表
|
|
|
- getProjectList() {
|
|
|
- let params = {
|
|
|
- current: 1,
|
|
|
- size: 9999,
|
|
|
- myself: true,
|
|
|
- name: "",
|
|
|
- sort: {
|
|
|
- order: "desc",
|
|
|
- prop: "create_time",
|
|
|
- },
|
|
|
- };
|
|
|
- this.$api.getProjectListV2(params).then((response) => {
|
|
|
- this.projectList = response.data.records;
|
|
|
- });
|
|
|
+
|
|
|
+ // 下拉框懒加载
|
|
|
+ lazyLoading() {
|
|
|
+ if(!this.isLazy){
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ this.queryParams.current++;
|
|
|
+ this.getReportList();
|
|
|
+ },
|
|
|
+ //远程搜索
|
|
|
+ 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=>{
|
|
|
+ })
|
|
|
+ } 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=>{
|
|
|
+ })
|
|
|
},
|
|
|
//打开新增专题库弹窗
|
|
|
addProject() {
|
|
@@ -390,7 +491,7 @@ export default {
|
|
|
},
|
|
|
//更新列表
|
|
|
submitProjectForm(type) {
|
|
|
- this.getProjectList()
|
|
|
+ this.getReportList()
|
|
|
},
|
|
|
},
|
|
|
};
|
|
@@ -399,6 +500,13 @@ export default {
|
|
|
@import "@/assets/css/selectButton.scss";
|
|
|
</style>
|
|
|
<style lang="scss" scoped>
|
|
|
+.MessageBoxClass{
|
|
|
+ color: red;
|
|
|
+}
|
|
|
+.MessageBoxClass:hover{
|
|
|
+ cursor:pointer;
|
|
|
+ border-bottom:1px solid red ;
|
|
|
+}
|
|
|
.button{
|
|
|
display: flex;
|
|
|
justify-content: center;
|