From 959a846bcfffe12d8024431284ce554983d3d2d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E5=89=8D=E6=98=8E?= <909355014@qq.com> Date: Sat, 22 Oct 2022 23:35:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E5=91=98=E7=BC=93=E5=AD=98=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 171 ++++--------- manifest.json | 6 +- pages.json | 2 +- pages/home/detail/ticketHandle.vue | 192 +++++++------- pages/login/login_.vue | 327 ++++++++++++++---------- pages/my/my.vue | 10 +- pages/workSpace/opls/high.vue | 2 +- pages/workSpace/opls/soil.vue | 2 +- pages/workSpace/opls/space.vue | 2 +- pages/workSpace/opls/usecl.vue | 2 +- pages/workSpace/visit/visitCreate.vue | 4 +- pages/workSpace/visit/vpeopleSelect.vue | 2 +- pages/workSpace/workSpace.vue | 2 +- store/index.js | 6 +- 14 files changed, 359 insertions(+), 371 deletions(-) diff --git a/App.vue b/App.vue index ec158fd..38300d6 100644 --- a/App.vue +++ b/App.vue @@ -4,6 +4,57 @@ globalData: { appid: 'wxf7d6140f507466be' }, + getUserRange() { + let that = this; + that.$u.api.deptList({ + page: 0, + type__in: 'rparty,dept', + query: '{id, name, parent, type}' + }).then(res => { + let list1 = res; + let list2 = []; + let reqList = []; + list1.forEach(function(item) { + reqList.push(that.$u.api.userList({ + page: 0, + belong_dept: item.id, + is_active: true, + query: '{id, name, belong_dept}' + })) + }) + Promise.all(reqList).then(res => { + for (let i = 0; i < res.length; i++) { + list1[i].children = res[i] + } + list1.forEach(item=>{ + if(item.type == 'dept'){ + list2.push({ ...item }) + } + }) + that.$u.vuex('vuex_userRange', that.parseData(list1)) + that.$u.vuex('vuex_userRange2', that.parseData(list2)) + }) + }) + }, + parseData(data) { + // * 先生成parent建立父子关系 + const obj = {}; + data.forEach((item) => { + obj[item.id] = item; + }); + const parentList = []; + data.forEach((item) => { + const parent = obj[item.parent]; + if (parent) { + // * 当前项有父节点 + parent.children = parent.children || []; + parent.children.unshift(item); + } else { + parentList.push(item); + } + }); + return parentList; + }, onLaunch() { // #ifdef APP-PLUS @@ -68,7 +119,6 @@ } }); // #endif - uni.getSystemInfo({ success(res) { console.log(res) @@ -99,125 +149,6 @@ // #endif } }) - - // #ifdef APP-PLUS - uni.showLoading({ - title: '自动登录中...', - mask: true - }) - uni.getStorage({ - key: 'mySecret', - success: function(res) { - let secret = res.data - if (secret) { - uni.showToast({ - title: JSON.parse(secret).username, - icon: "none" - }) - that.$u.api.loginSecret(JSON.parse(secret)).then(res => { - that.$u.vuex('vuex_token', res.access) - that.$u.api.getUserInfo().then(res => { - if(res.avatar){ - res.avatar = this.vuex_host + res.avatar - } - that.$u.vuex('vuex_user', res) - let perms = []; - for (let key in user.perms) { - perms.push(key); - } - console.log(perms); - that.$u.vuex('vuex_perm', perms) - // 修改资源请求地址 - }) - uni.reLaunch({ - url: '/pages/home/home_' - }) - }).catch(e=>{ - uni.reLaunch({ - url: '/pages/login/login_' - }) - }) - }else{ - uni.reLaunch({ - url: '/pages/login/login_' - }) - } - - }, - fail() { - uni.reLaunch({ - url: '/pages/login/login_' - }) - }, - complete() { - uni.hideLoading() - } - }); - - // 根据设备唯一标识进行自动登录 - uni.showToast({ - title: qyjyClientId, - icon: "none" - }) - /* that.$u.api.loginCOde(qyjyClientId).then(res => { - that.$u.api.getUserInfo().then(res => { - that.$u.vuex('vuex_user', res) - // 修改资源请求地址 - }) - uni.reLaunch({ - url: '/pages/home/home_' - }) - }).catch(res=>{ - uni.reLaunch({ - url: '/pages/login/login_' - }) - }) */ - // #endif - - - - - uni.showLoading({ - title: '自动登录中...', - mask: true - }) - uni.getStorage({ - key: 'mySecret', - success: function(res) { - let secret = res.data - if (secret) { - - uni.showToast({ - title: JSON.parse(secret).username, - icon: "none" - }) - let a=JSON.parse(secret).username; - console.log(a) - that.$u.api.getUserInfo().then(res => { - that.$u.vuex('vuex_user', res) - let perms = []; - for (let key in user.perms) { - perms.push(key); - } - console.log(perms); - that.$u.vuex('vuex_perm', perms) - if(res.type==='employee'||res.type==='remployee'){ - uni.reLaunch({ - url: '/pages/home/home_' - }) - }else{ - uni.reLaunch({ - url: '/pages/workSpace/workSpace' - }) - } - // 修改资源请求地址 - }) - } - }, - complete() { - uni.hideLoading() - } - }); }, } diff --git a/manifest.json b/manifest.json index 533deb8..4286f68 100644 --- a/manifest.json +++ b/manifest.json @@ -2,8 +2,8 @@ "name" : "曲阳金隅EHS", "appid" : "__UNI__B00D419", "description" : "曲阳金隅EHS", - "versionName" : "1.01.04", - "versionCode" : 10104, + "versionName" : "1.01.06", + "versionCode" : 10106, "transformPx" : false, /* 5+App特有相关 */ "app-plus" : { @@ -121,6 +121,6 @@ "mode" : "history", "base" : "/h5/" }, - "title" : "共享平台" + "title" : "曲阳金隅EHS" } } diff --git a/pages.json b/pages.json index c98d9d0..e475739 100644 --- a/pages.json +++ b/pages.json @@ -41,7 +41,7 @@ { "path": "pages/home/home_", "style": { - // "navigationBarTitleText": "曲阳金隅EHS主页", + "navigationBarTitleText": "曲阳金隅EHS主页", "enablePullDownRefresh": false } }, diff --git a/pages/home/detail/ticketHandle.vue b/pages/home/detail/ticketHandle.vue index c89bb3e..aadde16 100644 --- a/pages/home/detail/ticketHandle.vue +++ b/pages/home/detail/ticketHandle.vue @@ -2,32 +2,32 @@ - - - - 工单流水号 - - - {{ticketDetail.sn}} - + + + + 工单流水号 - - - 工单名称 - - - {{ticketDetail.title}} - - - - - 工单状态 - - - {{ticketDetail.state_.name}} - + + {{ticketDetail.sn}} + + + 工单名称 + + + {{ticketDetail.title}} + + + + + 工单状态 + + + {{ticketDetail.state_.name}} + + + @@ -192,7 +192,7 @@ - + @@ -269,7 +269,8 @@ 所属作业 - {{oplDetail.operation_.name}} + {{oplDetail.operation_.name}} + @@ -332,42 +333,44 @@ - - - * - 作业情况 - - + + + * + 作业情况 - - - + + + + + * + 审批意见 - - - * - 审批意见 - -