diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/WxMenuConfigMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/WxMenuConfigMapper.xml index 57b52317..2e3e93ce 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/WxMenuConfigMapper.xml +++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/WxMenuConfigMapper.xml @@ -140,7 +140,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join wx_menu_config_role smcr on smcr.smcid = smc.id left join sys_user_role ur on ur.role_id = smcr.role_id where smc.del_flag = 0 - and ur.user_id = #{currentUserId} + and (ur.user_id = #{currentUserId} or smc.menu_identi='GRQMPZ') and smc.project_id = #{activeProjectId} and smc.menu_type = #{menuType} order by smc.menu_sort asc diff --git a/yanzhu-ui-app/miniprogram/pageage/mobile_attendance/attendance/list/index.js b/yanzhu-ui-app/miniprogram/pageage/mobile_attendance/attendance/list/index.js index 3665c4f8..a768d641 100644 --- a/yanzhu-ui-app/miniprogram/pageage/mobile_attendance/attendance/list/index.js +++ b/yanzhu-ui-app/miniprogram/pageage/mobile_attendance/attendance/list/index.js @@ -1,7 +1,7 @@ import { getToken, getUserInfo } from "../../../../utils/auth.js"; import { getMobileAttendanceConfig } from "../../../../api/project.js"; import { calculateDistance } from "../../../../utils/location.js"; - +import cfg from "../../../../config.js"; const app = getApp(); Page({ @@ -20,6 +20,7 @@ Page({ currentAddress: "", // 当前位置地址 pageNum: 1, pageSize: 10, + baseImgUrl: cfg.baseImgUrl, }, /** @@ -168,7 +169,11 @@ Page({ }, returnToPage: function () { /*关闭当前页面,跳转到其它页面。*/ - if (wx.getStorageSync("nav-menu") == "xmgl") { + if (wx.getStorageSync("nav-menu") == "prjInfo") { + wx.redirectTo({ + url: "../../../project_info/index", + }); + } else if (wx.getStorageSync("nav-menu") == "xmgl") { wx.redirectTo({ url: "../../../project_more/index", }); diff --git a/yanzhu-ui-app/miniprogram/pageage/mobile_attendance/attendance/list/index.wxml b/yanzhu-ui-app/miniprogram/pageage/mobile_attendance/attendance/list/index.wxml index aaec85c7..58ab6ed8 100644 --- a/yanzhu-ui-app/miniprogram/pageage/mobile_attendance/attendance/list/index.wxml +++ b/yanzhu-ui-app/miniprogram/pageage/mobile_attendance/attendance/list/index.wxml @@ -28,7 +28,7 @@ - + 暂无数据 diff --git a/yanzhu-ui-app/miniprogram/pageage/mobile_attendance/attendance_config/list/index.js b/yanzhu-ui-app/miniprogram/pageage/mobile_attendance/attendance_config/list/index.js index c1361bf0..feabfb95 100644 --- a/yanzhu-ui-app/miniprogram/pageage/mobile_attendance/attendance_config/list/index.js +++ b/yanzhu-ui-app/miniprogram/pageage/mobile_attendance/attendance_config/list/index.js @@ -27,6 +27,7 @@ Page({ pageNum: 1, pageSize: 10, total: 0, + baseImgUrl: config.baseImgUrl, // 添加 baseImgUrl 到页面数据中 }, /** diff --git a/yanzhu-ui-app/miniprogram/pageage/mobile_attendance/attendance_config/list/index.wxml b/yanzhu-ui-app/miniprogram/pageage/mobile_attendance/attendance_config/list/index.wxml index cb920056..4fd5893e 100644 --- a/yanzhu-ui-app/miniprogram/pageage/mobile_attendance/attendance_config/list/index.wxml +++ b/yanzhu-ui-app/miniprogram/pageage/mobile_attendance/attendance_config/list/index.wxml @@ -5,7 +5,7 @@ - + @@ -31,7 +31,7 @@ - + 暂无数据 @@ -75,7 +75,7 @@ - + 新增 diff --git a/yanzhu-ui-app/miniprogram/pageage/project_checked/list/index.wxml b/yanzhu-ui-app/miniprogram/pageage/project_checked/list/index.wxml index 7ffb91c9..cb01d251 100644 --- a/yanzhu-ui-app/miniprogram/pageage/project_checked/list/index.wxml +++ b/yanzhu-ui-app/miniprogram/pageage/project_checked/list/index.wxml @@ -73,13 +73,13 @@ - + 暂无数据 - + 新增 diff --git a/yanzhu-ui-app/miniprogram/pageage/project_flowable/subDepts/index.wxml b/yanzhu-ui-app/miniprogram/pageage/project_flowable/subDepts/index.wxml index 64d884ac..b90bb31d 100644 --- a/yanzhu-ui-app/miniprogram/pageage/project_flowable/subDepts/index.wxml +++ b/yanzhu-ui-app/miniprogram/pageage/project_flowable/subDepts/index.wxml @@ -49,7 +49,7 @@ - + 暂无数据 diff --git a/yanzhu-ui-app/miniprogram/pageage/project_flowable/subDeptsUsers/index.wxml b/yanzhu-ui-app/miniprogram/pageage/project_flowable/subDeptsUsers/index.wxml index 86c38fa2..f4946228 100644 --- a/yanzhu-ui-app/miniprogram/pageage/project_flowable/subDeptsUsers/index.wxml +++ b/yanzhu-ui-app/miniprogram/pageage/project_flowable/subDeptsUsers/index.wxml @@ -31,7 +31,7 @@ 办结时间 {{item.endTime}} - + @@ -56,7 +56,7 @@ - + 暂无数据 diff --git a/yanzhu-ui-app/miniprogram/pageage/project_info/index.js b/yanzhu-ui-app/miniprogram/pageage/project_info/index.js index 963a3a63..93a94897 100644 --- a/yanzhu-ui-app/miniprogram/pageage/project_info/index.js +++ b/yanzhu-ui-app/miniprogram/pageage/project_info/index.js @@ -1,21 +1,14 @@ -import config from '../../config' -import { - getToken, - getUserInfo -} from '../../utils/auth' -import { - findProjectInfo, - findProjectDepts -} from '../../api/project' +import config from "../../config"; +import { getToken, getUserInfo } from "../../utils/auth"; +import { findUserMenuList } from "../../api/publics"; +import { findProjectInfo, findProjectDepts } from "../../api/project"; import { findSubDeptsUsers, findDaysAttendanceView, findUsersAttendanceView, - findSubDeptsAttendanceView -} from '../api/attendance' -import { - findMyTask -} from '../api/flowable' + findSubDeptsAttendanceView, +} from "../api/attendance"; +import { findMyTask } from "../api/flowable"; const app = getApp(); Page({ /** @@ -27,101 +20,115 @@ Page({ //项目信息 projectInfo: {}, projectDeptsList: [], - deptTypes: [{ - "name": "建设单位", - "iconSrc": "https://xiangguan.sxyanzhu.com/profile/static/icon/WEB_jsdw.png" - }, { - "name": "监理单位", - "iconSrc": "https://xiangguan.sxyanzhu.com/profile/static/icon/WEB_jldw.png" - }, { - "name": "设计单位", - "iconSrc": "https://xiangguan.sxyanzhu.com/profile/static/icon/WEB_sjdw.png" - }, { - "name": "检测单位", - "iconSrc": "https://xiangguan.sxyanzhu.com/profile/static/icon/WEB_jcjg.png" - }, { - "name": "勘察单位", - "iconSrc": "https://xiangguan.sxyanzhu.com/profile/static/icon/web_ktdw.png" - }, { - "name": "总包单位", - "iconSrc": "https://xiangguan.sxyanzhu.com/profile/static/icon/web_zbdw.png" - }], + deptTypes: [ + { + name: "建设单位", + iconSrc: config.baseImgUrl + "/profile/static/icon/WEB_jsdw.png", + }, + { + name: "监理单位", + iconSrc: config.baseImgUrl + "/profile/static/icon/WEB_jldw.png", + }, + { + name: "设计单位", + iconSrc: config.baseImgUrl + "/profile/static/icon/WEB_sjdw.png", + }, + { + name: "检测单位", + iconSrc: config.baseImgUrl + "/profile/static/icon/WEB_jcjg.png", + }, + { + name: "勘察单位", + iconSrc: config.baseImgUrl + "/profile/static/icon/web_ktdw.png", + }, + { + name: "总包单位", + iconSrc: config.baseImgUrl + "/profile/static/icon/web_zbdw.png", + }, + ], active: 0, - projectId: '', - projectName: '', + projectId: "", + projectName: "", initData: {}, aqglDb: 0, zlglDb: 0, todoDb: 0, nactive: 0, - labourData: [{ - name: "管理人员", - total: 0, - unit: "人", - yesMonitor: 180 - }, - { - name: "劳务人员", - yesMonitor: 0, - total: 0, - unit: "人" - }, - { - name: "特殊工种", - yesMonitor: 0, - total: 0, - unit: "人" - }, + labourData: [ + { + name: "管理人员", + total: 0, + unit: "人", + yesMonitor: 180, + }, + { + name: "劳务人员", + yesMonitor: 0, + total: 0, + unit: "人", + }, + { + name: "特殊工种", + yesMonitor: 0, + total: 0, + unit: "人", + }, ], labourDataList: [], - labourDays: [{ - name: "管理人员", - total: 0, - unit: "人", - yesMonitor: 180 - }, - { - name: "劳务人员", - yesMonitor: 0, - total: 0, - unit: "人" - }, - { - name: "特殊工种", - yesMonitor: 0, - total: 0, - unit: "人" - }, + labourDays: [ + { + name: "管理人员", + total: 0, + unit: "人", + yesMonitor: 180, + }, + { + name: "劳务人员", + yesMonitor: 0, + total: 0, + unit: "人", + }, + { + name: "特殊工种", + yesMonitor: 0, + total: 0, + unit: "人", + }, ], labourDaysTotal: 0, - labourImg: "https://szgcwx.jhncidg.com/staticFiles/icon/zgry.png", + labourImg: config.baseImgUrl + "/cdn/appimgs/zgry.png", labourName: "在岗人员", labourTotal: 0, - labourTypeList: [{ - name: "在岗人员", - total: 0, - img: "https://szgcwx.jhncidg.com/staticFiles/icon/zgry.png" - }, { - name: "离岗人员", - total: 0, - img: "https://szgcwx.jhncidg.com/staticFiles/icon/rylg.png" - }], + labourTypeList: [ + { + name: "在岗人员", + total: 0, + img: config.baseImgUrl + "/cdn/appimgs/zgry.png", + }, + { + name: "离岗人员", + total: 0, + img: config.baseImgUrl + "/cdn/appimgs/rylg.png", + }, + ], animation: true, animationData: {}, labourDatas: { - unit: '人', - legend: ['出勤人数', '当前在岗'], - color: ['#2e6ed0', '#fb9300'], - Xdata: ['01-01', '01-02', '01-03', '01-04', '01-05', '01-06', '01-07'], + unit: "人", + legend: ["出勤人数", "当前在岗"], + color: ["#2e6ed0", "#fb9300"], + Xdata: ["01-01", "01-02", "01-03", "01-04", "01-05", "01-06", "01-07"], Ydata: [ [0, 0, 0, 0, 0, 0, 0], - [0, 0, 0, 0, 0, 0, 0] - ] + [0, 0, 0, 0, 0, 0, 0], + ], }, switchChart: false, attendanceListData: [], subDeptUserInfo: {}, - imgBaseUrl: config.baseImgUrl + imgBaseUrl: config.baseImgUrl, + menuList: [], + baseImgUrl: config.baseImgUrl, }, /** @@ -130,10 +137,10 @@ Page({ onLoad: function (options) { if (!getToken()) { wx.redirectTo({ - url: '../../pages/login/login', - }) + url: "../../pages/login/login", + }); } - wx.setStorageSync('nav-menu', "xmgk"); + wx.setStorageSync("nav-menu", "xmgk"); const proUserInfo = getUserInfo(); app.globalData.subDeptUserData = proUserInfo.projectUserInfo; this.initAnimationData(); @@ -145,7 +152,7 @@ Page({ id: app.globalData.useProjectId, text: app.globalData.useProjectName, }, - subDeptUserInfo: proUserInfo.projectUserInfo + subDeptUserInfo: proUserInfo.projectUserInfo, }); //项目基本信息 this.getProjectInfo(app.globalData.useProjectId); @@ -153,19 +160,50 @@ Page({ this.getProUserDatas(); //项目建设单位 this.getProjectDepts(app.globalData.useProjectId); + this.getMenu(); + }, + getMenu() { + let subDeptUserInfo = this.data.subDeptUserInfo; + if ( + (subDeptUserInfo.subDeptType == "4" || + subDeptUserInfo.subDeptType == "5") && + (subDeptUserInfo.userPost == "4" || subDeptUserInfo.userPost == "5") + ) { + let proId = app.globalData.useProjectId; + findUserMenuList(proId, "gdgn").then((res) => { + if (res.code == 200) { + let menus = (res.data || []).filter( + (it) => it.menuIdenti != "YDKQGL" + ); + this.setData({ + menuList: menus, + }); + } + }); + } + }, + goMenu: function (event) { + let _url = event.currentTarget.dataset.url; + if (!_url) { + app.toast("正在建设中..."); + return false; + } + wx.setStorageSync("nav-menu", "prjInfo"); + wx.redirectTo({ + url: _url, + }); }, - /** * 统计劳务人员信息 - * @param {*} proId + * @param {*} proId */ getSubDeptsUsers(proId) { - findSubDeptsUsers(proId).then(res => { + findSubDeptsUsers(proId).then((res) => { if (res.code == 200) { let zg = 0; let lg = 0; - res.data.forEach(item => { - if (item.useStatus == '0') { + res.data.forEach((item) => { + if (item.useStatus == "0") { zg += item.total; } else { lg += item.total; @@ -175,8 +213,8 @@ Page({ "labourTypeList[0].total": zg, "labourTypeList[1].total": lg, labourTotal: zg, - labourDataList: res.data || [] - }) + labourDataList: res.data || [], + }); this.initSubDeptUsersCharts(); } }); @@ -188,8 +226,8 @@ Page({ initAnimationData() { var animation = wx.createAnimation({ duration: 1000, - timingFunction: 'linear', - }) + timingFunction: "linear", + }); this.animation = animation; if (this.data.animation) { animation.translateY(-8).step(); @@ -198,11 +236,11 @@ Page({ } this.setData({ animation: this.data.animation ? false : true, - animationData: animation.export() - }) + animationData: animation.export(), + }); setTimeout(() => { this.initAnimationData(); - }, 1200) + }, 1200); }, /** @@ -214,22 +252,22 @@ Page({ let gl = 0; let ts = 0; let lw = 0; - labourDataList.forEach(item => { + labourDataList.forEach((item) => { if (this.data.nactive == 0) { - if (item.useStatus == '0') { - if (item.craftType == '2') { + if (item.useStatus == "0") { + if (item.craftType == "2") { ts += item.total; - } else if (item.craftType == '3') { + } else if (item.craftType == "3") { gl += item.total; } else { lw += item.total; } } } else { - if (item.useStatus != '0') { - if (item.craftType == '2') { + if (item.useStatus != "0") { + if (item.craftType == "2") { ts += item.total; - } else if (item.craftType == '3') { + } else if (item.craftType == "3") { gl += item.total; } else { lw += item.total; @@ -244,8 +282,8 @@ Page({ "labourData[1].yesMonitor": ts, "labourData[2].total": lw, "labourData[2].yesMonitor": lw, - labourTotal: this.data.labourTypeList[this.data.nactive].total - }) + labourTotal: this.data.labourTypeList[this.data.nactive].total, + }); if (this.data.switchChart) { let chats = this.selectComponent("#userChart"); chats.initChart(); @@ -256,18 +294,18 @@ Page({ /** * 初始化 * 今日考勤 - * @param {*} proId + * @param {*} proId */ initSubDeptDaysCharts(proId) { - findDaysAttendanceView(proId).then(res => { + findDaysAttendanceView(proId).then((res) => { if (res.code == 200) { let gl = 0; let ts = 0; let lw = 0; - res.data.forEach(item => { - if (item.craftType == '2') { + res.data.forEach((item) => { + if (item.craftType == "2") { ts += item.total; - } else if (item.craftType == '3') { + } else if (item.craftType == "3") { gl += item.total; } else { lw += item.total; @@ -280,8 +318,8 @@ Page({ "labourDays[1].yesMonitor": ts, "labourDays[2].total": lw, "labourDays[2].yesMonitor": lw, - labourDaysTotal: gl + ts + lw - }) + labourDaysTotal: gl + ts + lw, + }); if (this.data.switchChart) { let chats = this.selectComponent("#attsChart"); chats.initChart(); @@ -293,22 +331,22 @@ Page({ /** * 统计 * 最近出勤信息 - * @param {*} proId + * @param {*} proId */ getSubDeptsAttendanceView(proId) { - findSubDeptsAttendanceView(proId).then(res => { + findSubDeptsAttendanceView(proId).then((res) => { if (res.code == 200) { let xd = []; let yd1 = []; let yd2 = []; - res.data.list.forEach(item => { + res.data.list.forEach((item) => { xd.push(item.attendanceTime); yd1.push(item.total); }); if (xd.length < 7) { let n = 7 - xd.length; for (let i = 0; i < n; i++) { - xd.push('-'); + xd.push("-"); yd1.push(0); } } @@ -320,7 +358,7 @@ Page({ yd.push(yd2); this.setData({ "labourDatas.Xdata": xd, - "labourDatas.Ydata": yd + "labourDatas.Ydata": yd, }); if (this.data.switchChart) { let chats = this.selectComponent("#chartBar"); @@ -332,36 +370,49 @@ Page({ /** * 查询用户考勤 - * @param {*} proId + * @param {*} proId */ getUsersAttendanceView(proId) { - findUsersAttendanceView(proId).then(res => { + findUsersAttendanceView(proId).then((res) => { if (res.code == 200) { this.setData({ - attendanceListData: res.data + attendanceListData: res.data, }); } - }) + }); }, /** * 单位人员信息 - * @param {*} proId + * @param {*} proId */ getProUserDatas() { //劳务人员信息 - if ((app.globalData.subDeptUserData.subDeptType == '1' || app.globalData.subDeptUserData.subDeptType == '4' || app.globalData.subDeptUserData.subDeptType == '5') && app.globalData.subDeptUserData.userPost != '4' && app.globalData.subDeptUserData.userPost != '5' && app.globalData.subDeptUserData.userPost != '6' && app.globalData.subDeptUserData.userPost != '8') { + if ( + (app.globalData.subDeptUserData.subDeptType == "1" || + app.globalData.subDeptUserData.subDeptType == "4" || + app.globalData.subDeptUserData.subDeptType == "5") && + app.globalData.subDeptUserData.userPost != "4" && + app.globalData.subDeptUserData.userPost != "5" && + app.globalData.subDeptUserData.userPost != "6" && + app.globalData.subDeptUserData.userPost != "8" + ) { //统计劳务人员信息 this.getSubDeptsUsers(app.globalData.useProjectId); this.initSubDeptDaysCharts(app.globalData.useProjectId); } this.awaitTask(); //今日出勤信息 - if (app.globalData.subDeptUserData.subDeptType == '1') { + if (app.globalData.subDeptUserData.subDeptType == "1") { this.getSubDeptsAttendanceView(app.globalData.useProjectId); } //人员出勤信息 - if (app.globalData.subDeptUserData.userPost == '4' || app.globalData.subDeptUserData.userPost == '5' || app.globalData.subDeptUserData.userPost == '6' || app.globalData.subDeptUserData.userPost == '8') { + if ( + app.globalData.subDeptUserData.userPost == "4" || + app.globalData.subDeptUserData.userPost == "5" || + app.globalData.subDeptUserData.userPost == "6" || + app.globalData.subDeptUserData.userPost == "8" + ) { //统计劳务人员信息 this.getUsersAttendanceView(app.globalData.useProjectId); } @@ -379,7 +430,7 @@ Page({ onChange(event) { // event.detail 的值为当前选中项的索引 this.setData({ - active: event.detail + active: event.detail, }); }, @@ -388,20 +439,20 @@ Page({ */ initLabourDatas() { findGroupAllByDays({ - projectId: app.globalData.projectId - }).then(res => { + projectId: app.globalData.projectId, + }).then((res) => { if (res.code == 200) { let xd = []; let yd1 = []; let yd2 = []; - res.data.list.forEach(item => { + res.data.list.forEach((item) => { xd.push(item.attendanceTime); yd1.push(item.total); }); if (xd.length < 7) { let n = 7 - xd.length; for (let i = 0; i < n; i++) { - xd.push(''); + xd.push(""); yd1.push(0); } } @@ -413,7 +464,7 @@ Page({ yd.push(yd2); this.setData({ "labourDatas.Xdata": xd, - "labourDatas.Ydata": yd + "labourDatas.Ydata": yd, }); if (this.data.switchChart) { let chats = this.selectComponent("#chartBar"); @@ -425,22 +476,24 @@ Page({ /** * 查询项目详情 - * @param {*} proId + * @param {*} proId */ getProjectInfo: function (proId) { - findProjectInfo(proId).then(res => { + findProjectInfo(proId).then((res) => { if (res.data.scheduledStartTime) { res.data.scheduledStartTime = res.data.scheduledStartTime.split("T")[0]; } else { res.data.scheduledStartTime = " - "; } if (res.data.actualOperatingTime) { - res.data.actualOperatingTime = res.data.actualOperatingTime.split("T")[0]; + res.data.actualOperatingTime = + res.data.actualOperatingTime.split("T")[0]; } else { res.data.actualOperatingTime = " - "; } if (res.data.plannedCompletionTime) { - res.data.plannedCompletionTime = res.data.plannedCompletionTime.split("T")[0]; + res.data.plannedCompletionTime = + res.data.plannedCompletionTime.split("T")[0]; } else { res.data.plannedCompletionTime = " - "; } @@ -454,21 +507,21 @@ Page({ // }); this.setData({ projectInfo: res.data, - projectDeptsList: res.data.projectDeptsList - }) + projectDeptsList: res.data.projectDeptsList, + }); }); }, /** * 查询 * 项目建设单位 - * @param {*} proId + * @param {*} proId */ getProjectDepts: function (proId) { - findProjectDepts(proId).then(res => { + findProjectDepts(proId).then((res) => { this.setData({ - projectDeptsList: res.data - }) + projectDeptsList: res.data, + }); }); }, @@ -478,7 +531,7 @@ Page({ this.setData({ nactive: e.target.dataset.set, labourImg: this.data.labourTypeList[e.target.dataset.set].img, - }) + }); this.initSubDeptUsersCharts(); } }, @@ -490,8 +543,8 @@ Page({ app.globalData.useProjectId = projectId; app.globalData.useProjectName = projectName; this.setData({ - switchChart: true - }) + switchChart: true, + }); this.onLoad(); }, @@ -504,31 +557,31 @@ Page({ /** * 拨打电话 - * @param {*} event + * @param {*} event */ calling: function (event) { let callPhone = event.currentTarget.dataset.phone; wx.makePhoneCall({ phoneNumber: callPhone, success: function () { - console.log("拨打电话成功!") + console.log("拨打电话成功!"); }, fail: function () { - console.log("拨打电话失败!") - } - }) + console.log("拨打电话失败!"); + }, + }); }, showImg: function (e) { let paths = e.target.dataset.set; let path = []; - paths.split(',').forEach(url => { + paths.split(",").forEach((url) => { path.push(config.baseImgUrl + url); }); wx.previewImage({ urls: path, - current: path[0] - }) + current: path[0], + }); }, /** @@ -537,8 +590,8 @@ Page({ goLWGL: function () { if (this.data.nactive == 2) { wx.redirectTo({ - url: '../../pageage/project_attendance/project_attendanceData/list/index' - }) + url: "../../pageage/project_attendance/project_attendanceData/list/index", + }); } else { let type; if (this.data.nactive == 0) { @@ -547,8 +600,10 @@ Page({ type = 2; } wx.redirectTo({ - url: '../../pageage/project_attendance/project_attendanceUser/list/index?type=' + type - }) + url: + "../../pageage/project_attendance/project_attendanceUser/list/index?type=" + + type, + }); } }, @@ -557,47 +612,47 @@ Page({ */ goZJCQ: function () { wx.redirectTo({ - url: '../../pageage/project_attendance/project_attendanceData/list/index' - }) + url: "../../pageage/project_attendance/project_attendanceData/list/index", + }); }, //跳转到安全管控 XMSP: function () { - wx.setStorageSync('nav-menu', "aqgl"); + wx.setStorageSync("nav-menu", "aqgl"); wx.redirectTo({ - url: '../project_safety/index' - }) + url: "../project_safety/index", + }); }, //跳转到质量管理 ZLGL: function () { - wx.setStorageSync('nav-menu', "zlgl"); + wx.setStorageSync("nav-menu", "zlgl"); wx.redirectTo({ - url: '../project_quality/index' - }) + url: "../project_quality/index", + }); }, //跳转到进度管理 JDGL: function () { - wx.setStorageSync('nav-menu', "xmgk"); + wx.setStorageSync("nav-menu", "xmgk"); wx.redirectTo({ - url: '../project_schedule/list/index' - }) + url: "../project_schedule/list/index", + }); }, //跳转到项目管理 XMGL: function () { - wx.setStorageSync('nav-menu', "xmgl"); + wx.setStorageSync("nav-menu", "xmgl"); wx.redirectTo({ - url: '../project_more/index' - }) + url: "../project_more/index", + }); }, //跳转到项目列表 XMLB: function () { wx.redirectTo({ - url: '../project_list/index' - }) + url: "../project_list/index", + }); }, /** @@ -605,15 +660,18 @@ Page({ */ awaitTask() { let param = "proId=" + app.globalData.useProjectId; - findMyTask(param).then(res => { + findMyTask(param).then((res) => { if (res.code == 200) { let proUserInfo = this.data.subDeptUserInfo; this.setData({ - todoDb: proUserInfo.subDeptType == "1" ? (res.data.dwsh + res.data.rysh) : res.data.todo, + todoDb: + proUserInfo.subDeptType == "1" + ? res.data.dwsh + res.data.rysh + : res.data.todo, aqglDb: proUserInfo.subDeptType == "1" ? res.data.aqgl : 0, - zlglDb: proUserInfo.subDeptType == "1" ? res.data.zlgl : 0 - }) + zlglDb: proUserInfo.subDeptType == "1" ? res.data.zlgl : 0, + }); } }); }, -}) \ No newline at end of file +}); diff --git a/yanzhu-ui-app/miniprogram/pageage/project_info/index.wxml b/yanzhu-ui-app/miniprogram/pageage/project_info/index.wxml index b67b8f85..2c5a4832 100644 --- a/yanzhu-ui-app/miniprogram/pageage/project_info/index.wxml +++ b/yanzhu-ui-app/miniprogram/pageage/project_info/index.wxml @@ -26,51 +26,51 @@ - + 项目单位:{{projectInfo.comName}} - + 所属区域:{{projectInfo.province+' - '+projectInfo.city}} - + 详细地址:{{projectInfo.projectAddress}} - + 项目类型:{{projectInfo.projectTypeName}} - + 总建筑面积:{{projectInfo.totalBuildingArea}} - + 计划开工日期:{{projectInfo.scheduledStartTime}} - + 实际开工日期:{{projectInfo.actualOperatingTime}} - + 计划竣工日期:{{projectInfo.plannedCompletionTime}} - + 总工期:{{projectInfo.projectTimeLimit + ' 天'}} - + 项目负责人:{{projectInfo.projectPerson}} - + 负责人手机号:{{projectInfo.projectPersonPhone}} - + 项目概述:{{projectInfo.projectSummarize}} @@ -78,7 +78,7 @@ - + {{item.deptType}} @@ -90,7 +90,22 @@ - + + + + + {{fbdwDB}} + {{fbrtDB}} + {{aqyhDB}} + {{zlyhDB}} + {{checkDB}} + + {{item.menuName}} + + + + @@ -142,7 +157,7 @@ - + @@ -249,7 +264,7 @@ - + 暂无数据 @@ -259,7 +274,6 @@ - diff --git a/yanzhu-ui-app/miniprogram/pageage/project_info/index.wxss b/yanzhu-ui-app/miniprogram/pageage/project_info/index.wxss index c5b2a97a..0b8d3c71 100644 --- a/yanzhu-ui-app/miniprogram/pageage/project_info/index.wxss +++ b/yanzhu-ui-app/miniprogram/pageage/project_info/index.wxss @@ -252,4 +252,24 @@ .bt30{ margin-bottom: 20px; +} + +.gd_max { + padding: 10rpx 50rpx 0; +} + +.gd_min { + padding: 30rpx 0; + text-align: center; + position: relative; +} + +.gd_min image { + width: 150rpx; + height: 150rpx; +} + +.gd_min view { + padding: 10rpx; + color: #89a4eb; } \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/pageage/project_magusers/list/index.js b/yanzhu-ui-app/miniprogram/pageage/project_magusers/list/index.js index 10df9b16..f7ec03b8 100644 --- a/yanzhu-ui-app/miniprogram/pageage/project_magusers/list/index.js +++ b/yanzhu-ui-app/miniprogram/pageage/project_magusers/list/index.js @@ -1,228 +1,226 @@ -import { - getToken -} from '../../../utils/auth' -import { - subusersList, - subusersCount -} from '../../../api/project' -const app = getApp() +import config from "../../../config"; +import { getToken } from "../../../utils/auth"; +import { subusersList, subusersCount } from "../../../api/project"; +const app = getApp(); Page({ + /** + * 页面的初始数据 + */ + data: { + addFlag: false, + initData: {}, + pageNum: 1, + pageSize: 10000, + total: 0, + listData: [], + activeState: "0", + yrcCount: 0, + ylcCount: 0, + activeName: "0_0", + imgBaseUrl: config.baseImgUrl, // 添加 imgBaseUrl + }, - /** - * 页面的初始数据 - */ - data: { - addFlag: false, - initData: {}, - pageNum: 1, - pageSize: 10000, - total: 0, - listData: [], - activeState: "0", - yrcCount: 0, - ylcCount: 0, - activeName: "0_0", - }, - - //项目切换 返回值 - onProjectSelect(e) { - let projectId = e.detail.id; - let projectName = e.detail.text; - app.globalData.useProjectId = projectId; - app.globalData.useProjectName = projectName; - this.onLoad(); - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad(options) { - if (!getToken()) { - wx.redirectTo({ - url: '../../../pages/login/login', - }) - } - this.setData({ - addFlag: true, - initData: { - id: app.globalData.useProjectId, - text: app.globalData.useProjectName, - }, - pageNum: 1, - pageSize: 10000, - listData: [], - total: 0 - }); - //获取数据列表 - this.getListData(); - this.getListCount(); - }, - - /** - * 添加按钮 - */ - skipAdd() { - wx.redirectTo({ - url: `../add/index`, - }) - }, - - /** - * 获取详情 - * @param {*} e - */ - getInfo(e) { - let _id = e.currentTarget.dataset.set; - wx.redirectTo({ - url: `../info/index?id=${_id}`, - }) - }, - - /** - * 修改按钮 - * @param {*} e - */ - editInfo(e) { - let _id = e.currentTarget.dataset.set; - wx.redirectTo({ - url: `../add/index?id=${_id}`, - }) - }, - - // 手风琴 - onChange(e) { - this.setData({ - activeName: e.target.dataset.set - }); - }, - - /** - * 查询数据列表 - */ - getListData() { - let params = "pageNum=" + this.data.pageNum + "&pageSize=" + this.data.pageSize + "&projectId=" + app.globalData.useProjectId + "&useStatus=" + this.data.activeState + "&activeTags=finished&searchValue=magUsers"; - subusersList(params).then(res => { - if (res.code == 200) { - this.setData({ - total: res.total, - listData: this.data.listData.concat(res.rows) - }) - } - }); - }, - - /** - * 统计数据列表 - */ - getListCount() { - let params = "pageNum=" + this.data.pageNum + "&pageSize=" + this.data.pageSize + "&projectId=" + app.globalData.useProjectId + "&activeTags=finished&searchValue=magUsers"; - subusersCount(params).then(res => { - if (res.code == 200) { - let _yrc = 0, - _ylc = 0; - res.data.forEach(item => { - if (item.useStatus == "0") { - _yrc = item.total; - } else { - _ylc = item.total; - } - }); - this.setData({ - yrcCount: _yrc, - ylcCount: _ylc - }) - } - }); - }, - - /** - * 标签切换 - */ - trainJump(e) { - let index = e.currentTarget.dataset.index; - let nav = ""; - if (index == 1) { - nav = '0'; - } else { - nav = '1'; - } - this.setData({ - activeState: nav, - pageNum: 1, - pageSize: 10000, - listData: [], - }); - this.getListData(); - }, - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady() { - - }, - - /** - * 生命周期函数--监听页面显示 - */ - onShow() { - - }, - - returnToPage: function () { - /*关闭当前页面,跳转到其它页面。*/ - wx.redirectTo({ - url: '../../project_more/index', - }) - }, - - /** - * 滚动到底部 - */ - onScrollToLower() { - let nal = Math.ceil(this.data.total / this.data.pageSize); - if (this.data.pageNum < nal) { - this.setData({ - pageNum: this.data.pageNum + 1 - }); - this.getListData(); - } else { - console.log("已经到底了,没有数据可加载!!!"); - } - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide() { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload() { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh() { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom() { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage() { + //项目切换 返回值 + onProjectSelect(e) { + let projectId = e.detail.id; + let projectName = e.detail.text; + app.globalData.useProjectId = projectId; + app.globalData.useProjectName = projectName; + this.onLoad(); + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + if (!getToken()) { + wx.redirectTo({ + url: "../../../pages/login/login", + }); } -}) \ No newline at end of file + this.setData({ + addFlag: true, + initData: { + id: app.globalData.useProjectId, + text: app.globalData.useProjectName, + }, + pageNum: 1, + pageSize: 10000, + listData: [], + total: 0, + }); + //获取数据列表 + this.getListData(); + this.getListCount(); + }, + + /** + * 添加按钮 + */ + skipAdd() { + wx.redirectTo({ + url: `../add/index`, + }); + }, + + /** + * 获取详情 + * @param {*} e + */ + getInfo(e) { + let _id = e.currentTarget.dataset.set; + wx.redirectTo({ + url: `../info/index?id=${_id}`, + }); + }, + + /** + * 修改按钮 + * @param {*} e + */ + editInfo(e) { + let _id = e.currentTarget.dataset.set; + wx.redirectTo({ + url: `../add/index?id=${_id}`, + }); + }, + + // 手风琴 + onChange(e) { + this.setData({ + activeName: e.target.dataset.set, + }); + }, + + /** + * 查询数据列表 + */ + getListData() { + let params = + "pageNum=" + + this.data.pageNum + + "&pageSize=" + + this.data.pageSize + + "&projectId=" + + app.globalData.useProjectId + + "&useStatus=" + + this.data.activeState + + "&activeTags=finished&searchValue=magUsers"; + subusersList(params).then((res) => { + if (res.code == 200) { + this.setData({ + total: res.total, + listData: this.data.listData.concat(res.rows), + }); + } + }); + }, + + /** + * 统计数据列表 + */ + getListCount() { + let params = + "pageNum=" + + this.data.pageNum + + "&pageSize=" + + this.data.pageSize + + "&projectId=" + + app.globalData.useProjectId + + "&activeTags=finished&searchValue=magUsers"; + subusersCount(params).then((res) => { + if (res.code == 200) { + let _yrc = 0, + _ylc = 0; + res.data.forEach((item) => { + if (item.useStatus == "0") { + _yrc = item.total; + } else { + _ylc = item.total; + } + }); + this.setData({ + yrcCount: _yrc, + ylcCount: _ylc, + }); + } + }); + }, + + /** + * 标签切换 + */ + trainJump(e) { + let index = e.currentTarget.dataset.index; + let nav = ""; + if (index == 1) { + nav = "0"; + } else { + nav = "1"; + } + this.setData({ + activeState: nav, + pageNum: 1, + pageSize: 10000, + listData: [], + }); + this.getListData(); + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() {}, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() {}, + + returnToPage: function () { + /*关闭当前页面,跳转到其它页面。*/ + wx.redirectTo({ + url: "../../project_more/index", + }); + }, + + /** + * 滚动到底部 + */ + onScrollToLower() { + let nal = Math.ceil(this.data.total / this.data.pageSize); + if (this.data.pageNum < nal) { + this.setData({ + pageNum: this.data.pageNum + 1, + }); + this.getListData(); + } else { + console.log("已经到底了,没有数据可加载!!!"); + } + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() {}, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() {}, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() {}, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() {}, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() {}, +}); diff --git a/yanzhu-ui-app/miniprogram/pageage/project_magusers/list/index.wxml b/yanzhu-ui-app/miniprogram/pageage/project_magusers/list/index.wxml index 9304b3cd..62663ddc 100644 --- a/yanzhu-ui-app/miniprogram/pageage/project_magusers/list/index.wxml +++ b/yanzhu-ui-app/miniprogram/pageage/project_magusers/list/index.wxml @@ -3,7 +3,7 @@ - + @@ -47,13 +47,13 @@ - + 暂无数据 - + 新增 diff --git a/yanzhu-ui-app/miniprogram/pageage/project_problemmodify/list/index.wxml b/yanzhu-ui-app/miniprogram/pageage/project_problemmodify/list/index.wxml index a65f312d..381d6b16 100644 --- a/yanzhu-ui-app/miniprogram/pageage/project_problemmodify/list/index.wxml +++ b/yanzhu-ui-app/miniprogram/pageage/project_problemmodify/list/index.wxml @@ -61,19 +61,19 @@ - + 暂无数据 - + 草稿 - + 新增 diff --git a/yanzhu-ui-app/miniprogram/pageage/project_schedule/list/index.wxml b/yanzhu-ui-app/miniprogram/pageage/project_schedule/list/index.wxml index e0fb8fe9..c6829d54 100644 --- a/yanzhu-ui-app/miniprogram/pageage/project_schedule/list/index.wxml +++ b/yanzhu-ui-app/miniprogram/pageage/project_schedule/list/index.wxml @@ -4,7 +4,7 @@ - + 返回 @@ -49,13 +49,13 @@ - + 暂无数据 - + 新增 @@ -64,28 +64,28 @@ - - + + 项目概况 - - + + 安全管理 {{aqglDB}} - - + + 质量管理 {{zlglDB}} - - + + 进度管理 diff --git a/yanzhu-ui-app/miniprogram/pageage/project_subdepts/list/index.js b/yanzhu-ui-app/miniprogram/pageage/project_subdepts/list/index.js index cae59555..674ecd1b 100644 --- a/yanzhu-ui-app/miniprogram/pageage/project_subdepts/list/index.js +++ b/yanzhu-ui-app/miniprogram/pageage/project_subdepts/list/index.js @@ -1,220 +1,218 @@ -import { - getToken -} from '../../../utils/auth' -import { - subdeptsList, - subdeptsCount -} from '../../../api/project' -const app = getApp() +import config from "../../../config"; +import { getToken } from "../../../utils/auth"; +import { subdeptsList, subdeptsCount } from "../../../api/project"; +const app = getApp(); Page({ + /** + * 页面的初始数据 + */ + data: { + addFlag: false, + initData: {}, + pageNum: 1, + pageSize: 10, + total: 0, + listData: [], + activeState: "0", + yrcCount: 0, + ylcCount: 0, + imgBaseUrl: config.baseImgUrl, // 添加 imgBaseUrl + }, - /** - * 页面的初始数据 - */ - data: { - addFlag: false, - initData: {}, - pageNum: 1, - pageSize: 10, - total: 0, - listData: [], - activeState: "0", - yrcCount: 0, - ylcCount: 0 - }, - - //项目切换 返回值 - onProjectSelect(e) { - let projectId = e.detail.id; - let projectName = e.detail.text; - app.globalData.useProjectId = projectId; - app.globalData.useProjectName = projectName; - this.onLoad(); - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad(options) { - if (!getToken()) { - wx.redirectTo({ - url: '../../../pages/login/login', - }) - } - this.setData({ - addFlag: true, - initData: { - id: app.globalData.useProjectId, - text: app.globalData.useProjectName, - }, - pageNum: 1, - pageSize: 10, - listData: [], - total: 0 - }); - //获取数据列表 - this.getListData(); - this.getListCount(); - }, - - /** - * 添加按钮 - */ - skipAdd() { - wx.redirectTo({ - url: `../add/index`, - }) - }, - - /** - * 获取详情 - * @param {*} e - */ - getInfo(e) { - let _id = e.currentTarget.dataset.set; - wx.redirectTo({ - url: `../info/index?id=${_id}`, - }) - }, - - /** - * 修改按钮 - * @param {*} e - */ - editInfo(e){ - let _id = e.currentTarget.dataset.set; - wx.redirectTo({ - url: `../add/index?id=${_id}`, - }) - }, - - /** - * 查询数据列表 - */ - getListData() { - let params = "pageNum=" + this.data.pageNum + "&pageSize=" + this.data.pageSize + "&projectId=" + app.globalData.useProjectId + "&useStatus=" + this.data.activeState + "&activeTags=finished"; - subdeptsList(params).then(res => { - if (res.code == 200) { - this.setData({ - total: res.total, - listData: this.data.listData.concat(res.rows) - }) - } - }); - }, - - /** - * 统计数据列表 - */ - getListCount() { - let params = "pageNum=" + this.data.pageNum + "&pageSize=" + this.data.pageSize + "&projectId=" + app.globalData.useProjectId + "&activeTags=finished"; - subdeptsCount(params).then(res => { - if (res.code == 200) { - let _yrc = 0, - _ylc = 0; - res.data.forEach(item => { - if (item.useStatus == "0") { - _yrc = item.total; - } else { - _ylc = item.total; - } - }); - this.setData({ - yrcCount: _yrc, - ylcCount: _ylc - }) - } - }); - }, - - /** - * 标签切换 - */ - trainJump(e) { - let index = e.currentTarget.dataset.index; - let nav = ""; - if (index == 1) { - nav = '0'; - } else { - nav = '1'; - } - this.setData({ - activeState: nav, - pageNum: 1, - pageSize: 10, - listData: [], - }); - this.getListData(); - }, - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady() { - - }, - - /** - * 生命周期函数--监听页面显示 - */ - onShow() { - - }, - - returnToPage: function () { - /*关闭当前页面,跳转到其它页面。*/ - wx.redirectTo({ - url: '../../project_more/index', - }) - }, - - /** - * 滚动到底部 - */ - onScrollToLower() { - let nal = Math.ceil(this.data.total / this.data.pageSize); - if (this.data.pageNum < nal) { - this.setData({ - pageNum: this.data.pageNum + 1 - }); - this.getListData(); - } else { - console.log("已经到底了,没有数据可加载!!!"); - } - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide() { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload() { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh() { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom() { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage() { + //项目切换 返回值 + onProjectSelect(e) { + let projectId = e.detail.id; + let projectName = e.detail.text; + app.globalData.useProjectId = projectId; + app.globalData.useProjectName = projectName; + this.onLoad(); + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + if (!getToken()) { + wx.redirectTo({ + url: "../../../pages/login/login", + }); } -}) \ No newline at end of file + this.setData({ + addFlag: true, + initData: { + id: app.globalData.useProjectId, + text: app.globalData.useProjectName, + }, + pageNum: 1, + pageSize: 10, + listData: [], + total: 0, + }); + //获取数据列表 + this.getListData(); + this.getListCount(); + }, + + /** + * 添加按钮 + */ + skipAdd() { + wx.redirectTo({ + url: `../add/index`, + }); + }, + + /** + * 获取详情 + * @param {*} e + */ + getInfo(e) { + let _id = e.currentTarget.dataset.set; + wx.redirectTo({ + url: `../info/index?id=${_id}`, + }); + }, + + /** + * 修改按钮 + * @param {*} e + */ + editInfo(e) { + let _id = e.currentTarget.dataset.set; + wx.redirectTo({ + url: `../add/index?id=${_id}`, + }); + }, + + /** + * 查询数据列表 + */ + getListData() { + let params = + "pageNum=" + + this.data.pageNum + + "&pageSize=" + + this.data.pageSize + + "&projectId=" + + app.globalData.useProjectId + + "&useStatus=" + + this.data.activeState + + "&activeTags=finished"; + subdeptsList(params).then((res) => { + if (res.code == 200) { + this.setData({ + total: res.total, + listData: this.data.listData.concat(res.rows), + }); + } + }); + }, + + /** + * 统计数据列表 + */ + getListCount() { + let params = + "pageNum=" + + this.data.pageNum + + "&pageSize=" + + this.data.pageSize + + "&projectId=" + + app.globalData.useProjectId + + "&activeTags=finished"; + subdeptsCount(params).then((res) => { + if (res.code == 200) { + let _yrc = 0, + _ylc = 0; + res.data.forEach((item) => { + if (item.useStatus == "0") { + _yrc = item.total; + } else { + _ylc = item.total; + } + }); + this.setData({ + yrcCount: _yrc, + ylcCount: _ylc, + }); + } + }); + }, + + /** + * 标签切换 + */ + trainJump(e) { + let index = e.currentTarget.dataset.index; + let nav = ""; + if (index == 1) { + nav = "0"; + } else { + nav = "1"; + } + this.setData({ + activeState: nav, + pageNum: 1, + pageSize: 10, + listData: [], + }); + this.getListData(); + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() {}, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() {}, + + returnToPage: function () { + /*关闭当前页面,跳转到其它页面。*/ + wx.redirectTo({ + url: "../../project_more/index", + }); + }, + + /** + * 滚动到底部 + */ + onScrollToLower() { + let nal = Math.ceil(this.data.total / this.data.pageSize); + if (this.data.pageNum < nal) { + this.setData({ + pageNum: this.data.pageNum + 1, + }); + this.getListData(); + } else { + console.log("已经到底了,没有数据可加载!!!"); + } + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() {}, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() {}, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() {}, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() {}, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() {}, +}); diff --git a/yanzhu-ui-app/miniprogram/pageage/project_subdepts/list/index.wxml b/yanzhu-ui-app/miniprogram/pageage/project_subdepts/list/index.wxml index 18f09875..0351ec29 100644 --- a/yanzhu-ui-app/miniprogram/pageage/project_subdepts/list/index.wxml +++ b/yanzhu-ui-app/miniprogram/pageage/project_subdepts/list/index.wxml @@ -3,7 +3,7 @@ - + @@ -44,13 +44,13 @@ - + 暂无数据 - + 新增 diff --git a/yanzhu-ui-app/miniprogram/pageage/project_subgroups/list/index.js b/yanzhu-ui-app/miniprogram/pageage/project_subgroups/list/index.js index e2617122..fde2a6c9 100644 --- a/yanzhu-ui-app/miniprogram/pageage/project_subgroups/list/index.js +++ b/yanzhu-ui-app/miniprogram/pageage/project_subgroups/list/index.js @@ -1,230 +1,227 @@ -import { - getToken, - getUserInfo -} from '../../../utils/auth' -import { - subgroupsList, - subgroupsCount -} from '../../../api/project' -const app = getApp() +import config from "../../../config"; +import { getToken, getUserInfo } from "../../../utils/auth"; +import { subgroupsList, subgroupsCount } from "../../../api/project"; +const app = getApp(); Page({ + /** + * 页面的初始数据 + */ + data: { + addFlag: false, + initData: {}, + pageNum: 1, + pageSize: 1000, + total: 0, + listData: [], + activeState: "0", + yrcCount: 0, + ylcCount: 0, + userInfo: {}, + imgBaseUrl: config.baseImgUrl, // 添加 imgBaseUrl + }, - /** - * 页面的初始数据 - */ - data: { - addFlag: false, - initData: {}, - pageNum: 1, - pageSize: 1000, - total: 0, - listData: [], - activeState: "0", - yrcCount: 0, - ylcCount: 0, - userInfo:{} - }, - - //项目切换 返回值 - onProjectSelect(e) { - let projectId = e.detail.id; - let projectName = e.detail.text; - app.globalData.useProjectId = projectId; - app.globalData.useProjectName = projectName; - this.onLoad(); - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad(options) { - if (!getToken()) { - wx.redirectTo({ - url: '../../../pages/login/login', - }) - } - const proUserInfo = getUserInfo(); - this.setData({ - addFlag: proUserInfo.projectUserInfo.subDeptType=='1'?true:false, - userInfo: proUserInfo.projectUserInfo, - initData: { - id: app.globalData.useProjectId, - text: app.globalData.useProjectName, - }, - pageNum: 1, - pageSize: 1000, - listData: [], - total: 0 - }); - //获取数据列表 - this.getListData(proUserInfo.projectUserInfo); - this.getListCount(proUserInfo.projectUserInfo); - }, - - /** - * 添加按钮 - */ - skipAdd() { - wx.redirectTo({ - url: `../add/index`, - }) - }, - - /** - * 获取详情 - * @param {*} e - */ - getInfo(e) { - let _id = e.currentTarget.dataset.set; - wx.redirectTo({ - url: `../info/index?id=${_id}`, - }) - }, - - /** - * 修改按钮 - * @param {*} e - */ - editInfo(e){ - let _id = e.currentTarget.dataset.set; - wx.redirectTo({ - url: `../add/index?id=${_id}`, - }) - }, - - /** - * 查询数据列表 - */ - getListData(_userInfo) { - let params = "pageNum=" + this.data.pageNum + "&pageSize=" + this.data.pageSize + "&projectId=" + app.globalData.useProjectId + "&useStatus=" + this.data.activeState + "&activeTags=finished"; - if(_userInfo.subDeptType && _userInfo.subDeptType!='1'){ - params += "&subDeptId="+_userInfo.subDeptId; - } - subgroupsList(params).then(res => { - if (res.code == 200) { - this.setData({ - total: res.total, - listData: this.data.listData.concat(res.rows) - }) - } - }); - }, - - /** - * 统计数据列表 - */ - getListCount(_userInfo) { - let params = "pageNum=" + this.data.pageNum + "&pageSize=" + this.data.pageSize + "&projectId=" + app.globalData.useProjectId + "&activeTags=finished"; - if(_userInfo.subDeptType && _userInfo.subDeptType!='1'){ - params += "&subDeptId="+_userInfo.subDeptId; - } - subgroupsCount(params).then(res => { - if (res.code == 200) { - let _yrc = 0, - _ylc = 0; - res.data.forEach(item => { - if (item.useStatus == "0") { - _yrc = item.total; - } else { - _ylc = item.total; - } - }); - this.setData({ - yrcCount: _yrc, - ylcCount: _ylc - }) - } - }); - }, - - /** - * 标签切换 - */ - trainJump(e) { - let index = e.currentTarget.dataset.index; - let nav = ""; - if (index == 1) { - nav = '0'; - } else { - nav = '1'; - } - this.setData({ - activeState: nav, - pageNum: 1, - pageSize: 1000, - listData: [], - }); - this.getListData(this.data.userInfo); - }, - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady() { - - }, - - /** - * 生命周期函数--监听页面显示 - */ - onShow() { - - }, - - returnToPage: function () { - /*关闭当前页面,跳转到其它页面。*/ - wx.redirectTo({ - url: '../../project_more/index', - }) - }, - - /** - * 滚动到底部 - */ - onScrollToLower() { - let nal = Math.ceil(this.data.total / this.data.pageSize); - if (this.data.pageNum < nal) { - this.setData({ - pageNum: this.data.pageNum + 1 - }); - this.getListData(this.data.userInfo); - } else { - console.log("已经到底了,没有数据可加载!!!"); - } - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide() { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload() { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh() { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom() { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage() { + //项目切换 返回值 + onProjectSelect(e) { + let projectId = e.detail.id; + let projectName = e.detail.text; + app.globalData.useProjectId = projectId; + app.globalData.useProjectName = projectName; + this.onLoad(); + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + if (!getToken()) { + wx.redirectTo({ + url: "../../../pages/login/login", + }); } -}) \ No newline at end of file + const proUserInfo = getUserInfo(); + this.setData({ + addFlag: proUserInfo.projectUserInfo.subDeptType == "1" ? true : false, + userInfo: proUserInfo.projectUserInfo, + initData: { + id: app.globalData.useProjectId, + text: app.globalData.useProjectName, + }, + pageNum: 1, + pageSize: 1000, + listData: [], + total: 0, + }); + //获取数据列表 + this.getListData(proUserInfo.projectUserInfo); + this.getListCount(proUserInfo.projectUserInfo); + }, + + /** + * 添加按钮 + */ + skipAdd() { + wx.redirectTo({ + url: `../add/index`, + }); + }, + + /** + * 获取详情 + * @param {*} e + */ + getInfo(e) { + let _id = e.currentTarget.dataset.set; + wx.redirectTo({ + url: `../info/index?id=${_id}`, + }); + }, + + /** + * 修改按钮 + * @param {*} e + */ + editInfo(e) { + let _id = e.currentTarget.dataset.set; + wx.redirectTo({ + url: `../add/index?id=${_id}`, + }); + }, + + /** + * 查询数据列表 + */ + getListData(_userInfo) { + let params = + "pageNum=" + + this.data.pageNum + + "&pageSize=" + + this.data.pageSize + + "&projectId=" + + app.globalData.useProjectId + + "&useStatus=" + + this.data.activeState + + "&activeTags=finished"; + if (_userInfo.subDeptType && _userInfo.subDeptType != "1") { + params += "&subDeptId=" + _userInfo.subDeptId; + } + subgroupsList(params).then((res) => { + if (res.code == 200) { + this.setData({ + total: res.total, + listData: this.data.listData.concat(res.rows), + }); + } + }); + }, + + /** + * 统计数据列表 + */ + getListCount(_userInfo) { + let params = + "pageNum=" + + this.data.pageNum + + "&pageSize=" + + this.data.pageSize + + "&projectId=" + + app.globalData.useProjectId + + "&activeTags=finished"; + if (_userInfo.subDeptType && _userInfo.subDeptType != "1") { + params += "&subDeptId=" + _userInfo.subDeptId; + } + subgroupsCount(params).then((res) => { + if (res.code == 200) { + let _yrc = 0, + _ylc = 0; + res.data.forEach((item) => { + if (item.useStatus == "0") { + _yrc = item.total; + } else { + _ylc = item.total; + } + }); + this.setData({ + yrcCount: _yrc, + ylcCount: _ylc, + }); + } + }); + }, + + /** + * 标签切换 + */ + trainJump(e) { + let index = e.currentTarget.dataset.index; + let nav = ""; + if (index == 1) { + nav = "0"; + } else { + nav = "1"; + } + this.setData({ + activeState: nav, + pageNum: 1, + pageSize: 1000, + listData: [], + }); + this.getListData(this.data.userInfo); + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() {}, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() {}, + + returnToPage: function () { + /*关闭当前页面,跳转到其它页面。*/ + wx.redirectTo({ + url: "../../project_more/index", + }); + }, + + /** + * 滚动到底部 + */ + onScrollToLower() { + let nal = Math.ceil(this.data.total / this.data.pageSize); + if (this.data.pageNum < nal) { + this.setData({ + pageNum: this.data.pageNum + 1, + }); + this.getListData(this.data.userInfo); + } else { + console.log("已经到底了,没有数据可加载!!!"); + } + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() {}, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() {}, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() {}, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() {}, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() {}, +}); diff --git a/yanzhu-ui-app/miniprogram/pageage/project_subgroups/list/index.wxml b/yanzhu-ui-app/miniprogram/pageage/project_subgroups/list/index.wxml index 41879ceb..8d65bc4c 100644 --- a/yanzhu-ui-app/miniprogram/pageage/project_subgroups/list/index.wxml +++ b/yanzhu-ui-app/miniprogram/pageage/project_subgroups/list/index.wxml @@ -3,7 +3,7 @@ - + @@ -41,13 +41,13 @@ - + 暂无数据 - + 新增 diff --git a/yanzhu-ui-app/miniprogram/pageage/project_subusers/list/index.js b/yanzhu-ui-app/miniprogram/pageage/project_subusers/list/index.js index 123a6445..1a08e39a 100644 --- a/yanzhu-ui-app/miniprogram/pageage/project_subusers/list/index.js +++ b/yanzhu-ui-app/miniprogram/pageage/project_subusers/list/index.js @@ -1,238 +1,235 @@ -import { - getToken, - getUserInfo -} from '../../../utils/auth' -import { - subusersList, - subusersCount -} from '../../../api/project' -const app = getApp() +import config from "../../../config"; +import { getToken, getUserInfo } from "../../../utils/auth"; +import { subusersList, subusersCount } from "../../../api/project"; +const app = getApp(); Page({ + /** + * 页面的初始数据 + */ + data: { + addFlag: false, + initData: {}, + pageNum: 1, + pageSize: 10000, + total: 0, + listData: [], + activeState: "0", + yrcCount: 0, + ylcCount: 0, + activeName: "", + userInfo: {}, + imgBaseUrl: config.baseImgUrl, // 添加 imgBaseUrl + }, - /** - * 页面的初始数据 - */ - data: { - addFlag: false, - initData: {}, - pageNum: 1, - pageSize: 10000, - total: 0, - listData: [], - activeState: "0", - yrcCount: 0, - ylcCount: 0, - activeName: "", - userInfo:{} - }, - - //项目切换 返回值 - onProjectSelect(e) { - let projectId = e.detail.id; - let projectName = e.detail.text; - app.globalData.useProjectId = projectId; - app.globalData.useProjectName = projectName; - this.onLoad(); - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad(options) { - if (!getToken()) { - wx.redirectTo({ - url: '../../../pages/login/login', - }) - } - const proUserInfo = getUserInfo(); - this.setData({ - addFlag: proUserInfo.projectUserInfo.subDeptType=='1'?true:false, - userInfo: proUserInfo.projectUserInfo, - initData: { - id: app.globalData.useProjectId, - text: app.globalData.useProjectName, - }, - pageNum: 1, - pageSize: 10000, - listData: [], - total: 0 - }); - //获取数据列表 - this.getListData(proUserInfo.projectUserInfo); - this.getListCount(proUserInfo.projectUserInfo); - }, - - /** - * 添加按钮 - */ - skipAdd() { - wx.redirectTo({ - url: `../add/index`, - }) - }, - - /** - * 获取详情 - * @param {*} e - */ - getInfo(e) { - let _id = e.currentTarget.dataset.set; - wx.redirectTo({ - url: `../info/index?id=${_id}`, - }) - }, - - /** - * 修改按钮 - * @param {*} e - */ - editInfo(e) { - let _id = e.currentTarget.dataset.set; - wx.redirectTo({ - url: `../add/index?id=${_id}`, - }) - }, - - // 手风琴 - onChange(e) { - this.setData({ - activeName: e.target.dataset.set - }); - }, - - /** - * 查询数据列表 - */ - getListData(_userInfo) { - let params = "pageNum=" + this.data.pageNum + "&pageSize=" + this.data.pageSize + "&projectId=" + app.globalData.useProjectId + "&useStatus=" + this.data.activeState + "&activeTags=finished&searchValue=subUsers"; - if(_userInfo.subDeptType && _userInfo.subDeptType!='1'){ - params += "&subDeptId="+_userInfo.subDeptId; - } - subusersList(params).then(res => { - if (res.code == 200) { - this.setData({ - total: res.total, - listData: this.data.listData.concat(res.rows) - }) - } - }); - }, - - /** - * 统计数据列表 - */ - getListCount(_userInfo) { - let params = "pageNum=" + this.data.pageNum + "&pageSize=" + this.data.pageSize + "&projectId=" + app.globalData.useProjectId + "&activeTags=finished&searchValue=subUsers"; - if(_userInfo.subDeptType && _userInfo.subDeptType!='1'){ - params += "&subDeptId="+_userInfo.subDeptId; - } - subusersCount(params).then(res => { - if (res.code == 200) { - let _yrc = 0, - _ylc = 0; - res.data.forEach(item => { - if (item.useStatus == "0") { - _yrc = item.total; - } else { - _ylc = item.total; - } - }); - this.setData({ - yrcCount: _yrc, - ylcCount: _ylc - }) - } - }); - }, - - /** - * 标签切换 - */ - trainJump(e) { - let index = e.currentTarget.dataset.index; - let nav = ""; - if (index == 1) { - nav = '0'; - } else { - nav = '1'; - } - this.setData({ - activeState: nav, - pageNum: 1, - pageSize: 10000, - listData: [], - }); - this.getListData(this.data.userInfo); - }, - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady() { - - }, - - /** - * 生命周期函数--监听页面显示 - */ - onShow() { - - }, - - returnToPage: function () { - /*关闭当前页面,跳转到其它页面。*/ - wx.redirectTo({ - url: '../../project_more/index', - }) - }, - - /** - * 滚动到底部 - */ - onScrollToLower() { - let nal = Math.ceil(this.data.total / this.data.pageSize); - if (this.data.pageNum < nal) { - this.setData({ - pageNum: this.data.pageNum + 1 - }); - this.getListData(this.data.userInfo); - } else { - console.log("已经到底了,没有数据可加载!!!"); - } - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide() { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload() { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh() { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom() { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage() { + //项目切换 返回值 + onProjectSelect(e) { + let projectId = e.detail.id; + let projectName = e.detail.text; + app.globalData.useProjectId = projectId; + app.globalData.useProjectName = projectName; + this.onLoad(); + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + if (!getToken()) { + wx.redirectTo({ + url: "../../../pages/login/login", + }); } -}) \ No newline at end of file + const proUserInfo = getUserInfo(); + this.setData({ + addFlag: proUserInfo.projectUserInfo.subDeptType == "1" ? true : false, + userInfo: proUserInfo.projectUserInfo, + initData: { + id: app.globalData.useProjectId, + text: app.globalData.useProjectName, + }, + pageNum: 1, + pageSize: 10000, + listData: [], + total: 0, + }); + //获取数据列表 + this.getListData(proUserInfo.projectUserInfo); + this.getListCount(proUserInfo.projectUserInfo); + }, + + /** + * 添加按钮 + */ + skipAdd() { + wx.redirectTo({ + url: `../add/index`, + }); + }, + + /** + * 获取详情 + * @param {*} e + */ + getInfo(e) { + let _id = e.currentTarget.dataset.set; + wx.redirectTo({ + url: `../info/index?id=${_id}`, + }); + }, + + /** + * 修改按钮 + * @param {*} e + */ + editInfo(e) { + let _id = e.currentTarget.dataset.set; + wx.redirectTo({ + url: `../add/index?id=${_id}`, + }); + }, + + // 手风琴 + onChange(e) { + this.setData({ + activeName: e.target.dataset.set, + }); + }, + + /** + * 查询数据列表 + */ + getListData(_userInfo) { + let params = + "pageNum=" + + this.data.pageNum + + "&pageSize=" + + this.data.pageSize + + "&projectId=" + + app.globalData.useProjectId + + "&useStatus=" + + this.data.activeState + + "&activeTags=finished&searchValue=subUsers"; + if (_userInfo.subDeptType && _userInfo.subDeptType != "1") { + params += "&subDeptId=" + _userInfo.subDeptId; + } + subusersList(params).then((res) => { + if (res.code == 200) { + this.setData({ + total: res.total, + listData: this.data.listData.concat(res.rows), + }); + } + }); + }, + + /** + * 统计数据列表 + */ + getListCount(_userInfo) { + let params = + "pageNum=" + + this.data.pageNum + + "&pageSize=" + + this.data.pageSize + + "&projectId=" + + app.globalData.useProjectId + + "&activeTags=finished&searchValue=subUsers"; + if (_userInfo.subDeptType && _userInfo.subDeptType != "1") { + params += "&subDeptId=" + _userInfo.subDeptId; + } + subusersCount(params).then((res) => { + if (res.code == 200) { + let _yrc = 0, + _ylc = 0; + res.data.forEach((item) => { + if (item.useStatus == "0") { + _yrc = item.total; + } else { + _ylc = item.total; + } + }); + this.setData({ + yrcCount: _yrc, + ylcCount: _ylc, + }); + } + }); + }, + + /** + * 标签切换 + */ + trainJump(e) { + let index = e.currentTarget.dataset.index; + let nav = ""; + if (index == 1) { + nav = "0"; + } else { + nav = "1"; + } + this.setData({ + activeState: nav, + pageNum: 1, + pageSize: 10000, + listData: [], + }); + this.getListData(this.data.userInfo); + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() {}, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() {}, + + returnToPage: function () { + /*关闭当前页面,跳转到其它页面。*/ + wx.redirectTo({ + url: "../../project_more/index", + }); + }, + + /** + * 滚动到底部 + */ + onScrollToLower() { + let nal = Math.ceil(this.data.total / this.data.pageSize); + if (this.data.pageNum < nal) { + this.setData({ + pageNum: this.data.pageNum + 1, + }); + this.getListData(this.data.userInfo); + } else { + console.log("已经到底了,没有数据可加载!!!"); + } + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() {}, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() {}, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() {}, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() {}, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() {}, +}); diff --git a/yanzhu-ui-app/miniprogram/pageage/project_subusers/list/index.wxml b/yanzhu-ui-app/miniprogram/pageage/project_subusers/list/index.wxml index 0dd394b0..d78c254f 100644 --- a/yanzhu-ui-app/miniprogram/pageage/project_subusers/list/index.wxml +++ b/yanzhu-ui-app/miniprogram/pageage/project_subusers/list/index.wxml @@ -3,7 +3,7 @@ - + @@ -47,13 +47,13 @@ - + 暂无数据 - + 新增 diff --git a/yanzhu-ui-app/miniprogram/pageage/project_video/list/index.js b/yanzhu-ui-app/miniprogram/pageage/project_video/list/index.js index 3afb0268..c67e683b 100644 --- a/yanzhu-ui-app/miniprogram/pageage/project_video/list/index.js +++ b/yanzhu-ui-app/miniprogram/pageage/project_video/list/index.js @@ -1,12 +1,8 @@ -import { - getToken -} from '../../../utils/auth' -import { - proVideoList -} from '../../../api/project' -const app = getApp() +import config from "../../../config"; +import { getToken } from "../../../utils/auth"; +import { proVideoList } from "../../../api/project"; +const app = getApp(); Page({ - /** * 页面的初始数据 */ @@ -16,6 +12,7 @@ Page({ pageSize: 10, total: 0, listData: [], + imgBaseUrl: config.baseImgUrl, // 添加 imgBaseUrl }, //项目切换 返回值 @@ -33,8 +30,8 @@ Page({ onLoad(options) { if (!getToken()) { wx.redirectTo({ - url: '../../../pages/login/login', - }) + url: "../../../pages/login/login", + }); } this.setData({ initData: { @@ -44,37 +41,39 @@ Page({ pageNum: 1, pageSize: 10, listData: [], - total: 0 + total: 0, }); this.getListData(); }, /** * 播放视频 - * @param {*} e + * @param {*} e */ videoPlay(e) { - let { - id, - url, - secret - } = e.currentTarget.dataset.set + let { id, url, secret } = e.currentTarget.dataset.set; wx.redirectTo({ - url: `../info/index?id=${id}&url=${url}&token=${secret}`, - }) + url: `../info/index?id=${id}&url=${url}&token=${secret}`, + }); }, /** * 查询数据列表 */ getListData() { - let params = "pageNum=" + this.data.pageNum + "&pageSize=" + this.data.pageSize + "&projectId=" + app.globalData.useProjectId; - proVideoList(params).then(res => { + let params = + "pageNum=" + + this.data.pageNum + + "&pageSize=" + + this.data.pageSize + + "&projectId=" + + app.globalData.useProjectId; + proVideoList(params).then((res) => { if (res.code == 200) { this.setData({ total: res.total, - listData: this.data.listData.concat(res.rows) - }) + listData: this.data.listData.concat(res.rows), + }); } }); }, @@ -82,28 +81,24 @@ Page({ /** * 生命周期函数--监听页面初次渲染完成 */ - onReady() { - - }, + onReady() {}, /** * 生命周期函数--监听页面显示 */ - onShow() { - - }, + onShow() {}, returnToPage: function () { wx.redirectTo({ - url: '../../project_safety/index', - }) + url: "../../project_safety/index", + }); }, onScrollToLower() { let nal = Math.ceil(this.data.total / this.data.pageSize); if (this.data.pageNum < nal) { this.setData({ - pageNum: this.data.pageNum + 1 + pageNum: this.data.pageNum + 1, }); this.getListData(); } else { @@ -114,35 +109,25 @@ Page({ /** * 生命周期函数--监听页面隐藏 */ - onHide() { - - }, + onHide() {}, /** * 生命周期函数--监听页面卸载 */ - onUnload() { - - }, + onUnload() {}, /** * 页面相关事件处理函数--监听用户下拉动作 */ - onPullDownRefresh() { - - }, + onPullDownRefresh() {}, /** * 页面上拉触底事件的处理函数 */ - onReachBottom() { - - }, + onReachBottom() {}, /** * 用户点击右上角分享 */ - onShareAppMessage() { - - } -}) \ No newline at end of file + onShareAppMessage() {}, +}); diff --git a/yanzhu-ui-app/miniprogram/pageage/project_video/list/index.wxml b/yanzhu-ui-app/miniprogram/pageage/project_video/list/index.wxml index 86e0dc69..da19a695 100644 --- a/yanzhu-ui-app/miniprogram/pageage/project_video/list/index.wxml +++ b/yanzhu-ui-app/miniprogram/pageage/project_video/list/index.wxml @@ -3,7 +3,7 @@ - + @@ -30,8 +30,8 @@ - - play + + play @@ -39,7 +39,7 @@ - + 暂无数据 diff --git a/yanzhu-ui-app/miniprogram/pageage/sign_mags/index.js b/yanzhu-ui-app/miniprogram/pageage/sign_mags/index.js index 110f6731..50eef5a2 100644 --- a/yanzhu-ui-app/miniprogram/pageage/sign_mags/index.js +++ b/yanzhu-ui-app/miniprogram/pageage/sign_mags/index.js @@ -1,181 +1,161 @@ -import config from '../../config' -import { - getToken -} from '../../utils/auth' -import { - submitUserSign, - findUserSignList -} from '../../api/publics' -import { - securitySignFileUpload -} from '../../utils/request' -const app = getApp() +import config from "../../config"; +import { getToken } from "../../utils/auth"; +import { submitUserSign, findUserSignList } from "../../api/publics"; +import { securitySignFileUpload } from "../../utils/request"; +const app = getApp(); Page({ + /** + * 页面的初始数据 + */ + data: { + projectId: "", + projectName: "", + initData: {}, + signData: { + id: null, + signetPath: null, + }, + signPath: "", + imgBaseUrl: config.baseImgUrl, + }, - /** - * 页面的初始数据 - */ - data: { - projectId: '', - projectName: '', - initData: {}, - signData: { - id: null, - signetPath: null + //项目切换 返回值 + onProjectSelect(e) { + let projectId = e.detail.id; + let projectName = e.detail.text; + app.globalData.useProjectId = projectId; + app.globalData.useProjectName = projectName; + this.onLoad(); + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + if (getToken()) { + this.setData({ + projectId: app.globalData.useProjectId, + projectName: app.globalData.useProjectName, + initData: { + id: app.globalData.useProjectId, + text: app.globalData.useProjectName, }, - signPath: '', - imgBaseUrl: config.baseImgUrl - }, - - //项目切换 返回值 - onProjectSelect(e) { - let projectId = e.detail.id; - let projectName = e.detail.text; - app.globalData.useProjectId = projectId; - app.globalData.useProjectName = projectName; - this.onLoad(); - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad(options) { - if (getToken()) { - this.setData({ - projectId: app.globalData.useProjectId, - projectName: app.globalData.useProjectName, - initData: { - id: app.globalData.useProjectId, - text: app.globalData.useProjectName, - } - }); - this.getUserSignList(app.globalData.useProjectId); - } else { - console.log("未查询到Token...{}...准备重新登录") - wx.redirectTo({ - url: '../../pages/login/login', - }) - } - }, - - /** - * 获取签名 - * @param {*} proId - */ - getUserSignList(proId) { - findUserSignList(proId).then(res => { - if (res.code == 200 && res.data.length > 0) { - this.setData({ - signData: res.data[0] - }); - } - }) - }, - - /** - * 确认签名 - */ - sign(e) { - let tempFilePath = e.detail - securitySignFileUpload(tempFilePath).then(res => { - if (res.code == 200) { - this.setData({ - signPath: res.data.url - }); - } - }); - }, - - /** - * 确认修改签名 - */ - submitSign() { - let { - projectId, - signPath, - signData - } = this.data; - //数据效验 - if (!projectId) { - app.toast("信息异常...请刷新后重试!"); - return false; - } - if (!signPath) { - app.toast("还未完成签名或修改,请签名后再试!"); - return false; - } - let param = { - id: signData.id, - projectId: projectId, - signetPath: signPath - } - submitUserSign(param).then(res => { - if (res.code == 200) { - app.toast("保存签名成功!") - setTimeout(() => { - wx.redirectTo({ - url: '../project_more/index', - }) - }, 200) - } - }); - }, - - /** - * 返回上级页面 - */ - BACK() { - wx.redirectTo({ - url: '../project_more/index', - }) - }, - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady() { - - }, - - /** - * 生命周期函数--监听页面显示 - */ - onShow() { - - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide() { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload() { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh() { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom() { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage() { - + }); + this.getUserSignList(app.globalData.useProjectId); + } else { + console.log("未查询到Token...{}...准备重新登录"); + wx.redirectTo({ + url: "../../pages/login/login", + }); } -}) \ No newline at end of file + }, + + /** + * 获取签名 + * @param {*} proId + */ + getUserSignList(proId) { + findUserSignList(proId).then((res) => { + if (res.code == 200 && res.data.length > 0) { + this.setData({ + signData: res.data[0], + }); + } + }); + }, + + /** + * 确认签名 + */ + sign(e) { + let tempFilePath = e.detail; + securitySignFileUpload(tempFilePath).then((res) => { + if (res.code == 200) { + this.setData({ + signPath: res.data.url, + }); + } + }); + }, + + /** + * 确认修改签名 + */ + submitSign() { + let { projectId, signPath, signData } = this.data; + //数据效验 + if (!projectId) { + app.toast("信息异常...请刷新后重试!"); + return false; + } + if (!signPath) { + app.toast("还未完成签名或修改,请签名后再试!"); + return false; + } + let param = { + id: signData.id, + projectId: projectId, + signetPath: signPath, + }; + submitUserSign(param).then((res) => { + if (res.code == 200) { + app.toast("保存签名成功!"); + setTimeout(() => { + wx.redirectTo({ + url: "../project_more/index", + }); + }, 200); + } + }); + }, + + /** + * 返回上级页面 + */ + BACK() { + if (wx.getStorageSync("nav-menu") == "prjInfo") { + wx.redirectTo({ + url: "../project_info/index", + }); + } else { + wx.redirectTo({ + url: "../project_more/index", + }); + } + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() {}, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() {}, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() {}, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() {}, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() {}, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() {}, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() {}, +}); diff --git a/yanzhu-ui-app/miniprogram/pages/components/user-infos/index.js b/yanzhu-ui-app/miniprogram/pages/components/user-infos/index.js index b43e0e3b..20501229 100644 --- a/yanzhu-ui-app/miniprogram/pages/components/user-infos/index.js +++ b/yanzhu-ui-app/miniprogram/pages/components/user-infos/index.js @@ -1,210 +1,197 @@ -import { - removeToken -} from '../../../utils/auth' -import { - loginOut, - updatePwd, - findOpenUserMsgId -} from '../../../api/login' - -const app = getApp() +import { removeToken } from "../../../utils/auth"; +import { loginOut, updatePwd, findOpenUserMsgId } from "../../../api/login"; +import cfg from "../../../config"; +const app = getApp(); Component({ - /**数据监听 */ - observers: {}, - /** - * 组件的初始数据 - */ - data: { - show: false, - userData: {}, - resPas: false, - oldPsw: '', - newPsw: '', - password: '', - showOldPass: true, - showNewPass: true, - showPassWord: true, - binding: false, - msgOpenId: "", - }, + /**数据监听 */ + observers: {}, + /** + * 组件的初始数据 + */ + data: { + show: false, + userData: {}, + resPas: false, + oldPsw: "", + newPsw: "", + password: "", + showOldPass: true, + showNewPass: true, + showPassWord: true, + binding: false, + msgOpenId: "", + baseImgUrl: cfg.baseImgUrl, + }, - created() { - this.setData({ - userData: app.globalData.userData, - loginName: app.globalData.userData.userName, - msgOpenId: "", - }) - }, - - /** - * 组件的方法列表 - */ - methods: { - loadUserInfo() { - let that = this; - //获取缓存数据 - wx.getStorage({ - key: 'userinfo', - success: function (res) { - findOpenUserMsgId(res.data.openId).then(vo => { - if (vo.code == 200 && vo.data) { - res.data.msgOpenId = vo.data.msgOpenId; - wx.setStorage({ - key: 'userinfo', - data: res.data - }); - that.setData({ - show: true, - userData: res.data, - loginName: res.data.loginName, - msgOpenId: res.data.msgOpenId || "", - }) - } - }); - } - }) - }, + created() { + this.setData({ + userData: app.globalData.userData, + loginName: app.globalData.userData.userName, + msgOpenId: "", + }); + }, - showPopup() { - this.setData({ - show: true - }); - }, + /** + * 组件的方法列表 + */ + methods: { + loadUserInfo() { + let that = this; + //获取缓存数据 + wx.getStorage({ + key: "userinfo", + success: function (res) { + findOpenUserMsgId(res.data.openId).then((vo) => { + if (vo.code == 200 && vo.data) { + res.data.msgOpenId = vo.data.msgOpenId; + wx.setStorage({ + key: "userinfo", + data: res.data, + }); + that.setData({ + show: true, + userData: res.data, + loginName: res.data.loginName, + msgOpenId: res.data.msgOpenId || "", + }); + } + }); + }, + }); + }, - /** - * 关闭用户详情 - */ - closePopup() { - this.setData({ - show: false - }); - }, + showPopup() { + this.setData({ + show: true, + }); + }, - //修改密码 - resPassword: function () { - this.setData({ - resPas: true - }); - }, + /** + * 关闭用户详情 + */ + closePopup() { + this.setData({ + show: false, + }); + }, - //绑定公众号 - binding: function () { - app.initWxAuth(); - }, + //修改密码 + resPassword: function () { + this.setData({ + resPas: true, + }); + }, - /** - * 修改密码返回 - */ - closeResPas: function () { - this.setData({ - resPas: false - }); - }, + //绑定公众号 + binding: function () { + app.initWxAuth(); + }, - /** - * 修改密码返回 - */ - closeBinding: function () { - this.setData({ - binding: false - }); - }, + /** + * 修改密码返回 + */ + closeResPas: function () { + this.setData({ + resPas: false, + }); + }, - bindingBuild: function () { - wx.previewImage({ - urls: "https://szgcwx.jhncidg.com/staticFiles/qrv1.jpg".split(","), - current: 0 - }) - }, + /** + * 修改密码返回 + */ + closeBinding: function () { + this.setData({ + binding: false, + }); + }, - //退出登录 - loginOut: function () { - loginOut().then(res => { - removeToken(); - wx.clearStorageSync(); - wx.navigateTo({ - url: '/pages/login/login' - }) - }); - }, + bindingBuild: function () { + wx.previewImage({ + urls: cfg.baseImgUrl + "/cdn/appimgs/qrv1.jpg".split(","), + current: 0, + }); + }, - seeTap1() { - let that = this; - that.setData({ - // 切换图标 - showOldPass: !that.data.showOldPass - }) - }, + //退出登录 + loginOut: function () { + loginOut().then((res) => { + removeToken(); + wx.clearStorageSync(); + wx.navigateTo({ + url: "/pages/login/login", + }); + }); + }, - seeTap2() { - let that = this; - that.setData({ - // 切换图标 - showNewPass: !that.data.showNewPass - }) - }, + seeTap1() { + let that = this; + that.setData({ + // 切换图标 + showOldPass: !that.data.showOldPass, + }); + }, - seeTap3() { - let that = this; - that.setData({ - // 切换图标 - showPassWord: !that.data.showPassWord - }) - if (that.data.newPsw != '' && that.data.newPsw != that.data.password) { - app.toast("两次密码输入不一致!"); - } - }, + seeTap2() { + let that = this; + that.setData({ + // 切换图标 + showNewPass: !that.data.showNewPass, + }); + }, - /** - * 添加预警信息 - */ - submit: function () { - var that = this; - if (false && that.data.oldPsw == '') { - app.toast("请输入旧密码!"); - return; - } - if (that.data.password == '') { - app.toast("请确认新密码!"); - return; - } - if (that.data.newPsw != '' && that.data.newPsw != that.data.password) { - app.toast("两次密码输入不一致!"); - return; - } - if (false && that.data.oldPsw.length < 6) { - app.toast("请输入旧密码长度 [6-20]位字符!"); - return; - } - if (that.data.newPsw.length < 6) { - app.toast("请输入新密码长度 [6-20]位字符!"); - return; - } - if (that.data.password.length < 6) { - app.toast("请输入确认密码长度 [6-20]位字符!"); - return; - } - let data = { - loginName: that.data.loginName, - oldPass: that.data.oldPsw, - password: that.data.newPsw, - confPass: that.data.password, - source: "u" - } - updatePwd(data).then(res => { - if (res.code == 200) { - app.toast("密码修改成功,请重新登录!", 800); - loginOut().then(res => { - removeToken(); - wx.clearStorageSync(); - setTimeout(() => { - wx.redirectTo({ - url: '../login/login' - }); - }, 500) - }); - } - }); - }, - } -}) \ No newline at end of file + seeTap3() { + let that = this; + that.setData({ + // 切换图标 + showPassWord: !that.data.showPassWord, + }); + if (that.data.newPsw != "" && that.data.newPsw != that.data.password) { + app.toast("两次密码输入不一致!"); + } + }, + + /** + * 添加预警信息 + */ + submit: function () { + var that = this; + if (that.data.password == "") { + app.toast("请确认新密码!"); + return; + } + if (that.data.newPsw != "" && that.data.newPsw != that.data.password) { + app.toast("两次密码输入不一致!"); + return; + } + if (that.data.newPsw.length < 6) { + app.toast("请输入新密码长度 [6-20]位字符!"); + return; + } + if (that.data.password.length < 6) { + app.toast("请输入确认密码长度 [6-20]位字符!"); + return; + } + let data = { + loginName: that.data.loginName, + oldPass: that.data.oldPsw, + password: that.data.newPsw, + confPass: that.data.password, + source: "u", + }; + updatePwd(data).then((res) => { + if (res.code == 200) { + app.toast("密码修改成功,请重新登录!", 800); + loginOut().then((res) => { + removeToken(); + wx.clearStorageSync(); + setTimeout(() => { + wx.redirectTo({ + url: "../login/login", + }); + }, 500); + }); + } + }); + }, + }, +}); diff --git a/yanzhu-ui-app/miniprogram/pages/components/user-infos/index.wxml b/yanzhu-ui-app/miniprogram/pages/components/user-infos/index.wxml index bb3f58be..a8ddd3fa 100644 --- a/yanzhu-ui-app/miniprogram/pages/components/user-infos/index.wxml +++ b/yanzhu-ui-app/miniprogram/pages/components/user-infos/index.wxml @@ -1,5 +1,5 @@ - + @@ -10,7 +10,7 @@ - + @@ -28,56 +28,56 @@ - + 授权消息通知 - + - + 修改密码 - + - + 退出登录 - + - + - + 旧密码 - - + + 新密码 - - + + 确认密码 - - + + diff --git a/yanzhu-ui-vue3/make.cjs b/yanzhu-ui-vue3/make.cjs index ea1de21a..de5c8600 100644 --- a/yanzhu-ui-vue3/make.cjs +++ b/yanzhu-ui-vue3/make.cjs @@ -41,7 +41,8 @@ config.forEach((item) => { const newData = data .replace(/数字建安施工/g, item.title) .replaceAll(`src="./`, `src = "/xd/`) - .replaceAll(`href="./`, `href = "/xd/`); + .replaceAll(`href="./`, `href = "/xd/`) + .replaceAll(`/cdn/webcfg.js`,`/cdn/tmp.js`) // 将替换后的内容写入目标文件 fs.writeFile(targetFilePath, newData, "utf8", (err) => {