Files
app-govern/pages/project/new.vue

116 lines
3.6 KiB
Vue
Raw Normal View History

2023-02-20 14:19:28 +08:00
<template>
<Cn-page :loading='loading'>
<view slot='body'>
<view class='new'>
<view class="content">
<uni-forms :label-width="80">
<uni-forms-item label="项目名称">
<uni-easyinput type="number" v-model="formData.name" placeholder="请输入项目名称" />
</uni-forms-item>
2023-02-28 14:03:38 +08:00
<uni-forms-item label="项目类别">
<uni-data-select v-model="formData.type" :localdata="TypeRange"></uni-data-select>
</uni-forms-item>
2023-02-20 14:19:28 +08:00
<uni-forms-item label="区域">
<view style="display:flex;">
<uni-easyinput :clearable="false" type="textarea" autoHeight v-model="formData.address"
placeholder="请输入区域信息" />
<uni-icons type="location" color="#007aff" size="26" class="ml20"
@click="chooseLocation"></uni-icons>
</view>
</uni-forms-item>
<uni-forms-item label="描述">
2023-02-28 14:03:38 +08:00
<uni-easyinput type="textarea" autoHeight v-model="formData.name" placeholder="请输入项目描述" />
2023-02-20 14:19:28 +08:00
</uni-forms-item>
<uni-file-picker title="请上传拓扑图" :sourceType="['album']"></uni-file-picker>
</uni-forms>
</view>
<view class="btn-wrap">
<view class="btn-wrap-item" @click="submit"> 提交 </view>
</view>
</view>
</view>
</Cn-page>
</template>
<script>
export default {
data () {
return {
loading: false,
formData: {
name: '',
2023-02-28 14:03:38 +08:00
gplot: '',
type:''
2023-02-20 14:19:28 +08:00
},
2023-02-28 14:03:38 +08:00
TypeRange: [
{
text: '监测',
value: '1'
},
{
text: '用能',
value: '2'
}
]
2023-02-20 14:19:28 +08:00
}
},
methods: {
chooseLocation () {
uni.chooseLocation({
success: function (res) {
this.address = res.name
console.log('位置名称:' + res.name);
console.log('详细地址:' + res.address);
console.log('纬度:' + res.latitude);
console.log('经度:' + res.longitude);
}
});
},
submit () {
this.$util.toast('项目创建成功')
setTimeout(() => {
2023-02-28 14:03:38 +08:00
uni.navigateBack({ delta: 1 })
2023-02-20 14:19:28 +08:00
}, 1500);
}
}
}
</script>
<style lang='scss'>
.new {
2023-02-28 14:03:38 +08:00
padding: 34rpx;
2023-02-20 14:19:28 +08:00
.content {
.content-des {
font-size: 28rpx;
color: #666;
margin-bottom: 20rpx;
}
margin-bottom: 20rpx;
2023-02-28 14:03:38 +08:00
padding: 34rpx;
2023-02-20 14:19:28 +08:00
background: $uni-theme-white;
border-radius: 12rpx;
}
.btn-wrap {
margin-top: 40rpx;
display: flex;
align-items: center;
justify-content: space-between;
.btn-wrap-item {
display: flex;
align-items: center;
justify-content: center;
flex: 1;
background: $uni-theme-blue;
color: #fff;
height: 80rpx;
border-radius: 12rpx;
}
}
}
/deep/ .uni-drawer__content {
width: 100vw !important;
}
</style>