ct
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item style="width: 100%" label="地区" prop="areaId">
|
||||
<ai-area-get v-model="form.areaId" :instance="instance" @select="handleAreaSelect"/>
|
||||
<ai-area-get v-model="form.areaId" :instance="instance" @select="handleAreaSelect" :root="areaId"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item style="width: 100%" label="地址" prop="address">
|
||||
@@ -75,8 +75,8 @@ export default {
|
||||
permissions: Function,
|
||||
},
|
||||
data() {
|
||||
var locate = (rule, value, callback) => {
|
||||
if(!this.form.lat.length || !this.form.lng.length) {
|
||||
var validLocation = (rule, value, callback) => {
|
||||
if(!this.form.lat || !this.form.lng) {
|
||||
return callback(new Error('请标绘地理位置'))
|
||||
} else {
|
||||
callback()
|
||||
@@ -107,27 +107,22 @@ export default {
|
||||
},
|
||||
showMap: false,
|
||||
searchPlace: '',
|
||||
// locate
|
||||
rules: {
|
||||
categoryId: [{ required: true, message: '请选择资源分类', trigger: 'blur' }],
|
||||
resourceName: [{ required: true, message: '请输入资源名称', trigger: 'blur' }],
|
||||
areaId: [{ required: true, message: '选择地区', trigger: 'change' }],
|
||||
address: [{ required: true, message: '请输入地址', trigger: 'change' }],
|
||||
location: [{ required: true, validator: validLocation, trigger: 'change' }],
|
||||
},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getCategoryList()
|
||||
},
|
||||
computed: {
|
||||
rules() {
|
||||
return {
|
||||
categoryId: [{ required: true, message: '请选择资源分类', trigger: 'blur' }],
|
||||
resourceName: [{ required: true, message: '请输入资源名称', trigger: 'blur' }],
|
||||
areaId: [{ required: true, message: '选择地区', trigger: 'change' }],
|
||||
address: [{ required: true, message: '请输入地址', trigger: 'change' }],
|
||||
location: [{ required: true, validator: this.locate, trigger: 'change' }],
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
cancel() {
|
||||
// currentPage: resourceManagement
|
||||
this.$router.push({hash: "#AppCommunityResource", query: {}})
|
||||
this.$router.push({})
|
||||
},
|
||||
getCategoryList() {
|
||||
this.instance.post(`/app/appresourcecategory/list`,null,{
|
||||
|
||||
@@ -101,8 +101,6 @@ export default {
|
||||
if(res?.data) {
|
||||
this.tableData = res.data.records
|
||||
this.total = res.data.total
|
||||
console.log(this.tableData);
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
@@ -75,7 +75,7 @@ export default {
|
||||
methods: {
|
||||
changeAreaId() {
|
||||
this.$nextTick(() => {
|
||||
// this.$refs[this.tabs[Number(this.currIndex)].name][0].getList()
|
||||
this.$refs[this.tabs[Number(this.currIndex)].name][0].getList()
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
@@ -62,7 +62,7 @@ export default {
|
||||
this.instance.post(`/app/appresourceinfo/list`,null,{
|
||||
params: {
|
||||
...this.search,
|
||||
// areaId: this.areaId,
|
||||
areaId: this.areaId,
|
||||
}
|
||||
}).then(res=> {
|
||||
if(res?.data) {
|
||||
|
||||
@@ -72,7 +72,7 @@ export default {
|
||||
this.areaName = this.user.info.areaName
|
||||
this.getTypeList()
|
||||
this.getCorpLocation()
|
||||
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
@@ -161,7 +161,7 @@ export default {
|
||||
initMap({lng, lat}) {
|
||||
this.center = [lng, lat];
|
||||
AMapLoader.load({
|
||||
key: 'b553334ba34f7ac3cd09df9bc8b539dc',
|
||||
key: '54a02a43d9828a8f9cd4f26fe281e74e',
|
||||
version: '2.0',
|
||||
plugins: ['AMap.ToolBar', 'AMap.Scale', 'AMap.MouseTool', 'AMap.MarkerClusterer'],
|
||||
AMapUI: {
|
||||
@@ -438,7 +438,7 @@ export default {
|
||||
::v-deep .el-input, ::v-deep input {
|
||||
border: none;
|
||||
}
|
||||
|
||||
|
||||
::v-deep .el-select {
|
||||
padding-right: 28px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user