|
@ -41,34 +41,53 @@ |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div v-else class="advanced-search"> |
|
|
<div v-else class="advanced-search"> |
|
|
<el-form ref="form" inline :model="form" :rules="rules" size="small" label-width="100px"> |
|
|
|
|
|
<el-form-item label="字段名" prop="filedName"> |
|
|
|
|
|
<el-select v-model="form.filedName" placeholder="请选择"> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="item in filedOptions" |
|
|
|
|
|
:key="item.value" |
|
|
|
|
|
:label="item.label" |
|
|
|
|
|
:value="item.value" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="运算符" prop="symbol"> |
|
|
|
|
|
<el-select v-model="form.symbol" placeholder="请选择"> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="item in symbolOptions" |
|
|
|
|
|
:key="item.value" |
|
|
|
|
|
:label="item.label" |
|
|
|
|
|
:value="item.value" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="检索值" prop="keyWord"> |
|
|
|
|
|
<el-input v-model="form.keyWord" /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-form> |
|
|
|
|
|
<div> |
|
|
|
|
|
<el-button size="mini"><i class="iconfont icon-xinzeng" />新增</el-button> |
|
|
|
|
|
<el-button class="filter-item filter-refresh" size="mini" type="warning" icon="el-icon-refresh-left">重置</el-button> |
|
|
|
|
|
|
|
|
<div class="advanced-search-main"> |
|
|
|
|
|
<el-form ref="form" inline :model="form" :rules="rules" size="small" label-width="70px"> |
|
|
|
|
|
<el-form-item label="字段名" prop="field"> |
|
|
|
|
|
<el-select v-model="form.field" value-key="id"> |
|
|
|
|
|
<el-option v-for="item in fieldOptions" :key="item.id" :label="item.label" :value="item" /> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="运算符" prop="symbol"> |
|
|
|
|
|
<el-select v-model="form.symbol" value-key="value" placeholder="请选择"> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="item in symbolOptions" |
|
|
|
|
|
:key="item.value" |
|
|
|
|
|
:label="item.label" |
|
|
|
|
|
:value="item" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="检索值" prop="keyWord" :rules="getKeywordRules"> |
|
|
|
|
|
<el-input v-model="form.keyWord" /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-form> |
|
|
|
|
|
<div class="advanced-btn"> |
|
|
|
|
|
<el-button size="mini" @click="addConditionData"><i class="iconfont icon-xinzeng" />新增</el-button> |
|
|
|
|
|
<el-button class="filter-refresh" size="mini" icon="el-icon-refresh-left">重置</el-button> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="search-condition"> |
|
|
|
|
|
<h4> 检索条件</h4> |
|
|
|
|
|
<div class="condition-main"> |
|
|
|
|
|
<div class="condition-left"> |
|
|
|
|
|
<el-button size="mini" :disabled="currentIndex===null"><i class="iconfont icon-shanchu" />删除</el-button> |
|
|
|
|
|
<el-button size="mini" icon="el-icon-top" :disabled="currentIndex === 0" @click="moveUp(currentIndex)">上移</el-button> |
|
|
|
|
|
<el-button size="mini" icon="el-icon-bottom" :disabled="currentIndex === conditionData.length - 1" @click="moveDown(currentIndex)">下移</el-button> |
|
|
|
|
|
</div> |
|
|
|
|
|
<ul class="condition-content"> |
|
|
|
|
|
<li v-for="(item, index) in conditionData" :key="index" :class="currentIndex===index ? 'active': ''" @click="selectCurrent(index)"> |
|
|
|
|
|
{{ item }} |
|
|
|
|
|
</li> |
|
|
|
|
|
</ul> |
|
|
|
|
|
<div class="condition-right"> |
|
|
|
|
|
<el-button v-for="(item,index) in connectorList" :key="index" type="primary" size="mini" @click="addConnector(item)">{{ item }}</el-button> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="adv-bottom"> |
|
|
|
|
|
<el-button slot="append" @click="handleAdvancedSearch"><i class="iconfont icon-sousuo" />搜索</el-button> |
|
|
|
|
|
<div class="advanced-search-btn" @click="isCommon=!isCommon">普通检索</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
@ -78,6 +97,7 @@ |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script > |
|
|
<script > |
|
|
|
|
|
import { FetchFindGroupType } from '@/api/system/field' |
|
|
export default { |
|
|
export default { |
|
|
name: 'ArchiveSearch', |
|
|
name: 'ArchiveSearch', |
|
|
data() { |
|
|
data() { |
|
@ -85,34 +105,143 @@ export default { |
|
|
isCommon: true, |
|
|
isCommon: true, |
|
|
keywords: '', |
|
|
keywords: '', |
|
|
form: { |
|
|
form: { |
|
|
filedName: null, |
|
|
|
|
|
|
|
|
field: null, |
|
|
symbol: null, |
|
|
symbol: null, |
|
|
keyWord: null |
|
|
keyWord: null |
|
|
}, |
|
|
}, |
|
|
filedOptions: [], |
|
|
|
|
|
symbolOptions: [], |
|
|
|
|
|
|
|
|
fieldOptions: [], |
|
|
|
|
|
symbolOptions: [ |
|
|
|
|
|
{ |
|
|
|
|
|
label: '包含', |
|
|
|
|
|
value: 'like' |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
label: '不包含', |
|
|
|
|
|
value: 'not like' |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
label: '等于', |
|
|
|
|
|
value: '=' |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
label: '不等于', |
|
|
|
|
|
value: '!=' |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
label: '为空', |
|
|
|
|
|
value: 'is null' |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
label: '不为空', |
|
|
|
|
|
value: 'is not null' |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
label: '大于', |
|
|
|
|
|
value: '>' |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
label: '大于等于', |
|
|
|
|
|
value: '>=' |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
label: '小于', |
|
|
|
|
|
value: '<' |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
label: '小于等于', |
|
|
|
|
|
value: '<=' |
|
|
|
|
|
} |
|
|
|
|
|
], |
|
|
rules: { |
|
|
rules: { |
|
|
filedName: [ |
|
|
|
|
|
|
|
|
field: [ |
|
|
{ required: true, message: '请选择字段名', trigger: 'change' } |
|
|
{ required: true, message: '请选择字段名', trigger: 'change' } |
|
|
], |
|
|
], |
|
|
symbol: [ |
|
|
symbol: [ |
|
|
{ required: true, message: '请选择运算符', trigger: 'change' } |
|
|
{ required: true, message: '请选择运算符', trigger: 'change' } |
|
|
], |
|
|
|
|
|
keyWord: [ |
|
|
|
|
|
{ required: true, message: '检索值不可为空', trigger: 'blur' } |
|
|
|
|
|
] |
|
|
] |
|
|
|
|
|
}, |
|
|
|
|
|
conditionData: [], |
|
|
|
|
|
currentIndex: null, |
|
|
|
|
|
connectorList: ['并且', '或者', '(', ')'] |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
computed: { |
|
|
|
|
|
getKeywordRules() { |
|
|
|
|
|
console.log(this.form.symbol) |
|
|
|
|
|
if ((this.form.symbol && this.form.symbol.label === '为空') || (this.form.symbol && this.form.symbol.label === '不为空')) { |
|
|
|
|
|
console.log('2222') |
|
|
|
|
|
return [] |
|
|
|
|
|
} else { |
|
|
|
|
|
return [{ required: true, message: '请输入检索值', trigger: 'blur' }] |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
mounted() { |
|
|
mounted() { |
|
|
|
|
|
|
|
|
|
|
|
this.getFieldCommon() |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
dimSearch() { |
|
|
|
|
|
|
|
|
addConditionData() { |
|
|
|
|
|
this.$refs.form.validate((valid) => { |
|
|
|
|
|
if (valid) { |
|
|
|
|
|
let str = '' |
|
|
|
|
|
if ((this.form.symbol && this.form.symbol.label === '包含') || (this.form.symbol && this.form.symbol.label === '不包含')) { |
|
|
|
|
|
str = `<span style="color:blue">${this.form.field.label}</span> <span style="color:green">${this.form.symbol.label}</span> "%" + <span style="color:red">${this.form.keyWord}</span> + "%"` |
|
|
|
|
|
// str = this.form.field.label + ' ' + this.form.symbol.label + " '%" + this.form.keyWord + "%'" |
|
|
|
|
|
} else { |
|
|
|
|
|
str = `<span style="color:blue">${this.form.field.label}</span> <span style="color:green">${this.form.symbol.label}</span> <span style="color:red">${this.form.keyWord}</span>` |
|
|
|
|
|
// str = this.form.field.label + ' ' + this.form.symbol.label + ' ' + this.form.keyWord |
|
|
|
|
|
} |
|
|
|
|
|
this.conditionData.push(str) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
moveUp(index) { |
|
|
|
|
|
if (index > 0) { |
|
|
|
|
|
// [this.conditionData[index], this.conditionData[index - 1]] = [this.conditionData[index - 1], this.conditionData[index]] |
|
|
|
|
|
const temp = this.conditionData[index] |
|
|
|
|
|
this.conditionData[index] = this.conditionData[index - 1] |
|
|
|
|
|
this.conditionData[index - 1] = temp |
|
|
|
|
|
this.currentIndex = index - 1 |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
moveDown(index) { |
|
|
|
|
|
if (index < this.conditionData.length - 1) { |
|
|
|
|
|
// [this.conditionData[index], this.conditionData[index + 1]] = [this.conditionData[index + 1], this.conditionData[index]] |
|
|
|
|
|
const temp = this.conditionData[index] |
|
|
|
|
|
this.conditionData[index] = this.conditionData[index + 1] |
|
|
|
|
|
this.conditionData[index + 1] = temp |
|
|
|
|
|
this.currentIndex = index + 1 |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
selectCurrent(index) { |
|
|
|
|
|
if (this.currentIndex === index) { |
|
|
|
|
|
this.currentIndex = null |
|
|
|
|
|
} else { |
|
|
|
|
|
this.currentIndex = index |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
addConnector(item) { |
|
|
|
|
|
this.conditionData.push(item) |
|
|
|
|
|
}, |
|
|
|
|
|
getFieldCommon() { |
|
|
|
|
|
FetchFindGroupType({ isType: 2 }).then((res) => { |
|
|
|
|
|
if (res.length !== 0) { |
|
|
|
|
|
this.fieldOptions = res.map((item, index) => { |
|
|
|
|
|
const json = {} |
|
|
|
|
|
json.id = item.id |
|
|
|
|
|
json.label = item.fieldCnName |
|
|
|
|
|
json.value = item.fieldName |
|
|
|
|
|
return json |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
handleAdvancedSearch() { |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
dimSearch() { |
|
|
}, |
|
|
}, |
|
|
handleSearch() { |
|
|
handleSearch() { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -273,14 +402,115 @@ export default { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.advanced-search{ |
|
|
|
|
|
|
|
|
.advanced-search-main{ |
|
|
position: relative; |
|
|
position: relative; |
|
|
width: 1010px; |
|
|
width: 1010px; |
|
|
height: 350px; |
|
|
|
|
|
|
|
|
// height: 350px; |
|
|
margin: 0 auto; |
|
|
margin: 0 auto; |
|
|
|
|
|
padding: 30px 40px; |
|
|
background-color: #fff; |
|
|
background-color: #fff; |
|
|
border-radius: 3px; |
|
|
border-radius: 3px; |
|
|
z-index: 9999; |
|
|
z-index: 9999; |
|
|
|
|
|
::v-deep .el-form--inline .el-form-item{ |
|
|
|
|
|
margin-right: 40px !important; |
|
|
|
|
|
} |
|
|
|
|
|
.advanced-btn{ |
|
|
|
|
|
display: flex; |
|
|
|
|
|
justify-content: center; |
|
|
|
|
|
text-align: center; |
|
|
|
|
|
.el-button{ |
|
|
|
|
|
margin-top: 0; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
.search-condition{ |
|
|
|
|
|
padding: 18px 0 24px 0; |
|
|
|
|
|
margin-top: 20px; |
|
|
|
|
|
background: #F6F9FF; |
|
|
|
|
|
border-radius: 3px; |
|
|
|
|
|
opacity: 1; |
|
|
|
|
|
border: 1px dashed #DCDFE6; |
|
|
|
|
|
h4{ |
|
|
|
|
|
width: 480px; |
|
|
|
|
|
margin: 0 auto 17px auto; |
|
|
|
|
|
padding-left: 33px; |
|
|
|
|
|
color: #0C0E1E; |
|
|
|
|
|
background: url('~@/assets/images/archives/icon-js.png') no-repeat left center; |
|
|
|
|
|
background-size: 33px 28px; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
.condition-main{ |
|
|
|
|
|
display: flex; |
|
|
|
|
|
justify-content: center; |
|
|
|
|
|
flex-wrap: nowrap; |
|
|
|
|
|
.condition-left{ |
|
|
|
|
|
display: flex; |
|
|
|
|
|
flex-direction: column; |
|
|
|
|
|
justify-content: center; |
|
|
|
|
|
.el-button{ |
|
|
|
|
|
width: 76px; |
|
|
|
|
|
margin: 5px 0; |
|
|
|
|
|
::v-deep i.el-icon-top, |
|
|
|
|
|
::v-deep i.el-icon-bottom{ |
|
|
|
|
|
font-size: 16px; |
|
|
|
|
|
font-weight: bold; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
.condition-content{ |
|
|
|
|
|
width: 480px; |
|
|
|
|
|
height: 160px; |
|
|
|
|
|
margin: 0 10px; |
|
|
|
|
|
background: #E6E8ED; |
|
|
|
|
|
overflow: hidden; |
|
|
|
|
|
overflow-y: scroll; |
|
|
|
|
|
li{ |
|
|
|
|
|
height: 32px; |
|
|
|
|
|
line-height: 32px; |
|
|
|
|
|
font-size: 14px; |
|
|
|
|
|
text-align: center; |
|
|
|
|
|
background-color: #fff; |
|
|
|
|
|
border-bottom: 1px solid #E6E8ED; |
|
|
|
|
|
cursor: default; |
|
|
|
|
|
&:hover, |
|
|
|
|
|
&:focus, |
|
|
|
|
|
&.active{ |
|
|
|
|
|
background-color: #E8F2FF; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
.condition-right{ |
|
|
|
|
|
display: flex; |
|
|
|
|
|
flex-direction: column; |
|
|
|
|
|
justify-content: center; |
|
|
|
|
|
.el-button{ |
|
|
|
|
|
width: 64px; |
|
|
|
|
|
margin: 5px 0; |
|
|
|
|
|
background-color: #0348F3; |
|
|
|
|
|
color: #fff; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.adv-bottom{ |
|
|
|
|
|
position: relative; |
|
|
|
|
|
display: flex; |
|
|
|
|
|
flex-direction: column; |
|
|
|
|
|
align-items: center; |
|
|
|
|
|
margin: 31px auto 0 auto; |
|
|
|
|
|
width: 96px; |
|
|
|
|
|
z-index: 999999; |
|
|
|
|
|
.el-button{ |
|
|
|
|
|
font-size: 16px; |
|
|
|
|
|
background-color: #0348F3; |
|
|
|
|
|
color: #fff; |
|
|
|
|
|
} |
|
|
|
|
|
.advanced-search-btn{ |
|
|
|
|
|
padding-top: 7px; |
|
|
|
|
|
font-size: 14px; |
|
|
|
|
|
color: #0348F3; |
|
|
|
|
|
cursor: default; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</style> |
|
|
</style> |