From bd429c8c081e760a468f87faf24de578fe3db66d Mon Sep 17 00:00:00 2001 From: jiangrui <403209447@qq.com> Date: Mon, 19 Apr 2021 10:22:26 +0800 Subject: [PATCH 1/7] v430 --- .env.development | 1 + package.json | 1 + src/api/region.js | 13 + src/api/residentInformation.js | 29 ++ src/components/RegionSelect/index.vue | 67 +++ src/components/cutUploadImage/index.vue | 273 +++++++++++ src/components/uploader/cropper.vue | 596 ++++++++++++++++++++++++ src/main.js | 4 + src/router/index.js | 24 + src/views/convenience/add.vue | 54 +-- src/views/convenience/detail.vue | 115 ++++- src/views/login/index.vue | 6 +- src/views/residentInformation/list.vue | 276 +++++++++++ 13 files changed, 1407 insertions(+), 52 deletions(-) create mode 100644 src/api/region.js create mode 100644 src/api/residentInformation.js create mode 100644 src/components/RegionSelect/index.vue create mode 100644 src/components/cutUploadImage/index.vue create mode 100644 src/components/uploader/cropper.vue create mode 100644 src/views/residentInformation/list.vue diff --git a/.env.development b/.env.development index 44c8efd..6f76c3a 100644 --- a/.env.development +++ b/.env.development @@ -4,3 +4,4 @@ ENV = 'development' # base api #VUE_APP_BASE_API = '/dev-api' VUE_APP_BASE_API = 'http://app.rt.xianci.info/' +#VUE_APP_BASE_API = 'http://api.rt.myntv.cn/' diff --git a/package.json b/package.json index 9f4cac6..ea87228 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "tui-editor": "1.3.3", "vue": "2.6.10", "vue-count-to": "1.0.13", + "vue-cropper": "^0.5.3", "vue-router": "3.0.2", "vue-splitpane": "1.0.4", "vuedraggable": "2.20.0", diff --git a/src/api/region.js b/src/api/region.js new file mode 100644 index 0000000..d66e186 --- /dev/null +++ b/src/api/region.js @@ -0,0 +1,13 @@ +import request from "@/utils/request"; + +/** + * 行政区域 + * @param {*} data + * @returns + */ +export function getRegions() { + return request({ + url: "/api/convenience/residentInformation/region/list", + method: "get" + }); +} diff --git a/src/api/residentInformation.js b/src/api/residentInformation.js new file mode 100644 index 0000000..c6cee59 --- /dev/null +++ b/src/api/residentInformation.js @@ -0,0 +1,29 @@ +import request from "@/utils/request"; + +/** + * 居民信息列表 + * @param {*} data + * @returns + */ +export function getResidentInfoList(data) { + return request({ + url: "/api/convenience/residentInformation/list", + method: "post", + data + }); +} + +/** + * 添加居民信息 + * @param {*} data + * @returns + */ +export function addResidentInfoList(data) { + return request({ + url: "/api/convenience/residentInformation/add", + method: "post", + data + }); +} + + \ No newline at end of file diff --git a/src/components/RegionSelect/index.vue b/src/components/RegionSelect/index.vue new file mode 100644 index 0000000..352d37f --- /dev/null +++ b/src/components/RegionSelect/index.vue @@ -0,0 +1,67 @@ + + + + + + + diff --git a/src/components/cutUploadImage/index.vue b/src/components/cutUploadImage/index.vue new file mode 100644 index 0000000..b15193c --- /dev/null +++ b/src/components/cutUploadImage/index.vue @@ -0,0 +1,273 @@ + + + + + + + + + + + + + + + + + + 上传中.. + 上传失败 + + + + + + + + + + + + + diff --git a/src/components/uploader/cropper.vue b/src/components/uploader/cropper.vue new file mode 100644 index 0000000..4d798e6 --- /dev/null +++ b/src/components/uploader/cropper.vue @@ -0,0 +1,596 @@ + + + + + 热门预览 + 非热门预览 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main.js b/src/main.js index b5fa135..26f24d0 100644 --- a/src/main.js +++ b/src/main.js @@ -4,6 +4,7 @@ import Cookies from 'js-cookie' 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'// 如果使用中文语言包请默认支持,无需额外引入,请删除该依赖 @@ -14,6 +15,9 @@ import App from './App' import store from './store' import router from './router' +import VueCropper from 'vue-cropper' +Vue.use(VueCropper) + import './icons' // icon import './permission' // permission control import './utils/error-log' // error log diff --git a/src/router/index.js b/src/router/index.js index c259723..e364f3d 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -157,6 +157,30 @@ export const constantRoutes = [ } } ] + }, + { + path: "/residentInformation", + component: Layout, + name: "ResidentInformation", + redirect: "/residentInformation/list", + meta: { + title: "居民信息管理", + icon: "list", + roles: ["admin", "editor"] + }, + children: [ + { + path: "list", + component: () => import("@/views/residentInformation/list"), + name: "residentInformationList", + meta: { + title: "居民信息列表", + icon: "list", + affix: true, + parentTitle: "居民信息管理" + } + } + ] } // { // path: "/staff", diff --git a/src/views/convenience/add.vue b/src/views/convenience/add.vue index 2cecdf0..b5b0729 100644 --- a/src/views/convenience/add.vue +++ b/src/views/convenience/add.vue @@ -1,9 +1,6 @@ - - - - + - + + {{ file }} + {{file}} + + + {{ file.substring(file.lastIndexOf("/") + 1) }} + + 审批结果:{{ item.approve ? "通过" : "驳回" }} @@ -532,10 +575,31 @@ - + + + + + { const tempRef = this.$refs.eventTypeRef; console.log(tempRef); - if(tempRef) - tempRef.toggleMenu(); + if (tempRef) tempRef.toggleMenu(); // tempRef.$el.style.display = "inline-block"; // this.$refs.eventTypeRef.focusFirstNode(); }, 100); @@ -1542,8 +1623,8 @@ h3 { margin-right: 6px; vertical-align: top; } -.icon_edit{ - background: url("./img/icon_edit.png") no-repeat; +.icon_edit { + background: url("./img/icon_edit.png") no-repeat; width: 16px; height: 16px; display: inline-block; diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 6ffb3c8..c172586 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -120,8 +120,8 @@ export default { // password: '111111' // }, loginForm: { - username: '', - captcha: '', + username: '22222222222', + captcha: '111111', appVersion: '1.0.0', system: 'IOS', device: navigator.userAgent, @@ -339,7 +339,7 @@ button:focus { padding: 12px 5px 12px 15px; color: $light_gray; height: 47px; - caret-color: $cursor; + caret-color: #000; &:-webkit-autofill { box-shadow: 0 0 0px 1000px $bg inset !important; diff --git a/src/views/residentInformation/list.vue b/src/views/residentInformation/list.vue new file mode 100644 index 0000000..74e7595 --- /dev/null +++ b/src/views/residentInformation/list.vue @@ -0,0 +1,276 @@ + + + + + + + + + 搜索 + + 新增 + + + + {{ scope.row.name }} + + + + + {{ scope.row.nameZ }} + + + + + {{ scope.row.phone }} + + + + + {{ scope.row.idCard }} + + + + + + {{ + scope.row.permanentResidenceRegion + + "-" + + scope.row.permanentResidenceTown + + "-" + + scope.row.permanentResidenceTownShip + }} + + + + + 修改 + + + + + + + + + + + + + + + + + + + + + + 女 + 男 + 未知 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 取 消 + 确 定 + + + + + + + + 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 2/7] =?UTF-8?q?=E5=B1=85=E6=B0=91=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E7=AE=A1=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;" > - 壤塘家园定点服务系统 + + 壤塘家园定点服务系统 + + - + 登录 + >登录 @@ -87,12 +93,12 @@ + + + + + + + + +
审批结果:{{ item.approve ? "通过" : "驳回" }} @@ -532,10 +575,31 @@