校验
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,23 +107,18 @@ export default { | ||||
|       }, | ||||
|       showMap: false, | ||||
|       searchPlace: '', | ||||
|       // locate | ||||
|     } | ||||
|   }, | ||||
|   created() { | ||||
|     this.getCategoryList() | ||||
|   }, | ||||
|   computed: { | ||||
|     rules() { | ||||
|       return { | ||||
|       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: this.locate, trigger: 'change' }], | ||||
|       } | ||||
|         location: [{ required: true, validator: validLocation, trigger: 'change' }], | ||||
|       }, | ||||
|     } | ||||
|   }, | ||||
|   created() { | ||||
|     this.getCategoryList() | ||||
|   }, | ||||
|   methods: { | ||||
|     cancel() { | ||||
|       // currentPage: resourceManagement | ||||
|   | ||||
| @@ -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) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user