完善检索封装
This commit is contained in:
parent
cfe3bba57f
commit
be2c2a6b12
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Descripttion: 关键字组件
|
* @Descripttion: 输入框全等于检索组件
|
||||||
* @Author: 龙运模
|
* @Author: 龙运模
|
||||||
* @Date: 2024年07月11日
|
* @Date: 2024年07月11日
|
||||||
* @LastEditors: 龙运模
|
* @LastEditors: 龙运模
|
||||||
|
|||||||
64
src/components/scInput/inputVague.vue
Normal file
64
src/components/scInput/inputVague.vue
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
<!--
|
||||||
|
* @Descripttion: 输入框模糊检索组件
|
||||||
|
* @Author: 龙运模
|
||||||
|
* @Date: 2024年07月11日
|
||||||
|
* @LastEditors: 龙运模
|
||||||
|
* @LastEditTime:
|
||||||
|
-->
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="scDatePicker">
|
||||||
|
<el-input v-bind="$attrs" class="input" v-model="localText" @input="textChange" :size="size" :placeholder="placeholder" clearable></el-input>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "inputVague",
|
||||||
|
props:{
|
||||||
|
activation_text: {
|
||||||
|
type: Object,
|
||||||
|
default: ()=>({ operator: "link", value: "" })
|
||||||
|
},
|
||||||
|
size:{ type: String, default: "small" },
|
||||||
|
placeholder:{type:String, default:"请输入关键字"},
|
||||||
|
},
|
||||||
|
watch:{
|
||||||
|
activation_text:{
|
||||||
|
handler(val){
|
||||||
|
if(val){
|
||||||
|
this.localText = val.value;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
deep:true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data(){
|
||||||
|
return{
|
||||||
|
localText:'',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
textChange(e){
|
||||||
|
this.localText = e;
|
||||||
|
this.emitActivationText();
|
||||||
|
},
|
||||||
|
emitActivationText() {
|
||||||
|
this.$emit('update:activation_text', {
|
||||||
|
operator: this.activation_text.operator,
|
||||||
|
value: this.localText? this.localText:""
|
||||||
|
});
|
||||||
|
this.$emit('fetchData');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.scDatePicker{
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -2,11 +2,11 @@
|
|||||||
<div v-for="item in columnList" :key="item">
|
<div v-for="item in columnList" :key="item">
|
||||||
<div class="searchItem" v-if="item.type == 'date'">
|
<div class="searchItem" v-if="item.type == 'date'">
|
||||||
<label class="name">{{item.name}}</label>
|
<label class="name">{{item.name}}</label>
|
||||||
<scDatePicker :size="size" v-model:activation_date="params.activation_date" start-placeholder="开始日期" end-placeholder="结束日期"></scDatePicker>
|
<scDatePicker :size="size" v-model:activation_date="params[item.code]" @visible-change="getSelect(item,$event)" start-placeholder="开始日期" end-placeholder="结束日期"></scDatePicker>
|
||||||
</div>
|
</div>
|
||||||
<div class="searchItem" v-if="item.type =='multiple'">
|
<div class="searchItem" v-if="item.type =='multiple'">
|
||||||
<label class="name">{{item.name}}</label>
|
<label class="name">{{item.name}}</label>
|
||||||
<scMultipleSelect :size="size" v-model:activation_select="params.id" @fetchData="getSelect(item,$event)" :placeholder="item.placeholder" multiple collapse-tags filterable clearable>
|
<scMultipleSelect :size="size" v-model:activation_select="params[item.code]" @fetchData="getSelect(item,$event)" :placeholder="item.placeholder" multiple collapse-tags filterable clearable>
|
||||||
<el-option v-for="em in item.data" :key="em" :label="em.full_name" :value="em.id"></el-option>
|
<el-option v-for="em in item.data" :key="em" :label="em.full_name" :value="em.id"></el-option>
|
||||||
</scMultipleSelect>
|
</scMultipleSelect>
|
||||||
</div>
|
</div>
|
||||||
@ -18,7 +18,17 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="searchItem" v-if="item.type == 'text'">
|
<div class="searchItem" v-if="item.type == 'text'">
|
||||||
<label class="name">{{item.name}}</label>
|
<label class="name">{{item.name}}</label>
|
||||||
<scInput class="input" v-model:activation_text="keywordParams" @fetchData="getText(item,$event)" :placeholder="item.placeholder" :size="size"></scInput>
|
<div v-if="item.keyword">
|
||||||
|
<scInput class="input" v-model:activation_text="keywordParams" @fetchData="getText(item,$event)" :placeholder="item.placeholder" :size="size"></scInput>
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
<div v-if="typeof item.code == 'string'">
|
||||||
|
<scInput class="input" v-model:activation_text="params[item.code]" @fetchData="getText(item,$event)" :placeholder="item.placeholder" :size="size"></scInput>
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
<scVgInput class="input" v-model:activation_text="params[item.code]" @fetchData="getText(item,$event)" :placeholder="item.placeholder" :size="size"></scVgInput>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -96,7 +106,7 @@ export default {
|
|||||||
grouped[item.code] = {};
|
grouped[item.code] = {};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (item.type === 'text') {
|
if (item.type === 'text' && Array.isArray(item.code)) {
|
||||||
item.code.forEach(code => {
|
item.code.forEach(code => {
|
||||||
if(!grouped[code]){
|
if(!grouped[code]){
|
||||||
grouped[code] = {};
|
grouped[code] = {};
|
||||||
@ -123,7 +133,7 @@ export default {
|
|||||||
operator:operator,
|
operator:operator,
|
||||||
value:operator=='link'?"":[]
|
value:operator=='link'?"":[]
|
||||||
}
|
}
|
||||||
grouped[item.code] = operator==''?"":params;
|
grouped[item.code] = operator=='' || operator== 'link'?"":params;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return grouped
|
return grouped
|
||||||
|
|||||||
@ -24,6 +24,7 @@ import ossImgListUpload from "./components/scUpload/uploadListImg";
|
|||||||
import scDatePicker from "./components/scDatePicker";
|
import scDatePicker from "./components/scDatePicker";
|
||||||
import scMultipleSelect from "./components/scMultipleSelect";
|
import scMultipleSelect from "./components/scMultipleSelect";
|
||||||
import scInput from "./components/scInput";
|
import scInput from "./components/scInput";
|
||||||
|
import scVgInput from "./components/scInput/inputVague";
|
||||||
import scSearch from "./components/scSearch";
|
import scSearch from "./components/scSearch";
|
||||||
|
|
||||||
import scStatusIndicator from './components/scMini/scStatusIndicator'
|
import scStatusIndicator from './components/scMini/scStatusIndicator'
|
||||||
@ -73,6 +74,7 @@ export default {
|
|||||||
app.component('scDatePicker', scDatePicker);
|
app.component('scDatePicker', scDatePicker);
|
||||||
app.component('scMultipleSelect', scMultipleSelect);
|
app.component('scMultipleSelect', scMultipleSelect);
|
||||||
app.component('scInput', scInput);
|
app.component('scInput', scInput);
|
||||||
|
app.component('scVgInput', scVgInput);
|
||||||
app.component('scSearch', scSearch);
|
app.component('scSearch', scSearch);
|
||||||
|
|
||||||
//注册全局指令
|
//注册全局指令
|
||||||
|
|||||||
@ -77,9 +77,12 @@ export default {
|
|||||||
selection: [],
|
selection: [],
|
||||||
searchList:[
|
searchList:[
|
||||||
{name:'开通日期',type:'date',code:'activation_date'},
|
{name:'开通日期',type:'date',code:'activation_date'},
|
||||||
{name:'公司名称',type:'multiple',code:'id', data:[], placeholder:"请选择公司名称",},
|
{name:'公司名称',type:'multiple',code:'id', data:[], placeholder:"请选择公司名称"},
|
||||||
{name:'状态',type:'select',code:'active_status', data:[], placeholder:"请选择状态",},
|
{name:'状态',type:'select',code:'active_status', data:[], placeholder:"请选择状态"},
|
||||||
{name:'关键字',type:'text',code:['domain','name','address','owner','mobile'],keyword:true},
|
{name:'手机号',type:'text',code:'mobile',placeholder:"请输入手机号"},
|
||||||
|
{name:'公司地址',type:'text',code:['address'],placeholder:"请输入公司地址"},
|
||||||
|
{name:'负责人',type:'text',code:['owner'],placeholder:"请输入负责人"},
|
||||||
|
{name:'关键字',type:'text',code:['domain','name'],keyword:true},
|
||||||
],
|
],
|
||||||
params: {},
|
params: {},
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user