|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div style="width: 550px;">
|
|
|
+ <div class="searchPatent">
|
|
|
<div style="display: flex;align-items: center;">
|
|
|
<el-cascader :options="options" @change="cascaderChange" :show-all-levels="false" size="small"
|
|
|
style="width: 150px;"></el-cascader>
|
|
@@ -8,36 +8,42 @@
|
|
|
<el-input v-if="!isControl.select" v-model="inputValue" size="small"
|
|
|
:placeholder="isControl.placeholder"></el-input>
|
|
|
<el-select v-else v-model="inputValue" placeholder="请选择" size="small">
|
|
|
- <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
|
|
|
+ <el-option v-for="item in typeStatus[isControl.selectCheck]" :key="item.value" :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</div>
|
|
|
<el-button @click="search" type="primary" size="small">检索</el-button>
|
|
|
|
|
|
- <el-popover placement="bottom" width="260" trigger="click">
|
|
|
- <div v-for="(item, index) in searchStorageText" :key="item.value">
|
|
|
- <div style="margin-bottom:10px;background:#F0F9EB">
|
|
|
- <span>{{ item.label }}</span>
|
|
|
- <span> = </span>
|
|
|
- <template v-if="item.type == 'Array'">
|
|
|
- <span>(</span>
|
|
|
- <template v-if="item.filedKind == 0">
|
|
|
- <span v-for="(result, i) in item.checkName" :key="result" @click="resultBtn(item, index, i)">{{ result
|
|
|
- }}<i class="el-icon-close"></i>
|
|
|
- <b v-if="item.checkName.length - 1 > i"> OR </b>
|
|
|
- </span></template>
|
|
|
+ <el-popover placement="bottom" v-if="searchStorageText.length > 0" width="260" trigger="click">
|
|
|
+ <div style="height: 200px;overflow-x: auto;">
|
|
|
+ <div v-for="(item, index) in searchStorageText" :key="item.value">
|
|
|
+ <div style="margin-bottom:10px;background:#F0F9EB;padding: 10px 5px;">
|
|
|
+ <span>{{ item.label }}</span>
|
|
|
+ <span> = </span>
|
|
|
+ <template v-if="Array.isArray(item.inputValue)">
|
|
|
+ <span>(</span>
|
|
|
+ <template v-if="item.filedKind == 0">
|
|
|
+ <span v-for="(result, i) in item.checkName" :key="result" @click="resultBtn(item, index, i)"
|
|
|
+ style="cursor: pointer;">{{ result
|
|
|
+ }}<i class="el-icon-close"></i>
|
|
|
+ <b v-if="item.checkName.length - 1 > i"> OR </b>
|
|
|
+ </span></template>
|
|
|
+ <template v-else>
|
|
|
+ <span v-for="(result, i) in item.inputValue" :key="result" @click="resultBtn(item, index, i)"
|
|
|
+ style="cursor: pointer;">{{ result
|
|
|
+ }}<i class="el-icon-close"></i>
|
|
|
+ <b v-if="item.inputValue.length - 1 > i"> OR </b>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ <span>)</span>
|
|
|
+ <!-- <span>({{ item.result.join(' OR ') }})</span> -->
|
|
|
+ </template>
|
|
|
<template v-else>
|
|
|
- <span v-for="(result, i) in item.inputValue" :key="result" @click="resultBtn(item, index, i)">{{ result
|
|
|
- }}<i class="el-icon-close"></i>
|
|
|
- <b v-if="item.inputValue.length - 1 > i"> OR </b>
|
|
|
- </span>
|
|
|
+ <span @click="resultBtn(item, index, 0)" style="cursor: pointer;">({{ item.inputValue }})<i
|
|
|
+ class="el-icon-close"></i></span>
|
|
|
</template>
|
|
|
- <span>)</span>
|
|
|
- <!-- <span>({{ item.result.join(' OR ') }})</span> -->
|
|
|
- </template>
|
|
|
- <template v-else>
|
|
|
- <span @click="resultBtn(item, index, 0)">{{ item.inputValue }}<i class="el-icon-close"></i></span>
|
|
|
- </template>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
@@ -105,6 +111,27 @@ export default {
|
|
|
{ value: 'locLevel2', label: 'LOC小类' },
|
|
|
],
|
|
|
},
|
|
|
+ // 类型及状态
|
|
|
+ typeStatus: {
|
|
|
+ //法律状态暂定
|
|
|
+ LG: [
|
|
|
+ { value: '1', label: '有效' },
|
|
|
+ { value: '2', label: '无效' },
|
|
|
+ { value: '3', label: '审中' },
|
|
|
+ ],
|
|
|
+ //专利类型
|
|
|
+ PT: [
|
|
|
+ { value: '1 OR 8', label: '发明' },
|
|
|
+ { value: '2 OR 9', label: '实用新型' },
|
|
|
+ { value: '3', label: '外观' },
|
|
|
+ ],
|
|
|
+ //专利状态
|
|
|
+ SS: [
|
|
|
+ { value: '1', label: '有效' },
|
|
|
+ { value: '2', label: '无效' },
|
|
|
+ { value: '3', label: '审中' },
|
|
|
+ ],
|
|
|
+ },
|
|
|
// 控制检索式弹窗显示
|
|
|
dialogVisible: false,
|
|
|
// 选择的cascader
|
|
@@ -131,9 +158,6 @@ export default {
|
|
|
methods: {
|
|
|
// 点击检索式中的检索条件
|
|
|
resultBtn(item, index, i) {
|
|
|
- // console.log('点击率', item, index, i);
|
|
|
- // console.log(item);
|
|
|
- // return
|
|
|
if (Array.isArray(item.inputValue)) {
|
|
|
item.inputValue.splice(i, 1)
|
|
|
if (this.searchStorageText[index].inputValue.length == 0) {
|
|
@@ -145,9 +169,8 @@ export default {
|
|
|
spliceName = 'searchPatentCheck'
|
|
|
}
|
|
|
this[spliceName].splice(index, 1)
|
|
|
- // console.log(this.searchStorage, this.searchPatentCheck);
|
|
|
}
|
|
|
- if (item.checkName && item.checkName.length > 0) {
|
|
|
+ if (item.checkName && item.checkName.length > 0) {//统计自定义字段
|
|
|
item.checkName.splice(i, 1)
|
|
|
}
|
|
|
} else {
|
|
@@ -170,6 +193,7 @@ export default {
|
|
|
},
|
|
|
// cascader变化事件
|
|
|
cascaderChange(val) {
|
|
|
+ this.inputValue = ''
|
|
|
let a = this.options.find(item => {
|
|
|
return item.value == val[0]
|
|
|
})
|
|
@@ -182,6 +206,7 @@ export default {
|
|
|
}
|
|
|
if (val[0] == 'typeStatus') {
|
|
|
this.$set(this.isControl, 'select', true)
|
|
|
+ this.$set(this.isControl, 'selectCheck', val[val.length - 1])
|
|
|
}
|
|
|
},
|
|
|
// 存储条件
|
|
@@ -193,7 +218,6 @@ export default {
|
|
|
},
|
|
|
getSearchOptionData() {
|
|
|
var data = []
|
|
|
- // console.log(this.searchStorage, this.searchPatentCheck);
|
|
|
this.searchStorage.forEach(item => {
|
|
|
data.push(
|
|
|
{
|
|
@@ -207,7 +231,6 @@ export default {
|
|
|
)
|
|
|
})
|
|
|
this.searchPatentCheck.forEach(item => {
|
|
|
- console.log(item);
|
|
|
var type = 1
|
|
|
data.push(
|
|
|
{
|
|
@@ -223,7 +246,6 @@ export default {
|
|
|
)
|
|
|
})
|
|
|
this.searchStorageText = data
|
|
|
- console.log(this.searchStorageText);
|
|
|
return data
|
|
|
},
|
|
|
// 页面检索按钮
|
|
@@ -239,10 +261,11 @@ export default {
|
|
|
// 处理检索条件
|
|
|
getSearchStorage() {
|
|
|
let customFields = []
|
|
|
- // console.log(this.searchStorageText);
|
|
|
+ let count = 0
|
|
|
this.searchStorageText.forEach((item, index) => {
|
|
|
if (item.group == 'nos') {
|
|
|
- if (index == 0) {
|
|
|
+ if (count == 0) {
|
|
|
+ count++
|
|
|
if (Array.isArray(item.inputValue)) {
|
|
|
this.searchStr = `${item.value} = (${item.inputValue.join(' OR ')})`
|
|
|
} else {
|
|
@@ -250,6 +273,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
+ count++
|
|
|
if (Array.isArray(item.inputValue)) {
|
|
|
this.searchStr += ` AND ${item.value} = (${item.inputValue.join(' OR ')})`
|
|
|
} else {
|
|
@@ -259,12 +283,15 @@ export default {
|
|
|
} else {
|
|
|
let a = {
|
|
|
fieldId: item.value,
|
|
|
- value: item.filedKind ? item.inputValue : [this.inputValue],
|
|
|
+ value: (item.filedKind == 0 || item.filedKind) ? item.inputValue : [this.inputValue],
|
|
|
}
|
|
|
customFields.push(a)
|
|
|
}
|
|
|
})
|
|
|
- // console.log(this.searchStr,this.searchStorage,this.searchPatentCheck);
|
|
|
+ if (this.searchStorageText==0) {
|
|
|
+ this.searchStr = ''
|
|
|
+ }
|
|
|
+ // console.log(this.searchStr,customFields,this.searchStorage,this.searchPatentCheck,this.searchStorageText);
|
|
|
this.$emit('searchValue', { searchStr: this.searchStr, customFields: customFields, })
|
|
|
},
|
|
|
|
|
@@ -316,7 +343,6 @@ export default {
|
|
|
children: [data[i]]
|
|
|
}
|
|
|
}
|
|
|
- // console.log(filedObj);
|
|
|
}
|
|
|
}
|
|
|
this.options = Object.values(filedObj)
|
|
@@ -325,4 +351,8 @@ export default {
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
-<style lang="scss" scoped></style>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.searchPatent {
|
|
|
+ width: 550px;
|
|
|
+}
|
|
|
+</style>
|