Commit 32cd90e3 authored by wangqinghua's avatar wangqinghua

commit

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