Commit 32cd90e3 authored by wangqinghua's avatar wangqinghua

commit

parent e920a159
......@@ -6,7 +6,9 @@
<el-row>
<el-col :span="18">
<div class="border padding-10-10">
<p v-for="item of list">{{item.name}}</p>
<template v-for="(item,i) in list">
<p @click="selectIndex(i)"> {{item.name}}</p>
</template>
</div>
</el-col>
<el-col class="text-center" :span="6">
......@@ -36,13 +38,14 @@
data(){
return{
title:"",
sIndex:null,
dialogFormVisible:false,
list:[
{name:"1"},
{name:"2"},
{name:"3"},
{name:"4"},
{name:"5"},
{name:"1",index:1},
{name:"2",index:2},
{name:"3",index:3},
{name:"4",index:4},
{name:"5",index:5},
]
}
},
......@@ -51,14 +54,42 @@
this.title = title
this.dialogFormVisible = true;
},
//
selectIndex(i){
this.sIndex = i;
},
//置顶
toTop(){
if (this.sIndex != 0) {
this.swapArray(this.list, this.sIndex, this.sIndex - 1);
} else {
alert('已经处于置底,无法下移');
}
},
//上移
movePrev(){
if (this.sIndex != 0) {
this.swapArray(this.list, this.sIndex, this.sIndex - 1);
} else {
this.$message.warning("已经处于置底,无法下移")
}
},
//下移
moveNext(){
if (this.sIndex + 1 != this.list.length) {
this.swapArray(this.list, this.sIndex ,this.sIndex + 1);
} else {
// alert('已经处于置顶,无法上移');
}
},
/**
* @param arr 数组
* @param index1 需要变更的对象序号
* @param index2 需要被变更的对象序号
*/
swapArray(arr,index1,index2){
arr[index1] = arr.splice(index2,1,arr[index1])[0]
return arr
}
}
}
......
......@@ -37,14 +37,11 @@
</el-col>
<el-col :span="8">
<span>会议时间:</span>
<el-select style="width: 220px;" v-model="input1" placeholder="请选择" size="small">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-date-picker
v-model="input1"
type="datetime"
placeholder="选择日期时间">
</el-date-picker>
</el-col>
</el-row>
<el-row class="margin-top-20">
......
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