Commit d976877c authored by 高宇's avatar 高宇

调整按钮

parent 2b945605
import request from '@/utils/request'
// 获取测试接口
export function getWbMove(query) {
return request({
url: '/wbMove/test',
method: 'get',
params: query
})
}
......@@ -245,8 +245,7 @@ export default {
// this.$router.push({ path: `http://main.court.com${this.redirect || "/"}` });
// this.$router.push('/welcome')
this.$router.push('/controlPlatform/control')
// setTimeout(this.loading =false,1000)
this.loading = false
setTimeout(this.loading =false,1000)
}).catch(() => {
this.loading = false
this.verify = false
......
......@@ -4,10 +4,10 @@
<div class="search">
<el-form :model="queryForm" label-width="40px">
<el-form-item label="XX:">
<el-input v-model="queryForm.value1"></el-input>
<el-input ref="input1" v-model="queryForm.value1" @keyup.enter.native="handelTab(1,$event)" ></el-input>
</el-form-item>
<el-form-item label="YY:">
<el-input v-model="queryForm.value1"></el-input>
<el-input ref="input2" v-model="queryForm.value2" @keyup.enter.native="addList"></el-input>
</el-form-item>
</el-form>
</div>
......@@ -30,7 +30,7 @@
</el-table-column>
<el-table-column min-width="20" :show-overflow-tooltip="true">
<template slot-scope="scope">
<i class="el-icon-delete-solid" style="font-size: 19px;margin-left: -5px;color: red"></i>
<i @click="handleDelte(scope.$index)" class="el-icon-delete-solid" style="font-size: 26px;margin-left: -10px;color: #46BCF3; margin-top: 7px"></i>
<!-- <span>{{scope.row.value3}}</span>-->
</template>
</el-table-column>
......@@ -62,6 +62,62 @@ export default {
}
]
}
},
created() {
this.focusing()
},
methods: {
/**
* @description: 监听输入框回车事件,如果回车焦点聚集到下一个输入框
* @author: gaoyu
* @param:
* @return:
**/
handelTab(i, e) {
const that = this
if (!that.$refs['input' + i]) {
return
}
that.$nextTick(() => {
e.target.blur()
const index = i + 1
that.$refs['input' + index].focus()
})
},
/**
* @description: 一开始将焦点聚焦到第一个输入框下
* @author: gaoyu
* @param:
* @return:
**/
focusing(){
this.$nextTick().then(() => {
this.$refs.input1.focus()
})
},
/**
* @description: 监听第二个输入框,回车将输入添加到数组中
* @author: gaoyu
* @param:
* @return:
**/
addList() {
const obj = {
value1: this.queryForm.value1,
value2: this.queryForm.value2,
value3: '1000'
}
this.enterTable.push(obj)
},
/**
* @description: 删除数据中元素
* @author: gaoyu
* @param:
* @return:
**/
handleDelte(index) {
this.enterTable.splice(index,1)
},
}
}
</script>
......
<template>
<!-- 测试页面-->
<div class="testContainer">
<div class="testContent">
<el-form :model="testFrom" ref="testRef" label-width="40px">
<el-form-item label="xxx:">
<el-input v-model="testFrom.accept"></el-input>
</el-form-item>
</el-form>
<div class="buttonRegion">
<el-button class="button_rowBtn" type="primary" @click="handleTest">测试</el-button>
</div>
<!-- 测试文本 -->
<div class="testText">{{testFrom.back}}</div>
</div>
</div>
</template>
<script>
import {getWbMove} from "@/api/setup/test";
export default {
name: "test",
data() {
return{
testFrom:{
accept: '',
back: ''
}
}
},
methods: {
// 测试接口
handleTest() {
this.$refs.testRef.validate(vaild => {
if (vaild) {
getWbMove(this.testFrom).then(res => {
if (res.code === 200) {
this.testFrom = res.data
}
})
}
})
},
}
}
</script>
<style scoped lang="scss">
.testContainer{
display: flex;
justify-content: center;
.testContent{
width: 98%;
.buttonRegion{
display: flex;
justify-content: center;
.button_rowBtn{
font-size: 17px;
width: 160px;
}
}
.testText{
margin-top: 20px;
width: 98%;
display: flex;
justify-content: center;
color: red;
}
}
}
</style>
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