提交 72029bbd 编写于 作者: lijinyang's avatar lijinyang

穿梭框宽度

上级 cc0361b3
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
@on-open-change="transferRefresh" @on-open-change="transferRefresh"
@on-change="dataChange" @on-change="dataChange"
v-model="dataRight" v-model="dataRight"
style="width:586px" :style="{width:width}"
multiple multiple
> >
<Option class="hidden" :value="item" v-for="(item,i) in dataRight" :key="i">{{findLabel(item)}}</Option> <Option class="hidden" :value="item" v-for="(item,i) in dataRight" :key="i">{{findLabel(item)}}</Option>
...@@ -17,18 +17,22 @@ import { ElSelect } from "element-ui/types/select"; ...@@ -17,18 +17,22 @@ import { ElSelect } from "element-ui/types/select";
@Component({}) @Component({})
export default class AppTransfer extends Vue { export default class AppTransfer extends Vue {
/**
* 表单传递右侧框中的数据
*/
// @Prop() public data?: any;
/** /**
* 左侧框数据 * 左侧框数据
*/ */
public dataLeft: any[] = []; public dataLeft: any[] = [];
/** /**
* 右侧框数据 * 右侧框数据
*/ */
public dataRight: any[] = []; public dataRight: any[] = [];
/**
* 穿梭框宽度
*/
@Prop() public width:any;
/** /**
* 代码表服务对象 * 代码表服务对象
* *
...@@ -79,10 +83,8 @@ export default class AppTransfer extends Vue { ...@@ -79,10 +83,8 @@ export default class AppTransfer extends Vue {
* @memberof AppTransfer * @memberof AppTransfer
*/ */
dataChange(e: any) { dataChange(e: any) {
console.log(e);
let newVal: any; let newVal: any;
newVal = e.join(`${this.valueSeparator}`); newVal = e.join(`${this.valueSeparator}`);
console.log(newVal, typeof newVal);
if (newVal) { if (newVal) {
this.$emit("change", newVal); this.$emit("change", newVal);
} else { } else {
...@@ -155,8 +157,6 @@ export default class AppTransfer extends Vue { ...@@ -155,8 +157,6 @@ export default class AppTransfer extends Vue {
this.dataLeft = [...JSON.parse(JSON.stringify(codelist.items))]; this.dataLeft = [...JSON.parse(JSON.stringify(codelist.items))];
this.initLeft(); this.initLeft();
this.initRight(); this.initRight();
console.log(this.dataLeft);
console.log(this.dataRight);
} else { } else {
console.log(`----${this.tag}----代码表不存在`); console.log(`----${this.tag}----代码表不存在`);
} }
...@@ -171,7 +171,6 @@ export default class AppTransfer extends Vue { ...@@ -171,7 +171,6 @@ export default class AppTransfer extends Vue {
.getItems(this.tag, _context, _param) .getItems(this.tag, _context, _param)
.then((res: any) => { .then((res: any) => {
this.dataLeft = res; this.dataLeft = res;
console.log(this.dataLeft);
this.initLeft(); this.initLeft();
this.initRight(); this.initRight();
}) })
...@@ -233,9 +232,6 @@ export default class AppTransfer extends Vue { ...@@ -233,9 +232,6 @@ export default class AppTransfer extends Vue {
*/ */
public initRight() { public initRight() {
let _data: any = this.itemValue; let _data: any = this.itemValue;
console.log(_data);
console.log(this.valueSeparator);
if (_data) { if (_data) {
let newData: any[] = _data.split(`${this.valueSeparator}`); let newData: any[] = _data.split(`${this.valueSeparator}`);
this.dataLeft.forEach((elem: any) => { this.dataLeft.forEach((elem: any) => {
...@@ -251,7 +247,6 @@ export default class AppTransfer extends Vue { ...@@ -251,7 +247,6 @@ export default class AppTransfer extends Vue {
* 穿梭框打开时刷新数据 * 穿梭框打开时刷新数据
*/ */
public transferRefresh(e: any) { public transferRefresh(e: any) {
console.log(e);
if (e && this.codelistType === "DYNAMIC") { if (e && this.codelistType === "DYNAMIC") {
this.dataLeft = []; this.dataLeft = [];
this.dataRight = []; this.dataRight = [];
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册