You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

265 lines
6.1 KiB

<template>
<view class="container">
<uni-forms ref="form" :modelValue="form" :rules="rules" class="padding-wrap" label-position="top">
<uni-forms-item label="楼号" name="buildId" label-width="200upx">
<uni-easyinput trim="all" v-model="form.buildId" placeholder="请输入楼号"></uni-easyinput>
</uni-forms-item>
<uni-forms-item label="楼层" name="floorNo" label-width="200upx">
<uni-easyinput trim="all" v-model="form.floorNo" placeholder="请输入楼层"></uni-easyinput>
</uni-forms-item>
<uni-forms-item label="经度" name="longitude" label-width="200upx">
<uni-easyinput trim="all" v-model="form.longidute" placeholder="请输入经度"></uni-easyinput>
</uni-forms-item>
<uni-forms-item label="维度" name="latitude" label-width="200upx">
<uni-easyinput trim="all" v-model="form.latidute" placeholder="请输入纬度"></uni-easyinput>
</uni-forms-item>
<uni-forms-item label="应急预案报警类型" name="planTypeId" label-width="300upx">
<uni-data-select v-model="form.planTypeId" :localdata="planTypeList" placeholder="请选择常应急预案报警类型"></uni-data-select>
</uni-forms-item>
<view class="btn-box">
<view class="submit-btn" @click="submit">保存</view>
</view>
</uni-forms>
</view>
</template>
<script>
export default {
data() {
return {
form: {
employeeId: '',
buildId: '1',
floorNo: '1',
longidute: '120.61988850529002',
latidute: '31.37531834395683',
planTypeId: '1',
planTypeName: '测试预案01',
},
rules: {
buildId: {
rules: [{
required: true,
errorMessage: '请输入楼号'
}]
},
floorNo: {
rules: [{
required: true,
errorMessage: '请输入楼层'
}]
},
longidute: {
rules: [{
required: true,
errorMessage: "请输入经度"
}]
},
latidute: {
rules: [{
required: true,
errorMessage: "请输入纬度"
}]
},
},
planTypeList: [],//应急预案类型
userInfo: {}
}
},
onLoad() {
this.queryPlanTypeList();
let userInfo = uni.getStorageSync('mobileInfo');
if(userInfo){
this.userInfo = JSON.parse(userInfo);
this.form.employeeId = this.userInfo.employeeId;
}
},
methods: {
//预案类型
queryPlanTypeList() {
uni.request({
url: "http://172.19.2.177:8081/GetAllPlanInfo",
success: (data) => {
let _data = JSON.parse(data);
if(_data.code == 200) {
_data.data.forEach(item => {
item.value = item.planId;
item.text = item.planName;
})
this.planTypeList = _data.data;
}
}
})
},
submit() {
this.$refs.form.validate().then(res => {
uni.setStorageSync("locationInfo",JSON.stringify(this.form));//测试使用
// uni.request({
// url: 'http://172.19.0.11:8081/employee/modify',
// data: this.form,
// method: "POST",
// success: (res) => {
// console.log(res.data);
// uni.showToast({
// title: '设置成功'
// });
// uni.setStorageSync("mobileInfo",JSON.stringify(this.form));
// }
// });
}).catch(err => {
console.log('表单错误信息:', err);
uni.showToast({
title: err
});
})
}
},
}
</script>
<style lang="scss" scoped>
page,
.container {
min-height: 100vh;
background-color: #FFFFFF;
/deep/.uni-forms-item__label{
color: #031945;
font-size: 28upx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
}
/deep/.uni-easyinput__content{
height: 99upx;
border: 0;
border-bottom: 1px solid #D6D8DF;;
border-radius: 0;
}
/deep/.uni-easyinput__content-input{
font-size: 28upx;
height: 99upx;
}
/deep/.uni-input-placeholder{
color: #90959D;
font-size: 28upx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
}
/deep/.uni-select{
height: 99upx;
background: #F6F8FA;
border-radius: 30upx;
padding: 0 15upx 0 30upx;
border: 0;
}
/deep/.uni-select__input-box{
height: 99upx;
}
/deep/.uni-select__input-placeholder{
color: #C4C7CB;
font-size: 28upx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
}
/deep/.uni-icons{
color: #C4C7CB;
font-size: 28upx;
}
}
.padding-wrap {
padding: 30upx;
}
.voice-rocord-box{
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 40upx;
.voice-box{
display: flex;
align-items: center;
justify-content: flex-end;
min-width: 300px;
height: 90upx;
background: #338AF8 url(@/static/voive_bg.png) 40upx 28upx no-repeat;
background-size: 226upx 34upx;
border-radius: 100upx;
.voice-mins{
color: #FFFFFF;
font-size: 28upx;
font-family: Arial-Regular, Arial;
font-weight: 400;
margin-right: 40upx;
}
}
.voice-del{
color: #B6B8BB;
font-size: 28upx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
margin-left: 20upx;
}
}
.submit-btn {
display: block;
color: #338AF8;
font-size: 28upx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
line-height: 66upx;
text-align: center;
background: #E5F0FF;
border-radius: 20upx;
border: 1px solid #338AF8;
}
.tab-switch {
display: flex;
justify-content: flex-end;
align-items: center;
.tab-btn {
display: flex;
width: 80upx;
height: 40upx;
border-radius: 20upx;
background-color: #eee;
margin-right: 10upx;
.tab-btn-item {
float: right;
width: 36upx;
height: 36upx;
border-radius: 18upx;
background-color: #FFFFFF;
margin: 2upx;
}
&.active {
background-color: #338AF8;
.tab-btn-item {
float: left;
}
}
}
}
.btn-box{
position: fixed;
left: 30upx;
right: 30upx;
bottom: 100upx;
.submit-btn{
color: #FFFFFF;
font-size: 28px;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
line-height: 90upx;
text-align: center;
background: #338AF8;
border-radius: 100upx;
}
}
</style>