|
@@ -6,14 +6,16 @@
|
|
|
<el-header style="display: flex;align-items: center;">
|
|
|
<slot name="head">
|
|
|
<div id="step1">
|
|
|
- <mySearch style="width: 500px" :SearchFields="searchFiled" @search="search" :searchValue="searchOption">
|
|
|
- </mySearch>
|
|
|
+ <!-- <mySearch style="width: 500px" :SearchFields="searchFiled" @search="search" :searchValue="searchOption">
|
|
|
+ </mySearch> -->
|
|
|
+ <searchPatent ref="searchPatent" :searchFiled="searchFiled"
|
|
|
+ @searchValue="search"></searchPatent>
|
|
|
</div>
|
|
|
</slot>
|
|
|
|
|
|
</el-header>
|
|
|
- <el-main>
|
|
|
- <Table :column="column" :tableData="tableData" :queryParams="queryParams" :refresh="refresh"
|
|
|
+ <el-main style="height:calc(100vh - 300px)">
|
|
|
+ <Table :column="column" :tableData="tableData" :queryParams="queryParams" :refresh="refresh" v-loading="loading"
|
|
|
:patentNoList.sync="patentNoList" :projectId="projectId" @on-sort="handleSort"></Table>
|
|
|
</el-main>
|
|
|
<el-footer>
|
|
@@ -41,9 +43,11 @@
|
|
|
|
|
|
<script>
|
|
|
import Table from '@/views/project/patentCollection/components/views/Table.vue'
|
|
|
+import searchPatent from '@/views/report/components/patentList/components/searchPatent.vue';
|
|
|
export default {
|
|
|
components: {
|
|
|
- Table
|
|
|
+ Table,
|
|
|
+ searchPatent
|
|
|
},
|
|
|
props: {
|
|
|
customFields: {
|
|
@@ -53,7 +57,7 @@ export default {
|
|
|
},
|
|
|
oldSearchOption: {
|
|
|
default: () => {
|
|
|
- return {}
|
|
|
+ return ''
|
|
|
}
|
|
|
},
|
|
|
sign:''
|
|
@@ -66,7 +70,7 @@ export default {
|
|
|
//检索字段
|
|
|
searchFiled: [],
|
|
|
//检索条件
|
|
|
- searchOption: {},
|
|
|
+ searchOption: '',
|
|
|
// 分页信息
|
|
|
queryParams: {
|
|
|
current: 1,
|
|
@@ -155,34 +159,69 @@ export default {
|
|
|
},
|
|
|
//获取table栏位及分组字段、检索字段
|
|
|
async getColumn() {
|
|
|
- let params = ['patent']
|
|
|
- await this.$api.getParamsCommon(params).then(res => {
|
|
|
+ let params = [{
|
|
|
+ tableName: 'patent',
|
|
|
+ projectId: 0,
|
|
|
+ }]
|
|
|
+ this.searchFiled = []
|
|
|
+ await this.$api.getQueryFields(params).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
- let conditionDTOList = JSON.parse(JSON.stringify(res.data[0].conditionDTOList))
|
|
|
+ let conditionDTOList = JSON.parse(JSON.stringify(res.data.data[0].conditionDTOList))
|
|
|
+ let field = conditionDTOList.filter(item => {
|
|
|
+ return item.group == 'nos'
|
|
|
+ })
|
|
|
+ let custom = conditionDTOList.filter(item => {
|
|
|
+ return item.group == 'customField'
|
|
|
+ })
|
|
|
+ let customField = custom.filter(item => {
|
|
|
+ return item.type != 'tree' && item.type != 'Array'
|
|
|
+ })
|
|
|
+ let arr = field.concat(customField)
|
|
|
// 搜索字段
|
|
|
- this.searchFiled = this.$commonJS.getField(conditionDTOList, (u) => u.ifSearch == true, {
|
|
|
+ this.searchFiled = this.$commonJS.getField(arr, (u) => u.ifSearch == true, {
|
|
|
label: 'name',
|
|
|
- value: 'value',
|
|
|
+ value: 'field',
|
|
|
type: 'type',
|
|
|
+ group: 'group',
|
|
|
+ fieldType: 'fieldType',
|
|
|
+ groupBy: 'groupBy',
|
|
|
+ children:'children'
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
+ // let params = ['patent']
|
|
|
+ // 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',
|
|
|
+ // // })
|
|
|
+ // }
|
|
|
+ // })
|
|
|
},
|
|
|
//检索
|
|
|
- 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 = this.$commonJS.ArrayToArray(val)
|
|
|
- // 调用查询接口
|
|
|
+ // 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 = this.$commonJS.ArrayToArray(val)
|
|
|
+ // // 调用查询接口
|
|
|
+ // this.queryParams.current = 1
|
|
|
+ // this.getList()
|
|
|
+ // },
|
|
|
+ search({ searchStr, customFields }) {
|
|
|
+ this.searchOption = searchStr
|
|
|
this.queryParams.current = 1
|
|
|
this.getList()
|
|
|
},
|
|
@@ -240,18 +279,20 @@ export default {
|
|
|
// ...this.oldSearchOption,
|
|
|
// ...this.searchOption
|
|
|
// }
|
|
|
- var searchOption1 = this.searchOption
|
|
|
- if(this.searchOption.constructor == Object){
|
|
|
- searchOption1 = this.$commonJS.objectToArray(this.searchOption)
|
|
|
- }
|
|
|
- if(this.oldSearchOption.constructor == Object){
|
|
|
- oldSearchOption = this.$commonJS.objectToArray(this.oldSearchOption)
|
|
|
- }
|
|
|
- let searchOption = [
|
|
|
- ...oldSearchOption,//固有检索字段
|
|
|
- ...searchOption1
|
|
|
- ]
|
|
|
- var searchStr = this.$commonJS.objectToString(searchOption)
|
|
|
+ // var searchOption1 = this.searchOption
|
|
|
+ // if(this.searchOption.constructor == Object){
|
|
|
+ // searchOption1 = this.$commonJS.objectToArray(this.searchOption)
|
|
|
+ // }
|
|
|
+ // if(this.oldSearchOption.constructor == Object){
|
|
|
+ // oldSearchOption = this.$commonJS.objectToArray(this.oldSearchOption)
|
|
|
+ // }
|
|
|
+ // let searchOption = [
|
|
|
+ // // ...oldSearchOption,//固有检索字段
|
|
|
+ // ...searchOption1
|
|
|
+ // ]
|
|
|
+ // var str = this.$commonJS.objectToString(searchOption)
|
|
|
+ // var searchStr = (this.oldSearchOption?(' AND ' + (this.oldSearchOption)):'')
|
|
|
+ var searchStr = this.searchOption + ((this.searchOption && this.oldSearchOption)?' AND ':'') + (this.oldSearchOption || '')
|
|
|
var patentNoStr = ''
|
|
|
this.patentNos.forEach((item, index) =>{
|
|
|
if (index == 0) {
|
|
@@ -267,13 +308,17 @@ export default {
|
|
|
customFields: this.customFields,
|
|
|
orderDTOList: this.sort,//排序信息
|
|
|
}
|
|
|
+ this.loading = true
|
|
|
this.$api.QueryPatent(params).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.tableData = res.data.data
|
|
|
this.total = res.data.total
|
|
|
+ this.loading = false
|
|
|
}
|
|
|
}).catch(error => {
|
|
|
+ this.tableData = []
|
|
|
this.total = 0
|
|
|
+ this.loading = false
|
|
|
})
|
|
|
},
|
|
|
},
|