master
271556543@qq.com 3 years ago
parent 8b490b31d1
commit e5d8e3bb85

@ -1,7 +1,7 @@
<!--新增门店--> <!--新增门店-->
<template> <template>
<div> <div>
<xy-dialog :is-show.sync="isShow" title="新增门店" type="form" :form="form"> <xy-dialog :is-show.sync="isShow" title="新增门店" type="form" :form="form" :rules="rules">
<template v-slot:belongsMerchant> <template v-slot:belongsMerchant>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label"> <div class="xy-table-item-label">
@ -33,6 +33,15 @@
</div> </div>
</template> </template>
<template v-slot:address> <template v-slot:address>
<div class="xy-table-item" style="margin-bottom: 20px;">
<div class="xy-table-item-label">
地址选择
</div>
<div class="xy-table-item-content">
<avue-map placeholder="请选择地址" :option="option" v-model="map" @mapClick="mapClick"></avue-map>
</div>
</div>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label"> <div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>地址 <span style="color: red;font-weight: 600;padding-right: 4px;">*</span>地址
@ -83,7 +92,7 @@
</div> </div>
</template> </template>
<template v-slot:extraFormBottom> <template v-slot:extraFormBottom>
<avue-map size="small" :option="option" v-model="map" @mapClick="test"></avue-map>
</template> </template>
</xy-dialog> </xy-dialog>
</div> </div>
@ -99,12 +108,38 @@ export default {
belongsMerchant:'', belongsMerchant:'',
name:'', name:'',
password:'', password:'',
address:'',
contact:'', contact:'',
contactNumber:'', contactNumber:'',
address:'',
lng:'',// lng:'',//
lat:'',// lat:'',//
}, },
rules:{
belongsMerchant:[
{required:true,message:'请选择所属商家'}
],
name:[
{required:true,message:'请填写名称'}
],
password:[
{required:true,message:'请填写密码'}
],
contact:[
{required:true,message:'请填写联系人'}
],
contactNumber:[
{required:true,message:'请填写联系电话'}
],
address:[
{required:true,message:'请填写地址'}
],
lng:[
{required:true,message:'请选择定位'}
],
lat:[
{required:true,message:'请选择定位'}
]
},
map:{ map:{
}, },
@ -126,7 +161,8 @@ export default {
} }
}, },
methods: { methods: {
test(r,p){ //
mapClick(r,p){
this.$nextTick(()=>{ this.$nextTick(()=>{
this.form.lat = p this.form.lat = p
this.form.lng = r this.form.lng = r
@ -137,6 +173,7 @@ export default {
map(newVal){ map(newVal){
this.form.lat = newVal?.location?.lat this.form.lat = newVal?.location?.lat
this.form.lng = newVal?.location?.lng this.form.lng = newVal?.location?.lng
this.form.address = newVal?.formattedAddress
} }
}, },
mounted() { mounted() {

@ -64,7 +64,7 @@
return { return {
loginForm: { loginForm: {
username: 'admin', username: 'admin',
password: 'Admin2022' password: 'Yunyubang2021@'
}, },
loginRules: { loginRules: {
username: [{ username: [{

@ -23,6 +23,8 @@
</el-table-column> </el-table-column>
<el-table-column prop="url" label="菜单路径" sortable> <el-table-column prop="url" label="菜单路径" sortable>
</el-table-column> </el-table-column>
<el-table-column prop="path" label="菜单视图" sortable>
</el-table-column>
<el-table-column prop="icon" label="图标" sortable> <el-table-column prop="icon" label="图标" sortable>
</el-table-column> </el-table-column>
<el-table-column prop="api_prefix" label="API前缀" sortable> <el-table-column prop="api_prefix" label="API前缀" sortable>
@ -52,6 +54,9 @@
<el-form-item label="菜单路径" prop="url"> <el-form-item label="菜单路径" prop="url">
<el-input v-model="form.url" autocomplete="off"></el-input> <el-input v-model="form.url" autocomplete="off"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="菜单视图" prop="url">
<el-input v-model="form.path" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="是否显示" prop="visible"> <el-form-item label="是否显示" prop="visible">
<el-select v-model="form.visible"> <el-select v-model="form.visible">
<el-option label="显示" value="1"></el-option> <el-option label="显示" value="1"></el-option>
@ -105,7 +110,8 @@
sortnumber: 0, sortnumber: 0,
icon: "", icon: "",
pname: "根菜单", pname: "根菜单",
api_prefix:"" api_prefix:"",
path:''
}, },
rules: { rules: {
name: [{ name: [{

Loading…
Cancel
Save