Commit c6659c80 by 姜雷

修改穿梭框中选择全部时功能错误

parent 2e004b3d
<template> <template>
<list-layout> <list-layout>
<ks-transfer <ks-transfer v-model="value" :list="list" />
v-model="value"
:list="list"
/>
</list-layout> </list-layout>
</template> </template>
...@@ -30,9 +27,8 @@ export default { ...@@ -30,9 +27,8 @@ export default {
label: '3223', label: '3223',
}, },
], ],
value: [], value: [1, 3],
}; };
}, },
}; };
</script> </script>
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
{ {
"name": "rym-element-ui", "name": "rym-element-ui",
"version": "0.1.47", "version": "0.1.48",
"description": "任意门组件库", "description": "任意门组件库",
"main": "lib/rymUi.common.js", "main": "lib/rymUi.common.js",
"scripts": { "scripts": {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="transfer-wrap"> <div class="transfer-wrap">
<div class="transfer-allData"> <div class="transfer-allData">
<div class="transfer-allData-filter"> <div class="transfer-allData-filter">
<span>{{titles&&titles[0]?titles[0]:'全部'}}</span> <span>{{ titles && titles[0] ? titles[0] : '全部' }}</span>
<div class="transfer-filter-input"> <div class="transfer-filter-input">
<el-input <el-input
v-model="filters.all" v-model="filters.all"
...@@ -12,71 +12,48 @@ ...@@ -12,71 +12,48 @@
></el-input> ></el-input>
</div> </div>
<div> <div>
<el-button <el-button size="mini" @click="filterAllData">查询</el-button>
size="mini"
@click="filterAllData"
>查询</el-button>
</div> </div>
</div> </div>
<div class="transfer-allData-box"> <div class="transfer-allData-box">
<select <select class="transfer-allData-select" multiple v-model="selected.all">
class="transfer-allData-select"
multiple
v-model="selected.all"
>
<option <option
v-for="(item, index) in allDataOptions" v-for="(item, index) in allDataOptions"
:key="index" :key="index"
:value="getValue('key',item)" :value="getValue('key', item)"
@dblclick="() => addClickValue(getValue('key',item))" @dblclick="() => addClickValue(getValue('key', item))"
>{{getValue('label',item)}}</option> >{{ getValue('label', item) }}</option
>
</select> </select>
</div> </div>
</div> </div>
<div class="transfer-btnBox"> <div class="transfer-btnBox">
<div class="cancel-btn-box"> <div class="cancel-btn-box">
<div <div class="transfer-btnBox-btn" @click="removeSelectedValue(true)">
class="transfer-btnBox-btn"
@click="removeSelectedValue(true)"
>
<i class="el-icon-d-arrow-left"></i> <i class="el-icon-d-arrow-left"></i>
</div> </div>
<div <div class="transfer-btnBox-btn" @click="removeSelectedValue()">
class="transfer-btnBox-btn"
@click="removeSelectedValue()"
>
<i class="el-icon-arrow-left"></i> <i class="el-icon-arrow-left"></i>
</div> </div>
</div> </div>
<div class="selected-btn-box"> <div class="selected-btn-box">
<div <div class="transfer-btnBox-btn" @click="addSelectedValue()">
class="transfer-btnBox-btn"
@click="addSelectedValue()"
>
<i class="el-icon-arrow-right"></i> <i class="el-icon-arrow-right"></i>
</div> </div>
<div <div class="transfer-btnBox-btn" @click="addSelectedValue(true)">
class="transfer-btnBox-btn"
@click="addSelectedValue(true)"
>
<i class="el-icon-d-arrow-right"></i> <i class="el-icon-d-arrow-right"></i>
</div> </div>
</div> </div>
<el-button <el-button size="mini" type="primary" @click="submitHandle"
size="mini" >确定</el-button
type="primary" >
@click="submitHandle" <br />
>确定</el-button> <br />
<br> <el-button size="mini" @click="cancelHandle">取消</el-button>
<br>
<el-button
size="mini"
@click="cancelHandle"
>取消</el-button>
</div> </div>
<div class="transfer-selectData"> <div class="transfer-selectData">
<div class="transfer-selectData-filter"> <div class="transfer-selectData-filter">
<span>{{titles&&titles[1]?titles[1]:'已选'}}</span> <span>{{ titles && titles[1] ? titles[1] : '已选' }}</span>
<div class="transfer-filter-input"> <div class="transfer-filter-input">
<el-input <el-input
v-model.trim="filters.selected" v-model.trim="filters.selected"
...@@ -86,10 +63,7 @@ ...@@ -86,10 +63,7 @@
></el-input> ></el-input>
</div> </div>
<div> <div>
<el-button <el-button size="mini" @click="filterSelectedData">查询</el-button>
size="mini"
@click="filterSelectedData"
>查询</el-button>
</div> </div>
</div> </div>
<div class="transfer-selectData-box"> <div class="transfer-selectData-box">
...@@ -101,9 +75,10 @@ ...@@ -101,9 +75,10 @@
<option <option
v-for="(item, index) in selectDataOptions" v-for="(item, index) in selectDataOptions"
:key="index" :key="index"
:value="getValue('key',item)" :value="getValue('key', item)"
@dblclick="() => removeClickValue(getValue('key',item))" @dblclick="() => removeClickValue(getValue('key', item))"
>{{getValue('label',item)}}</option> >{{ getValue('label', item) }}</option
>
</select> </select>
</div> </div>
</div> </div>
...@@ -194,7 +169,7 @@ export default { ...@@ -194,7 +169,7 @@ export default {
}, },
addSelectedValue(flag) { addSelectedValue(flag) {
this.trueValue = flag this.trueValue = flag
? this.allDataOptions.map(i => i.id) ? this.list.map(i => i.id)
: [...this.trueValue, ...this.selected.all]; : [...this.trueValue, ...this.selected.all];
}, },
removeSelectedValue(flag) { removeSelectedValue(flag) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment