From 62533f0f68c1afd4f0e02fc364826c8f817c9f3a Mon Sep 17 00:00:00 2001 From: jiangrui <403209447@qq.com> Date: Wed, 21 Apr 2021 10:58:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=85=E6=B0=91=E4=BF=A1=E6=81=AF=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/residentInformation.js | 12 + src/components/RegionSelect/index.vue | 12 +- src/components/cutUploadImage/index.vue | 337 +++++++++++++++--------- src/main.js | 4 +- src/router/index.js | 2 +- src/store/modules/user.js | 9 +- src/views/login/index.vue | 182 ++++++------- src/views/residentInformation/list.vue | 298 +++++++++++++++++---- 8 files changed, 590 insertions(+), 266 deletions(-) diff --git a/src/api/residentInformation.js b/src/api/residentInformation.js index c6cee59..ad4a074 100644 --- a/src/api/residentInformation.js +++ b/src/api/residentInformation.js @@ -26,4 +26,16 @@ export function addResidentInfoList(data) { }); } +/** + * 居民信息修改 + * @param {*} data + * @returns + */ +export function updateResidentInfo(data) { + return request({ + url: "/api/convenience/residentInformation", + method: "put", + data + }); +} \ No newline at end of file diff --git a/src/components/RegionSelect/index.vue b/src/components/RegionSelect/index.vue index 352d37f..e4cbea1 100644 --- a/src/components/RegionSelect/index.vue +++ b/src/components/RegionSelect/index.vue @@ -4,7 +4,7 @@ style="width:240px" :options="regions" :props="{ checkStrictly: true }" - placeholder="" + placeholder="行政区域" @change="emitSelectValue" clearable /> @@ -23,8 +23,12 @@ export default { props: ["_regionNames"], created() { this.getList(); - // console.log(233); this.regionNames = this._regionNames; + console.log(233); + console.log(this.regionNames); + }, + mounted(){ + console.log(244); }, methods: { getList() { @@ -43,13 +47,15 @@ export default { const townObj = { value: town.root.name, label: town.root.name, + disabled: !town.root.check, children: [] }; countyObj.children.push(townObj); town.node.map(country => { townObj.children.push({ value: country.root.name, - label: country.root.name + label: country.root.name, + disabled: !country.root.check, }); }); }); diff --git a/src/components/cutUploadImage/index.vue b/src/components/cutUploadImage/index.vue index b15193c..7bf557b 100644 --- a/src/components/cutUploadImage/index.vue +++ b/src/components/cutUploadImage/index.vue @@ -1,41 +1,133 @@ diff --git a/src/main.js b/src/main.js index 26f24d0..68152c1 100644 --- a/src/main.js +++ b/src/main.js @@ -7,7 +7,7 @@ import 'normalize.css/normalize.css' // a modern alternative to CSS resets import Element from 'element-ui' import './styles/element-variables.scss' -import enLang from 'element-ui/lib/locale/lang/en'// 如果使用中文语言包请默认支持,无需额外引入,请删除该依赖 +// import enLang from 'element-ui/lib/locale/lang/en'// 如果使用中文语言包请默认支持,无需额外引入,请删除该依赖 import '@/styles/index.scss' // global css @@ -39,7 +39,7 @@ if (process.env.NODE_ENV === 'production') { Vue.use(Element, { size: Cookies.get('size') || 'medium', // set element-ui default size - locale: enLang // 如果使用中文,无需设置,请删除 + // locale: enLang // 如果使用中文,无需设置,请删除 }) // register global utility filters diff --git a/src/router/index.js b/src/router/index.js index e364f3d..be1f614 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -166,7 +166,7 @@ export const constantRoutes = [ meta: { title: "居民信息管理", icon: "list", - roles: ["admin", "editor"] + roles: ["ESIDENT_ADMIN"] }, children: [ { diff --git a/src/store/modules/user.js b/src/store/modules/user.js index c7b5697..993730b 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -58,11 +58,16 @@ const actions = { return new Promise((resolve, reject) => { getInfo({}) .then(res => { - commit('SET_ROLES', ['admin']) + // console.log(); + let roles = res.d.isResidentsAdministrator; + roles.push('admin') + commit('SET_ROLES', roles) + // commit('SET_ROLES', ['admin']) + // console.log(['admin',...res.isResidentsAdministrator]); sessionStorage.setItem('id', res.d.id) commit('SET_NAME', res.d.name) commit('SET_AVATAR', res.d.avatar) - resolve({ roles: ['admin'] }) + resolve({ roles}) }) .catch(error => { reject(error) diff --git a/src/views/login/index.vue b/src/views/login/index.vue index c172586..9daa23e 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -5,7 +5,13 @@ align-items: center;flex-direction: column; justify-content: center;" > -
壤塘家园定点服务系统
+
+