forked from zhurui/management
1 line
7.7 KiB
JSON
1 line
7.7 KiB
JSON
{"remainingRequest":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\views\\modules\\sys\\region-add-or-update.vue?vue&type=script&lang=js&","dependencies":[{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\views\\modules\\sys\\region-add-or-update.vue","mtime":1614735254000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\babel-loader\\lib\\index.js","mtime":499162500000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nimport debounce from 'lodash/debounce'\nimport { getPersonRegion } from '@/utils'\nexport default {\n data () {\n return {\n visible: false,\n insert: true,\n regionList: [],\n regionListVisible: false,\n dataForm: {\n id: '',\n name: '',\n pid: '0',\n parentName: '',\n sort: 0\n }\n }\n },\n computed: {\n dataRule () {\n return {\n id: [\n { required: true, message: this.$t('validate.required'), trigger: 'blur' }\n ],\n name: [\n { required: true, message: this.$t('validate.required'), trigger: 'blur' }\n ],\n sort: [\n { required: true, message: this.$t('validate.required'), trigger: 'blur' }\n ]\n }\n }\n },\n methods: {\n init (id) {\n this.insert = true\n this.visible = true\n this.dataForm.pid = '0'\n this.$nextTick(() => {\n this.$refs['dataForm'].resetFields()\n this.dataForm.id = id\n if (this.dataForm.id) {\n this.insert = false\n this.getInfo()\n }\n })\n },\n // 获取信息\n getInfo () {\n this.$http.get(`/sys/region/${this.dataForm.id}`).then(({ data: res }) => {\n if (res.code !== 0) {\n return this.$message.error(res.msg)\n }\n this.dataForm = {\n ...this.dataForm,\n ...res.data\n }\n this.$refs.regionListTree.setCurrentKey(this.dataForm.pid)\n }).catch(() => {})\n },\n // 表单提交\n dataFormSubmitHandle: debounce(function () {\n this.$refs['dataForm'].validate((valid) => {\n if (!valid) {\n return false\n }\n this.$http[this.insert ? 'post' : 'put']('/sys/region', this.dataForm).then(({ data: res }) => {\n if (res.code !== 0) {\n return this.$message.error(res.msg)\n }\n this.$message({\n message: this.$t('prompt.success'),\n type: 'success',\n duration: 500,\n onClose: () => {\n this.visible = false\n this.$emit('refreshDataList')\n getPersonRegion()\n }\n })\n }).catch(() => {})\n })\n }, 1000, { 'leading': true, 'trailing': false })\n }\n}\n",{"version":3,"sources":["region-add-or-update.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAwBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"region-add-or-update.vue","sourceRoot":"src/views/modules/sys","sourcesContent":["<template>\n <el-dialog :visible.sync=\"visible\" :title=\"insert ? $t('add') : $t('update')\" :close-on-click-modal=\"false\" :close-on-press-escape=\"false\">\n <el-form :model=\"dataForm\" :rules=\"dataRule\" ref=\"dataForm\" @keyup.enter.native=\"dataFormSubmitHandle()\" label-width=\"120px\">\n <el-form-item prop=\"parentName\" :label=\"$t('region.parentName')\">\n <ren-region-tree v-model=\"dataForm.pid\" :placeholder=\"$t('region.select')\" :parent-name.sync=\"dataForm.parentName\"></ren-region-tree>\n </el-form-item>\n <el-form-item prop=\"name\" :label=\"$t('region.name')\">\n <el-input v-model=\"dataForm.name\" :placeholder=\"$t('region.name')\"></el-input>\n </el-form-item>\n <el-form-item prop=\"id\" :label=\"$t('region.id')\">\n <el-input v-model=\"dataForm.id\" :disabled=\"!insert\" :placeholder=\"$t('region.id')\"></el-input>\n </el-form-item>\n <el-form-item prop=\"sort\" :label=\"$t('region.sort')\">\n <el-input-number v-model=\"dataForm.sort\" controls-position=\"right\" :min=\"0\" :label=\"$t('region.sort')\"></el-input-number>\n </el-form-item>\n </el-form>\n <template slot=\"footer\">\n <el-button @click=\"visible = false\">{{ $t('cancel') }}</el-button>\n <el-button type=\"primary\" @click=\"dataFormSubmitHandle()\">{{ $t('confirm') }}</el-button>\n </template>\n </el-dialog>\n</template>\n\n<script>\nimport debounce from 'lodash/debounce'\nimport { getPersonRegion } from '@/utils'\nexport default {\n data () {\n return {\n visible: false,\n insert: true,\n regionList: [],\n regionListVisible: false,\n dataForm: {\n id: '',\n name: '',\n pid: '0',\n parentName: '',\n sort: 0\n }\n }\n },\n computed: {\n dataRule () {\n return {\n id: [\n { required: true, message: this.$t('validate.required'), trigger: 'blur' }\n ],\n name: [\n { required: true, message: this.$t('validate.required'), trigger: 'blur' }\n ],\n sort: [\n { required: true, message: this.$t('validate.required'), trigger: 'blur' }\n ]\n }\n }\n },\n methods: {\n init (id) {\n this.insert = true\n this.visible = true\n this.dataForm.pid = '0'\n this.$nextTick(() => {\n this.$refs['dataForm'].resetFields()\n this.dataForm.id = id\n if (this.dataForm.id) {\n this.insert = false\n this.getInfo()\n }\n })\n },\n // 获取信息\n getInfo () {\n this.$http.get(`/sys/region/${this.dataForm.id}`).then(({ data: res }) => {\n if (res.code !== 0) {\n return this.$message.error(res.msg)\n }\n this.dataForm = {\n ...this.dataForm,\n ...res.data\n }\n this.$refs.regionListTree.setCurrentKey(this.dataForm.pid)\n }).catch(() => {})\n },\n // 表单提交\n dataFormSubmitHandle: debounce(function () {\n this.$refs['dataForm'].validate((valid) => {\n if (!valid) {\n return false\n }\n this.$http[this.insert ? 'post' : 'put']('/sys/region', this.dataForm).then(({ data: res }) => {\n if (res.code !== 0) {\n return this.$message.error(res.msg)\n }\n this.$message({\n message: this.$t('prompt.success'),\n type: 'success',\n duration: 500,\n onClose: () => {\n this.visible = false\n this.$emit('refreshDataList')\n getPersonRegion()\n }\n })\n }).catch(() => {})\n })\n }, 1000, { 'leading': true, 'trailing': false })\n }\n}\n</script>\n\n<style lang=\"scss\">\n.mod-sys__region {\n .region-list {\n .el-input__inner,\n .el-input__suffix {\n cursor: pointer;\n }\n }\n}\n</style>\n"]}]} |