no message
This commit is contained in:
parent
4bbb43dcfe
commit
4f39e2597f
@ -4,10 +4,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<slot :filterLength="filterObjLength" :openFilter="openFilter">
|
<slot :filterLength="filterObjLength" :openFilter="openFilter">
|
||||||
<el-badge :value="filterObjLength" type="danger" :hidden="filterObjLength<=0">
|
<el-badge :value="filterObjLength" type="danger" :hidden="filterObjLength<=0">
|
||||||
<el-button icon="el-icon-filter" @click="openFilter"></el-button>
|
<el-button icon="el-icon-filter" @click="openFilter" v-if="filtermoreLength"></el-button>
|
||||||
</el-badge>
|
</el-badge>
|
||||||
<div class="right-panel-search" v-if="filter.length>0">
|
<div class="right-panel-search" v-if="filter.length>0">
|
||||||
<el-form :inline="true" :model="data">
|
<el-form ref="form" :inline="true" :model="data" @submit.prevent="ok">
|
||||||
<el-form-item :style="{ 'margin-bottom': '0px', 'margin-right': '6px', 'width': getWidth(i) }" v-for="(i,index) in fieldTop" :key="index">
|
<el-form-item :style="{ 'margin-bottom': '0px', 'margin-right': '6px', 'width': getWidth(i) }" v-for="(i,index) in fieldTop" :key="index">
|
||||||
<x-item :item="i" v-model="data"></x-item>
|
<x-item :item="i" v-model="data"></x-item>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -96,6 +96,7 @@
|
|||||||
defaultValue: Object.assign({}, this.modelValue),
|
defaultValue: Object.assign({}, this.modelValue),
|
||||||
defaultField: [].concat(this.options),
|
defaultField: [].concat(this.options),
|
||||||
filterObjLength: 0,
|
filterObjLength: 0,
|
||||||
|
filtermoreLength: 0,
|
||||||
saveLoading: false,
|
saveLoading: false,
|
||||||
data: this.modelValue,
|
data: this.modelValue,
|
||||||
optionsList: [],
|
optionsList: [],
|
||||||
@ -131,12 +132,21 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted(){
|
mounted(){
|
||||||
|
|
||||||
|
|
||||||
//默认显示的过滤项
|
//默认显示的过滤项
|
||||||
this.fields.forEach((item) => {
|
this.fields.forEach((item) => {
|
||||||
|
|
||||||
|
|
||||||
if(item.selected){
|
if(item.selected){
|
||||||
|
item.options.placeholder = item.options.placeholder ? item.options.placeholder : item.label;
|
||||||
|
item.options.clearable = true;
|
||||||
this.fieldTop.push(item)
|
this.fieldTop.push(item)
|
||||||
item.value = item.name;
|
item.value = item.name;
|
||||||
this.filter.push(item)
|
this.filter.push(item)
|
||||||
|
}else{
|
||||||
|
|
||||||
|
this.filtermoreLength++
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.optionsList = [].concat(this.fields);
|
this.optionsList = [].concat(this.fields);
|
||||||
|
@ -12,12 +12,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<!-- checkbox -->
|
<!-- checkbox -->
|
||||||
<template v-else-if="item.component=='checkbox'">
|
<template v-else-if="item.component=='checkbox'">
|
||||||
<template v-if="item.name" >
|
<el-checkbox v-model="data[item.name]" :label="_item.value" v-for="(_item, _index) in item.options.items" :key="_index">{{ _item.label }}</el-checkbox>
|
||||||
<el-checkbox v-model="data[item.name][_item.name]" :label="_item.label" v-for="(_item, _index) in item.options.items" :key="_index"></el-checkbox>
|
|
||||||
</template>
|
|
||||||
<template v-else >
|
|
||||||
<el-checkbox v-model="data[_item.name]" :label="_item.label" v-for="(_item, _index) in item.options.items" :key="_index"></el-checkbox>
|
|
||||||
</template>
|
|
||||||
</template>
|
</template>
|
||||||
<!-- radio -->
|
<!-- radio -->
|
||||||
<template v-else-if="item.component=='radio'">
|
<template v-else-if="item.component=='radio'">
|
||||||
|
@ -18,6 +18,16 @@
|
|||||||
<p v-else-if="item.columntype=='input'">
|
<p v-else-if="item.columntype=='input'">
|
||||||
<input class="el-input__inner" type="text" readonly :value="row[item.name]">
|
<input class="el-input__inner" type="text" readonly :value="row[item.name]">
|
||||||
</p>
|
</p>
|
||||||
|
<p v-else-if="item.columntype=='button' && item.options.items && item.options.items.length>0">
|
||||||
|
<el-button v-for="op in item.options.items" :key="op.value" :type="op.type || 'warning'" style="margin: 0;" :size="op.size || 'small'" :icon="op.icon" v-show="op.value==row[item.name]">
|
||||||
|
{{ op.label }}
|
||||||
|
</el-button>
|
||||||
|
</p>
|
||||||
|
<p v-else-if="item.columntype=='button'">
|
||||||
|
<el-button :type="item.options.type || 'warning'" :size="item.options.size || 'small'" :icon="item.options.icon">
|
||||||
|
{{ row[item.name] }}
|
||||||
|
</el-button>
|
||||||
|
</p>
|
||||||
<slot v-else-if="item.columntype=='select'" :name="item.name" v-bind="scope">
|
<slot v-else-if="item.columntype=='select'" :name="item.name" v-bind="scope">
|
||||||
<p style="overflow:hidden; white-space: nowrap; text-overflow: ellipsis; -o-text-overflow:ellipsis;" :title="row[item.name]">
|
<p style="overflow:hidden; white-space: nowrap; text-overflow: ellipsis; -o-text-overflow:ellipsis;" :title="row[item.name]">
|
||||||
{{ getNameByValue( row[item.name], item.options.items) }}
|
{{ getNameByValue( row[item.name], item.options.items) }}
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
<el-switch v-model="item.sortable"></el-switch>
|
<el-switch v-model="item.sortable"></el-switch>
|
||||||
</span>
|
</span>
|
||||||
<span class="tabletype">
|
<span class="tabletype">
|
||||||
<el-select v-model="item.columntype" size="small" placeholder="选择">
|
<el-select v-model="item.columntype" size="small" :teleported="false" placeholder="选择">
|
||||||
<el-option value="" key="" label=""> 请选择 </el-option>
|
<el-option value="" key="" label=""> 请选择 </el-option>
|
||||||
<el-option value="avatar" key="avatar" label="用户"> 用户 </el-option>
|
<el-option value="avatar" key="avatar" label="用户"> 用户 </el-option>
|
||||||
<el-option value="badge" key="badge" label="徽章"> 徽章 </el-option>
|
<el-option value="badge" key="badge" label="徽章"> 徽章 </el-option>
|
||||||
@ -44,7 +44,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</span>
|
</span>
|
||||||
<span class="tabletype">
|
<span class="tabletype">
|
||||||
<el-select v-model="item.component" size="small" placeholder="选择">
|
<el-select v-model="item.component" size="small" :teleported="false" placeholder="选择">
|
||||||
<el-option value="" key="" label=""> 请选择 </el-option>
|
<el-option value="" key="" label=""> 请选择 </el-option>
|
||||||
<el-option value="input" key="input" label="Input"> Input </el-option>
|
<el-option value="input" key="input" label="Input"> Input </el-option>
|
||||||
<el-option value="title" key="title" label="标题占位"> 标题占位 </el-option>
|
<el-option value="title" key="title" label="标题占位"> 标题占位 </el-option>
|
||||||
|
@ -171,7 +171,7 @@
|
|||||||
|
|
||||||
if(mode=='edit'){
|
if(mode=='edit'){
|
||||||
if (data) {
|
if (data) {
|
||||||
this.$refs.table.tableData.filter(item => item.id===data.id ).forEach(item => {
|
this.$refs.table.tableData.filter(item => item[this.key]===data[this.key] ).forEach(item => {
|
||||||
Object.assign(item, data, data)
|
Object.assign(item, data, data)
|
||||||
})
|
})
|
||||||
}else{
|
}else{
|
||||||
|
Loading…
Reference in New Issue
Block a user