diff --git a/api/.vscode/launch.json b/api/.vscode/launch.json index b1538083..07402aac 100644 --- a/api/.vscode/launch.json +++ b/api/.vscode/launch.json @@ -15,7 +15,7 @@ "args": [ "-p 14000", "-f http://localhost:14000", - "-g postgres://postgres:123@10.8.30.32:5432/yinjiguanli", + "-g postgres://postgres:123@10.8.30.32:5432/highways4good", ] }, { diff --git a/api/app/lib/controllers/approval/index.js b/api/app/lib/controllers/approval/index.js deleted file mode 100644 index 48dc3750..00000000 --- a/api/app/lib/controllers/approval/index.js +++ /dev/null @@ -1,71 +0,0 @@ -'use strict'; - -/** - * 提交审批、驳回修改 - * body { - * action:1驳回修改 2审批通过 - * userRegionType:提交用户所属区域级别:3乡镇级,2区县级 - * userId:提交用户id - * rejectReasons:驳回意见 - * correctiveAction:采取措施。区县复核时提交内容 - * punishment:实施处罚,强制措施情况。区县复核时提交内容 - * } - */ -const moment = require('moment'); -async function submitApproval (ctx) { - try { - const data = ctx.request.body; - const models = ctx.fs.dc.models; - let oldData = await models.UserPlaceSecurityRecord.findOne({ where: { id: data.id } }) - if (oldData == null) { - ctx.status = 400; - ctx.body = { name: `message`, message: `该条填报数据不存在` }; - } else { - if ((data.action == 1 || data.action == 2) && (data.userRegionType == 3 || data.userRegionType == 2)) { - let dataSave = {} - if (data.action == 1) {//驳回 - dataSave = { - rejectManId: data.userId, - rejectReasons: data.rejectReasons, - type: false,//是否重新发起true默认false可以重新发起 - rejectTime: moment() - } - if (data.userRegionType == 2) {//区县复核,14、15项可修改 - dataSave.correctiveAction = data.correctiveAction; - dataSave.punishment = data.punishment; - } - } else {//通过 - if (data.userRegionType == 3) { - dataSave = { - audit1ManId: data.userId, - audit1ManIdTime: moment().format() - } - } else { - dataSave = {//区县复核,14、15项可修改 - correctiveAction: data.correctiveAction, - punishment: data.punishment, - audit2ManId: data.userId, - audit2ManIdTime: moment().format() - } - } - } - await models.UserPlaceSecurityRecord.update(dataSave, { where: { id: data.id } }); - ctx.status = 200; - ctx.body = { name: `message`, message: `提交成功` }; - } else { - ctx.status = 400; - ctx.body = { name: `message`, message: `提交数据有误` }; - } - } - } catch (error) { - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { - "message": { name: `message`, message: `提交审批、驳回修改数据失败` } - } - } -} - -module.exports = { - submitApproval -}; \ No newline at end of file diff --git a/api/app/lib/controllers/auth/index.js b/api/app/lib/controllers/auth/index.js index 07f25057..e486593e 100644 --- a/api/app/lib/controllers/auth/index.js +++ b/api/app/lib/controllers/auth/index.js @@ -4,7 +4,7 @@ const MD5 = require('crypto-js/md5'); const moment = require('moment'); const uuid = require('uuid'); -async function login(ctx, next) { +async function login (ctx, next) { const transaction = await ctx.fs.dc.orm.transaction(); try { const models = ctx.fs.dc.models; @@ -17,11 +17,7 @@ async function login(ctx, next) { password: password, delete: false, }, - attributes: { exclude: ['password'] }, - include: [{ - attributes: ["resourceId"], - model: models.UserResource - }] + attributes: { exclude: ['password', 'delete'] }, }); if (!userRes) { @@ -43,8 +39,6 @@ async function login(ctx, next) { let userRslt = Object.assign(userRes.dataValues, { authorized: true, token: token, - userResources: userRes.userResources.map(r => r.resourceId), - type: deptInfo.type }); await models.UserToken.create({ @@ -71,7 +65,7 @@ async function login(ctx, next) { * 微信小程序登录 * @@requires.body {phone-手机号, password-密码} ctx */ -async function wxLogin(ctx, next) { +async function wxLogin (ctx, next) { const transaction = await ctx.fs.dc.orm.transaction(); try { const models = ctx.fs.dc.models; @@ -83,7 +77,7 @@ async function wxLogin(ctx, next) { password: password, delete: false, }, - attributes: { exclude: ['password'] } + attributes: { exclude: ['password', 'delete'] }, }); if (!userRes) { ctx.status = 400; @@ -93,27 +87,7 @@ async function wxLogin(ctx, next) { ctx.body = { message: "该用户已被禁用" } } else { const token = uuid.v4(); - //获取用户关注区域信息 - const departmentRes = await models.Department.findOne({ where: { id: userRes.departmentId } }); - let attentionRegion = departmentRes; - while (attentionRegion.dependence && attentionRegion.type != 1) { - const departmentParent = await models.Department.findOne({ where: { id: attentionRegion.dependence } }); - attentionRegion = { - ...departmentParent.dataValues, - nextRegin: attentionRegion - } - } - //获取用户权限信息 - const resourceRes = await models.UserResource.findAll({ - where: { - userId: userRes.id - }, - include: [{ - model: models.Resource, - attributes: ['code', 'name'], - }], - attributes: [] - }); + let userRslt = Object.assign({ authorized: true, token: token, @@ -127,9 +101,6 @@ async function wxLogin(ctx, next) { ctx.status = 200; ctx.body = Object.assign({ ...userRslt, - userRegionType: departmentRes.type,//1-市级,2-区县级,3-乡镇级,4-村级 - attentionRegion: attentionRegion, - resources: resourceRes.map(r => r.resource) }); } await transaction.commit(); @@ -143,7 +114,7 @@ async function wxLogin(ctx, next) { } } -async function logout(ctx) { +async function logout (ctx) { try { const { token, code } = ctx.request.body; const models = ctx.fs.dc.models; @@ -164,32 +135,8 @@ async function logout(ctx) { } } -/** - * 微信小程序登出 - * @request.body {token-用户登录Token} ctx - */ -async function wxLogout(ctx) { - try { - const { token } = ctx.request.body; - const models = ctx.fs.dc.models; - await models.UserToken.destroy({ - where: { - token: token, - }, - }); - ctx.status = 204; - } catch (error) { - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { - "message": "登出失败" - } - } -} - module.exports = { login, wxLogin, logout, - wxLogout }; \ No newline at end of file diff --git a/api/app/lib/controllers/common/contants.js b/api/app/lib/controllers/common/contants.js deleted file mode 100644 index 2e04a7ac..00000000 --- a/api/app/lib/controllers/common/contants.js +++ /dev/null @@ -1,116 +0,0 @@ - -function deepCompare(x, y) { - var i, l, leftChain, rightChain; - - function compare2Objects(x, y) { - var p; - - // remember that NaN === NaN returns false - // and isNaN(undefined) returns true - if (isNaN(x) && isNaN(y) && typeof x === 'number' && typeof y === 'number') { - return true; - } - - // Compare primitives and functions. - // Check if both arguments link to the same object. - // Especially useful on the step where we compare prototypes - if (x === y) { - return true; - } - - // Works in case when functions are created in constructor. - // Comparing dates is a common scenario. Another built-ins? - // We can even handle functions passed across iframes - if ((typeof x === 'function' && typeof y === 'function') || - (x instanceof Date && y instanceof Date) || - (x instanceof RegExp && y instanceof RegExp) || - (x instanceof String && y instanceof String) || - (x instanceof Number && y instanceof Number)) { - return x.toString() === y.toString(); - } - - // At last checking prototypes as good as we can - if (!(x instanceof Object && y instanceof Object)) { - return false; - } - - if (x.isPrototypeOf(y) || y.isPrototypeOf(x)) { - return false; - } - - if (x.constructor !== y.constructor) { - return false; - } - - if (x.prototype !== y.prototype) { - return false; - } - - // Check for infinitive linking loops - if (leftChain.indexOf(x) > -1 || rightChain.indexOf(y) > -1) { - return false; - } - - // Quick checking of one object being a subset of another. - // todo: cache the structure of arguments[0] for performance - for (p in y) { - if (y.hasOwnProperty(p) !== x.hasOwnProperty(p)) { - return false; - } else if (typeof y[p] !== typeof x[p]) { - return false; - } - } - - for (p in x) { - if (y.hasOwnProperty(p) !== x.hasOwnProperty(p)) { - return false; - } else if (typeof y[p] !== typeof x[p]) { - return false; - } - - switch (typeof (x[p])) { - case 'object': - case 'function': - - leftChain.push(x); - rightChain.push(y); - - if (!compare2Objects(x[p], y[p])) { - return false; - } - - leftChain.pop(); - rightChain.pop(); - break; - - default: - if (x[p] !== y[p]) { - return false; - } - break; - } - } - - return true; - } - - if (arguments.length < 1) { - return true; //Die silently? Don't know how to handle such case, please help... - // throw "Need two or more arguments to compare"; - } - - for (i = 1, l = arguments.length; i < l; i++) { - - leftChain = []; //Todo: this can be cached - rightChain = []; - - if (!compare2Objects(arguments[0], arguments[i])) { - return false; - } - } - - return true; -} -module.exports = { - deepCompare -} \ No newline at end of file diff --git a/api/app/lib/controllers/common/index.js b/api/app/lib/controllers/common/index.js deleted file mode 100644 index efb13a15..00000000 --- a/api/app/lib/controllers/common/index.js +++ /dev/null @@ -1,63 +0,0 @@ -//获取固化数据接口 -async function getDataDictionary(ctx) { - try { - const models = ctx.fs.dc.models; - const { model } = ctx.params; - const { where, attributes, order } = ctx.query; - let findObj = {}; - if (where) { - let whereJson = JSON.parse(where); - findObj.where = whereJson; - } - if (order) { - findObj.order = [JSON.parse(order)]; - } - if (attributes) { - attributes = attributes.split(','); - } - let rslt = await models[model].findAll(findObj); - ctx.status = 200; - ctx.body = rslt; - } catch (error) { - console.log(error) - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { - "message": "获取数据字典失败" - } - } -} -//基础修改接口 -async function putDataDictionary(ctx) { - const transaction = await ctx.fs.dc.orm.transaction(); - try { - const models = ctx.fs.dc.models; - let errMsg = "修改失败"; - - const { model } = ctx.params; - const { where, dataToSave } = ctx.request.body; - - const oldData = await models[model].findOne({ where: where }); - if (oldData) { - await models[model].update(dataToSave, { where: where, transaction }); - } else { - errMsg = "未找到需要修改的数据"; - ctx.throw(400) - } - ctx.status = 204; - await transaction.commit(); - } catch (error) { - await transaction.rollback(); - console.log(error) - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { - "message": errMsg - } - } -} - -module.exports = { - getDataDictionary, - putDataDictionary -}; \ No newline at end of file diff --git a/api/app/lib/controllers/data/road.js b/api/app/lib/controllers/data/road.js new file mode 100644 index 00000000..a59d7c99 --- /dev/null +++ b/api/app/lib/controllers/data/road.js @@ -0,0 +1,36 @@ +'use strict'; +const roadKeyMap = require('./road.json') +console.log(roadKeyMap); +async function importIn (ctx) { + try { + const models = ctx.fs.dc.models; + const { level } = ctx.query; + const data = ctx.request.body; + + const roadRes = await models.Road.findAll({ + where: { + level + } + }) + let preCreateArr = [] + for (let d of data) { + if (roadRes.some(r => r.routeCode + r.sectionNo == d['路线代码'] + d['路段序号'])) { + //repeat + } else { + // await models.Road.create(d); + } + } + + ctx.status = 204 + } catch (error) { + ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); + ctx.status = 400; + ctx.body = { + message: typeof error == 'string' ? error : undefined + } + } +} + +module.exports = { + importIn +}; \ No newline at end of file diff --git a/api/app/lib/controllers/data/road.json b/api/app/lib/controllers/data/road.json new file mode 100644 index 00000000..0fb97a7f --- /dev/null +++ b/api/app/lib/controllers/data/road.json @@ -0,0 +1,50 @@ +{ + "路线名称": "routeName", + "路线代码": "routeCode", + "路段序号": "sectionNo", + "乡镇编码": "townshipCode", + "起点地名": "startingPlaceName", + "起点桩号": "startStation", + "起点分界点类别": "categoryOfStartingPointAndDividingPoint", + "止点地名": "stopPlaceName", + "止点分界点类别": "categoryOfDeadCenterAndDividingPoint", + "止点桩号": "stopStation", + "路段类型": "sectionType", + "路段性质": "natureOfRoadSection", + "建成时间": "completionTime", + "GBM及文明样板路": "gBMAndCivilizedModelRoad", + "地貌": "landforms", + "收费性质": "natureOfCharges", + "涵洞数量": "numberOfCulverts", + "技术等级": "technicalLevel", + "路面类型": "pavementType", + "路面宽度": "pavementWidth", + "路基宽度": "subgradeWidth", + "车道特征": "laneCharacteristics", + "是否晴雨通车": "whetherItIsOpenToTrafficInSunnyOrRainyDays", + "设计时速": "designSpeedPerHour", + "是否城管路段": "urbanManagementSectionOrNot", + "管养单位": "managementAndMaintenanceUnit", + "路政管理单位": "roadAdministrationUnit", + "列养情况": "alimentation", + "列养资金来源": "sourceOfListedMaintenanceFunds", + "养护时间": "curingTime", + "可绿化里程": "greeningMileage", + "已绿化里程": "greeningMileaged", + "重复道路路段类型": "typeOfRepeatedRoadSection", + "重复路段序号": "serialNumberOfRepeatedSection", + "重复路段路线编码": "repeatedSectionRouteCode", + "填报单位": "reportingUnit", + "变更原因": "reasonForChange", + "变更时间": "changeTime", + "是否按干线公路管理接养": "whetherMaintenanceManagedHighway", + "备注": "remarks", + "上年路线编码": "routeCodeOfLastYear", + "上年路线名称": "routeNameOfLastYear", + "上年起点桩号": "startingStationOfLastYear", + "上年止点桩号": "lastYearsEndingPointStakeNumber", + "图形里程": "graphicMileage", + "桩号里程": "chainageMileage", + "所在区县": "districtcounty", + "所在地市": "locationCity" +} \ No newline at end of file diff --git a/api/app/lib/controllers/department/index.js b/api/app/lib/controllers/department/index.js deleted file mode 100644 index e571a67b..00000000 --- a/api/app/lib/controllers/department/index.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict'; - -//获取南昌市下所有区县 -async function getCountiesList(ctx) { - try { - const models = ctx.fs.dc.models; - let rslt = await models.Department.findAll({ - where: { type: 2 }, - order: [['id', 'asc']], - }); - ctx.status = 200; - ctx.body = rslt; - } catch (error) { - console.log(error) - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { - "message": "获取南昌市下所有区县失败" - } - } -} - -module.exports = { - getCountiesList, -}; \ No newline at end of file diff --git a/api/app/lib/controllers/organization/authority.js b/api/app/lib/controllers/organization/authority.js deleted file mode 100644 index bcb5a68e..00000000 --- a/api/app/lib/controllers/organization/authority.js +++ /dev/null @@ -1,87 +0,0 @@ -async function getResource(ctx, next) { - try { - const models = ctx.fs.dc.models; - - const res = await models.Resource.findAll({ - where: { parentResource: null }, - include: [{ - model: models.Resource, - }] - }) - - ctx.body = res; - ctx.status = 200; - - } catch (error) { - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { - "message": "查询所有权限数据失败" - } - } -} -async function getUserResource(ctx, next) { - try { - const models = ctx.fs.dc.models; - const { userId } = ctx.query; - - const res = await models.UserResource.findAll({ - where: { userId: userId }, - include: [{ - model: models.Resource, - }] - }) - - ctx.body = res; - ctx.status = 200; - - } catch (error) { - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { - "message": "查询用户权限数据失败" - } - } -} - -async function updateUserRes(ctx, next) { - const transaction = await ctx.fs.dc.orm.transaction(); - try { - const models = ctx.fs.dc.models; - const { userId, resCode } = ctx.request.body; - - const res = await models.UserResource.findAll({ - attributes: ["resourceId"], - raw: true, - where: { userId: userId } - }) - - const addRes = resCode.filter(r => !res.some(rr => rr.resourceId == r)).map(r => { return { userId: userId, resourceId: r } }); - const delRes = res.filter(r => !resCode.includes(r.resourceId)).map(r => r.resourceId); - addRes.length && await models.UserResource.bulkCreate(addRes, { transaction: transaction }); - delRes.length && await models.UserResource.destroy({ - where: { - resourceId: { $in: delRes }, - userId: userId - }, - transaction: transaction - }) - - ctx.status = 204; - await transaction.commit(); - - } catch (error) { - await transaction.rollback(); - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { - "message": "更新用户权限数据失败" - } - } -} - -module.exports = { - getResource, - getUserResource, - updateUserRes -}; \ No newline at end of file diff --git a/api/app/lib/controllers/organization/user.js b/api/app/lib/controllers/organization/user.js index 990b96de..798c8a7d 100644 --- a/api/app/lib/controllers/organization/user.js +++ b/api/app/lib/controllers/organization/user.js @@ -2,65 +2,6 @@ const Hex = require('crypto-js/enc-hex'); const MD5 = require('crypto-js/md5'); -async function getDepMessage (ctx, next) { - try { - const { fs: { api: { userInfo } } } = ctx - const models = ctx.fs.dc.models; - - let depType1 = await models.Department.findAll({ - order: [['id', 'asc']], - // include: [{ - // model: models.User, - // required: false, - // where: { delete: false }, - // attributes: { exclude: ['password'] }, - // }], - where: { - // type: 1, - id: userInfo.departmentId - }, - }) - - let depRslt = [] - const getDep = async (d) => { - let subordinate = [] - let depRes = await models.Department.findAll({ - order: [['id', 'asc']], - // include: [{ - // model: models.User, - // required: false, - // where: { delete: false }, - // attributes: { exclude: ['password'] }, - // }], - where: { - dependence: d.id - }, - }) - if (depRes.length) - for (let d of depRes) { - let dep = d.dataValues - dep.subordinate = await getDep(d.dataValues) - subordinate.push(dep) - } - return subordinate - } - for (let d of depType1) { - let dep_1 = d.dataValues - dep_1.subordinate = await getDep(d.dataValues) - depRslt.push(dep_1) - } - - ctx.status = 200; - ctx.body = depRslt - } catch (error) { - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { - "message": "获取部门信息失败" - } - } -} - async function getUser (ctx, next) { try { const models = ctx.fs.dc.models; @@ -70,7 +11,7 @@ async function getUser (ctx, next) { departmentId: parseInt(depId), delete: false }, - attributes: { exclude: ['password'] }, + attributes: { exclude: ['password', 'delete'] }, order: [['id', 'asc']], }) @@ -86,33 +27,31 @@ async function getUser (ctx, next) { } async function creatUser (ctx, next) { - let errMsg = "新建用户失败" try { const models = ctx.fs.dc.models; const data = ctx.request.body; let repeatUserNameCount = await models.User.count({ where: { - username: data.phone, + username: data.username, delete: false } }) if (repeatUserNameCount) { - errMsg = '已有当前用户名' - throw errMsg + throw '已有当前用户名' } await models.User.create({ name: data.name, - username: data.phone, + username: data.username, password: Hex.stringify(MD5(data.password)), departmentId: data.departmentId, email: data.email, enable: data.enable, delete: false, phone: data.phone, - post: data.post, + remark: 'th', }) ctx.status = 204; @@ -120,7 +59,7 @@ async function creatUser (ctx, next) { ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); ctx.status = 400; ctx.body = { - "message": errMsg + message: typeof error == 'string' ? error : undefined } } } @@ -131,22 +70,23 @@ async function updateUser (ctx, next) { try { const models = ctx.fs.dc.models; const data = ctx.request.body; - const { id } = ctx.params; + const { userId } = ctx.params; let repeatUserNameCount = await models.User.count({ where: { - username: data.username + username: data.username, + delete: false, + id: { $ne: userId } } }) if (repeatUserNameCount) { - errMsg = '已有当前用户名' - throw errMsg + throw '已有当前用户名' } await models.User.update({ name: data.name, - username: data.phone, + username: data.username, departmentId: data.departmentId, email: data.email, enable: data.enable, @@ -155,7 +95,7 @@ async function updateUser (ctx, next) { post: data.post, }, { where: { - id: id + id: userId } }); @@ -164,7 +104,7 @@ async function updateUser (ctx, next) { ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); ctx.status = 400; ctx.body = { - "message": errMsg + message: typeof error == 'string' ? error : undefined } } } @@ -172,13 +112,13 @@ async function updateUser (ctx, next) { async function deleteUser (ctx, next) { try { const models = ctx.fs.dc.models; - const { ids } = ctx.params; - const userIds = ids.split(','); + const { userIds } = ctx.params; + const userIds_ = userIds.split(','); await models.User.update({ delete: true, }, { where: { - id: { $in: userIds }, + id: { $in: userIds_ }, } }); ctx.status = 204; @@ -191,34 +131,29 @@ async function deleteUser (ctx, next) { } } -async function resetPwd (ctx, next) { - try { - const models = ctx.fs.dc.models; - const { id } = ctx.params; - const data = ctx.request.body; - await models.User.update({ - password: Hex.stringify(MD5(data.password)), - }, { - where: { - id: id, - } - }); - ctx.status = 204; - } catch (error) { - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { - "message": "重置用户密码失败" - } - } -} - -/** - * 修改用户密码 - * @params {userId-用户Id} ctx - * @request.body {password-用户新密码} ctx - */ -async function updateUserPassword (ctx, next) { +// async function resetPwd (ctx, next) { +// try { +// const models = ctx.fs.dc.models; +// const { id } = ctx.params; +// const data = ctx.request.body; +// await models.User.update({ +// password: Hex.stringify(MD5(data.password)), +// }, { +// where: { +// id: id, +// } +// }); +// ctx.status = 204; +// } catch (error) { +// ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); +// ctx.status = 400; +// ctx.body = { +// "message": "重置用户密码失败" +// } +// } +// } + +async function setPassword (ctx, next) { try { const models = ctx.fs.dc.models; const { userId } = ctx.params; @@ -254,11 +189,10 @@ async function updateUserPassword (ctx, next) { module.exports = { - getDepMessage, getUser, creatUser, updateUser, deleteUser, - resetPwd, - updateUserPassword + // resetPwd, + setPassword } \ No newline at end of file diff --git a/api/app/lib/controllers/placeSecurityRecord/index.js b/api/app/lib/controllers/placeSecurityRecord/index.js deleted file mode 100644 index ff3fc45d..00000000 --- a/api/app/lib/controllers/placeSecurityRecord/index.js +++ /dev/null @@ -1,612 +0,0 @@ -'use strict'; -const moment = require('moment'); - -/** - * 提交填报信息/保存填报草稿 - * @requires.body { - * isDraft-是否草稿 - * userId-用户id,填报人 - * placeName-场所id - * placeType-场所性质 - * regionId-所属县/区 - * address-场所地址 - * placeOwner-场所负责人 - * phone-负责人手机号 - * dimension-面积 - * floors-多少层 - * numberOfPeople-常住人数 - * location-经纬度 - * isEnable-是否为合用场所 - * localtionDescribe-经纬度定位描述 - * hiddenDangerItem12-12项隐患信息,格式:[{ - * itemIndex-隐患项序号, - * value-是否存在隐患, - * description-隐患具体信息描述, - * photos-隐患图片(多张图片以 , 隔开)" - * }], - * description-存在具体问题描述 - * correctiveAction-采取整改措施 - * punishment-实施处罚,强制措施情况 - * } ctx - */ -async function addPlaceSecurityRecord (ctx, next) { - const transaction = await ctx.fs.dc.orm.transaction(); - try { - const models = ctx.fs.dc.models; - const body = ctx.request.body; - let ifRightRegion = true; - if (body.regionId) { - //判断填报信息所属乡镇/区县是否存在 - let region = await models.Department.findOne({ where: { id: body.regionId } }); - if (!region) { - ifRightRegion = false; - } - } - if (ifRightRegion) { - let placeId = null; - if (body.placeName) { - //判断“场所名称”是否存在,不存在则“新建场所” - let place = await models.Places.findOne({ where: { name: body.placeName, userId: ctx.fs.api.userId } }); - if (place) { - placeId = place.id - } else { - const newPlace = await models.Places.create({ - name: body.placeName, - userId: ctx.fs.api.userId - }, { transaction: transaction }); - placeId = newPlace.id; - } - } - //创建填报信息/填报草稿 - const userPlaceSecurityRecord = await models.UserPlaceSecurityRecord.create({ - isDraft: body.isDraft,//是否草稿 - userId: ctx.fs.api.userId,//用户id,填报人 - time: moment(),//录入时间 - placeId: placeId,//场所id - placeType: body.placeType,//场所性质 - regionId: body.regionId,//所属县/区 - address: body.address,//场所地址 - placeOwner: body.placeOwner,//场所负责人 - phone: body.phone,//负责人手机号 - dimension: body.dimension,//面积 - floors: body.floors,//多少层 - numberOfPeople: body.numberOfPeople,//常住人数 - location: body.location,//经纬度 - isEnable: body.isEnable,//是否为合用场所 - localtionDescribe: body.localtionDescribe,//经纬度定位描述 - hiddenDangerItem12: body.hiddenDangerItem12,//12项隐患信息 - description: body.description,//存在具体问题描述 - correctiveAction: body.correctiveAction,//采取措施 - type: true,//是否重新发起true默认false可以重新发起 - punishment: body.punishment,//实施处罚,强制措施情况 - departmentId: body.departmentId - }, { transaction: transaction }); - ctx.body = { - id: userPlaceSecurityRecord.id, - "message": "新增填报信息成功" - }; - ctx.status = 200; - } else { - ctx.status = 400; - ctx.body = { - "message": "所选地址不存在!" - } - } - await transaction.commit(); - } catch (error) { - await transaction.rollback(); - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { - "message": "新增填报信息失败" - } - } -} - -/** - * 编辑填报信息 - * @param {id-填报信息ID} ctx - * @requires.body { - * isDraft-是否草稿 - * userId-用户id,填报人 - * placeName-场所id - * placeType-场所性质 - * regionId-所属县/区 - * address-场所地址 - * placeOwner-场所负责人 - * phone-负责人手机号 - * dimension-面积 - * floors-多少层 - * numberOfPeople-常住人数 - * location-经纬度 - * isEnable-是否为合用场所 - * localtionDescribe-经纬度定位描述 - * hiddenDangerItem12-12项隐患信息,格式:[{ - * itemIndex-隐患项序号, - * value-是否存在隐患, - * description-隐患具体信息描述, - * photos-隐患图片(多张图片以 , 隔开)" - * }], - * description-存在具体问题描述 - * correctiveAction-采取整改措施 - * punishment-实施处罚,强制措施情况 - * } ctx - */ -async function editPlaceSecurityRecord (ctx, next) { - const transaction = await ctx.fs.dc.orm.transaction(); - try { - const models = ctx.fs.dc.models; - const { id } = ctx.params; - //判断该填报信息是否存在 - let userPlaceSecurityRecord = await models.UserPlaceSecurityRecord.findOne({ where: { id: id } }); - if (userPlaceSecurityRecord) { - const body = ctx.request.body; - let ifRightRegion = true; - if (body.regionId) { - //判断填报信息所属乡镇/区县是否存在 - let region = await models.Department.findOne({ where: { id: body.regionId } }); - if (!region) { - ifRightRegion = false; - } - } - if (ifRightRegion) { - let placeId = null; - if (body.placeName) { - //判断“场所名称”是否存在,不存在则“新建场所” - let place = await models.Places.findOne({ where: { name: body.placeName, userId: ctx.fs.api.userId } }); - if (place) { - placeId = place.id - } else { - const newPlace = await models.Places.create({ - name: body.placeName, - userId: ctx.fs.api.userId - }, { transaction: transaction }); - placeId = newPlace.id; - } - } - //修改填报信息 - await models.UserPlaceSecurityRecord.update({ - isDraft: body.isDraft,//是否草稿 - userId: ctx.fs.api.userId,//用户id,填报人 - time: moment(),//录入时间 - placeId: placeId,//场所id - placeType: body.placeType,//场所性质 - regionId: body.regionId,//所属县/区 - address: body.address,//场所地址 - placeOwner: body.placeOwner,//场所负责人 - phone: body.phone,//负责人手机号 - dimension: body.dimension,//面积 - floors: body.floors,//多少层 - numberOfPeople: body.numberOfPeople,//常住人数 - location: body.location,//经纬度 - isEnable: body.isEnable,//是否为合用场所 - localtionDescribe: body.localtionDescribe,//经纬度定位描述 - hiddenDangerItem12: body.hiddenDangerItem12,//12项隐患信息 - description: body.description,//存在具体问题描述 - correctiveAction: body.correctiveAction,//采取措施 - punishment: body.punishment,//实施处罚,强制措施情况 - departmentId: body.departmentId - }, { where: { id: id, }, transaction: transaction }); - ctx.body = { "message": "修改填报信息成功" }; - ctx.status = 200; - } else { - ctx.status = 400; - ctx.body = { "message": "所选地址不存在!" } - } - } else { - ctx.status = 400; - ctx.body = { "message": "该填报信息不存在!" } - } - await transaction.commit(); - } catch (error) { - await transaction.rollback(); - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { "message": "修改填报信息失败" } - } -} - -/** - * 修改type字段 - * @param {*} ctx - * @param {*} next - */ -async function updateType (ctx, next) { - const models = ctx.fs.dc.models; - const { id } = ctx.params; - try { - await models.UserPlaceSecurityRecord.update({ - type: true,//是否重新发起true默认false可以重新发起 - }, { where: { id: id, } }) - ctx.body = { "message": "修改信息成功" }; - ctx.status = 200; - } catch (error) { - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { "message": "修改信息失败" } - } -} - -/** - * 删除填报信息 - * @param {id-填报信息ID} ctx - */ -async function deletePlaceSecurityRecord (ctx, next) { - const transaction = await ctx.fs.dc.orm.transaction(); - try { - const models = ctx.fs.dc.models; - const { id } = ctx.params; - //判断该填报信息是否存在 - let userPlaceSecurityRecord = await models.UserPlaceSecurityRecord.findOne({ where: { id: id } }); - if (userPlaceSecurityRecord) { - await models.UserPlaceSecurityRecord.destroy({ where: { id: id }, transaction: transaction }); - ctx.body = { "message": "删除填报信息成功" }; - ctx.status = 200; - } else { - ctx.status = 400; - ctx.body = { "message": "该填报信息不存在!" } - } - await transaction.commit(); - } catch (error) { - await transaction.rollback(); - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { "message": "删除填报信息失败" } - } -} - -/** - * 根据填报信息ID查询填报信息 - * @param {id-填报信息ID} ctx - */ -async function getPlaceSecurityRecordById (ctx, next) { - try { - const models = ctx.fs.dc.models; - const { id } = ctx.params; - //判断该填报信息是否存在 - let userPlaceSecurityRecord = await models.UserPlaceSecurityRecord.findOne({ where: { id: id } }); - if (userPlaceSecurityRecord) { - let userPlaceSecurityRecord = await models.UserPlaceSecurityRecord.findOne({ - where: { id: id }, - include: [{ - model: models.Places, - }, { - model: models.User, - as: 'user', - attributes: ['id', 'name', 'username', 'phone'] - }, { - model: models.User, - as: 'audit1ManUser', - attributes: ['id', 'name', 'username', 'phone'] - }, { - model: models.User, - as: 'audit2ManUser', - attributes: ['id', 'name', 'username', 'phone'] - }, { - model: models.User, - as: 'rejectManUser', - attributes: ['id', 'name', 'username', 'phone'] - }] - }); - ctx.body = userPlaceSecurityRecord; - ctx.status = 200; - } else { - ctx.status = 400; - ctx.body = { "message": "该填报信息不存在!" } - } - } catch (error) { - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { "message": "查询填报信息失败" } - } -} - -/** - * 根据场所ID获取该场所最近用户填报信息 - * @param {placeId-场所信息ID} ctx - */ -async function getRecentlyPlaceSecurityRecordByPlaceId (ctx, next) { - try { - const models = ctx.fs.dc.models; - const { placeId } = ctx.params; - //判断该场所信息是否存在 - let place = await models.Places.findOne({ where: { id: placeId } }); - if (place) { - let userPlaceSecurityRecord = await models.UserPlaceSecurityRecord.findAll({ - where: { placeId: placeId, userId: place.userId }, - include: [{ - model: models.Places, - }], - limit: 1, - order: [["id", "desc"]], - }); - ctx.status = 200; - ctx.body = userPlaceSecurityRecord.length ? userPlaceSecurityRecord[0] : null; - } else { - ctx.status = 400; - ctx.body = { "message": "该场所不存在!" } - } - } catch (error) { - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { "message": "获取场所最近用户填报信息失败" } - } -} - -/** - * 根据筛选条件获取用户填报信息 - * @query { - * isDraft-是否草稿 - * userId-用户ID - * timeRange-录入时间范围 - * regionId-区域ID - * placeId-场所ID - * state-审批状态 - * pageIndex-页码 - * pageSize-页宽 - * } ctx - */ -async function getPlaceSecurityRecords (ctx, next) { - try { - const models = ctx.fs.dc.models; - const { isDraft, userId, timeRange, regionId, placeId, state, pageIndex, pageSize } = ctx.query; - let whereCondition = {}; - if (userId) { - let user = await models.User.findOne({ where: { id: userId } }); - if (user) { - whereCondition.userId = userId; - } else { - ctx.status = 400; - ctx.body = { "message": "用户不存在!" } - return; - } - } - if (regionId) { - let region = await models.Department.findOne({ where: { id: regionId } }); - if (region) { - whereCondition.regionId = regionId; - } else { - ctx.status = 400; - ctx.body = { "message": "区域不存在!" } - return; - } - } - if (placeId) { - let place = await models.Places.findOne({ where: { id: placeId } }); - if (place) { - whereCondition.placeId = placeId; - } else { - ctx.status = 400; - ctx.body = { "message": "场所不存在!" }; - return; - } - } - if (isDraft) { whereCondition.isDraft = isDraft; } - let times = timeRange; - if (timeRange && timeRange.indexOf(',')) { times = timeRange.split(',') } - if (times && times.length > 0) { - const len = times.length; - whereCondition.time = { - $between: [ - moment(times[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss'), - moment(times[len - 1]).endOf('day').format('YYYY-MM-DD HH:mm:ss') - ] - }; - } - switch (Number(state)) { - case 1: //待审批:未审核 或者 已审核+未复核 - whereCondition.$or = [ - { '$audit1ManId$': null }, - { '$audit2ManId$': null } - ]; - whereCondition.rejectManId = null; - break; - case 2://已审批:已审批+已复核 - whereCondition.audit1ManId = { $not: null }; - whereCondition.audit2ManId = { $not: null }; - break; - case 3: //驳回 - whereCondition.rejectManId = { $not: null }; - break; - default: break; - } - let findObj = { - where: whereCondition, - order: [["id", "desc"]], - include: [{ - model: models.Places, - }, { - model: models.User, - as: 'user', - attributes: ['id', 'name', 'username', 'phone'] - }, { - model: models.User, - as: 'audit1ManUser', - attributes: ['id', 'name', 'username', 'phone'] - }, { - model: models.User, - as: 'audit2ManUser', - attributes: ['id', 'name', 'username', 'phone'] - }, { - model: models.User, - as: 'rejectManUser', - attributes: ['id', 'name', 'username', 'phone'] - }] - }; - if (Number(pageSize) > 0 && Number(pageIndex) >= 0) { - findObj.limit = Number(pageSize); - findObj.offset = Number(pageIndex) * Number(pageSize); - } - let userPlaceSecurityRecords = await models.UserPlaceSecurityRecord.findAndCountAll(findObj); - ctx.status = 200; - ctx.body = userPlaceSecurityRecords; - } catch (error) { - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { "message": "获取用户填报信息失败" } - } -} - -/** - * 根据筛选条件获取用户审批填报信息 - * @query { - * approveUserId-审批人ID - * timeRange-录入时间范围 - * regionId-区域ID - * placeId-场所ID - * state-审批状态 - * pageIndex-页码 - * pageSize-页宽 - * } ctx - */ -async function getApprovePlaceSecurityRecords (ctx, next) { - try { - const models = ctx.fs.dc.models; - const { approveUserId, timeRange, regionId, placeId, state, pageIndex, pageSize } = ctx.query; - let whereCondition = { isDraft: false }; - if (approveUserId) { - let approveUser = await models.User.findOne({ where: { id: approveUserId } }); - if (approveUser) { - //获取审批人管辖区域内所有用户ID(注:市级人员查看所有用户数据) - const departmentRes = await models.Department.findOne({ where: { id: approveUser.departmentId } }); - if (departmentRes.dependence) { - let attentionRegionIds = [departmentRes.id]; - let regionType = departmentRes.type; - while (attentionRegionIds.length && regionType && regionType < 4) { - const departmentChilds = await models.Department.findAll({ where: { dependence: { $in: attentionRegionIds } } }); - regionType = departmentChilds.length ? departmentChilds[0].type : null; - attentionRegionIds = departmentChilds.map(d => d.id); - } - let users = await models.User.findAll({ where: { departmentId: { $in: attentionRegionIds } }, attributes: ['id'] }); - if (users.length) { - let userIds = users.map(u => u.id); - whereCondition.userId = { $in: userIds }; - } else { - ctx.status = 200; - ctx.body = { - "count": 0, - "rows": [] - } - return; - } - } - if (regionId) { - let region = await models.Department.findOne({ where: { id: regionId } }); - if (region) { - whereCondition.regionId = regionId; - } else { - ctx.status = 400; - ctx.body = { "message": "区域不存在!" } - return; - } - } - if (placeId) { - let place = await models.Places.findOne({ where: { id: placeId } }); - if (place) { - whereCondition.placeId = placeId; - } else { - ctx.status = 400; - ctx.body = { "message": "场所不存在!" }; - return; - } - } - let times = timeRange; - if (timeRange && timeRange.indexOf(',')) { times = timeRange.split(',') } - if (times && times.length > 0) { - const len = times.length; - whereCondition.time = { - $between: [ - moment(times[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss'), - moment(times[len - 1]).endOf('day').format('YYYY-MM-DD HH:mm:ss') - ] - }; - } - switch (Number(state)) { - case 1: //待审批 - if (departmentRes.type == 2) { - //区县待审:已审核+未复核 - whereCondition.audit1ManId = { $not: null }; - whereCondition.audit2ManId = null; - } else { - //乡镇待审:未审核+未复核 - whereCondition.audit1ManId = null; - whereCondition.audit2ManId = null; - } - whereCondition.rejectManId = null; - break; - case 2://已审批: - if (departmentRes.type == 3) { - //乡镇已审:已审核 - whereCondition.audit1ManId = { $not: null }; - } else { - //区域已审:已审批+已复核 - whereCondition.audit1ManId = { $not: null }; - whereCondition.audit2ManId = { $not: null }; - } - whereCondition.rejectManId = null; - break; - case 3: //驳回 - whereCondition.rejectManId = { $not: null }; - break; - default: - if (departmentRes.type == 2) { - //区县查看数据:去除未审核 - whereCondition.audit1ManId = { $not: null }; - } - break; - } - let findObj = { - where: whereCondition, - include: [{ - model: models.Places, - }, { - model: models.User, - as: 'user', - attributes: ['id', 'name', 'username', 'phone'] - }, { - model: models.User, - as: 'audit1ManUser', - attributes: ['id', 'name', 'username', 'phone'] - }, { - model: models.User, - as: 'audit2ManUser', - attributes: ['id', 'name', 'username', 'phone'] - }, { - model: models.User, - as: 'rejectManUser', - attributes: ['id', 'name', 'username', 'phone'] - }], - order: [["id", "desc"]] - }; - if (Number(pageSize) > 0 && Number(pageIndex) >= 0) { - findObj.limit = Number(pageSize); - findObj.offset = Number(pageIndex) * Number(pageSize); - } - let userPlaceSecurityRecords = await models.UserPlaceSecurityRecord.findAndCountAll(findObj); - ctx.status = 200; - ctx.body = userPlaceSecurityRecords; - } else { - ctx.status = 400; - ctx.body = { "message": "用户不存在!" } - } - } else { - ctx.status = 400; - ctx.body = { "message": "请传用户参数!" } - } - } catch (error) { - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { "message": "获取用户填报信息失败" } - } -} - -module.exports = { - addPlaceSecurityRecord, - editPlaceSecurityRecord, - deletePlaceSecurityRecord, - getPlaceSecurityRecordById, - getRecentlyPlaceSecurityRecordByPlaceId, - getPlaceSecurityRecords, - getApprovePlaceSecurityRecords, - updateType -}; \ No newline at end of file diff --git a/api/app/lib/controllers/places/index.js b/api/app/lib/controllers/places/index.js deleted file mode 100644 index c60d3195..00000000 --- a/api/app/lib/controllers/places/index.js +++ /dev/null @@ -1,91 +0,0 @@ -'use strict'; - -/** - * 根据用户ID获取该用户创建的所有场所信息 - * @param {userId-用户ID} ctx - */ -async function getPlacesByUserId(ctx, next) { - try { - const models = ctx.fs.dc.models; - const { userId } = ctx.params; - let places = await models.Places.findAll({ where: { userId: userId }, attributes: ['id', 'name'] }); - ctx.status = 200; - ctx.body = places; - } catch (error) { - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { "message": "查询用户场所信息失败" } - } -} - -/** - * 根据审批用户ID获取该审批用户范围内填报人创建的场所信息 - * @param {approveUserId-审批用户ID} ctx - */ -async function getPlacesByApproveUserId(ctx, next) { - try { - const models = ctx.fs.dc.models; - const { approveUserId } = ctx.params; - let approveUser = await models.User.findOne({ where: { id: approveUserId } }); - if (approveUser) { - let whereCondition = {}; - //获取审批人管辖区域内所有用户ID - const departmentRes = await models.Department.findOne({ where: { id: approveUser.departmentId } }); - if (departmentRes.dependence) { - let regionType = departmentRes.type; - if (regionType == 4) { - whereCondition.userId = approveUserId; - } else { - let attentionRegionIds = [departmentRes.id]; - while (attentionRegionIds.length && regionType && regionType < 4) { - const departmentChilds = await models.Department.findAll({ where: { dependence: { $in: attentionRegionIds } } }); - regionType = departmentChilds.length ? departmentChilds[0].type : null; - attentionRegionIds = departmentChilds.map(d => d.id); - } - let users = await models.User.findAll({ where: { departmentId: { $in: attentionRegionIds } }, attributes: ['id'] }); - if (users.length) { - let userIds = users.map(u => u.id); - whereCondition.userId = { $in: userIds }; - } else { - ctx.status = 200; - ctx.body = []; - return; - } - } - } - let places = await models.Places.findAll({ where: whereCondition, attributes: ['id', 'name'] }); - ctx.status = 200; - ctx.body = places; - } else { - ctx.status = 400; - ctx.body = { "message": "用户不存在!" } - } - } catch (error) { - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { "message": "查询用户区域内场所信息失败" } - } -} - -/** - * 获取所有场所信息 - */ -async function getAllPlaces(ctx, next) { - try { - const models = ctx.fs.dc.models; - let places = await models.Places.findAll(); - ctx.status = 200; - ctx.body = places; - } catch (error) { - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { "message": "获取场所信息失败" } - } -} - - -module.exports = { - getPlacesByUserId, - getPlacesByApproveUserId, - getAllPlaces -}; \ No newline at end of file diff --git a/api/app/lib/controllers/report/compile.js b/api/app/lib/controllers/report/compile.js deleted file mode 100644 index 3734aca2..00000000 --- a/api/app/lib/controllers/report/compile.js +++ /dev/null @@ -1,140 +0,0 @@ -const moment = require('moment') - -async function getReportRectify(ctx, next) { - try { - const models = ctx.fs.dc.models; - const { fs: { api: { userInfo } } } = ctx - const { startTime, endTime } = ctx.query - // 查找自己所属的区县数据 type == 2 - - let userDepRes = await models.Department.findOne({ - order: [['id', 'asc']], - where: { - id: userInfo.departmentId - }, - }) - let depRes = [] - if (userDepRes.dataValues.type == 1) { - depRes = await models.Department.findAll({ - where: { - type: 2, - } - }) - } else if (userDepRes.dataValues.type == 2) { - depRes = [userDepRes] - } - - let rectifyReportList = [] - - let calDay = moment(startTime).startOf('day') - let endDay = moment(endTime).endOf('day') - let today = moment().endOf('day') - while (calDay.isBefore(endDay) && calDay.isBefore(today)) { - let curDay_ = calDay.clone(); - for (let d of depRes) { - let reportCount = await models.ReportRectify.count({ - where: { - regionId: d.dataValues.id, - userId:{$not:null}, - dateTime: { - $between: [ - curDay_.startOf('day').format('YYYY-MM-DD HH:mm:ss'), - curDay_.endOf('day').format('YYYY-MM-DD HH:mm:ss') - ] - } - } - }) - let detailCount = await models.ReportRectify.count({ - where: { - regionId: d.dataValues.id, - dateTime: { - $between: [ - curDay_.startOf('day').format('YYYY-MM-DD HH:mm:ss'), - curDay_.endOf('day').format('YYYY-MM-DD HH:mm:ss') - ] - } - } - }) - if (detailCount > 0) - rectifyReportList.push({ - day: calDay.format('YYYY-MM-DD'), - region: d.dataValues.name, - name: d.dataValues.name + '合用场所安全隐患排查整治汇总表', - reportBool: reportCount > 0, - depId: d.id, - }) - } - - calDay.add(1, 'day') - } - - ctx.body = rectifyReportList; - ctx.status = 200; - } catch (error) { - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { - "message": "获取合用场所安全隐患排查整治汇总表列表失败" - } - } -} - -async function getReportRectifyDetail(ctx, next) { - try { - const models = ctx.fs.dc.models; - const { day, depId } = ctx.query - - let searchDay = moment(day) - let reportRes = await models.ReportRectify.findAll({ - where: { - regionId: depId, - dateTime: { - $between: [ - searchDay.startOf('day').format('YYYY-MM-DD HH:mm:ss'), - searchDay.endOf('day').format('YYYY-MM-DD HH:mm:ss') - ] - } - } - }) - - ctx.body = reportRes; - ctx.status = 200; - } catch (error) { - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { - "message": "获取合用场所安全隐患排查整治汇总表详情失败" - } - } -} - -async function compileReportRectifyDetail(ctx, next) { - const t = await ctx.fs.dc.orm.transaction(); - try { - const models = ctx.fs.dc.models; - const data = ctx.request.body - for (let d of data) { - await models.ReportRectify.update(d, { - transaction: t, - where: { - id: d.id - } - }) - } - await t.commit(); - ctx.status = 204; - } catch (error) { - await t.rollback(); - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { - "message": "保存合用场所安全隐患排查整治汇总表详情失败" - } - } -} - -module.exports = { - getReportRectify, - getReportRectifyDetail, - compileReportRectifyDetail, -}; \ No newline at end of file diff --git a/api/app/lib/controllers/report/config.js b/api/app/lib/controllers/report/config.js deleted file mode 100644 index 158704a2..00000000 --- a/api/app/lib/controllers/report/config.js +++ /dev/null @@ -1,173 +0,0 @@ -async function getAreas (ctx, next) { - try { - const { fs: { api: { userInfo } } } = ctx - const models = ctx.fs.dc.models; - - let userDepRes = await models.Department.findOne({ - order: [['id', 'asc']], - where: { - id: userInfo.departmentId - }, - }) - - let rslt = [] - if (userDepRes) { - if (userDepRes.dataValues.type == 1) { - rslt = await models.Department.findAll({ - order: [['id', 'asc']], - where: { - type: 2 - } - }) - } else if (userDepRes.dataValues.type == 2) { - rslt = [userDepRes.dataValues] - } - } - - ctx.body = rslt; - ctx.status = 200; - } catch (error) { - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { - "message": "查询区域数据失败" - } - } -} - -async function addReportConfig (ctx) { - let errMsg = "添加报表配置失败" - try { - const data = ctx.request.body - const models = ctx.fs.dc.models; - - const repeatRes = await models.ReportConfigition.find({ - where: { - regionId: data.regionId, - reportTypeId: data.reportTypeId, - excuteTime: data.excuteTime, - } - }) - - if (repeatRes) { - errMsg = '已有相同配置信息'; - throw errMsg - } - - const res = await models.ReportConfigition.create(data) - - ctx.body = res; - ctx.status = 200; - } catch (error) { - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { - "message": errMsg - } - } -} - -async function getReportConfig (ctx) { - try { - const { fs: { api: { userInfo } } } = ctx - const models = ctx.fs.dc.models; - - // 查找自己所属的区县数据 type == 2 - - let userDepRes = await models.Department.findOne({ - order: [['id', 'asc']], - where: { - id: userInfo.departmentId - }, - }) - let depRes = [] - if (userDepRes.dataValues.type == 1) { - depRes = await models.Department.findAll({ - where: { - type: 2, - } - }) - } else if (userDepRes.dataValues.type == 2) { - depRes = [userDepRes] - } - - const res = await models.ReportConfigition.findAll({ - where: { - regionId: { $in: depRes.map(d => d.dataValues.id) } - } - }) - - ctx.body = res; - ctx.status = 200; - } catch (error) { - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { - "message": "获取报表配置失败" - } - } -} - -async function editReportConfig (ctx) { - try { - const models = ctx.fs.dc.models; - const data = ctx.request.body - const { reportId } = ctx.params - - const repeatRes = await models.ReportConfigition.find({ - where: { - id: { $ne: parseInt(reportId) }, - regionId: data.regionId, - reportTypeId: data.reportTypeId, - excuteTime: data.excuteTime, - } - }) - - if (repeatRes) { - errMsg = '已有相同配置信息'; - throw errMsg - } - - await models.ReportConfigition.update(data, { - where: { - id: parseInt(reportId) - } - }) - - ctx.status = 204; - } catch (error) { - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { - "message": "编辑报表配置失败" - } - } -} - -async function delReportConfig (ctx) { - try { - const models = ctx.fs.dc.models; - const { reportId } = ctx.params - await models.ReportConfigition.destroy({ - where: { - id: parseInt(reportId) - } - }) - - ctx.status = 204; - } catch (error) { - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { - "message": "删除报表配置失败" - } - } -} - -module.exports = { - getAreas, - addReportConfig, - getReportConfig, - editReportConfig, - delReportConfig, -}; \ No newline at end of file diff --git a/api/app/lib/controllers/report/index.js b/api/app/lib/controllers/report/index.js deleted file mode 100644 index 2367e619..00000000 --- a/api/app/lib/controllers/report/index.js +++ /dev/null @@ -1,87 +0,0 @@ -const moment = require('moment'); -async function getReportList (ctx, next) { - try { - const { fs: { api: { userInfo } } } = ctx - const models = ctx.fs.dc.models; - const { creatTime, reportName, regionName, limit, offset } = ctx.query; - - let where = { - $and: { - reportName: { $notLike: '%填报信息导出%' } - } - }; - if (creatTime) { - where.creatTime = { - $gte: moment(creatTime[0]).format('YYYY-MM-DD HH:mm:ss'), - $lte: moment(creatTime[1]).format('YYYY-MM-DD HH:mm:ss') - } - } - - if (reportName) { - where.reportName = { - $iLike: `%${reportName}%` - } - } - - if (regionName && regionName != -1) { - where.regionId = regionName - } else { - let userDepRes = await models.Department.findOne({ - order: [['id', 'asc']], - where: { - id: userInfo.departmentId - }, - }) - - let userDep = [] - if (userDepRes) { - if (userDepRes.dataValues.type == 1) { - userDep = await models.Department.findAll({ - order: [['id', 'asc']], - where: { - type: 2 - } - }) - } else if (userDepRes.dataValues.type == 2) { - userDep = [userDepRes] - } - } - where.regionId = { $in: userDep.map(u => u.dataValues.id) } - } - - let findObj = { - include: [{ - model: models.ReportType, - attributes: ['name'] - }, { - model: models.Department, - attributes: ['name'] - }], - where: where, - order: [['creatTime', 'desc']], - }; - - if (Number(limit) > 0 && Number(offset) >= 0) { - findObj.limit = Number(limit); - findObj.offset = Number(offset); - } - - const res = await models.ReportDownManage.findAndCountAll(findObj) - - ctx.body = res; - ctx.status = 200; - - } catch (error) { - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { - "message": "查询报表数据失败" - } - } -} - - - -module.exports = { - getReportList, -}; \ No newline at end of file diff --git a/api/app/lib/controllers/statistic/index.js b/api/app/lib/controllers/statistic/index.js deleted file mode 100644 index 7ad489e4..00000000 --- a/api/app/lib/controllers/statistic/index.js +++ /dev/null @@ -1,342 +0,0 @@ -const moment = require('moment'); -const { QueryTypes } = require('sequelize'); - -async function reportDailyStatistic (ctx, next) { - const rslt = { - added: 0, //今日新增 - checked: 0, //今日已审填报 - unChecked: 0, //未审填报 - danger_place: 0, //隐患场所总数 - history: 0, //历史填报 - date: {} - }; - try { - const models = ctx.fs.dc.models; - const curDay_ = moment(); - const sequelize = ctx.fs.dc.orm; - - - rslt.added = await models.UserPlaceSecurityRecord.count({ - where: { - time: { - $between: [ - curDay_.startOf('day').format('YYYY-MM-DD HH:mm:ss'), - curDay_.endOf('day').format('YYYY-MM-DD HH:mm:ss') - ] - } - } - }) - rslt.unChecked = await models.UserPlaceSecurityRecord.count({ - where: { - $or: [ - { - audit2ManId: { $eq: null }, - rejectManId: { $eq: null }, - }, - // { - // audit2ManId: { $ne: null }, - // rejectManId: { $eq: null }, - // }, - { - audit1ManId: { $eq: null }, - rejectManId: { $eq: null }, - } - ] - } - }); - - rslt.checked = await models.UserPlaceSecurityRecord.count({ - where: { - $or: [ - { - audit2ManId: { $ne: null }, - audit2ManIdTime: { - $between: [ - curDay_.startOf('day').format('YYYY-MM-DD HH:mm:ss'), - curDay_.endOf('day').format('YYYY-MM-DD HH:mm:ss') - ] - } - }, - { - rejectManId: { $ne: null }, - rejectTime: { - $between: [ - curDay_.startOf('day').format('YYYY-MM-DD HH:mm:ss'), - curDay_.endOf('day').format('YYYY-MM-DD HH:mm:ss') - ] - } - } - ] - } - }); - - const list = await sequelize.query(`SELECT count(*) AS "count" FROM "user_placeSecurityRecord" AS "userPlaceSecurityRecord" - WHERE ("userPlaceSecurityRecord"."correctiveAction" IS NOT NULL AND "userPlaceSecurityRecord"."punishment" IS NOT NULL) AND "audit2ManId" IS NOT NULL GROUP BY "placeId";`, { type: QueryTypes.SELECT }) - rslt.danger_place = list.length; - - rslt.history = await models.UserPlaceSecurityRecord.count(); - - // seven days data - - const startDay = moment().startOf('day'); - for (let d = 1; d <= 7; d++) { - const START_DAY = moment(startDay).add(-d, 'day'); - const date = START_DAY.format('YYYY-MM-DD'); - const num = await models.UserPlaceSecurityRecord.count({ - where: { - time: { - $between: [ - START_DAY.startOf('day').format('YYYY-MM-DD HH:mm:ss'), - START_DAY.endOf('day').format('YYYY-MM-DD HH:mm:ss') - ] - } - } - }) - - rslt.date[date] = num; - } - - ctx.status = 200; - ctx.body = rslt; - - } catch (error) { - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { - "message": "获取数据中台数据失败" - } - } - -} - -async function reportAreaStatistic (ctx, next) { - let rslt = [], relationRegion = {}; - try { - const { startDate, endDate } = ctx.query; - const models = ctx.fs.dc.models; - const sequelize = ctx.fs.dc.orm; - - const list = await sequelize.query(`select "regionId", count("regionId") from "user_placeSecurityRecord" WHERE "time" BETWEEN '${moment(startDate).startOf('day').format('YYYY-MM-DD HH:mm:ss')}' AND '${moment(endDate).endOf('day').format('YYYY-MM-DD HH:mm:ss')}' AND "hiddenDangerItem12" IS NOT NULL GROUP BY "regionId" `, { type: QueryTypes.SELECT }) - // let regionIds = [] - // list.map(item => { - // if (item.regionId && item.regionId != '') { - // regionIds.push(item.regionId); - // } - // }); - - // const depts = await sequelize.query(`SELECT "id", "name", "type", "dependence" FROM "department" AS "department" WHERE "department"."id" IN (${regionIds.toString()});`, { type: QueryTypes.SELECT }); - const deptRelation = await sequelize.query(`SELECT "id", "name", "type", "dependence" FROM "department" AS "department";`, { type: QueryTypes.SELECT }); - const quArea = deptRelation.filter(f => f.type == 2); - quArea.map(item => { - relationRegion[item.id] = {}; - const xiang = deptRelation.filter(f => f.type == 3 && f.dependence == item.id).map(item => item.id); - - const cun = deptRelation.filter(f => f.type == 4 && xiang.some(ss => ss == f.dependence)).map(item => item.id); - relationRegion[item.id]['regionIds'] = [item.id, ...xiang, ...cun]; - relationRegion[item.id]['name'] = item.name; - }) - Object.keys(relationRegion).map(key => { - const { regionIds, name } = relationRegion[key]; - let data = list.filter(item => regionIds.some(id => id == item.regionId)) - let obj = {}; - obj['name'] = name; - obj['count'] = 0; - obj['regionId'] = key; - data.map(item => { - obj['count'] += Number(item.count) - }) - rslt.push(obj) - }) - - ctx.status = 200; - ctx.body = rslt; - - } catch (error) { - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { - "message": "获取数据中台数据失败" - } - } - -} - -async function dangerAreaQuery (ctx, next) { - const { userId } = ctx.fs.api - let rslt = { rows: [], count: 0, ids: [] }, relationRegion = {}; - try { - const { startDate, endDate, placeType, regionId, placeName, offset = 0, limit = 20 } = ctx.query; - const models = ctx.fs.dc.models; - const sequelize = ctx.fs.dc.orm; - - let options = { - audit2ManId: { $ne: null }, - }, places = [], dep4Ids = []; - if (startDate && endDate) { - options.time = { - $between: [ - moment(startDate).startOf('day').format('YYYY-MM-DD HH:mm:ss'), - moment(endDate).endOf('day').format('YYYY-MM-DD HH:mm:ss') - ] - } - } - if (placeName) { - places = await models.Places.findAll({ - where: { - name: { $like: `%${placeName}%` } - } - }) - options.placeId = { - $in: places.map(item => item.id) - } - } else { - places = await models.Places.findAll() - } - - if (regionId && regionId != -1) { - let idList = []; - const curDeptRelation = await sequelize.query(`SELECT "id", "name", "type", "dependence" FROM "department" WHERE "id" in (${regionId});`, { type: QueryTypes.SELECT }); - - const type = curDeptRelation[0].type - if (type != 1) { - const deptRelation = await sequelize.query(`SELECT "id", "name", "type", "dependence" FROM "department" AS "department";`, { type: QueryTypes.SELECT }); - const quArea = deptRelation.filter(f => f.type == 2); - quArea.map(item => { - relationRegion[item.id] = {}; - deptRelation.filter(f => f.type == 3 && f.dependence == item.id).map(x => { - relationRegion[item.id][x.id] = deptRelation.filter(f => f.type == 4 && x.id == f.dependence).map(cun => cun.id); - }); - }) - if (type == 2) { - const quList = [regionId]; - const xiangList = Object.keys(relationRegion[regionId]) - let cunList = xiangList.map(key => { - return relationRegion[regionId][key] - }) - idList = quList.concat(xiangList).concat(cunList.flat(Infinity)) - - options.regionId = { $in: idList }; - } - if (type == 3) { - Object.keys(relationRegion).map(quKey => { - Object.keys(relationRegion[quKey]).map(xiangKey => { - if (xiangKey == regionId) { - const xiangList = [xiangKey]; - const cunList = relationRegion[quKey][xiangKey] - idList = xiangList.concat(cunList); - } - }) - }) - dep4Ids = idList - } - if (type == 4) { - const curUser = await models.User.findOne({ where: { id: userId } }) - const corUserDepId = curUser.departmentId - const corUseUserDepRes = await models.Department.findOne({ where: { id: corUserDepId } }) - if(corUseUserDepRes.type < 4){ - dep4Ids = [regionId] - } else { - options.userId = userId - } - // idList = [regionId] - // options.userId = userId - } - // options.departmentId = { $in: idList }; - } - } - - if (placeType != null && placeType != -1) { - - if (placeType == 0) { - options = Object.assign({}, options, { - $or: [ - { - correctiveAction: { $ne: null }, - }, - { - punishment: { $ne: null }, - } - ] - }) - } - - if (placeType == 1) - options = Object.assign({}, options, { - $or: [ - { - correctiveAction: { $eq: null }, - }, - { - punishment: { $eq: null }, - } - ], - hiddenDangerItem12: { - $ne: null - } - }) - - if (placeType == 2) - options.hiddenDangerItem12 = { - $eq: null - } - } - - let findOption = { - where: options, - offset: offset, - limit: limit, - order: [['time', 'DESC']], - } - - if (dep4Ids.length) { - findOption.include = [{ - required: true, - model: models.User, - as: 'user', - where: { - departmentId: { $in: dep4Ids } - } - }] - } - - const list = await models.UserPlaceSecurityRecord.findAll(findOption) - - for (let item of list) { - const { name } = places.filter(p => p.id == item.placeId)[0] || {}; - const checkAreaName = await sequelize.query(`SELECT "dpt"."name" FROM "department" as "dpt" WHERE "dpt"."id" in (SELECT "department_id" FROM "user" WHERE "id" = ${item.userId} );`, { type: QueryTypes.SELECT }) - const checkUser = await sequelize.query(`SELECT "name", "phone" FROM "user" WHERE "id" = ${item.userId}`, { type: QueryTypes.SELECT }) - rslt.rows.push(Object.assign({}, item.dataValues, { placeName: name, checkAreaName: (checkAreaName[0] || {}).name || '', checkUserName: (checkUser[0] || {}).name || '', checkUserPhone: (checkUser[0] || {}).phone })) - } - - delete findOption.offset - delete findOption.limit - delete findOption.order - findOption.attributes = ['id'] - const dataAll = await models.UserPlaceSecurityRecord.findAll( - findOption - // { - // attributes: ['id'], - // where: options, - // } - ); - rslt.count = dataAll.length; - rslt.ids = dataAll.map(item => item.dataValues.id); - - ctx.status = 200; - ctx.body = rslt; - - } catch (error) { - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { - "message": "获取数据中台数据失败" - } - } - -} - -module.exports = { - reportDailyStatistic, - reportAreaStatistic, - dangerAreaQuery, -} \ No newline at end of file diff --git a/api/app/lib/controllers/wxReport/index.js b/api/app/lib/controllers/wxReport/index.js deleted file mode 100644 index 83c8711d..00000000 --- a/api/app/lib/controllers/wxReport/index.js +++ /dev/null @@ -1,483 +0,0 @@ -'use strict'; -const moment = require('moment'); -//获取每日汇总 -async function getDayReport(ctx) { - try { - const { date, areaId } = ctx.query; - const models = ctx.fs.dc.models; - let range = [moment(date).startOf('day').format("YYYY-MM-DD HH:mm:ss"), moment(date).endOf('day').format("YYYY-MM-DD HH:mm:ss")] - let rslt = await models.ReportCollection.findAll({ - where: { - dateTime: { - $between: range - }, - regionId: areaId - }, - include: [{ - required: true, - model: models.User, - attributes: ['name', 'username', 'phone'] - }, { - required: false, - model: models.Department, - attributes: ['name'] - }] - }); - ctx.status = 200; - ctx.body = rslt; - } catch (error) { - console.log(error) - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { - "message": "获取全市每日汇总表失败" - } - } -} - -//获取排查整治汇总表 -async function getGovern(ctx) { - try { - const { date, areaId } = ctx.query; - const models = ctx.fs.dc.models; - let range = [moment(date).startOf('day').format("YYYY-MM-DD HH:mm:ss"), moment(date).endOf('day').format("YYYY-MM-DD HH:mm:ss")] - let rslt = await models.ReportRectify.findAndCountAll({ - where: { - dateTime: { - $between: range - }, - regionId: areaId - }, - include: [{ - required: true, - model: models.User, - attributes: ['id', 'name', 'username', 'phone'] - }, { - required: false, - model: models.Department, - attributes: ['id', 'name'] - }], - limit: 1 - }); - ctx.status = 200; - let obj = { count: 0 } - if (rslt.count > 0) { - obj.area = rslt.rows[0].department; - obj.dateTime = rslt.rows[0].dateTime; - obj.count = rslt.count; - obj.user = rslt.rows[0].user; - obj.isAudit = rslt.rows[0].isAudit - } - ctx.body = obj; - } catch (error) { - console.log(error) - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { - "message": "获取排查整治汇总表失败" - } - } -} - -//获取排查整治汇总详情 -async function getGovernDetail(ctx) { - try { - const { name, date, areaId, pageSize, pageIndex } = ctx.query; - const models = ctx.fs.dc.models; - let range = [moment(date).startOf('day').format("YYYY-MM-DD HH:mm:ss"), moment(date).endOf('day').format("YYYY-MM-DD HH:mm:ss")] - let whereObj = { - dateTime: { - $between: range - }, - regionId: areaId - }; - if (name) { - whereObj.name = { $like: `%${name}%` } - } - let findObj = { - where: whereObj, - include: [{ - required: true, - model: models.User, - attributes: ['id', 'name', 'username', 'phone'] - }, { - required: false, - model: models.Department, - attributes: ['id', 'name'] - }], - order: [['dateTime', 'desc']] - }; - if (Number(pageSize) > 0 && Number(pageIndex) >= 0) { - findObj.limit = Number(pageSize); - findObj.offset = Number(pageIndex) * Number(pageSize); - } - let rslt = await models.ReportRectify.findAndCountAll(findObj); - ctx.status = 200; - ctx.body = rslt; - } catch (error) { - console.log(error) - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { - "message": "获取排查整治汇总详情失败" - } - } -} - -/** - * 确认整治汇总场所数据 - * body { - * governDetailIds:'1,2' - * } - */ -async function operateGovern(ctx, next) { - try { - const data = ctx.request.body; - const models = ctx.fs.dc.models; - if (data.governDetailIds && data.governDetailIds.length > 0) { - await models.ReportRectify.update({ - isAudit: true - }, { where: { id: { $in: data.governDetailIds.split(',') } } }); - - ctx.body = { "message": "确认整治汇总下场所数据成功" }; - ctx.status = 200; - } else { - ctx.body = { "message": "确认参数有误" }; - ctx.status = 400; - } - } catch (error) { - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { "message": "确认整治汇总下场所数据失败" } - } -} - -//获取安全隐患排查详细数据列表 -async function getSecurityRiskList(ctx) { - try { - const { name, date, areaId, pageSize, pageIndex } = ctx.query; - const models = ctx.fs.dc.models; - - let whereObj = {}; - let wheres = { - audit1ManId: { $not: null }, - audit2ManId: { $not: null } - } - if (areaId) { - wheres.regionId = areaId; - } - if (name) - whereObj = { name: { $like: `%${name}%` } } - let findObj = { - attributes: ['id', 'time', 'placeId', 'userId'], - where: - // time: { - // $between: range - // }, - // regionId: areaId, - // audit1ManId: { $not: null }, - // audit2ManId: { $not: null } - wheres - , - include: [{ - required: true, - model: models.Places, - attributes: ['id', 'name'], - where: whereObj - }, { - required: true, - model: models.User, - as: 'user', - attributes: ['id', 'name', 'username', 'phone'] - }], - order: [['time', 'desc']] - }; - if (date) { - let range = [moment(date).startOf('day').format("YYYY-MM-DD HH:mm:ss"), moment(date).endOf('day').format("YYYY-MM-DD HH:mm:ss")] - findObj.where.time = { - $between: range - } - } - if (areaId) { - findObj.where.regionId = areaId - } - - if (Number(pageSize) > 0 && Number(pageIndex) >= 0) { - findObj.limit = Number(pageSize); - findObj.offset = Number(pageIndex) * Number(pageSize); - } - let rslt = await models.UserPlaceSecurityRecord.findAndCountAll(findObj); - ctx.status = 200; - ctx.body = rslt; - } catch (error) { - console.log(error) - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { - "message": "获取安全隐患排查详细数据列表失败" - } - } -} - - -//获取待处理数量 -async function getHomeCount(ctx) { - try { - let { userId, departmentId, userRegionType } = ctx.params; - const models = ctx.fs.dc.models; - const departmentRes = await models.Department.findOne({ where: { id: departmentId } }); - if (userRegionType != 2 && userRegionType != 3 && !departmentRes) { - ctx.body = { "message": "请求参数有误" }; - ctx.status = 400; - } else { - //获取当前用户数据范围管辖区域内所有用户ID - let attentionRegionIds = [departmentRes.id]; - let regionType = departmentRes.type; - while (attentionRegionIds.length && regionType && regionType < 4) { - const departmentChilds = await models.Department.findAll({ where: { dependence: { $in: attentionRegionIds } } }); - regionType = departmentChilds.length ? departmentChilds[0].type : null; - attentionRegionIds = departmentChilds.map(d => d.id); - } - let users = await models.User.findAll({ where: { departmentId: { $in: attentionRegionIds } }, attributes: ['id'] }); - let userIds = users.map(u => u.id); - - let rslt = { recordCount: 0, reportCount: null } - if (userIds.length) { - let whereObj = { - userId: { $in: userIds }, - rejectManId: null, - isDraft: false - } - if (userRegionType == 3) { - whereObj.audit1ManId = null; - } else { - whereObj.audit1ManId = { $not: null }; - whereObj.audit2ManId = null; - } - let recordCount = await models.UserPlaceSecurityRecord.count({ - where: whereObj - }); - rslt.recordCount = recordCount; - if (userRegionType == 2) { - let reportCount = await models.ReportCollection.count({ - where: { - userId: null, - regionId: departmentId - } - }); - let reportRectify = await models.ReportRectify.findAll({ - where: { - userId: null, - regionId: departmentId - } - }); - let dateArr = []; - reportRectify.map(r => { - let date = moment(r.dateTime).format("YYYY-MM-DD"); - if (!dateArr.includes(date)) { - dateArr.push(date) - } - }) - rslt.reportCount = reportCount + dateArr.length; - } - } - ctx.status = 200; - ctx.body = rslt; - } - } catch (error) { - console.log(error) - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { - "message": "获取待处理数量失败" - } - } -} - -//每日汇总表上报 -async function operateReport(ctx, next) { - try { - let { id, userId } = ctx.params; - const models = ctx.fs.dc.models; - await models.ReportCollection.update({ - userId: userId - }, { where: { id: id } }); - - ctx.body = { "message": "每日汇总表上报成功" }; - ctx.status = 200; - - } catch (error) { - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { "message": "每日汇总表上报失败" } - } -} - -/** - * 根据筛选条件获取用户审核报表信息 - * @query { - * approveUserId-审批人ID - * reportType-报表类型(1-整治汇总表,2-每日汇总表,null-整治汇总表+每日汇总表) - * timeRange-时间范围 - * regionId-区域ID - * state-审批状态 - * pageIndex-页码 - * pageSize-页宽 - * } ctx - */ -async function getApproveReportCollections(ctx, next) { - try { - const models = ctx.fs.dc.models; - const { approveUserId, reportType, timeRange, regionId, state, pageIndex, pageSize } = ctx.query; - let whereCondition = {}; - if (approveUserId) { - let approveUser = await models.User.findOne({ where: { id: approveUserId } }); - if (approveUser) { - //市级用户可以看到所有报表数据 - const departmentRes = await models.Department.findOne({ where: { id: approveUser.departmentId } }); - if (departmentRes.dependence) { - if (departmentRes.type = 2) { - //区县人员只能看见自己区县下的报表信息 - whereCondition.regionId = departmentRes.id; - } else { - //其它层级无报表信息 - ctx.status = 200; - ctx.body = { - "count": 0, - "rows": [] - }; - return; - } - } - if (regionId) { - let region = await models.Department.findOne({ where: { id: regionId } }); - if (region) { - if (whereCondition.regionId && whereCondition.regionId != regionId) { - //区县人员只能看见自己区县下的报表信息 - ctx.status = 200; - ctx.body = { - "count": 0, - "rows": [] - }; - return; - } else { - whereCondition.regionId = regionId; - } - } else { - ctx.status = 400; - ctx.body = { "message": "区域不存在!" } - return; - } - } - let times = timeRange; - if (timeRange && timeRange.indexOf(',')) { times = timeRange.split(',') } - if (times && times.length > 0) { - const len = times.length; - whereCondition.dateTime = { - $between: [ - moment(times[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss'), - moment(times[len - 1]).endOf('day').format('YYYY-MM-DD HH:mm:ss') - ] - }; - } - switch (Number(state)) { - case 1: //待审批:无审核人员 - whereCondition.userId = null; - break; - case 2://已审批:有审核人员 - whereCondition.userId = { $not: null }; - break; - default: break; - } - let findObj = { - where: whereCondition, - order: [["id", "desc"]], - include: [{ - model: models.User, - attributes: ['name', 'username', 'phone'] - }, { - model: models.Department, - attributes: ['id', 'name'] - }] - }; - if (Number(pageSize) > 0 && Number(pageIndex) >= 0) { - findObj.limit = Number(pageSize); - findObj.offset = Number(pageIndex) * Number(pageSize); - } - switch (Number(reportType)) { - case 1: //整治汇总表 - ctx.body = await models.ReportRectify.findAndCountAll(findObj); - break; - case 2://每日汇总表 - ctx.body = await models.ReportCollection.findAndCountAll(findObj); - break; - default: //整治汇总表+每日汇总表 - const rectifies = await models.ReportRectify.findAndCountAll(findObj); - const collections = await models.ReportCollection.findAndCountAll(findObj); - ctx.body = { - "totalCount": rectifies.count + collections.count, - "totalRows": { - "rectify": rectifies, - "collection": collections - } - }; - break; - } - ctx.status = 200; - } else { - ctx.status = 400; - ctx.body = { "message": "用户不存在!" } - } - } else { - ctx.status = 400; - ctx.body = { "message": "请传用户参数!" } - } - } catch (error) { - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { "message": "获取审批报表信息失败" } - } -} - -/** - * 上报排查整治汇总表 - * query{ - * userId:1,//上报用户 - * } - * body { - * governDetailIds:'1,2' //排查整治汇总返回数据id字符串 - * } - */ -async function operateGovernReport(ctx, next) { - try { - let { userId } = ctx.params; - const data = ctx.request.body; - const models = ctx.fs.dc.models; - if (data.governDetailIds && data.governDetailIds.length > 0) { - await models.ReportRectify.update({ - userId: userId - }, { where: { id: { $in: data.governDetailIds.split(',') } } }); - - ctx.body = { "message": "上报排查整治汇总表成功" }; - ctx.status = 200; - } else { - ctx.body = { "message": "上报排查整治汇总表参数有误" }; - ctx.status = 400; - } - } catch (error) { - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { "message": "上报排查整治汇总表失败" } - } -} -module.exports = { - getDayReport, - getGovern, - getGovernDetail, - operateGovern, - getSecurityRiskList, - getHomeCount, - operateReport, - getApproveReportCollections, - operateGovernReport -}; \ No newline at end of file diff --git a/api/app/lib/index.js b/api/app/lib/index.js index df16b425..41389303 100644 --- a/api/app/lib/index.js +++ b/api/app/lib/index.js @@ -1,6 +1,8 @@ 'use strict'; const routes = require('./routes'); +const fs = require('fs'); +const path = require('path'); const authenticator = require('./middlewares/authenticator'); // const apiLog = require('./middlewares/api-log'); const businessRest = require('./middlewares/business-rest'); @@ -20,17 +22,13 @@ module.exports.entry = function (app, router, opts) { }; module.exports.models = function (dc) { // dc = { orm: Sequelize对象, ORM: Sequelize, models: {} } - require('./models/user')(dc); - require('./models/user_token')(dc); - require('./models/department')(dc); - require('./models/resource')(dc); - require('./models/user_resource')(dc); - require('./models/places')(dc); - require('./models/user_placeSecurityRecord')(dc); - require('./models/report_type')(dc); - require('./models/report_downManage')(dc); - require('./models/department')(dc); - require('./models/report_configition')(dc); - require('./models/report_collection')(dc); - require('./models/report_rectify')(dc); + fs.readdirSync(path.join(__dirname, '/models')).forEach((filename) => { + console.log(filename); + require(`./models/${filename}`)(dc) + }); + + const { User, Department } = dc.models; + // 定义外键 + User.belongsTo(Department, { foreignKey: 'departmentId', targetKey: 'id' }); + Department.hasMany(User, { foreignKey: 'departmentId', sourceKey: 'id' }); }; diff --git a/api/app/lib/models/department.js b/api/app/lib/models/department.js index 55c2a03d..025a0be3 100644 --- a/api/app/lib/models/department.js +++ b/api/app/lib/models/department.js @@ -2,56 +2,51 @@ 'use strict'; module.exports = dc => { - const DataTypes = dc.ORM; - const sequelize = dc.orm; - const Department = sequelize.define("department", { - id: { - type: DataTypes.INTEGER, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: true, - field: "id", - autoIncrement: true, - unique: "department_id_uindex" - }, - name: { - type: DataTypes.STRING, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: false, - field: "name", - autoIncrement: false - }, - dependence: { - type: DataTypes.INTEGER, - allowNull: true, - defaultValue: null, - comment: "上级部门/从属", - primaryKey: false, - field: "dependence", - autoIncrement: false - }, - type: { - type: DataTypes.INTEGER, - allowNull: false, - defaultValue: null, - comment: "市1,区县2,乡镇3,村4", - primaryKey: false, - field: "type", - autoIncrement: false - } - }, { - tableName: "department", - comment: "", - indexes: [] - }); - dc.models.Department = Department; - - const User = dc.models.User; - User.belongsTo(Department, { foreignKey: 'departmentId', targetKey: 'id' }); - Department.hasMany(User, { foreignKey: 'departmentId', sourceKey: 'id' }); - - return Department; + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const Department = sequelize.define("department", { + id: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: "nextval(department_id_seq1::regclass)", + comment: null, + primaryKey: true, + field: "id", + autoIncrement: false, + unique: "department_id_uindex" + }, + name: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: false, + field: "name", + autoIncrement: false + }, + dependence: { + type: DataTypes.INTEGER, + allowNull: true, + defaultValue: null, + comment: null, + primaryKey: false, + field: "dependence", + autoIncrement: false + }, + delete: { + type: DataTypes.BOOLEAN, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: false, + field: "delete", + autoIncrement: false + } + }, { + tableName: "department", + comment: "", + indexes: [] + }); + dc.models.Department = Department; + return Department; }; \ No newline at end of file diff --git a/api/app/lib/models/places.js b/api/app/lib/models/places.js deleted file mode 100644 index f25c0939..00000000 --- a/api/app/lib/models/places.js +++ /dev/null @@ -1,61 +0,0 @@ -/* eslint-disable*/ -'use strict'; - -module.exports = dc => { - const DataTypes = dc.ORM; - const sequelize = dc.orm; - const Places = sequelize.define("places", { - id: { - type: DataTypes.INTEGER, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: true, - field: "id", - autoIncrement: true, - unique: "places_id_uindex" - }, - name: { - type: DataTypes.STRING, - allowNull: false, - defaultValue: null, - comment: "场所名称", - primaryKey: false, - field: "name", - autoIncrement: false - }, - describe: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "描述", - primaryKey: false, - field: "describe", - autoIncrement: false - }, - userId: { - type: DataTypes.INTEGER, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: false, - field: "userId", - autoIncrement: false, - references: { - key: "id", - model: "user" - } - }, - }, { - tableName: "places", - comment: "", - indexes: [] - }); - dc.models.Places = Places; - - const User = dc.models.User; - Places.belongsTo(User, { foreignKey: 'userId', targetKey: 'id' }); - User.hasMany(Places, { foreignKey: 'userId', sourceKey: 'id' }); - - return Places; -}; \ No newline at end of file diff --git a/api/app/lib/models/post.js b/api/app/lib/models/post.js deleted file mode 100644 index 7efc90b0..00000000 --- a/api/app/lib/models/post.js +++ /dev/null @@ -1,47 +0,0 @@ -/* eslint-disable*/ -'use strict'; - -module.exports = dc => { - const DataTypes = dc.ORM; - const sequelize = dc.orm; - const Post = sequelize.define("post", { - id: { - type: DataTypes.INTEGER, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: true, - field: "id", - autoIncrement: true, - unique: "post_id_uindex" - }, - name: { - type: DataTypes.STRING, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: false, - field: "name", - autoIncrement: false - }, - departmentId: { - type: DataTypes.INTEGER, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: false, - field: "department_id", - autoIncrement: false, - references: { - key: "id", - model: "department" - } - } - }, { - tableName: "post", - comment: "", - indexes: [] - }); - dc.models.Post = Post; - return Post; -}; \ No newline at end of file diff --git a/api/app/lib/models/post_resource.js b/api/app/lib/models/post_resource.js deleted file mode 100644 index 253121c6..00000000 --- a/api/app/lib/models/post_resource.js +++ /dev/null @@ -1,51 +0,0 @@ -/* eslint-disable*/ -'use strict'; - -module.exports = dc => { - const DataTypes = dc.ORM; - const sequelize = dc.orm; - const PostResource = sequelize.define("postResource", { - id: { - type: DataTypes.INTEGER, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: true, - field: "id", - autoIncrement: true, - unique: "post_resource_id_uindex" - }, - postId: { - type: DataTypes.INTEGER, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: false, - field: "post_id", - autoIncrement: false, - references: { - key: "id", - model: "post" - } - }, - resource: { - type: DataTypes.STRING, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: false, - field: "resource", - autoIncrement: false, - references: { - key: "code", - model: "resource" - } - } - }, { - tableName: "post_resource", - comment: "", - indexes: [] - }); - dc.models.PostResource = PostResource; - return PostResource; -}; \ No newline at end of file diff --git a/api/app/lib/models/region_type.js b/api/app/lib/models/region_type.js deleted file mode 100644 index 1a596ac6..00000000 --- a/api/app/lib/models/region_type.js +++ /dev/null @@ -1,34 +0,0 @@ -/* eslint-disable*/ -'use strict'; - -module.exports = dc => { - const DataTypes = dc.ORM; - const sequelize = dc.orm; - const RegionType = sequelize.define("regionType", { - id: { - type: DataTypes.INTEGER, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: true, - field: "id", - autoIncrement: true, - unique: "region_type_id_uindex" - }, - type: { - type: DataTypes.STRING, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: false, - field: "type", - autoIncrement: false - } - }, { - tableName: "region_type", - comment: "", - indexes: [] - }); - dc.models.RegionType = RegionType; - return RegionType; -}; \ No newline at end of file diff --git a/api/app/lib/models/report_collection.js b/api/app/lib/models/report_collection.js deleted file mode 100644 index b04aafd3..00000000 --- a/api/app/lib/models/report_collection.js +++ /dev/null @@ -1,88 +0,0 @@ -/* eslint-disable*/ -'use strict'; - -module.exports = dc => { - const DataTypes = dc.ORM; - const sequelize = dc.orm; - const ReportCollection = sequelize.define("reportCollection", { - id: { - type: DataTypes.INTEGER, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: true, - field: "id", - autoIncrement: true, - unique: "report_collection_id_uindex" - }, - regionId: { - type: DataTypes.INTEGER, - allowNull: true, - defaultValue: null, - comment: "县区(id)", - primaryKey: false, - field: "regionId", - autoIncrement: false - }, - dateTime: { - type: DataTypes.DATE, - allowNull: true, - defaultValue: null, - comment: null, - primaryKey: false, - field: "dateTime", - autoIncrement: false - }, - placeCount: { - type: DataTypes.INTEGER, - allowNull: true, - defaultValue: null, - comment: "场所总数", - primaryKey: false, - field: "placeCount", - autoIncrement: false - }, - hiddenDangerCount: { - type: DataTypes.INTEGER, - allowNull: true, - defaultValue: null, - comment: "排查隐患总数", - primaryKey: false, - field: "hiddenDangerCount", - autoIncrement: false - }, - hiddenDangerItem12Count: { - type: DataTypes.JSON, - allowNull: true, - defaultValue: null, - comment: "排查隐患详细类目 1-12 项 总数", - primaryKey: false, - field: "hiddenDangerItem12Count", - autoIncrement: false - }, - userId: { - type: DataTypes.INTEGER, - allowNull: true, - defaultValue: null, - comment: "填报人(县区联络员)", - primaryKey: false, - field: "userId", - autoIncrement: false - } - }, { - tableName: "report_collection", - comment: "", - indexes: [] - }); - dc.models.ReportCollection = ReportCollection; - - const User = dc.models.User; - ReportCollection.belongsTo(User, { foreignKey: 'userId', targetKey: 'id' }); - User.hasMany(ReportCollection, { foreignKey: 'userId', sourceKey: 'id' }); - - const Department = dc.models.Department; - ReportCollection.belongsTo(Department, { foreignKey: 'regionId', targetKey: 'id' }); - Department.hasMany(ReportCollection, { foreignKey: 'regionId', sourceKey: 'id' }); - - return ReportCollection; -}; \ No newline at end of file diff --git a/api/app/lib/models/report_configition.js b/api/app/lib/models/report_configition.js deleted file mode 100644 index 629b5380..00000000 --- a/api/app/lib/models/report_configition.js +++ /dev/null @@ -1,74 +0,0 @@ -/* eslint-disable*/ -'use strict'; - -module.exports = dc => { - const DataTypes = dc.ORM; - const sequelize = dc.orm; - const ReportConfigition = sequelize.define("reportConfigition", { - reportName: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "报表名称", - primaryKey: false, - field: "reportName", - autoIncrement: false - }, - regionId: { - type: DataTypes.INTEGER, - allowNull: true, - defaultValue: null, - comment: "区域id", - primaryKey: false, - field: "regionId", - autoIncrement: false - }, - reportTypeId: { - type: DataTypes.INTEGER, - allowNull: true, - defaultValue: null, - comment: "报表类型", - primaryKey: false, - field: "reportTypeId", - autoIncrement: false, - references: { - key: "id", - model: "reportType" - } - }, - excuteTime: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "生成时间 cron表达式", - primaryKey: false, - field: "excuteTime", - autoIncrement: false - }, - isEnable: { - type: DataTypes.BOOLEAN, - allowNull: true, - defaultValue: null, - comment: "启用状态", - primaryKey: false, - field: "isEnable", - autoIncrement: false - }, - id: { - type: DataTypes.INTEGER, - allowNull: false, - defaultValue: null, - comment: "序号", - primaryKey: true, - field: "id", - autoIncrement: true, - unique: "report_configition_id_uindex" - } - }, { - tableName: "report_configition", - comment: "", - indexes: [] - }); - dc.models.ReportConfigition = ReportConfigition; - return ReportConfigition; -}; \ No newline at end of file diff --git a/api/app/lib/models/report_countyCollect.js b/api/app/lib/models/report_countyCollect.js deleted file mode 100644 index 78dd9d05..00000000 --- a/api/app/lib/models/report_countyCollect.js +++ /dev/null @@ -1,69 +0,0 @@ -/* eslint-disable*/ -'use strict'; - -module.exports = dc => { - const DataTypes = dc.ORM; - const sequelize = dc.orm; - const ReportCountyCollect = sequelize.define("reportCountyCollect", { - id: { - type: DataTypes.BIGINT, - allowNull: true, - defaultValue: null, - comment: "序号", - primaryKey: false, - field: "id", - autoIncrement: false - }, - name: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "名称", - primaryKey: false, - field: "name", - autoIncrement: false - }, - address: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "地址", - primaryKey: false, - field: "address", - autoIncrement: false - }, - hiddenDanger: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "排查发现隐患", - primaryKey: false, - field: "hiddenDanger", - autoIncrement: false - }, - correctiveAction: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "采取措施", - primaryKey: false, - field: "correctiveAction", - autoIncrement: false - }, - punishment: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "实施处罚,强制措施情况", - primaryKey: false, - field: "punishment", - autoIncrement: false - } - }, { - tableName: "report_countyCollect", - comment: "", - indexes: [] - }); - dc.models.ReportCountyCollect = ReportCountyCollect; - return ReportCountyCollect; -}; \ No newline at end of file diff --git a/api/app/lib/models/report_downManage.js b/api/app/lib/models/report_downManage.js deleted file mode 100644 index 91675253..00000000 --- a/api/app/lib/models/report_downManage.js +++ /dev/null @@ -1,82 +0,0 @@ -/* eslint-disable*/ -'use strict'; - -module.exports = dc => { - const DataTypes = dc.ORM; - const sequelize = dc.orm; - const ReportDownManage = sequelize.define("reportDownManage", { - id: { - type: DataTypes.INTEGER, - allowNull: false, - defaultValue: "nextval(\"report_downManage_id_seq\"::regclass)", - comment: null, - primaryKey: true, - field: "id", - autoIncrement: false, - unique: "report_downmanage_id_uindex" - }, - reportName: { - type: DataTypes.STRING, - allowNull: false, - defaultValue: null, - comment: "报表名称", - primaryKey: false, - field: "reportName", - autoIncrement: false - }, - regionId: { - type: DataTypes.INTEGER, - allowNull: false, - defaultValue: null, - comment: "区域id", - primaryKey: false, - field: "regionId", - autoIncrement: false, - references: { - key: "id", - model: "department" - } - }, - reportTypeId: { - type: DataTypes.INTEGER, - allowNull: false, - defaultValue: null, - comment: "报表类型id\n1.整治表\n2.汇总表", - primaryKey: false, - field: "reportTypeId", - autoIncrement: false, - references: { - key: "id", - model: "reportType" - } - }, - filePath: { - type: DataTypes.STRING, - allowNull: false, - defaultValue: null, - comment: "文件路径", - primaryKey: false, - field: "filePath", - autoIncrement: false, - }, - creatTime: { - type: DataTypes.DATE, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: false, - field: "creatTime", - autoIncrement: false - } - }, { - tableName: "report_downManage", - comment: "", - indexes: [] - }); - dc.models.ReportDownManage = ReportDownManage; - - const { ReportType, Department } = dc.models; - ReportDownManage.belongsTo(ReportType, { foreignKey: 'reportTypeId', targetKey: 'id' }); - ReportDownManage.belongsTo(Department, { foreignKey: 'regionId', targetKey: 'id' }); - return ReportDownManage; -}; \ No newline at end of file diff --git a/api/app/lib/models/report_rectify.js b/api/app/lib/models/report_rectify.js deleted file mode 100644 index dd534693..00000000 --- a/api/app/lib/models/report_rectify.js +++ /dev/null @@ -1,115 +0,0 @@ -/* eslint-disable*/ -'use strict'; - -module.exports = dc => { - const DataTypes = dc.ORM; - const sequelize = dc.orm; - const ReportRectify = sequelize.define("reportRectify", { - id: { - type: DataTypes.BIGINT, - allowNull: true, - defaultValue: "nextval(\"report_countyCollect_id_seq\"::regclass)", - comment: "序号", - primaryKey: true, - field: "id", - autoIncrement: false, - unique: "report_countycollect_id_uindex" - }, - regionId: { - type: DataTypes.INTEGER, - allowNull: true, - defaultValue: null, - comment: "县区(id)", - primaryKey: false, - field: "regionId", - autoIncrement: false - }, - dateTime: { - type: DataTypes.DATE, - allowNull: true, - defaultValue: null, - comment: null, - primaryKey: false, - field: "dateTime", - autoIncrement: false - }, - name: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "名称", - primaryKey: false, - field: "name", - autoIncrement: false - }, - address: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "地址", - primaryKey: false, - field: "address", - autoIncrement: false - }, - hiddenDanger: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "排查发现隐患", - primaryKey: false, - field: "hiddenDanger", - autoIncrement: false - }, - correctiveAction: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "采取措施", - primaryKey: false, - field: "correctiveAction", - autoIncrement: false - }, - punishment: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "实施处罚,强制措施情况", - primaryKey: false, - field: "punishment", - autoIncrement: false - }, - userId: { - type: DataTypes.INTEGER, - allowNull: true, - defaultValue: null, - comment: "web端上报", - primaryKey: false, - field: "userId", - autoIncrement: false - }, - isAudit: { - type: DataTypes.BOOLEAN, - allowNull: true, - defaultValue: null, - comment: "市级 确认审核", - primaryKey: false, - field: "isAudit", - autoIncrement: false - }, - }, { - tableName: "report_rectify", - comment: "", - indexes: [] - }); - dc.models.ReportRectify = ReportRectify; - - const User = dc.models.User; - ReportRectify.belongsTo(User, { foreignKey: 'userId', targetKey: 'id' }); - User.hasMany(ReportRectify, { foreignKey: 'userId', sourceKey: 'id' }); - - const Department = dc.models.Department; - ReportRectify.belongsTo(Department, { foreignKey: 'regionId', targetKey: 'id' }); - Department.hasMany(ReportRectify, { foreignKey: 'regionId', sourceKey: 'id' }); - - return ReportRectify; -}; \ No newline at end of file diff --git a/api/app/lib/models/report_type.js b/api/app/lib/models/report_type.js deleted file mode 100644 index d09c35fd..00000000 --- a/api/app/lib/models/report_type.js +++ /dev/null @@ -1,33 +0,0 @@ -/* eslint-disable*/ -'use strict'; - -module.exports = dc => { - const DataTypes = dc.ORM; - const sequelize = dc.orm; - const ReportType = sequelize.define("reportType", { - id: { - type: DataTypes.INTEGER, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: true, - field: "id", - autoIncrement: false - }, - name: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: null, - primaryKey: false, - field: "name", - autoIncrement: false - } - }, { - tableName: "report_type", - comment: "", - indexes: [] - }); - dc.models.ReportType = ReportType; - return ReportType; -}; \ No newline at end of file diff --git a/api/app/lib/models/resource.js b/api/app/lib/models/resource.js deleted file mode 100644 index f8ab18c6..00000000 --- a/api/app/lib/models/resource.js +++ /dev/null @@ -1,44 +0,0 @@ -/* eslint-disable*/ -'use strict'; - -module.exports = dc => { - const DataTypes = dc.ORM; - const sequelize = dc.orm; - const Resource = sequelize.define("resource", { - code: { - type: DataTypes.STRING, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: true, - field: "code", - autoIncrement: false, - unique: "resource_code_uindex" - }, - name: { - type: DataTypes.STRING, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: false, - field: "name", - autoIncrement: false, - unique: "resource_name_uindex" - }, - parentResource: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: null, - primaryKey: false, - field: "parent_resource", - autoIncrement: false - } - }, { - tableName: "resource", - comment: "", - indexes: [] - }); - dc.models.Resource = Resource; - return Resource; -}; \ No newline at end of file diff --git a/api/app/lib/models/road.js b/api/app/lib/models/road.js new file mode 100644 index 00000000..e45219df --- /dev/null +++ b/api/app/lib/models/road.js @@ -0,0 +1,466 @@ +/* eslint-disable*/ +'use strict'; + +module.exports = dc => { + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const Road = sequelize.define("road", { + id: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: true, + field: "id", + autoIncrement: true, + unique: "road_id_uindex" + }, + routeName: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "路线名称", + primaryKey: false, + field: "route_name", + autoIncrement: false + }, + routeCode: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "路线代码", + primaryKey: false, + field: "route_code", + autoIncrement: false + }, + sectionNo: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "路段序号", + primaryKey: false, + field: "section_no", + autoIncrement: false + }, + townshipCode: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "乡镇编码", + primaryKey: false, + field: "township_code", + autoIncrement: false + }, + startingPlaceName: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "起点地名", + primaryKey: false, + field: "starting_place_name", + autoIncrement: false + }, + startStation: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "起点桩号", + primaryKey: false, + field: "start_station", + autoIncrement: false + }, + categoryOfStartingPointAndDividingPoint: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "起点分界点类别", + primaryKey: false, + field: "category_of_starting_point_and_dividing_point", + autoIncrement: false + }, + stopPlaceName: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "止点地名", + primaryKey: false, + field: "stop_place_name", + autoIncrement: false + }, + categoryOfDeadCenterAndDividingPoint: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "止点分界点类别", + primaryKey: false, + field: "category_of_dead_center_and_dividing_point", + autoIncrement: false + }, + stopStation: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "止点桩号", + primaryKey: false, + field: "stop_station", + autoIncrement: false + }, + sectionType: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "路段类型", + primaryKey: false, + field: "section_type", + autoIncrement: false + }, + natureOfRoadSection: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "路段性质", + primaryKey: false, + field: "nature_of_road_section", + autoIncrement: false + }, + completionTime: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "建成时间", + primaryKey: false, + field: "completion_time", + autoIncrement: false + }, + gbmAndCivilizedModelRoad: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "GBM及文明样板路", + primaryKey: false, + field: "gbm_and_civilized_model_road", + autoIncrement: false + }, + landforms: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "地貌", + primaryKey: false, + field: "landforms", + autoIncrement: false + }, + natureOfCharges: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "收费性质", + primaryKey: false, + field: "nature_of_charges", + autoIncrement: false + }, + numberOfCulverts: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "涵洞数量", + primaryKey: false, + field: "number_of_culverts", + autoIncrement: false + }, + technicalLevel: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "技术等级", + primaryKey: false, + field: "technical_level", + autoIncrement: false + }, + pavementType: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "路面类型", + primaryKey: false, + field: "pavement_type", + autoIncrement: false + }, + pavementWidth: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "路面宽度", + primaryKey: false, + field: "pavement_width", + autoIncrement: false + }, + subgradeWidth: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "路基宽度", + primaryKey: false, + field: "subgrade_width", + autoIncrement: false + }, + laneCharacteristics: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "车道特征", + primaryKey: false, + field: "lane_characteristics", + autoIncrement: false + }, + whetherItIsOpenToTrafficInSunnyOrRainyDays: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "是否晴雨通车", + primaryKey: false, + field: "whether_it_is_open_to_traffic_in_sunny_or_rainy_days", + autoIncrement: false + }, + designSpeedPerHour: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "设计时速", + primaryKey: false, + field: "design_speed_per_hour", + autoIncrement: false + }, + urbanManagementSectionOrNot: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "是否城管路段", + primaryKey: false, + field: "urban_management_section_or_not", + autoIncrement: false + }, + managementAndMaintenanceUnit: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "管养单位", + primaryKey: false, + field: "management_and_maintenance_unit", + autoIncrement: false + }, + roadAdministrationUnit: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "路政管理单位", + primaryKey: false, + field: "road_administration_unit", + autoIncrement: false + }, + alimentation: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "列养情况", + primaryKey: false, + field: "alimentation", + autoIncrement: false + }, + sourceOfListedMaintenanceFunds: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "列养资金来源", + primaryKey: false, + field: "source_of_listed_maintenance_funds", + autoIncrement: false + }, + curingTime: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "养护时间", + primaryKey: false, + field: "curing_time_", + autoIncrement: false + }, + greeningMileage: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "可绿化里程", + primaryKey: false, + field: "greening_mileage", + autoIncrement: false + }, + greeningMileaged: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "已绿化里程", + primaryKey: false, + field: "greening_mileaged", + autoIncrement: false + }, + typeOfRepeatedRoadSection: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "重复道路路段类型", + primaryKey: false, + field: "type_of_repeated_road_section", + autoIncrement: false + }, + serialNumberOfRepeatedSection: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "重复路段序号", + primaryKey: false, + field: "serial_number_of_repeated_section", + autoIncrement: false + }, + repeatedSectionRouteCode: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "重复路段路线编码", + primaryKey: false, + field: "repeated_section_route_code", + autoIncrement: false + }, + reportingUnit: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "填报单位", + primaryKey: false, + field: "reporting_unit", + autoIncrement: false + }, + reasonForChange: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "变更原因", + primaryKey: false, + field: "reason_for_change", + autoIncrement: false + }, + changeTime: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "变更时间", + primaryKey: false, + field: "change_time", + autoIncrement: false + }, + whetherMaintenanceManagedHighway: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "是否按干线公路管理接养", + primaryKey: false, + field: "whether_maintenance_managed_highway", + autoIncrement: false + }, + remarks: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "备注", + primaryKey: false, + field: "remarks", + autoIncrement: false + }, + routeCodeOfLastYear: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "上年路线编码", + primaryKey: false, + field: "route_code_of_last_year", + autoIncrement: false + }, + routeNameOfLastYear: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "上年路线名称", + primaryKey: false, + field: "route_name_of_last_year", + autoIncrement: false + }, + startingStationOfLastYear: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "上年起点桩号", + primaryKey: false, + field: "starting_station_of_last_year", + autoIncrement: false + }, + lastYearsEndingPointStakeNumber: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "上年止点桩号", + primaryKey: false, + field: "last_years_ending_point_stake_number", + autoIncrement: false + }, + graphicMileage: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "图形里程", + primaryKey: false, + field: "graphic_mileage", + autoIncrement: false + }, + chainageMileage: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "桩号里程", + primaryKey: false, + field: "chainage_mileage", + autoIncrement: false + }, + districtcounty: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "所在区县", + primaryKey: false, + field: "districtcounty", + autoIncrement: false + }, + locationCity: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "所在地市", + primaryKey: false, + field: "location_city", + autoIncrement: false + }, + level: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "县 / 乡 / 村", + primaryKey: false, + field: "level", + autoIncrement: false + } + }, { + tableName: "road", + comment: "", + indexes: [] + }); + dc.models.Road = Road; + return Road; +}; \ No newline at end of file diff --git a/api/app/lib/models/user.js b/api/app/lib/models/user.js index 683ccaf7..6d356d4b 100644 --- a/api/app/lib/models/user.js +++ b/api/app/lib/models/user.js @@ -2,107 +2,105 @@ 'use strict'; module.exports = dc => { - const DataTypes = dc.ORM; - const sequelize = dc.orm; - const User = sequelize.define("user", { - id: { - type: DataTypes.INTEGER, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: true, - field: "id", - autoIncrement: true, - unique: "user_id_uindex" - }, - name: { - type: DataTypes.STRING, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: false, - field: "name", - autoIncrement: false - }, - username: { - type: DataTypes.STRING, - allowNull: false, - defaultValue: null, - comment: "用户名 账号", - primaryKey: false, - field: "username", - autoIncrement: false - }, - password: { - type: DataTypes.STRING, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: false, - field: "password", - autoIncrement: false - }, - departmentId: { - type: DataTypes.INTEGER, - allowNull: false, - defaultValue: null, - comment: "部门id", - primaryKey: false, - field: "department_id", - autoIncrement: false - }, - email: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: null, - primaryKey: false, - field: "email", - autoIncrement: false - }, - enable: { - type: DataTypes.BOOLEAN, - allowNull: false, - defaultValue: null, - comment: "启用状态", - primaryKey: false, - field: "enable", - autoIncrement: false - }, - delete: { - type: DataTypes.BOOLEAN, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: false, - field: "delete", - autoIncrement: false - }, - phone: { - type: DataTypes.STRING, - allowNull: false, - defaultValue: null, - comment: "手机号(小程序使用手机号登录)", - primaryKey: false, - field: "phone", - autoIncrement: false - }, - post: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "职位", - primaryKey: false, - field: "post", - autoIncrement: false - } - }, { - tableName: "user", - comment: "", - indexes: [] - }); - dc.models.User = User; - - - return User; + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const User = sequelize.define("user", { + id: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: "nextval(user_id_seq1::regclass)", + comment: null, + primaryKey: true, + field: "id", + autoIncrement: false, + unique: "user_id_uindex" + }, + name: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: false, + field: "name", + autoIncrement: false + }, + username: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: false, + field: "username", + autoIncrement: false + }, + password: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: false, + field: "password", + autoIncrement: false + }, + departmentId: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: false, + field: "department_id", + autoIncrement: false + }, + delete: { + type: DataTypes.BOOLEAN, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: false, + field: "delete", + autoIncrement: false + }, + remark: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: "th", + comment: null, + primaryKey: false, + field: "remark", + autoIncrement: false + }, + phone: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: null, + primaryKey: false, + field: "phone", + autoIncrement: false + }, + email: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: null, + primaryKey: false, + field: "email", + autoIncrement: false + }, + enable: { + type: DataTypes.BOOLEAN, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: false, + field: "enable", + autoIncrement: false + } + }, { + tableName: "user", + comment: "", + indexes: [] + }); + dc.models.User = User; + return User; }; \ No newline at end of file diff --git a/api/app/lib/models/user_placeSecurityRecord.js b/api/app/lib/models/user_placeSecurityRecord.js deleted file mode 100644 index 1adcce42..00000000 --- a/api/app/lib/models/user_placeSecurityRecord.js +++ /dev/null @@ -1,311 +0,0 @@ -/* eslint-disable*/ -'use strict'; - -module.exports = dc => { - const DataTypes = dc.ORM; - const sequelize = dc.orm; - const UserPlaceSecurityRecord = sequelize.define("userPlaceSecurityRecord", { - id: { - type: DataTypes.BIGINT, - allowNull: false, - defaultValue: null, - comment: "id", - primaryKey: true, - field: "id", - autoIncrement: true, - unique: "user_placesecurityrecord_id_uindex" - }, - time: { - type: DataTypes.DATE, - allowNull: true, - defaultValue: null, - comment: "录入时间", - primaryKey: false, - field: "time", - autoIncrement: false - }, - placeId: { - type: DataTypes.INTEGER, - allowNull: true, - defaultValue: null, - comment: "场所id", - primaryKey: false, - field: "placeId", - autoIncrement: false, - references: { - key: "id", - model: "places" - } - }, - hiddenDangerItem12: { - type: DataTypes.JSON, - allowNull: true, - defaultValue: null, - comment: "12项隐患信息", - primaryKey: false, - field: "hiddenDangerItem12", - autoIncrement: false - }, - description: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "存在具体问题描述", - primaryKey: false, - field: "description", - autoIncrement: false - }, - audit1ManId: { - type: DataTypes.INTEGER, - allowNull: true, - defaultValue: null, - comment: "乡镇人审核", - primaryKey: false, - field: "audit1ManId", - autoIncrement: false, - references: { - key: "id", - model: "user" - } - }, - audit2ManId: { - type: DataTypes.INTEGER, - allowNull: true, - defaultValue: null, - comment: "区县人复核", - primaryKey: false, - field: "audit2ManId", - autoIncrement: false, - references: { - key: "id", - model: "user" - } - }, - regionId: { - type: DataTypes.INTEGER, - allowNull: true, - defaultValue: null, - comment: "所属县/区", - primaryKey: false, - field: "regionId", - autoIncrement: false, - references: { - key: "id", - model: "department" - } - }, - userId: { - type: DataTypes.BIGINT, - allowNull: true, - defaultValue: null, - comment: "用户id,填报人", - primaryKey: false, - field: "userId", - autoIncrement: false - }, - placeType: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "场所性质", - primaryKey: false, - field: "placeType", - autoIncrement: false - }, - address: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "场所地址", - primaryKey: false, - field: "address", - autoIncrement: false - }, - phone: { - type: DataTypes.STRING, - allowNull: false, - defaultValue: null, - comment: "负责人手机号", - primaryKey: false, - field: "phone", - autoIncrement: false - }, - dimension: { - type: DataTypes.REAL, - allowNull: true, - defaultValue: null, - comment: "面积", - primaryKey: false, - field: "dimension", - autoIncrement: false - }, - floors: { - type: DataTypes.INTEGER, - allowNull: true, - defaultValue: null, - comment: "多少层", - primaryKey: false, - field: "floors", - autoIncrement: false - }, - numberOfPeople: { - type: DataTypes.INTEGER, - allowNull: true, - defaultValue: null, - comment: "常住人数", - primaryKey: false, - field: "numberOfPeople", - autoIncrement: false - }, - location: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "经纬度", - primaryKey: false, - field: "location", - autoIncrement: false - }, - isEnable: { - type: DataTypes.BOOLEAN, - allowNull: true, - defaultValue: null, - comment: "是否为合用场所", - primaryKey: false, - field: "isEnable", - autoIncrement: false - }, - rejectManId: { - type: DataTypes.INTEGER, - allowNull: true, - defaultValue: null, - comment: "驳回人", - primaryKey: false, - field: "rejectManId", - autoIncrement: false, - references: { - key: "id", - model: "user" - } - }, - rejectReasons: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "驳回意见", - primaryKey: false, - field: "rejectReasons", - autoIncrement: false - }, - isDraft: { - type: DataTypes.BOOLEAN, - allowNull: true, - defaultValue: null, - comment: "是否草稿", - primaryKey: false, - field: "isDraft", - autoIncrement: false - }, - placeOwner: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "场所负责人", - primaryKey: false, - field: "placeOwner", - autoIncrement: false - }, - localtionDescribe: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "经纬度定位描述", - primaryKey: false, - field: "localtionDescribe", - autoIncrement: false - }, - correctiveAction: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "采取措施", - primaryKey: false, - field: "correctiveAction", - autoIncrement: false - }, - type: { - type: DataTypes.BOOLEAN, - allowNull: true, - defaultValue: null, - comment: "是否重新发起", - primaryKey: false, - field: "type", - autoIncrement: false - }, - punishment: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "实施处罚,强制措施情况", - primaryKey: false, - field: "punishment", - autoIncrement: false - }, - audit1ManIdTime: { - type: DataTypes.DATE, - allowNull: true, - defaultValue: null, - comment: "乡镇人审核时间", - primaryKey: false, - field: "audit1ManIdTime", - autoIncrement: false - }, - audit2ManIdTime: { - type: DataTypes.DATE, - allowNull: true, - defaultValue: null, - comment: "区县人复核时间", - primaryKey: false, - field: "audit2ManIdTime", - autoIncrement: false - }, - rejectTime: { - type: DataTypes.DATE, - allowNull: true, - defaultValue: null, - comment: "驳回日期", - primaryKey: false, - field: "rejectTime", - autoIncrement: false - }, - departmentId: { - type: DataTypes.INTEGER, - allowNull: true, - defaultValue: null, - primaryKey: false, - field: "department_id", - autoIncrement: false, - }, - }, { - tableName: "user_placeSecurityRecord", - comment: "", - indexes: [] - }); - dc.models.UserPlaceSecurityRecord = UserPlaceSecurityRecord; - - const Places = dc.models.Places; - UserPlaceSecurityRecord.belongsTo(Places, { foreignKey: 'placeId', targetKey: 'id' }); - Places.hasMany(UserPlaceSecurityRecord, { foreignKey: 'placeId', sourceKey: 'id' }); - - const User = dc.models.User; - UserPlaceSecurityRecord.belongsTo(User, { as: 'user', foreignKey: 'userId', targetKey: 'id' }); - User.hasMany(UserPlaceSecurityRecord, { foreignKey: 'userId', sourceKey: 'id' }); - - UserPlaceSecurityRecord.belongsTo(User, { as: 'audit1ManUser', foreignKey: 'audit1ManId', targetKey: 'id' }); - - UserPlaceSecurityRecord.belongsTo(User, { as: 'audit2ManUser', foreignKey: 'audit2ManId', targetKey: 'id' }); - - UserPlaceSecurityRecord.belongsTo(User, { as: 'rejectManUser', foreignKey: 'rejectManId', targetKey: 'id' }); - - return UserPlaceSecurityRecord; -}; \ No newline at end of file diff --git a/api/app/lib/models/user_resource.js b/api/app/lib/models/user_resource.js deleted file mode 100644 index 455c3a88..00000000 --- a/api/app/lib/models/user_resource.js +++ /dev/null @@ -1,61 +0,0 @@ -/* eslint-disable*/ -'use strict'; - -module.exports = dc => { - const DataTypes = dc.ORM; - const sequelize = dc.orm; - const UserResource = sequelize.define("userResource", { - id: { - type: DataTypes.INTEGER, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: true, - field: "id", - autoIncrement: true, - unique: "post_resource_id_uindex" - }, - userId: { - type: DataTypes.INTEGER, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: false, - field: "user_id", - autoIncrement: false, - references: { - key: "id", - model: "post" - } - }, - resourceId: { - type: DataTypes.STRING, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: false, - field: "resource", - autoIncrement: false, - references: { - key: "code", - model: "resource" - } - } - }, { - tableName: "user_resource", - comment: "", - indexes: [] - }); - dc.models.UserResource = UserResource; - - const User = dc.models.User; - UserResource.belongsTo(User, { foreignKey: 'userId', targetKey: 'id' }); - User.hasMany(UserResource, { foreignKey: 'userId', sourceKey: 'id' }); - - const Resource = dc.models.Resource; - UserResource.belongsTo(Resource, { foreignKey: 'resourceId', targetKey: 'code' }); - Resource.hasMany(UserResource, { foreignKey: 'resourceId', sourceKey: 'code' }); - Resource.hasMany(Resource, { foreignKey: 'parentResource', sourceKey: 'code' }); - - return UserResource; -}; \ No newline at end of file diff --git a/api/app/lib/models/user_token.js b/api/app/lib/models/user_token.js index 3f2354e0..2415c105 100644 --- a/api/app/lib/models/user_token.js +++ b/api/app/lib/models/user_token.js @@ -2,42 +2,41 @@ 'use strict'; module.exports = dc => { - const DataTypes = dc.ORM; - const sequelize = dc.orm; - const UserToken = sequelize.define("userToken", { - token: { - type: DataTypes.UUIDV4, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: true, - field: "token", - autoIncrement: false, - unique: "user_token_token_uindex" - }, - userInfo: { - type: DataTypes.JSONB, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: false, - field: "user_info", - autoIncrement: false - }, - expired: { - type: DataTypes.DATE, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: false, - field: "expired", - autoIncrement: false - } - }, { - tableName: "user_token", - comment: "", - indexes: [] - }); - dc.models.UserToken = UserToken; - return UserToken; + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const UserToken = sequelize.define("userToken", { + token: { + type: DataTypes.UUIDV4, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: true, + field: "token", + autoIncrement: false + }, + userInfo: { + type: DataTypes.JSONB, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: false, + field: "user_info", + autoIncrement: false + }, + expired: { + type: DataTypes.DATE, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: false, + field: "expired", + autoIncrement: false + } + }, { + tableName: "user_token", + comment: "", + indexes: [] + }); + dc.models.UserToken = UserToken; + return UserToken; }; \ No newline at end of file diff --git a/api/app/lib/routes/approval/index.js b/api/app/lib/routes/approval/index.js deleted file mode 100644 index 738af25f..00000000 --- a/api/app/lib/routes/approval/index.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -const Approval = require('../../controllers/approval/index'); - -module.exports = function (app, router, opts) { - /** - * @api {POST} approval/submit 提交审批、驳回修改. - * @apiVersion 1.0.0 - * @apiGroup Approval - */ - app.fs.api.logAttr['GET/approval/submit'] = { content: '提交审批、驳回修改', visible: true }; - router.post('/approval/submit', Approval.submitApproval); -}; \ No newline at end of file diff --git a/api/app/lib/routes/auth/index.js b/api/app/lib/routes/auth/index.js index b0de650b..f3de342c 100644 --- a/api/app/lib/routes/auth/index.js +++ b/api/app/lib/routes/auth/index.js @@ -3,30 +3,13 @@ const auth = require('../../controllers/auth'); module.exports = function (app, router, opts) { - /** - * @api {Post} login 登录. - * @apiVersion 1.0.0 - * @apiGroup Auth - */ + app.fs.api.logAttr['POST/login'] = { content: '登录', visible: true }; router.post('/login', auth.login); - - /** - * @api {POST} wxLogin 微信小程序登录.(使用手机号、密码登录) - * @apiVersion 1.0.0 - * @apiGroup Auth - */ + app.fs.api.logAttr['POST/wxLogin'] = { content: '微信小程序登录', visible: true }; router.post('/wxLogin', auth.wxLogin); app.fs.api.logAttr['PUT/logout'] = { content: '登出', visible: false }; router.put('/logout', auth.logout); - - /** - * @api {PUT} wxLogout 微信小程序登出 - * @apiVersion 1.0.0 - * @apiGroup Auth - */ - app.fs.api.logAttr['PUT/wxLogout'] = { content: '登出', visible: false }; - router.put('/wxLogout', auth.wxLogout); }; diff --git a/api/app/lib/routes/common/index.js b/api/app/lib/routes/common/index.js deleted file mode 100644 index c39f7ace..00000000 --- a/api/app/lib/routes/common/index.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -const common = require('../../controllers/common'); - -module.exports = function (app, router, opts) { - - router.get('/data-dictionary/:model', common.getDataDictionary); - router.put('/data-dictionary/:model', common.putDataDictionary); -}; \ No newline at end of file diff --git a/api/app/lib/routes/data/index.js b/api/app/lib/routes/data/index.js index 7e36f369..de5abf0f 100644 --- a/api/app/lib/routes/data/index.js +++ b/api/app/lib/routes/data/index.js @@ -1,9 +1,10 @@ 'use strict'; const vehicle = require('../../controllers/data/vehicle'); - +const road = require('../../controllers/data/road'); module.exports = function (app, router, opts) { + // 路政 废弃 app.fs.api.logAttr['GET/vehicle'] = { content: '获取运政列表', visible: true }; router.get('/vehicle', vehicle.get); @@ -12,4 +13,8 @@ module.exports = function (app, router, opts) { app.fs.api.logAttr['DEL/vehicle/:vehicleId'] = { content: '删除运政数据', visible: false }; router.del('/vehicle/:vehicleId', vehicle.del); + // 路政 END 废弃 + + app.fs.api.logAttr['POST/road/import'] = { content: '导入道路数据', visible: true }; + router.post('/road/import', road.importIn); }; diff --git a/api/app/lib/routes/department/index.js b/api/app/lib/routes/department/index.js deleted file mode 100644 index 4713e013..00000000 --- a/api/app/lib/routes/department/index.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -const Department = require('../../controllers/department/index'); - -module.exports = function (app, router, opts) { - /** - * @api {GET} counties/list 获取南昌市下所有区县. - * @apiVersion 1.0.0 - * @apiGroup Department - */ - app.fs.api.logAttr['GET/counties/list'] = { content: '获取南昌市下所有区县', visible: true }; - router.get('/counties/list', Department.getCountiesList); -}; diff --git a/api/app/lib/routes/organization/authority.js b/api/app/lib/routes/organization/authority.js deleted file mode 100644 index 99de6df3..00000000 --- a/api/app/lib/routes/organization/authority.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; - -const Authority = require('../../controllers/organization/authority'); - -module.exports = function (app, router, opts) { - /** - * @api {GET} resource 查询所有权限码. - * @apiVersion 1.0.0 - * @apiGroup Org - */ - app.fs.api.logAttr['GET/resource'] = { content: '查询所有权限码', visible: true }; - router.get('resource', Authority.getResource); - /** - * @api {GET} user/resource 查询用户权限. - * @apiVersion 1.0.0 - * @apiGroup Org - */ - app.fs.api.logAttr['GET/user/resource'] = { content: '查询用户权限', visible: true }; - router.get('user/resource', Authority.getUserResource); - - /** - * @api {POST} user/resource 更新用户权限. - * @apiVersion 1.0.0 - * @apiGroup Org - */ - app.fs.api.logAttr['POST/user/resource'] = { content: '更新用户权限', visible: true }; - router.post('user/resource', Authority.updateUserRes); -}; \ No newline at end of file diff --git a/api/app/lib/routes/organization/user.js b/api/app/lib/routes/organization/user.js deleted file mode 100644 index 3a71d0a7..00000000 --- a/api/app/lib/routes/organization/user.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; - -const user = require('../../controllers/organization/user'); - -module.exports = function (app, router, opts) { - - app.fs.api.logAttr['GET/organization/department'] = { content: '获取部门信息', visible: false }; - router.get('/organization/department', user.getDepMessage); - - app.fs.api.logAttr['GET/organization/department/:depId/user'] = { content: '获取部门下用户信息', visible: false }; - router.get('/organization/department/:depId/user', user.getUser); - - app.fs.api.logAttr['POST/organization/department/user'] = { content: '创建部门下用户信息', visible: false }; - router.post('/organization/department/user', user.creatUser); - - app.fs.api.logAttr['PUT/organization/department/user/:id'] = { content: '修改部门下用户信息', visible: false }; - router.put('/organization/department/user/:id', user.updateUser); - - app.fs.api.logAttr['DEL/organization/department/user/:ids'] = { content: '删除部门下用户信息', visible: false }; - router.del('/organization/department/user/:ids', user.deleteUser); - - app.fs.api.logAttr['PUT/organization/department/user/resetPwd/:id'] = { content: '重置用户密码', visible: false }; - router.put('/organization/department/user/resetPwd/:id', user.resetPwd); - - /** - * @api {PUT} user/password/:id 修改用户密码 - * @apiVersion 1.0.0 - * @apiGroup Organization - */ - app.fs.api.logAttr['PUT/user/password/:userId'] = { content: '修改用户密码', visible: false }; - router.put('/user/password/:userId', user.updateUserPassword); -}; \ No newline at end of file diff --git a/api/app/lib/routes/placeSecurityRecord/index.js b/api/app/lib/routes/placeSecurityRecord/index.js deleted file mode 100644 index f5ec05d8..00000000 --- a/api/app/lib/routes/placeSecurityRecord/index.js +++ /dev/null @@ -1,70 +0,0 @@ -'use strict'; - -const placeSecurityRecord = require('../../controllers/placeSecurityRecord'); - -module.exports = function (app, router, opts) { - /** - * @api {POST} /add/placeSecurityRecord 提交填报信息/保存填报草稿. - * @apiVersion 1.0.0 - * @apiGroup placeSecurityRecord - */ - app.fs.api.logAttr['POST/add/placeSecurityRecord'] = { content: '提交填报信息/保存填报草稿', visible: true }; - router.post('/add/placeSecurityRecord', placeSecurityRecord.addPlaceSecurityRecord); - - /** - * @api {PUT} /placeSecurityRecord/:id 编辑填报信息. - * @apiVersion 1.0.0 - * @apiGroup placeSecurityRecord - */ - app.fs.api.logAttr['PUT/placeSecurityRecord/:id'] = { content: '编辑填报信息', visible: true }; - router.put('/placeSecurityRecord/:id', placeSecurityRecord.editPlaceSecurityRecord); - - /** - * @api {PUT} /placeSecurityRecord/:id 修改type字段 - * @apiVersion 1.0.0 - * @apiGroup placeSecurityRecord - */ - app.fs.api.logAttr['PUT/updateType/:id'] = { content: '修改type字段', visible: true }; - router.put('/updateType/:id', placeSecurityRecord.updateType); - - /** - * @api {DELETE} /placeSecurityRecord/:id 删除填报信息. - * @apiVersion 1.0.0 - * @apiGroup placeSecurityRecord - */ - app.fs.api.logAttr['DELETE/placeSecurityRecord/:id'] = { content: '删除填报信息', visible: true }; - router.del('/placeSecurityRecord/:id', placeSecurityRecord.deletePlaceSecurityRecord); - - /** - * @api {GET} /placeSecurityRecord/:id 根据填报信息ID查询填报信息. - * @apiVersion 1.0.0 - * @apiGroup placeSecurityRecord - */ - app.fs.api.logAttr['GET/placeSecurityRecord/:id'] = { content: '根据填报信息ID查询填报信息', visible: true }; - router.get('/placeSecurityRecord/:id', placeSecurityRecord.getPlaceSecurityRecordById); - - /** - * @api {GET} /recently/placeSecurityRecord/:placeId 根据场所ID获取该场所最近用户填报信息. - * @apiVersion 1.0.0 - * @apiGroup placeSecurityRecord - */ - app.fs.api.logAttr['GET/recently/placeSecurityRecord/:placeId'] = { content: '根据场所ID获取该场所最近用户填报信息', visible: true }; - router.get('/recently/placeSecurityRecord/:placeId', placeSecurityRecord.getRecentlyPlaceSecurityRecordByPlaceId); - - /** - * @api {GET} /placeSecurityRecords 根据筛选条件获取用户填报信息. - * @apiVersion 1.0.0 - * @apiGroup placeSecurityRecord - */ - app.fs.api.logAttr['GET/placeSecurityRecords'] = { content: '根据筛选条件获取用户填报信息', visible: true }; - router.get('/placeSecurityRecords', placeSecurityRecord.getPlaceSecurityRecords); - - /** - * @api {GET} /approve/placeSecurityRecords 根据筛选条件获取用户审批填报信息. - * @apiVersion 1.0.0 - * @apiGroup placeSecurityRecord - */ - app.fs.api.logAttr['GET/approve/placeSecurityRecords'] = { content: '根据筛选条件获取用户审批填报信息', visible: true }; - router.get('/approve/placeSecurityRecords', placeSecurityRecord.getApprovePlaceSecurityRecords); - -}; \ No newline at end of file diff --git a/api/app/lib/routes/places/index.js b/api/app/lib/routes/places/index.js deleted file mode 100644 index daf3d0f4..00000000 --- a/api/app/lib/routes/places/index.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict'; - -const places = require('../../controllers/places'); - -module.exports = function (app, router, opts) { - /** - * @api {GET} /user/places/:userId 根据用户ID获取该用户创建的所有场所信息. - * @apiVersion 1.0.0 - * @apiGroup places - */ - app.fs.api.logAttr['GET/user/places/:userId'] = { content: '根据用户ID获取该用户创建的所有场所信息', visible: true }; - router.get('/user/places/:userId', places.getPlacesByUserId); - - /** - * @api {GET} /approveUser/places/:approveUserId 根据审批用户ID获取该审批用户范围内填报人创建的场所信息. - * @apiVersion 1.0.0 - * @apiGroup places - */ - app.fs.api.logAttr['GET/approveUser/places/:approveUserId'] = { content: '根据审批用户ID获取该审批用户范围内填报人创建的场所信息', visible: true }; - router.get('/approveUser/places/:approveUserId', places.getPlacesByApproveUserId); - - /** - * @api {GET} /all/places 获取所有场所信息. - * @apiVersion 1.0.0 - * @apiGroup places - */ - app.fs.api.logAttr['GET/all/places'] = { content: '获取所有场所信息', visible: true }; - router.get('/all/places', places.getAllPlaces); - -}; \ No newline at end of file diff --git a/api/app/lib/routes/report/index.js b/api/app/lib/routes/report/index.js deleted file mode 100644 index 3e56b52c..00000000 --- a/api/app/lib/routes/report/index.js +++ /dev/null @@ -1,41 +0,0 @@ -'use strict'; - -const report = require('../../controllers/report'); -const reportConfig = require('../../controllers/report/config') -const reportRectify = require('../../controllers/report/compile') - -module.exports = function (app, router, opts) { - /** - * @api {GET} report 报表. - * @apiVersion 1.0.0 - * @apiGroup report - */ - app.fs.api.logAttr['GET/report/list'] = { content: '报表下载列表', visible: true }; - router.get('/report/list', report.getReportList); - - // 报表配置 - app.fs.api.logAttr['GET/allAreas'] = { content: '获取全部区域', visible: true }; - router.get('/allAreas', reportConfig.getAreas); - - app.fs.api.logAttr['POST/report/config'] = { content: '添加报表配置', visible: true }; - router.post('/report/config', reportConfig.addReportConfig); - - app.fs.api.logAttr['GET/report/config'] = { content: '获取报表配置', visible: true }; - router.get('/report/config', reportConfig.getReportConfig); - - app.fs.api.logAttr['PUT/report/:reportId/config'] = { content: '编辑报表配置', visible: true }; - router.put('/report/:reportId/config', reportConfig.editReportConfig); - - app.fs.api.logAttr['DEL/report/:reportId/config'] = { content: '删除报表配置', visible: true }; - router.del('/report/:reportId/config', reportConfig.delReportConfig); - - // 报表编辑 - app.fs.api.logAttr['GET/report/rectify'] = { content: '获取合用场所安全隐患排查整治汇总表', visible: true }; - router.get('/report/rectify', reportRectify.getReportRectify); - - app.fs.api.logAttr['GET/report/rectify/detail'] = { content: '获取合用场所安全隐患排查整治汇总表详情', visible: true }; - router.get('/report/rectify/detail', reportRectify.getReportRectifyDetail); - - app.fs.api.logAttr['POST/report/rectify/detail'] = { content: '保存合用场所安全隐患排查整治汇总表编辑信息', visible: true }; - router.post('/report/rectify/detail', reportRectify.compileReportRectifyDetail); -}; \ No newline at end of file diff --git a/api/app/lib/routes/statistic/index.js b/api/app/lib/routes/statistic/index.js deleted file mode 100644 index 94dc160d..00000000 --- a/api/app/lib/routes/statistic/index.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; - -const statistic = require('../../controllers/statistic') -module.exports = function (app, router, opts) { - /** - * @api {GET} getGovern 获取数据中台. - * @apiVersion 1.0.0 - * @apiGroup wxReport - */ - app.fs.api.logAttr['GET/daily/report/data/statistic'] = { content: '获取数据中台', visible: true }; - router.get('/daily/report/data/statistic', statistic.reportDailyStatistic); - /** -* @api {GET} getGovern 获取数据中台地区填报数量. -* @apiVersion 1.0.0 -* @apiGroup wxReport -*/ - app.fs.api.logAttr['GET/daily/report/area/statistic'] = { content: '获取数据中台地区填报数量', visible: true }; - router.get('/daily/report/area/statistic', statistic.reportAreaStatistic); - - /** - * @api {GET} getGovern 获取填报管理数据. - * @apiVersion 1.0.0 - * @apiGroup wxReport - */ - app.fs.api.logAttr['GET/report/management/statistic'] = { content: '获取填报管理数据', visible: true }; - router.get('/report/management/statistic', statistic.dangerAreaQuery); - -} \ No newline at end of file diff --git a/api/app/lib/routes/wxReport/index.js b/api/app/lib/routes/wxReport/index.js deleted file mode 100644 index 2e208ca1..00000000 --- a/api/app/lib/routes/wxReport/index.js +++ /dev/null @@ -1,78 +0,0 @@ -'use strict'; - -const wxReport = require('../../controllers/wxReport/index'); -module.exports = function (app, router, opts) { - /*******************首页-市级***************************/ - /** - * @api {GET} getDayReport 获取每日汇总. - * @apiVersion 1.0.0 - * @apiGroup wxReport - */ - app.fs.api.logAttr['GET/getDayReport'] = { content: '获取每日汇总', visible: true }; - router.get('/getDayReport', wxReport.getDayReport); - - /** - * @api {GET} getGovern 获取排查整治汇总. - * @apiVersion 1.0.0 - * @apiGroup wxReport - */ - app.fs.api.logAttr['GET/getGovern'] = { content: '获取排查整治汇总', visible: true }; - router.get('/getGovern', wxReport.getGovern); - - /** - * @api {GET} getGovernDetail 获取排查整治汇总详情. - * @apiVersion 1.0.0 - * @apiGroup wxReport - */ - app.fs.api.logAttr['GET/getGovernDetail'] = { content: '获取排查整治汇总详情', visible: true }; - router.get('/getGovernDetail', wxReport.getGovernDetail); - - /** - * @api {PUT} /operateGovern 确认整治汇总场所数据. - * @apiVersion 1.0.0 - * @apiGroup wxReport - */ - app.fs.api.logAttr['PUT/operateGovern'] = { content: '确认整治汇总场所数据', visible: true }; - router.put('/operateGovern', wxReport.operateGovern); - - /** - * @api {GET} getSecurityRiskList 获取安全隐患排查详细数据列表. - * @apiVersion 1.0.0 - * @apiGroup wxReport - */ - app.fs.api.logAttr['GET/getSecurityRiskList'] = { content: '获取安全隐患排查详细数据列表', visible: true }; - router.get('/getSecurityRiskList', wxReport.getSecurityRiskList); - - /** - * @api {GET} /getHomeCount/:userId/:departmentId/:userRegionType 获取待处理数量. - * @apiVersion 1.0.0 - * @apiGroup wxReport - */ - app.fs.api.logAttr['GET/getHomeCount/:userId/:departmentId/:userRegionType'] = { content: '获取待处理数量', visible: true }; - router.get('/getHomeCount/:userId/:departmentId/:userRegionType', wxReport.getHomeCount); - - - /** - * @api {PUT} /operateReport/:id/:userId 每日汇总表上报. - * @apiVersion 1.0.0 - * @apiGroup wxReport - */ - app.fs.api.logAttr['PUT/operateReport/:id/:userId'] = { content: '每日汇总表上报', visible: true }; - router.put('/operateReport/:id/:userId', wxReport.operateReport); - - /** - * @api {GET} /approve/reportCollections 根据筛选条件获取用户审核报表信息. - * @apiVersion 1.0.0 - * @apiGroup wxReport - */ - app.fs.api.logAttr['GET/approve/reportCollections'] = { content: '根据筛选条件获取用户审核报表信息', visible: true }; - router.get('/approve/reportCollections', wxReport.getApproveReportCollections); - - /** - * @api {PUT} /operateGovernReport/:userId 上报排查整治汇总表. - * @apiVersion 1.0.0 - * @apiGroup wxReport - */ - app.fs.api.logAttr['PUT/operateGovernReport/:userId'] = { content: '上报排查整治汇总表', visible: true }; - router.put('/operateGovernReport/:userId', wxReport.operateGovernReport); -} \ No newline at end of file diff --git a/api/log/development.log b/api/log/development.log index c2cc5341..81f96b21 100644 --- a/api/log/development.log +++ b/api/log/development.log @@ -6709,3 +6709,248 @@ >>>>>>> .theirs2022-05-17 09:54:28.415 - debug: [FS-LOGGER] Init. 2022-05-17 09:54:28.497 - info: [FS-ATTACHMENT] Inject attachment mw into router. 2022-05-17 09:54:28.498 - info: [FS-AUTH] Inject auth and api mv into router. +2022-07-20 20:43:09.196 - debug: [FS-LOGGER] Init. +2022-07-20 20:43:09.290 - info: [FS-ATTACHMENT] Inject attachment mw into router. +2022-07-20 20:43:09.291 - info: [FS-AUTH] Inject auth and api mv into router. +2022-07-20 20:43:56.830 - error: path: /login, error: SequelizeDatabaseError: 关系 "user_token" 的 "id" 字段不存在 +2022-07-20 20:44:18.849 - error: path: /login, error: SequelizeDatabaseError: 关系 "user_token" 的 "id" 字段不存在 +2022-07-20 20:45:25.022 - debug: [FS-LOGGER] Init. +2022-07-20 20:45:25.106 - info: [FS-ATTACHMENT] Inject attachment mw into router. +2022-07-20 20:45:25.106 - info: [FS-AUTH] Inject auth and api mv into router. +2022-07-20 20:45:56.444 - debug: [FS-LOGGER] Init. +2022-07-20 20:45:56.515 - info: [FS-ATTACHMENT] Inject attachment mw into router. +2022-07-20 20:45:56.515 - info: [FS-AUTH] Inject auth and api mv into router. +2022-07-20 20:47:15.777 - error: path: /login, error: SequelizeDatabaseError: 关系 "user_token" 的 "id" 字段不存在 +2022-07-20 20:47:17.648 - error: [FS-ERRHD] +{ + message: 'read ECONNRESET', + stack: 'SequelizeConnectionError: read ECONNRESET\n' + + ' at c:\\_WorkCode\\四好公路\\api\\node_modules\\sequelize\\lib\\dialects\\postgres\\connection-manager.js:154:24\n' + + ' at Connection.connectingErrorHandler (c:\\_WorkCode\\四好公路\\api\\node_modules\\pg\\lib\\client.js:194:14)\n' + + ' at Connection.emit (events.js:314:20)\n' + + ' at Socket.reportStreamError (c:\\_WorkCode\\四好公路\\api\\node_modules\\pg\\lib\\connection.js:73:10)\n' + + ' at Socket.emit (events.js:314:20)\n' + + ' at emitErrorNT (internal/streams/destroy.js:92:8)\n' + + ' at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)\n' + + ' at processTicksAndRejections (internal/process/task_queues.js:84:21)\n' + + 'From previous event:\n' + + ' at ConnectionManager.connect (c:\\_WorkCode\\四好公路\\api\\node_modules\\sequelize\\lib\\dialects\\postgres\\connection-manager.js:107:12)\n' + + ' at c:\\_WorkCode\\四好公路\\api\\node_modules\\sequelize\\lib\\dialects\\abstract\\connection-manager.js:338:50\n' + + 'From previous event:\n' + + ' at ConnectionManager._connect (c:\\_WorkCode\\四好公路\\api\\node_modules\\sequelize\\lib\\dialects\\abstract\\connection-manager.js:338:8)\n' + + ' at Object.create (c:\\_WorkCode\\四好公路\\api\\node_modules\\sequelize\\lib\\dialects\\abstract\\connection-manager.js:101:28)\n' + + ' at Pool._createResource (c:\\_WorkCode\\四好公路\\api\\node_modules\\generic-pool\\lib\\Pool.js:308:42)\n' + + ' at Pool._ensureMinimum (c:\\_WorkCode\\四好公路\\api\\node_modules\\generic-pool\\lib\\Pool.js:338:12)\n' + + ' at Pool.start (c:\\_WorkCode\\四好公路\\api\\node_modules\\generic-pool\\lib\\Pool.js:412:10)\n' + + ' at Pool.acquire (c:\\_WorkCode\\四好公路\\api\\node_modules\\generic-pool\\lib\\Pool.js:429:12)\n' + + ' at c:\\_WorkCode\\四好公路\\api\\node_modules\\sequelize\\lib\\dialects\\abstract\\connection-manager.js:292:24\n' + + ' at processImmediate (internal/timers.js:461:21)\n' + + ' at process.callbackTrampoline (internal/async_hooks.js:126:14)\n' + + 'From previous event:\n' + + ' at ConnectionManager.getConnection (c:\\_WorkCode\\四好公路\\api\\node_modules\\sequelize\\lib\\dialects\\abstract\\connection-manager.js:291:20)\n' + + ' at Transaction.prepareEnvironment (c:\\_WorkCode\\四好公路\\api\\node_modules\\sequelize\\lib\\transaction.js:125:60)\n' + + ' at Sequelize.transaction (c:\\_WorkCode\\四好公路\\api\\node_modules\\sequelize\\lib\\sequelize.js:996:43)\n' + + ' at login (c:\\_WorkCode\\四好公路\\api\\app\\lib\\controllers\\auth\\index.js:8:45)\n' + + ' at dispatch (c:\\_WorkCode\\四好公路\\api\\node_modules\\koa-compose\\index.js:44:32)\n' + + ' at next (c:\\_WorkCode\\四好公路\\api\\node_modules\\koa-compose\\index.js:45:18)\n' + + ' at c:\\_WorkCode\\四好公路\\api\\app\\lib\\middlewares\\business-rest.js:45:16\n' + + ' at dispatch (c:\\_WorkCode\\四好公路\\api\\node_modules\\koa-compose\\index.js:44:32)\n' + + ' at next (c:\\_WorkCode\\四好公路\\api\\node_modules\\koa-compose\\index.js:45:18)\n' + + ' at auth (c:\\_WorkCode\\四好公路\\api\\app\\lib\\middlewares\\authenticator.js:145:19)\n' + + ' at dispatch (c:\\_WorkCode\\四好公路\\api\\node_modules\\koa-compose\\index.js:44:32)\n' + + ' at c:\\_WorkCode\\四好公路\\api\\node_modules\\koa-compose\\index.js:36:12\n' + + ' at c:\\_WorkCode\\四好公路\\api\\node_modules\\koa-66\\index.js:209:56\n' + + ' at dispatch (c:\\_WorkCode\\四好公路\\api\\node_modules\\koa\\node_modules\\koa-compose\\index.js:42:32)\n' + + ' at c:\\_WorkCode\\四好公路\\api\\node_modules\\fs-dc\\lib\\dc.js:35:15\n' + + ' at Generator.next ()\n' + + ' at onFulfilled (c:\\_WorkCode\\四好公路\\api\\node_modules\\co\\index.js:65:19)\n' + + ' at c:\\_WorkCode\\四好公路\\api\\node_modules\\co\\index.js:54:5\n' + + ' at new Promise ()\n' + + ' at co (c:\\_WorkCode\\四好公路\\api\\node_modules\\co\\index.js:50:10)\n' + + ' at createPromise (c:\\_WorkCode\\四好公路\\api\\node_modules\\co\\index.js:30:15)\n' + + ' at dispatch (c:\\_WorkCode\\四好公路\\api\\node_modules\\koa\\node_modules\\koa-compose\\index.js:42:32)\n' + + ' at c:\\_WorkCode\\四好公路\\api\\node_modules\\fs-logger\\lib\\logger.js:48:15\n' + + ' at Generator.next ()\n' + + ' at onFulfilled (c:\\_WorkCode\\四好公路\\api\\node_modules\\co\\index.js:65:19)', + name: 'SequelizeConnectionError', + parent: { errno: 'ECONNRESET', code: 'ECONNRESET', syscall: 'read' }, + original: { '$ref': '$["parent"]' }, + __stackCleaned__: true +} +2022-07-20 20:47:19.778 - error: [FS-ERRHD] +{ + message: 'read ECONNRESET', + stack: 'SequelizeConnectionError: read ECONNRESET\n' + + ' at c:\\_WorkCode\\四好公路\\api\\node_modules\\sequelize\\lib\\dialects\\postgres\\connection-manager.js:154:24\n' + + ' at Connection.connectingErrorHandler (c:\\_WorkCode\\四好公路\\api\\node_modules\\pg\\lib\\client.js:194:14)\n' + + ' at Connection.emit (events.js:314:20)\n' + + ' at Socket.reportStreamError (c:\\_WorkCode\\四好公路\\api\\node_modules\\pg\\lib\\connection.js:73:10)\n' + + ' at Socket.emit (events.js:314:20)\n' + + ' at emitErrorNT (internal/streams/destroy.js:92:8)\n' + + ' at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)\n' + + ' at processTicksAndRejections (internal/process/task_queues.js:84:21)\n' + + 'From previous event:\n' + + ' at ConnectionManager.connect (c:\\_WorkCode\\四好公路\\api\\node_modules\\sequelize\\lib\\dialects\\postgres\\connection-manager.js:107:12)\n' + + ' at c:\\_WorkCode\\四好公路\\api\\node_modules\\sequelize\\lib\\dialects\\abstract\\connection-manager.js:338:50\n' + + 'From previous event:\n' + + ' at ConnectionManager._connect (c:\\_WorkCode\\四好公路\\api\\node_modules\\sequelize\\lib\\dialects\\abstract\\connection-manager.js:338:8)\n' + + ' at Object.create (c:\\_WorkCode\\四好公路\\api\\node_modules\\sequelize\\lib\\dialects\\abstract\\connection-manager.js:101:28)\n' + + ' at Pool._createResource (c:\\_WorkCode\\四好公路\\api\\node_modules\\generic-pool\\lib\\Pool.js:308:42)\n' + + ' at Pool._ensureMinimum (c:\\_WorkCode\\四好公路\\api\\node_modules\\generic-pool\\lib\\Pool.js:338:12)\n' + + ' at Pool.start (c:\\_WorkCode\\四好公路\\api\\node_modules\\generic-pool\\lib\\Pool.js:412:10)\n' + + ' at Pool.acquire (c:\\_WorkCode\\四好公路\\api\\node_modules\\generic-pool\\lib\\Pool.js:429:12)\n' + + ' at c:\\_WorkCode\\四好公路\\api\\node_modules\\sequelize\\lib\\dialects\\abstract\\connection-manager.js:292:24\n' + + ' at processImmediate (internal/timers.js:461:21)\n' + + ' at process.callbackTrampoline (internal/async_hooks.js:126:14)\n' + + 'From previous event:\n' + + ' at ConnectionManager.getConnection (c:\\_WorkCode\\四好公路\\api\\node_modules\\sequelize\\lib\\dialects\\abstract\\connection-manager.js:291:20)\n' + + ' at Transaction.prepareEnvironment (c:\\_WorkCode\\四好公路\\api\\node_modules\\sequelize\\lib\\transaction.js:125:60)\n' + + ' at Sequelize.transaction (c:\\_WorkCode\\四好公路\\api\\node_modules\\sequelize\\lib\\sequelize.js:996:43)\n' + + ' at login (c:\\_WorkCode\\四好公路\\api\\app\\lib\\controllers\\auth\\index.js:8:45)\n' + + ' at dispatch (c:\\_WorkCode\\四好公路\\api\\node_modules\\koa-compose\\index.js:44:32)\n' + + ' at next (c:\\_WorkCode\\四好公路\\api\\node_modules\\koa-compose\\index.js:45:18)\n' + + ' at c:\\_WorkCode\\四好公路\\api\\app\\lib\\middlewares\\business-rest.js:45:16\n' + + ' at dispatch (c:\\_WorkCode\\四好公路\\api\\node_modules\\koa-compose\\index.js:44:32)\n' + + ' at next (c:\\_WorkCode\\四好公路\\api\\node_modules\\koa-compose\\index.js:45:18)\n' + + ' at auth (c:\\_WorkCode\\四好公路\\api\\app\\lib\\middlewares\\authenticator.js:145:19)\n' + + ' at dispatch (c:\\_WorkCode\\四好公路\\api\\node_modules\\koa-compose\\index.js:44:32)\n' + + ' at c:\\_WorkCode\\四好公路\\api\\node_modules\\koa-compose\\index.js:36:12\n' + + ' at c:\\_WorkCode\\四好公路\\api\\node_modules\\koa-66\\index.js:209:56\n' + + ' at dispatch (c:\\_WorkCode\\四好公路\\api\\node_modules\\koa\\node_modules\\koa-compose\\index.js:42:32)\n' + + ' at c:\\_WorkCode\\四好公路\\api\\node_modules\\fs-dc\\lib\\dc.js:35:15\n' + + ' at Generator.next ()\n' + + ' at onFulfilled (c:\\_WorkCode\\四好公路\\api\\node_modules\\co\\index.js:65:19)\n' + + ' at c:\\_WorkCode\\四好公路\\api\\node_modules\\co\\index.js:54:5\n' + + ' at new Promise ()\n' + + ' at co (c:\\_WorkCode\\四好公路\\api\\node_modules\\co\\index.js:50:10)\n' + + ' at createPromise (c:\\_WorkCode\\四好公路\\api\\node_modules\\co\\index.js:30:15)\n' + + ' at dispatch (c:\\_WorkCode\\四好公路\\api\\node_modules\\koa\\node_modules\\koa-compose\\index.js:42:32)\n' + + ' at c:\\_WorkCode\\四好公路\\api\\node_modules\\fs-logger\\lib\\logger.js:48:15\n' + + ' at Generator.next ()\n' + + ' at onFulfilled (c:\\_WorkCode\\四好公路\\api\\node_modules\\co\\index.js:65:19)', + name: 'SequelizeConnectionError', + parent: { errno: 'ECONNRESET', code: 'ECONNRESET', syscall: 'read' }, + original: { '$ref': '$["parent"]' }, + __stackCleaned__: true +} +2022-07-20 20:47:21.058 - error: [FS-ERRHD] +{ + message: 'read ECONNRESET', + stack: 'SequelizeConnectionError: read ECONNRESET\n' + + ' at c:\\_WorkCode\\四好公路\\api\\node_modules\\sequelize\\lib\\dialects\\postgres\\connection-manager.js:154:24\n' + + ' at Connection.connectingErrorHandler (c:\\_WorkCode\\四好公路\\api\\node_modules\\pg\\lib\\client.js:194:14)\n' + + ' at Connection.emit (events.js:314:20)\n' + + ' at Socket.reportStreamError (c:\\_WorkCode\\四好公路\\api\\node_modules\\pg\\lib\\connection.js:73:10)\n' + + ' at Socket.emit (events.js:314:20)\n' + + ' at emitErrorNT (internal/streams/destroy.js:92:8)\n' + + ' at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)\n' + + ' at processTicksAndRejections (internal/process/task_queues.js:84:21)\n' + + 'From previous event:\n' + + ' at ConnectionManager.connect (c:\\_WorkCode\\四好公路\\api\\node_modules\\sequelize\\lib\\dialects\\postgres\\connection-manager.js:107:12)\n' + + ' at c:\\_WorkCode\\四好公路\\api\\node_modules\\sequelize\\lib\\dialects\\abstract\\connection-manager.js:338:50\n' + + 'From previous event:\n' + + ' at ConnectionManager._connect (c:\\_WorkCode\\四好公路\\api\\node_modules\\sequelize\\lib\\dialects\\abstract\\connection-manager.js:338:8)\n' + + ' at Object.create (c:\\_WorkCode\\四好公路\\api\\node_modules\\sequelize\\lib\\dialects\\abstract\\connection-manager.js:101:28)\n' + + ' at Pool._createResource (c:\\_WorkCode\\四好公路\\api\\node_modules\\generic-pool\\lib\\Pool.js:308:42)\n' + + ' at Pool._ensureMinimum (c:\\_WorkCode\\四好公路\\api\\node_modules\\generic-pool\\lib\\Pool.js:338:12)\n' + + ' at Pool.start (c:\\_WorkCode\\四好公路\\api\\node_modules\\generic-pool\\lib\\Pool.js:412:10)\n' + + ' at Pool.acquire (c:\\_WorkCode\\四好公路\\api\\node_modules\\generic-pool\\lib\\Pool.js:429:12)\n' + + ' at c:\\_WorkCode\\四好公路\\api\\node_modules\\sequelize\\lib\\dialects\\abstract\\connection-manager.js:292:24\n' + + ' at processImmediate (internal/timers.js:461:21)\n' + + ' at process.callbackTrampoline (internal/async_hooks.js:126:14)\n' + + 'From previous event:\n' + + ' at ConnectionManager.getConnection (c:\\_WorkCode\\四好公路\\api\\node_modules\\sequelize\\lib\\dialects\\abstract\\connection-manager.js:291:20)\n' + + ' at Transaction.prepareEnvironment (c:\\_WorkCode\\四好公路\\api\\node_modules\\sequelize\\lib\\transaction.js:125:60)\n' + + ' at Sequelize.transaction (c:\\_WorkCode\\四好公路\\api\\node_modules\\sequelize\\lib\\sequelize.js:996:43)\n' + + ' at login (c:\\_WorkCode\\四好公路\\api\\app\\lib\\controllers\\auth\\index.js:8:45)\n' + + ' at dispatch (c:\\_WorkCode\\四好公路\\api\\node_modules\\koa-compose\\index.js:44:32)\n' + + ' at next (c:\\_WorkCode\\四好公路\\api\\node_modules\\koa-compose\\index.js:45:18)\n' + + ' at c:\\_WorkCode\\四好公路\\api\\app\\lib\\middlewares\\business-rest.js:45:16\n' + + ' at dispatch (c:\\_WorkCode\\四好公路\\api\\node_modules\\koa-compose\\index.js:44:32)\n' + + ' at next (c:\\_WorkCode\\四好公路\\api\\node_modules\\koa-compose\\index.js:45:18)\n' + + ' at auth (c:\\_WorkCode\\四好公路\\api\\app\\lib\\middlewares\\authenticator.js:145:19)\n' + + ' at dispatch (c:\\_WorkCode\\四好公路\\api\\node_modules\\koa-compose\\index.js:44:32)\n' + + ' at c:\\_WorkCode\\四好公路\\api\\node_modules\\koa-compose\\index.js:36:12\n' + + ' at c:\\_WorkCode\\四好公路\\api\\node_modules\\koa-66\\index.js:209:56\n' + + ' at dispatch (c:\\_WorkCode\\四好公路\\api\\node_modules\\koa\\node_modules\\koa-compose\\index.js:42:32)\n' + + ' at c:\\_WorkCode\\四好公路\\api\\node_modules\\fs-dc\\lib\\dc.js:35:15\n' + + ' at Generator.next ()\n' + + ' at onFulfilled (c:\\_WorkCode\\四好公路\\api\\node_modules\\co\\index.js:65:19)\n' + + ' at c:\\_WorkCode\\四好公路\\api\\node_modules\\co\\index.js:54:5\n' + + ' at new Promise ()\n' + + ' at co (c:\\_WorkCode\\四好公路\\api\\node_modules\\co\\index.js:50:10)\n' + + ' at createPromise (c:\\_WorkCode\\四好公路\\api\\node_modules\\co\\index.js:30:15)\n' + + ' at dispatch (c:\\_WorkCode\\四好公路\\api\\node_modules\\koa\\node_modules\\koa-compose\\index.js:42:32)\n' + + ' at c:\\_WorkCode\\四好公路\\api\\node_modules\\fs-logger\\lib\\logger.js:48:15\n' + + ' at Generator.next ()\n' + + ' at onFulfilled (c:\\_WorkCode\\四好公路\\api\\node_modules\\co\\index.js:65:19)', + name: 'SequelizeConnectionError', + parent: { errno: 'ECONNRESET', code: 'ECONNRESET', syscall: 'read' }, + original: { '$ref': '$["parent"]' }, + __stackCleaned__: true +} +2022-07-20 20:47:22.122 - error: [FS-ERRHD] +{ + message: 'read ECONNRESET', + stack: 'SequelizeConnectionError: read ECONNRESET\n' + + ' at c:\\_WorkCode\\四好公路\\api\\node_modules\\sequelize\\lib\\dialects\\postgres\\connection-manager.js:154:24\n' + + ' at Connection.connectingErrorHandler (c:\\_WorkCode\\四好公路\\api\\node_modules\\pg\\lib\\client.js:194:14)\n' + + ' at Connection.emit (events.js:314:20)\n' + + ' at Socket.reportStreamError (c:\\_WorkCode\\四好公路\\api\\node_modules\\pg\\lib\\connection.js:73:10)\n' + + ' at Socket.emit (events.js:314:20)\n' + + ' at emitErrorNT (internal/streams/destroy.js:92:8)\n' + + ' at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)\n' + + ' at processTicksAndRejections (internal/process/task_queues.js:84:21)\n' + + 'From previous event:\n' + + ' at ConnectionManager.connect (c:\\_WorkCode\\四好公路\\api\\node_modules\\sequelize\\lib\\dialects\\postgres\\connection-manager.js:107:12)\n' + + ' at c:\\_WorkCode\\四好公路\\api\\node_modules\\sequelize\\lib\\dialects\\abstract\\connection-manager.js:338:50\n' + + 'From previous event:\n' + + ' at ConnectionManager._connect (c:\\_WorkCode\\四好公路\\api\\node_modules\\sequelize\\lib\\dialects\\abstract\\connection-manager.js:338:8)\n' + + ' at Object.create (c:\\_WorkCode\\四好公路\\api\\node_modules\\sequelize\\lib\\dialects\\abstract\\connection-manager.js:101:28)\n' + + ' at Pool._createResource (c:\\_WorkCode\\四好公路\\api\\node_modules\\generic-pool\\lib\\Pool.js:308:42)\n' + + ' at Pool._ensureMinimum (c:\\_WorkCode\\四好公路\\api\\node_modules\\generic-pool\\lib\\Pool.js:338:12)\n' + + ' at Pool.start (c:\\_WorkCode\\四好公路\\api\\node_modules\\generic-pool\\lib\\Pool.js:412:10)\n' + + ' at Pool.acquire (c:\\_WorkCode\\四好公路\\api\\node_modules\\generic-pool\\lib\\Pool.js:429:12)\n' + + ' at c:\\_WorkCode\\四好公路\\api\\node_modules\\sequelize\\lib\\dialects\\abstract\\connection-manager.js:292:24\n' + + ' at processImmediate (internal/timers.js:461:21)\n' + + ' at process.callbackTrampoline (internal/async_hooks.js:126:14)\n' + + 'From previous event:\n' + + ' at ConnectionManager.getConnection (c:\\_WorkCode\\四好公路\\api\\node_modules\\sequelize\\lib\\dialects\\abstract\\connection-manager.js:291:20)\n' + + ' at Transaction.prepareEnvironment (c:\\_WorkCode\\四好公路\\api\\node_modules\\sequelize\\lib\\transaction.js:125:60)\n' + + ' at Sequelize.transaction (c:\\_WorkCode\\四好公路\\api\\node_modules\\sequelize\\lib\\sequelize.js:996:43)\n' + + ' at login (c:\\_WorkCode\\四好公路\\api\\app\\lib\\controllers\\auth\\index.js:8:45)\n' + + ' at dispatch (c:\\_WorkCode\\四好公路\\api\\node_modules\\koa-compose\\index.js:44:32)\n' + + ' at next (c:\\_WorkCode\\四好公路\\api\\node_modules\\koa-compose\\index.js:45:18)\n' + + ' at c:\\_WorkCode\\四好公路\\api\\app\\lib\\middlewares\\business-rest.js:45:16\n' + + ' at dispatch (c:\\_WorkCode\\四好公路\\api\\node_modules\\koa-compose\\index.js:44:32)\n' + + ' at next (c:\\_WorkCode\\四好公路\\api\\node_modules\\koa-compose\\index.js:45:18)\n' + + ' at auth (c:\\_WorkCode\\四好公路\\api\\app\\lib\\middlewares\\authenticator.js:145:19)\n' + + ' at dispatch (c:\\_WorkCode\\四好公路\\api\\node_modules\\koa-compose\\index.js:44:32)\n' + + ' at c:\\_WorkCode\\四好公路\\api\\node_modules\\koa-compose\\index.js:36:12\n' + + ' at c:\\_WorkCode\\四好公路\\api\\node_modules\\koa-66\\index.js:209:56\n' + + ' at dispatch (c:\\_WorkCode\\四好公路\\api\\node_modules\\koa\\node_modules\\koa-compose\\index.js:42:32)\n' + + ' at c:\\_WorkCode\\四好公路\\api\\node_modules\\fs-dc\\lib\\dc.js:35:15\n' + + ' at Generator.next ()\n' + + ' at onFulfilled (c:\\_WorkCode\\四好公路\\api\\node_modules\\co\\index.js:65:19)\n' + + ' at c:\\_WorkCode\\四好公路\\api\\node_modules\\co\\index.js:54:5\n' + + ' at new Promise ()\n' + + ' at co (c:\\_WorkCode\\四好公路\\api\\node_modules\\co\\index.js:50:10)\n' + + ' at createPromise (c:\\_WorkCode\\四好公路\\api\\node_modules\\co\\index.js:30:15)\n' + + ' at dispatch (c:\\_WorkCode\\四好公路\\api\\node_modules\\koa\\node_modules\\koa-compose\\index.js:42:32)\n' + + ' at c:\\_WorkCode\\四好公路\\api\\node_modules\\fs-logger\\lib\\logger.js:48:15\n' + + ' at Generator.next ()\n' + + ' at onFulfilled (c:\\_WorkCode\\四好公路\\api\\node_modules\\co\\index.js:65:19)', + name: 'SequelizeConnectionError', + parent: { errno: 'ECONNRESET', code: 'ECONNRESET', syscall: 'read' }, + original: { '$ref': '$["parent"]' }, + __stackCleaned__: true +} +2022-07-20 20:47:28.269 - debug: [FS-LOGGER] Init. +2022-07-20 20:47:28.345 - info: [FS-ATTACHMENT] Inject attachment mw into router. +2022-07-20 20:47:28.345 - info: [FS-AUTH] Inject auth and api mv into router. +2022-07-20 20:48:16.746 - debug: [FS-LOGGER] Init. +2022-07-20 20:48:16.819 - info: [FS-ATTACHMENT] Inject attachment mw into router. +2022-07-20 20:48:16.819 - info: [FS-AUTH] Inject auth and api mv into router. +2022-07-20 21:00:55.063 - debug: [FS-LOGGER] Init. +2022-07-20 21:00:55.128 - info: [FS-ATTACHMENT] Inject attachment mw into router. +2022-07-20 21:00:55.129 - info: [FS-AUTH] Inject auth and api mv into router. diff --git a/api/sequelize-automate.config.js b/api/sequelize-automate.config.js index a0fb179c..cd6e5e4c 100644 --- a/api/sequelize-automate.config.js +++ b/api/sequelize-automate.config.js @@ -1,7 +1,7 @@ module.exports = { // 数据库配置 与 sequelize 相同 dbOptions: { - database: 'yinjiguanli', + database: 'highways4good', username: 'postgres', password: '123', dialect: 'postgres', @@ -26,8 +26,8 @@ module.exports = { dir: './app/lib/models', // 指定输出 models 文件的目录 typesDir: 'models', // 指定输出 TypeScript 类型定义的文件目录,只有 TypeScript / Midway 等会有类型定义 emptyDir: false, // !!! 谨慎操作 生成 models 之前是否清空 `dir` 以及 `typesDir` - tables: ['user_placeSecurityRecord', 'places'], // 指定生成哪些表的 models,如 ['user', 'user_post'];如果为 null,则忽略改属性 - skipTables: ['user'], // 指定跳过哪些表的 models,如 ['user'];如果为 null,则忽略改属性 + tables: null, // 指定生成哪些表的 models,如 ['user', 'user_post'];如果为 null,则忽略改属性 + skipTables: null, // 指定跳过哪些表的 models,如 ['user'];如果为 null,则忽略改属性 tsNoCheck: false, // 是否添加 `@ts-nocheck` 注释到 models 文件中 ignorePrefix: [], // 生成的模型名称忽略的前缀,因为 项目中有以下表名是以 t_ 开头的,在实际模型中不需要, 可以添加多个 [ 't_data_', 't_',] ,长度较长的 前缀放前面 attrLength: false, // 在生成模型的字段中 是否生成 如 var(128)这种格式,公司一般使用 String ,则配置为 false diff --git a/scripts/1_update_user_data.sql b/scripts/0.0.1/data/1_update_user_data.sql similarity index 100% rename from scripts/1_update_user_data.sql rename to scripts/0.0.1/data/1_update_user_data.sql diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/.vscode/launch.json b/scripts/0.0.1/data/工具脚本(无需执行)/.vscode/launch.json new file mode 100644 index 00000000..3a3fcba2 --- /dev/null +++ b/scripts/0.0.1/data/工具脚本(无需执行)/.vscode/launch.json @@ -0,0 +1,17 @@ +{ + // 使用 IntelliSense 了解相关属性。 + // 悬停以查看现有属性的描述。 + // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "node", + "request": "launch", + "name": "启动程序", + "skipFiles": [ + "/**" + ], + "program": "${workspaceFolder}\\index.js" + } + ] +} \ No newline at end of file diff --git a/web/client/src/sections copy/example/actions/example.js b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/actions/example.js similarity index 100% rename from web/client/src/sections copy/example/actions/example.js rename to scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/actions/example.js diff --git a/web/client/src/sections copy/example/actions/index.js b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/actions/index.js similarity index 100% rename from web/client/src/sections copy/example/actions/index.js rename to scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/actions/index.js diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/example.js b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/example.js new file mode 100644 index 00000000..d38abe45 --- /dev/null +++ b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/example.js @@ -0,0 +1,53 @@ +import React, { useEffect, useState } from 'react'; +import { connect } from 'react-redux'; +import { Spin, Card } from 'antd'; +import Build from './footer/build' +import '../style.less'; +import Header from './heand'; +import Footer from './footer'; +import ProTable, { TableDropdown } from '@ant-design/pro-table'; + +const Example = (props) => { + const { dispatch, actions, user, loading } = props + const [tabKey, setTabKey] = useState('leadership') + + useEffect(() => { + dispatch(actions.example.getMembers(user.orgId)) + }, []) + const tabChange = (tab) => { + //leader 领导驾驶舱 site 工地 toilet 公厕 light 照明 water水质 encomic经济 environment 生态环境 security 智慧安监 + // setCurrentTab(tab); + setTabKey(tab) + // dispatch({ type: 'TAB-CHANGE', data: tab }) + } + + return ( + +
+
+
+
+
+
+
+
+
+ ) +} + +function mapStateToProps(state) { + const { auth, global, members } = state; + return { + loading: members.isRequesting, + user: auth.user, + actions: global.actions, + members: members.data + }; +} + +export default connect(mapStateToProps)(Example); diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/build/index.js b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/build/index.js new file mode 100644 index 00000000..1b0f3f0f --- /dev/null +++ b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/build/index.js @@ -0,0 +1,8 @@ +import React from 'react' + +const Build = () => { + return ( + <>Build + ) +} +export default Build diff --git a/web/client/src/sections/quanju/containers/footer/build/left.js b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/build/left.js similarity index 100% rename from web/client/src/sections/quanju/containers/footer/build/left.js rename to scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/build/left.js diff --git a/web/client/src/sections/quanju/containers/footer/build/right.js b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/build/right.js similarity index 100% rename from web/client/src/sections/quanju/containers/footer/build/right.js rename to scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/build/right.js diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/conserve/index.js b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/conserve/index.js new file mode 100644 index 00000000..e48f40cb --- /dev/null +++ b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/conserve/index.js @@ -0,0 +1,8 @@ +import React from 'react' + +const Conserve = () => { + return ( + <>1212121 + ) +} +export default Conserve \ No newline at end of file diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/guanli/index.js b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/guanli/index.js new file mode 100644 index 00000000..d20e2d29 --- /dev/null +++ b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/guanli/index.js @@ -0,0 +1,8 @@ +import React from 'react' + +const Guanli = () => { + return ( + <>管理 + ) +} +export default Guanli \ No newline at end of file diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/index.js b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/index.js new file mode 100644 index 00000000..485c6839 --- /dev/null +++ b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/index.js @@ -0,0 +1,29 @@ +import React from 'react' +import Build from './build' +import Conserve from './conserve' +import Guanli from './guanli' +import Leadership from './leadership' +import Operation from './operation' +const Footer = ({ tabKey }) => { + return ( + <> + { + (() => { + switch (tabKey) { + case 'build': + return + case 'conserve': + return + case "leadership": + return + case "guanli": + return + case "operation": + return + } + })() + } + + ) +} +export default Footer diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/centerLeft.js b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/centerLeft.js new file mode 100644 index 00000000..f5745538 --- /dev/null +++ b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/centerLeft.js @@ -0,0 +1,17 @@ +import React from 'react' +import Centerlefttop from "./centerleft/center-left-top" +import Centerleftcenter from "./centerleft/center-left-center" +import Centerleftcentertop from "./centerleft/center-left-centertop" +import Centerleftbottom from "./centerleft/center-left-bottom" + +const CenterLeft = () => { + return ( + <> +
+ + +
+ + ) +} +export default CenterLeft \ No newline at end of file diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/centerRight.js b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/centerRight.js new file mode 100644 index 00000000..4fb8cce5 --- /dev/null +++ b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/centerRight.js @@ -0,0 +1,19 @@ +import React from 'react' +import Centerrighttop from "./centerRight/center-right-top" +import Centerrightcenter from "./centerRight/center-right-center" +import CenterRightcentertop from "./centerRight/center-right-centertop" +import Centerrightbottom from "./centerRight/center-right-bottom" + +const CenterLeft = () => { + return ( + <> +
+ + + + +
+ + ) +} +export default CenterLeft \ No newline at end of file diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/centerRight/center-right-bottom.js b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/centerRight/center-right-bottom.js new file mode 100644 index 00000000..5a75b55b --- /dev/null +++ b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/centerRight/center-right-bottom.js @@ -0,0 +1,14 @@ +import React from 'react' +import Module from '../../../public/module' + +const Rightbottom = () => { + const style = { height: "33%" } + return ( + <> + +
+
+ + ) +} +export default Rightbottom \ No newline at end of file diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/centerRight/center-right-center.js b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/centerRight/center-right-center.js new file mode 100644 index 00000000..604b5330 --- /dev/null +++ b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/centerRight/center-right-center.js @@ -0,0 +1,14 @@ +import React from 'react' +import Module from '../../../public/module' + +const Rightcenter = () => { + const style = { height: "17%" } + return ( + <> + +
+
+ + ) +} +export default Rightcenter \ No newline at end of file diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/centerRight/center-right-centertop.js b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/centerRight/center-right-centertop.js new file mode 100644 index 00000000..71e56878 --- /dev/null +++ b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/centerRight/center-right-centertop.js @@ -0,0 +1,14 @@ +import React from 'react' +import Module from '../../../public/module' + +const Rightcentertop = () => { + const style = { height: "23%" } + return ( + <> + +
+
+ + ) +} +export default Rightcentertop \ No newline at end of file diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/centerRight/center-right-top.js b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/centerRight/center-right-top.js new file mode 100644 index 00000000..722a855d --- /dev/null +++ b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/centerRight/center-right-top.js @@ -0,0 +1,15 @@ +import React from 'react' +import Module from '../../../public/module' + +const Righttop = (props) => { + const { } = props + const style = { height: "17%" } + return ( + <> + +
+
+ + ) +} +export default Righttop \ No newline at end of file diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/centerleft/center-left-bottom.js b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/centerleft/center-left-bottom.js new file mode 100644 index 00000000..cd33b97d --- /dev/null +++ b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/centerleft/center-left-bottom.js @@ -0,0 +1,14 @@ +import React from 'react' +import Module from '../../../public/module' + +const Leftbottom = () => { + const style = { height: "23%", marginTop: "5%" } + return ( + <> + +
+
+ + ) +} +export default Leftbottom \ No newline at end of file diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/centerleft/center-left-center.js b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/centerleft/center-left-center.js new file mode 100644 index 00000000..08ff5043 --- /dev/null +++ b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/centerleft/center-left-center.js @@ -0,0 +1,16 @@ +import React from 'react' +import Module from '../../../public/module' + +const Leftcenter = () => { + const style = { + height: "23%" + } + return ( + <> + +
+
+ + ) +} +export default Leftcenter \ No newline at end of file diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/centerleft/center-left-centertop.js b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/centerleft/center-left-centertop.js new file mode 100644 index 00000000..393e3164 --- /dev/null +++ b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/centerleft/center-left-centertop.js @@ -0,0 +1,14 @@ +import React from 'react' +import Module from '../../../public/module' + +const Leftcentertop = () => { + const style = { height: "23%" } + return ( + <> + +
+
+ + ) +} +export default Leftcentertop \ No newline at end of file diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/centerleft/center-left-top.js b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/centerleft/center-left-top.js new file mode 100644 index 00000000..9c7e922c --- /dev/null +++ b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/centerleft/center-left-top.js @@ -0,0 +1,15 @@ +import React from 'react' +import Module from '../../../public/module' + +const Lefttop = (props) => { + const { } = props + const style = { height: "23%" } + return ( + <> + +
+
+ + ) +} +export default Lefttop \ No newline at end of file diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/index.js b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/index.js new file mode 100644 index 00000000..cbd1980a --- /dev/null +++ b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/index.js @@ -0,0 +1,18 @@ +import React from 'react' +import Left from './left' +import Right from './right' +import CenterLeft from "./centerLeft" +import Centerright from "./centerRight" + +const Leadership = () => { + return ( + <> + + + + {/* */} + + + ) +} +export default Leadership \ No newline at end of file diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/left.js b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/left.js new file mode 100644 index 00000000..5461c2fc --- /dev/null +++ b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/left.js @@ -0,0 +1,17 @@ +import React from 'react' +import Lefttop from './left/left-top' +import Leftcenter from "./left/left-center" +import Leftbottom from './left/left-bottom' + +const Left = () => { + return ( + <> +
+ + + +
+ + ) +} +export default Left \ No newline at end of file diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/left/left-bottom.js b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/left/left-bottom.js new file mode 100644 index 00000000..bd992c86 --- /dev/null +++ b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/left/left-bottom.js @@ -0,0 +1,14 @@ +import React from 'react' +import Module from '../../../public/module' + +const Leftbottom = () => { + const style = { height: "25%", marginTop: "5%" } + return ( + <> + + + + + ) +} +export default Leftbottom \ No newline at end of file diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/left/left-center.js b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/left/left-center.js new file mode 100644 index 00000000..767e2d38 --- /dev/null +++ b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/left/left-center.js @@ -0,0 +1,14 @@ +import React from 'react' +import Module from '../../../public/module' + +const Leftcenter = () => { + const style = { height: "30%", marginTop: "5%" } + return ( + <> + +
+
+ + ) +} +export default Leftcenter \ No newline at end of file diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/left/left-top.js b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/left/left-top.js new file mode 100644 index 00000000..14af9db5 --- /dev/null +++ b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/left/left-top.js @@ -0,0 +1,14 @@ +import React from 'react' +import Module from '../../../public/module' + +const Lefttop = () => { + const style = { height: "25%" } + return ( + <> + + {/*
*/} +
+ + ) +} +export default Lefttop \ No newline at end of file diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/right.js b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/right.js new file mode 100644 index 00000000..d690515f --- /dev/null +++ b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/right.js @@ -0,0 +1,16 @@ +import React from 'react' +import Righttop from './right/right-top' +import Rightcenter from './right/right-center' +import Rightbottom from './right/right-bottom' + +const Right = () => { + return ( + <> +
+ + +
+ + ) +} +export default Right \ No newline at end of file diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/right/right-bottom.js b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/right/right-bottom.js new file mode 100644 index 00000000..f6a8aa24 --- /dev/null +++ b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/right/right-bottom.js @@ -0,0 +1,14 @@ +import React from 'react' +import Module from '../../../public/module' + +const Rightbottom = () => { + const style = { height: "45%", marginTop: "5%" } + return ( + <> + +
+
+ + ) +} +export default Rightbottom \ No newline at end of file diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/right/right-center.js b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/right/right-center.js new file mode 100644 index 00000000..609facf8 --- /dev/null +++ b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/right/right-center.js @@ -0,0 +1,9 @@ +import React from 'react' + +const Rightcenter = () => { + return ( + <>
+
+ ) +} +export default Rightcenter \ No newline at end of file diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/right/right-top.js b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/right/right-top.js new file mode 100644 index 00000000..d1955b88 --- /dev/null +++ b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/leadership/right/right-top.js @@ -0,0 +1,13 @@ +import React from 'react' +import Module from '../../../public/module' + +const Righttop = () => { + const style = { height: "45%" } + return ( + <> + + + + ) +} +export default Righttop \ No newline at end of file diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/operation/index.js b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/operation/index.js new file mode 100644 index 00000000..c8b81208 --- /dev/null +++ b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/footer/operation/index.js @@ -0,0 +1,8 @@ +import React from 'react' + +const Operation = () => { + return ( + <>运营 + ) +} +export default Operation \ No newline at end of file diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/heand/index.js b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/heand/index.js new file mode 100644 index 00000000..339ff20a --- /dev/null +++ b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/heand/index.js @@ -0,0 +1,40 @@ +import React, { useState, uesEffect } from 'react' +import { push } from 'react-router-redux'; +import "./style.less" +import { Tabs } from 'antd'; + + +const { TabPane } = Tabs; +const Header = (props) => { + const { dispatch, tabChange, tabKey } = props + // const [tab, setTad] = useState("base") + const onClick = (tab) => { + // setTad({ tab }) + tabChange(tab) + } + const dianji = () => { + dispatch(push('/fillion/infor')) + } + return ( +
+ +
{ + onClick("build") + }}>建设
+
{ + onClick("conserve") + }}>养护
+
{ + onClick("leadership") + }}>领导驾驶舱
+
{ + onClick("guanli") + }}>管理
+
{ + onClick("operation") + }}>运营
+
dianji()}>南昌县运输交通总局
+
+ ) +} +export default Header diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/heand/style.less b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/heand/style.less new file mode 100644 index 00000000..7beaadfe --- /dev/null +++ b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/heand/style.less @@ -0,0 +1,23 @@ +.tabKey-map{ + width: 12%; + height: 45px; + text-align: center; + position: absolute; + top: 30px; + a{ + color: #c3d4f5; + line-height: 45px; + } +} +.notabKey{ + width:12%; + height: 45px; + position: absolute; + top: 30px; + text-align: center; + a{ + color: #6593c6; + line-height: 45px; + } + +} \ No newline at end of file diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/index.js b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/index.js new file mode 100644 index 00000000..a4321ad0 --- /dev/null +++ b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/index.js @@ -0,0 +1,6 @@ +'use strict'; + +import Example from './example'; +import Build from './footer/build' + +export { Example, Build }; \ No newline at end of file diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/public/font.css b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/public/font.css new file mode 100644 index 00000000..5a30fb99 --- /dev/null +++ b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/public/font.css @@ -0,0 +1,4 @@ +@font-face { + font-family: "YouSheBiaoTiHei"; + src: url("/assets/fontziti/YouSheBiaoTiHei-2.ttf") format("truetype"); + } \ No newline at end of file diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/public/module.js b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/public/module.js new file mode 100644 index 00000000..29682c4e --- /dev/null +++ b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/containers/public/module.js @@ -0,0 +1,22 @@ +import React from 'react' +import "./font.css" + +const Module = (props) => { + const { style, children, title } = props + return ( + <> +
+
+ {/*

{title || []}

*/} + + {title || []} + +
+
+ {children} +
+
+ + ) +} +export default Module \ No newline at end of file diff --git a/web/client/src/sections copy/example/index.js b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/index.js similarity index 92% rename from web/client/src/sections copy/example/index.js rename to scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/index.js index 92c4b452..c7296b0c 100644 --- a/web/client/src/sections copy/example/index.js +++ b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/index.js @@ -6,7 +6,7 @@ import actions from './actions'; import { getNavItem } from './nav-item'; export default { - key: 'example', + key: 'example2', name: '书写示例', reducers: reducers, routes: routes, diff --git a/web/client/src/sections copy/example/nav-item.js b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/nav-item.js similarity index 69% rename from web/client/src/sections copy/example/nav-item.js rename to scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/nav-item.js index 845c1aa1..74bdd2a2 100644 --- a/web/client/src/sections copy/example/nav-item.js +++ b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/nav-item.js @@ -7,9 +7,9 @@ const SubMenu = Menu.SubMenu; export function getNavItem(user, dispatch) { return ( - } title={'举个栗子'}> + } title={'举个栗子'}> - 举个棒子 + 举个棒子2 ); diff --git a/web/client/src/sections copy/example/reducers/index.js b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/reducers/index.js similarity index 100% rename from web/client/src/sections copy/example/reducers/index.js rename to scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/reducers/index.js diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/routes.js b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/routes.js new file mode 100644 index 00000000..cb7dd73a --- /dev/null +++ b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/routes.js @@ -0,0 +1,21 @@ +'use strict'; +import { Example, Build } from './containers'; + +export default [{ + type: 'outer', + route: { + path: '/quanju', + key: 'quanju', + breadcrumb: '栗子222', + exact: false, + component: Example, + // 不设置 component 则面包屑禁止跳转 + // childRoutes: [{ + // path: '/e2', + // key: 'e2', + // exact: false, + // component: Build, + // breadcrumb: '棒子', + // }] + } +}]; \ No newline at end of file diff --git a/web/client/src/sections copy/example/style.less b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/style.less similarity index 100% rename from web/client/src/sections copy/example/style.less rename to scripts/0.0.1/data/工具脚本(无需执行)/data/道路/quanju/style.less diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/乡道第三方.xls b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/乡道第三方.xls new file mode 100644 index 00000000..577906e9 Binary files /dev/null and b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/乡道第三方.xls differ diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/县道第三方.xls b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/县道第三方.xls new file mode 100644 index 00000000..0e3a1aa7 Binary files /dev/null and b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/县道第三方.xls differ diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/村道第三方.xls b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/村道第三方.xls new file mode 100644 index 00000000..9a7dc066 Binary files /dev/null and b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/村道第三方.xls differ diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/index.js b/scripts/0.0.1/data/工具脚本(无需执行)/index.js new file mode 100644 index 00000000..fe631f25 --- /dev/null +++ b/scripts/0.0.1/data/工具脚本(无需执行)/index.js @@ -0,0 +1,126 @@ +try { + const { Pool, Client } = require('pg') + const request = require('superagent'); + const Hex = require('crypto-js/enc-hex'); + const MD5 = require('crypto-js/md5'); + const XLSX = require('xlsx') + const path = require('path') + const fs = require("fs"); + + // 连接数据库 + const pool = new Pool({ + user: 'FashionAdmin', + host: '10.8.30.156', + database: 'SmartEmergency', + password: '123456', + port: 5432, + }) + + let appid = '20200917000567738'; + let key = 'xXm4jsuuD38JIkkhEcK6'; + const getAnswer = async (query) => { + let start = (new Date()).getTime(); + let salt = start; + let str1 = appid + query + salt + key; + let sign = Hex.stringify(MD5(str1)); + console.log(`翻译:${query}`); + let answer = await request.get('http://api.fanyi.baidu.com/api/trans/vip/translate').timeout(1000 * 30).query({ + q: query, + appid: appid, + salt: salt, + from: 'zh', + to: 'en', + sign: sign + }); + if (answer.body.error_code) { + console.warn(answer.body); + throw '百度不给力,快快debug' + } + let rslt = answer.body.trans_result; + // let upperCaseRslt = rslt[0].dst.toLowerCase().replace(/( |^)[a-z]/g, (L) => L.toUpperCase()).replace(/ /g, ''); + // let upperCaseRslt = rslt[0].dst.toUpperCase().replace(/ /g, '_'); + // let upperCaseRslt = rslt[0].dst.toLowerCase().replace(/ /g, '_'); + let upperCaseRslt = rslt[0].dst.replace(/\//g, ' ').replace(/'/g, '').replace(/\s{2,}/g, ''); + console.log(`翻译结果:${upperCaseRslt}`); + while (((new Date()).getTime() - start) < (1000 / 8)) {//每s只能调用10次 + continue; + } + return upperCaseRslt + } + + const fun = async () => { + // note: we don't try/catch this because if connecting throws an exception + // we don't need to dispose of the client (it will be undefined) + const client = await pool.connect() + try { + await client.query('BEGIN') + + const fileList = [ + // { + // path: './data/道路/乡道第三方.xls', + // n: '道路', + // tableName: 'road' + // }, + ] + + for (let f of fileList) { + console.log(`读取 ${f.path}`); + // 读取数据文件 + let workbook = XLSX.readFile(path.join(__dirname, f.path)) + let firstSheetName = workbook.SheetNames[0]; + let worksheet = workbook.Sheets[firstSheetName]; + let res = XLSX.utils.sheet_to_json(worksheet); + console.log(res[0]); + let dataEx = res[0]; + transResult = '' + sql = ` + -- ${f.n} + create table if not exists "${f.tableName}" + ( + id serial not null + ); + + create unique index if not exists ${f.tableName}_id_uindex + on ${f.tableName} (id); + + alter table ${f.tableName} + add constraint ${f.tableName}_pk + primary key (id); + ` + let upperEngTArr = [] + for (let t in dataEx) { + const engT = await getAnswer(t); + let upperEngT = engT + .replace(/( |^)[a-z]/g, (L) => L.toUpperCase()) + .replace(/ /g, '_') + + transResult += `"${t}" : "${upperEngT + .replace(/_/g, '') + .replace(/( |^)[A-Z]/g, (L) => L.toLowerCase()) + }", \n + ` + sql += ` + alter table ${f.tableName} add ${upperEngT} varchar(1024); + comment on column ${f.tableName}.${upperEngT} is '${t}'; + ` + } + fs.writeFileSync(`${f.n}_字段对应.json`, `{${transResult}}`, 'utf-8'); + // fs.writeFileSync(`${f.n}_数据脚本对应.sql`, sql, 'utf-8'); + } + + // await client.query('ROLLBACK') + await client.query('COMMIT') + console.log('执行完毕~') + } catch (e) { + await client.query('ROLLBACK') + console.log('执行错误~') + throw e + } finally { + client.release(); + } + } + + fun() +} catch (error) { + console.error(error) +} diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/package.json b/scripts/0.0.1/data/工具脚本(无需执行)/package.json new file mode 100644 index 00000000..5bcaed1a --- /dev/null +++ b/scripts/0.0.1/data/工具脚本(无需执行)/package.json @@ -0,0 +1,18 @@ +{ + "name": "appkey-generator", + "version": "1.0.0", + "description": "tool", + "main": "index.js", + "scripts": { + "test": "mocha", + "start": "set NODE_ENV=development&&node index" + }, + "author": "liu", + "license": "ISC", + "dependencies": { + "crypto-js": "^4.1.1", + "pg": "^7.18.2", + "superagent": "^8.0.0", + "xlsx": "^0.17.1" + } +} diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/道路_字段对应.json b/scripts/0.0.1/data/工具脚本(无需执行)/道路_字段对应.json new file mode 100644 index 00000000..0fb97a7f --- /dev/null +++ b/scripts/0.0.1/data/工具脚本(无需执行)/道路_字段对应.json @@ -0,0 +1,50 @@ +{ + "路线名称": "routeName", + "路线代码": "routeCode", + "路段序号": "sectionNo", + "乡镇编码": "townshipCode", + "起点地名": "startingPlaceName", + "起点桩号": "startStation", + "起点分界点类别": "categoryOfStartingPointAndDividingPoint", + "止点地名": "stopPlaceName", + "止点分界点类别": "categoryOfDeadCenterAndDividingPoint", + "止点桩号": "stopStation", + "路段类型": "sectionType", + "路段性质": "natureOfRoadSection", + "建成时间": "completionTime", + "GBM及文明样板路": "gBMAndCivilizedModelRoad", + "地貌": "landforms", + "收费性质": "natureOfCharges", + "涵洞数量": "numberOfCulverts", + "技术等级": "technicalLevel", + "路面类型": "pavementType", + "路面宽度": "pavementWidth", + "路基宽度": "subgradeWidth", + "车道特征": "laneCharacteristics", + "是否晴雨通车": "whetherItIsOpenToTrafficInSunnyOrRainyDays", + "设计时速": "designSpeedPerHour", + "是否城管路段": "urbanManagementSectionOrNot", + "管养单位": "managementAndMaintenanceUnit", + "路政管理单位": "roadAdministrationUnit", + "列养情况": "alimentation", + "列养资金来源": "sourceOfListedMaintenanceFunds", + "养护时间": "curingTime", + "可绿化里程": "greeningMileage", + "已绿化里程": "greeningMileaged", + "重复道路路段类型": "typeOfRepeatedRoadSection", + "重复路段序号": "serialNumberOfRepeatedSection", + "重复路段路线编码": "repeatedSectionRouteCode", + "填报单位": "reportingUnit", + "变更原因": "reasonForChange", + "变更时间": "changeTime", + "是否按干线公路管理接养": "whetherMaintenanceManagedHighway", + "备注": "remarks", + "上年路线编码": "routeCodeOfLastYear", + "上年路线名称": "routeNameOfLastYear", + "上年起点桩号": "startingStationOfLastYear", + "上年止点桩号": "lastYearsEndingPointStakeNumber", + "图形里程": "graphicMileage", + "桩号里程": "chainageMileage", + "所在区县": "districtcounty", + "所在地市": "locationCity" +} \ No newline at end of file diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/道路_数据脚本对应.sql b/scripts/0.0.1/data/工具脚本(无需执行)/道路_数据脚本对应.sql new file mode 100644 index 00000000..5b8392bb --- /dev/null +++ b/scripts/0.0.1/data/工具脚本(无需执行)/道路_数据脚本对应.sql @@ -0,0 +1,54 @@ +-- 道路 + +CREATE TABLE if not exists "road" ( id serial not null ); + +CREATE unique index if not exists road_id_uindex +ON road (id); alter TABLE road add constraint road_pk primary key (id); alter TABLE road add Route_Name varchar(1024); comment +ON column road.Route_Name is '路线名称'; alter TABLE road add Route_Code varchar(1024); comment +ON column road.Route_Code is '路线代码'; alter TABLE road add Section_No varchar(1024); comment +ON column road.Section_No is '路段序号'; alter TABLE road add Township_Code varchar(1024); comment +ON column road.Township_Code is '乡镇编码'; alter TABLE road add Starting_Place_Name varchar(1024); comment +ON column road.Starting_Place_Name is '起点地名'; alter TABLE road add Start_Station varchar(1024); comment +ON column road.Start_Station is '起点桩号'; alter TABLE road add Category_Of_Starting_Point_And_Dividing_Point varchar(1024); comment +ON column road.Category_Of_Starting_Point_And_Dividing_Point is '起点分界点类别'; alter TABLE road add Stop_Place_Name varchar(1024); comment +ON column road.Stop_Place_Name is '止点地名'; alter TABLE road add Category_Of_Dead_Center_And_Dividing_Point varchar(1024); comment +ON column road.Category_Of_Dead_Center_And_Dividing_Point is '止点分界点类别'; alter TABLE road add Stop_Station varchar(1024); comment +ON column road.Stop_Station is '止点桩号'; alter TABLE road add Section_Type varchar(1024); comment +ON column road.Section_Type is '路段类型'; alter TABLE road add Nature_Of_Road_Section varchar(1024); comment +ON column road.Nature_Of_Road_Section is '路段性质'; alter TABLE road add Completion_Time varchar(1024); comment +ON column road.Completion_Time is '建成时间'; alter TABLE road add GBM_And_Civilized_Model_Road varchar(1024); comment +ON column road.GBM_And_Civilized_Model_Road is 'GBM及文明样板路'; alter TABLE road add Landforms varchar(1024); comment +ON column road.Landforms is '地貌'; alter TABLE road add Nature_Of_Charges varchar(1024); comment +ON column road.Nature_Of_Charges is '收费性质'; alter TABLE road add Number_Of_Culverts varchar(1024); comment +ON column road.Number_Of_Culverts is '涵洞数量'; alter TABLE road add Technical_Level varchar(1024); comment +ON column road.Technical_Level is '技术等级'; alter TABLE road add Pavement_Type varchar(1024); comment +ON column road.Pavement_Type is '路面类型'; alter TABLE road add Pavement_Width varchar(1024); comment +ON column road.Pavement_Width is '路面宽度'; alter TABLE road add Subgrade_Width varchar(1024); comment +ON column road.Subgrade_Width is '路基宽度'; alter TABLE road add Lane_Characteristics varchar(1024); comment +ON column road.Lane_Characteristics is '车道特征'; alter TABLE road add Whether_It_Is_Open_To_Traffic_In_Sunny_Or_Rainy_Days varchar(1024); comment +ON column road.Whether_It_Is_Open_To_Traffic_In_Sunny_Or_Rainy_Days is '是否晴雨通车'; alter TABLE road add Design_Speed_Per_Hour varchar(1024); comment +ON column road.Design_Speed_Per_Hour is '设计时速'; alter TABLE road add Urban_Management_Section_Or_Not varchar(1024); comment +ON column road.Urban_Management_Section_Or_Not is '是否城管路段'; alter TABLE road add Management_And_Maintenance_Unit varchar(1024); comment +ON column road.Management_And_Maintenance_Unit is '管养单位'; alter TABLE road add Road_Administration_Unit varchar(1024); comment +ON column road.Road_Administration_Unit is '路政管理单位'; alter TABLE road add Alimentation varchar(1024); comment +ON column road.Alimentation is '列养情况'; alter TABLE road add Source_Of_Listed_Maintenance_Funds varchar(1024); comment +ON column road.Source_Of_Listed_Maintenance_Funds is '列养资金来源'; alter TABLE road add Curing_Time_ varchar(1024); comment +ON column road.Curing_Time_ is '养护时间'; alter TABLE road add Greening_Mileage varchar(1024); comment +ON column road.Greening_Mileage is '可绿化里程'; alter TABLE road add Greening_Mileaged varchar(1024); comment +ON column road.Greening_Mileaged is '已绿化里程'; alter TABLE road add Type_Of_Repeated_Road_Section varchar(1024); comment +ON column road.Type_Of_Repeated_Road_Section is '重复道路路段类型'; alter TABLE road add Serial_Number_Of_Repeated_Section varchar(1024); comment +ON column road.Serial_Number_Of_Repeated_Section is '重复路段序号'; alter TABLE road add Repeated_Section_Route_Code varchar(1024); comment +ON column road.Repeated_Section_Route_Code is '重复路段路线编码'; alter TABLE road add Reporting_Unit varchar(1024); comment +ON column road.Reporting_Unit is '填报单位'; alter TABLE road add Reason_For_Change varchar(1024); comment +ON column road.Reason_For_Change is '变更原因'; alter TABLE road add Change_Time varchar(1024); comment +ON column road.Change_Time is '变更时间'; alter TABLE road add Whether_Maintenance_Managed_Highway varchar(1024); comment +ON column road.Whether_Maintenance_Managed_Highway is '是否按干线公路管理接养'; alter TABLE road add Remarks varchar(1024); comment +ON column road.Remarks is '备注'; alter TABLE road add Route_Code_Of_Last_Year varchar(1024); comment +ON column road.Route_Code_Of_Last_Year is '上年路线编码'; alter TABLE road add Route_Name_Of_Last_Year varchar(1024); comment +ON column road.Route_Name_Of_Last_Year is '上年路线名称'; alter TABLE road add Starting_Station_Of_Last_Year varchar(1024); comment +ON column road.Starting_Station_Of_Last_Year is '上年起点桩号'; alter TABLE road add Last_Years_Ending_Point_Stake_Number varchar(1024); comment +ON column road.Last_Years_Ending_Point_Stake_Number is '上年止点桩号'; alter TABLE road add Graphic_Mileage varchar(1024); comment +ON column road.Graphic_Mileage is '图形里程'; alter TABLE road add Chainage_Mileage varchar(1024); comment +ON column road.Chainage_Mileage is '桩号里程'; alter TABLE road add Districtcounty varchar(1024); comment +ON column road.Districtcounty is '所在区县'; alter TABLE road add Location_City varchar(1024); comment +ON column road.Location_City is '所在地市'; \ No newline at end of file diff --git a/weapp/src/app.config.js b/weapp/src/app.config.js index 2bee0a0c..7bbd532a 100644 --- a/weapp/src/app.config.js +++ b/weapp/src/app.config.js @@ -23,7 +23,7 @@ export default { 'pagePath': 'pages/home/index', 'iconPath': 'static/img/tabbar/shouye.png', 'selectedIconPath': 'static/img/tabbar/shouye-active.png', - 'text': '巡查' + 'text': '首页' }, { 'pagePath': 'pages/user/index', diff --git a/web/client/assets/color.less b/web/client/assets/color.less index ff4253c6..fb497618 100644 --- a/web/client/assets/color.less +++ b/web/client/assets/color.less @@ -174,7 +174,7 @@ button::-moz-focus-inner, [type='submit']::-moz-focus-inner {border-style: none;} fieldset {border: 0;} legend {color: inherit;} -mark {background-color: color(~`colorPalette("@{skeleton-to-color}", 1)`);} +mark {background-color: color(~`colorPalette("@{table-fixed-header-sort-active-bg}", 1)`);} ::selection {color: #fff;background: @primary-color;} .anticon {color: inherit;} .ant-fade-enter, .ant-fade-appear {animation-fill-mode: both;} @@ -555,6 +555,18 @@ html {--antd-wave-shadow-color: @primary-color;} .ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled], .ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:hover, .ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:focus, .ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:active {color: @disabled-color;border-color: @border-color-base;background: @disabled-bg;box-shadow: none;} .ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled] > a:only-child, .ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:hover > a:only-child, .ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:focus > a:only-child, .ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:active > a:only-child {color: currentcolor;} .ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled] > a:only-child::after, .ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:hover > a:only-child::after, .ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:focus > a:only-child::after, .ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:active > a:only-child::after {background: transparent;} +a.ant-btn-disabled, +a.ant-btn-disabled:hover, +a.ant-btn-disabled:focus, +a.ant-btn-disabled:active {color: @disabled-color;border-color: transparent;background: transparent;box-shadow: none;} +a.ant-btn-disabled > a:only-child, +a.ant-btn-disabled:hover > a:only-child, +a.ant-btn-disabled:focus > a:only-child, +a.ant-btn-disabled:active > a:only-child {color: currentcolor;} +a.ant-btn-disabled > a:only-child::after, +a.ant-btn-disabled:hover > a:only-child::after, +a.ant-btn-disabled:focus > a:only-child::after, +a.ant-btn-disabled:active > a:only-child::after {background: transparent;} .ant-btn-group-rtl.ant-btn-group .ant-btn-primary:last-child:not(:first-child), .ant-btn-group-rtl.ant-btn-group .ant-btn-primary + .ant-btn-primary {border-right-color: color(~`colorPalette("@{primary-color}", 5)`);border-left-color: @border-color-base;} .ant-btn-group-rtl.ant-btn-group .ant-btn-primary:last-child:not(:first-child)[disabled], .ant-btn-group-rtl.ant-btn-group .ant-btn-primary + .ant-btn-primary[disabled] {border-right-color: @border-color-base;border-left-color: color(~`colorPalette("@{primary-color}", 5)`);} .ant-picker-calendar {color: @text-color;background: @calendar-full-bg;} @@ -589,7 +601,6 @@ html {--antd-wave-shadow-color: @primary-color;} .ant-card-type-inner .ant-card-head {background: @background-color-light;} .ant-card-meta-title {color: @heading-color;} .ant-card-meta-description {color: @text-color-secondary;} -.ant-card-loading-block {background: linear-gradient(90deg, fade(@card-skeleton-bg, 20%), fade(@card-skeleton-bg, 40%), fade(@card-skeleton-bg, 20%));background-size: 600% 600%;border-radius: 2px;} .ant-carousel {color: @text-color;} .ant-carousel .slick-slider {-webkit-tap-highlight-color: transparent;} .ant-carousel .slick-prev, .ant-carousel .slick-next {color: transparent;background: transparent;border: 0;} @@ -663,8 +674,10 @@ html {--antd-wave-shadow-color: @primary-color;} .ant-comment-actions > li > span:hover {color: @comment-action-hover-color;} .ant-picker-status-error.ant-picker, .ant-picker-status-error.ant-picker:not([disabled]):hover {background-color: @input-bg;border-color: #ff4d4f;} .ant-picker-status-error.ant-picker-focused, .ant-picker-status-error.ant-picker:focus {border-color: #ff7875;box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.2);border-right-width: 1px;} +.ant-picker-status-error.ant-picker .ant-picker-active-bar {background: #ff7875;} .ant-picker-status-warning.ant-picker, .ant-picker-status-warning.ant-picker:not([disabled]):hover {background-color: @input-bg;border-color: #faad14;} .ant-picker-status-warning.ant-picker-focused, .ant-picker-status-warning.ant-picker:focus {border-color: #ffc53d;box-shadow: 0 0 0 2px rgba(250, 173, 20, 0.2);border-right-width: 1px;} +.ant-picker-status-warning.ant-picker .ant-picker-active-bar {background: #ffc53d;} .ant-picker {color: @text-color;background: @picker-bg;border: 1px solid @border-color-base;border-radius: 2px;} .ant-picker:hover, .ant-picker-focused {border-color: color(~`colorPalette("@{primary-color}", 5)`);border-right-width: 1px;} .ant-input-rtl .ant-picker:hover, .ant-input-rtl .ant-picker-focused {border-right-width: 0;border-left-width: 1px !important;} @@ -695,7 +708,7 @@ html {--antd-wave-shadow-color: @primary-color;} .ant-picker-range .ant-picker-active-bar {background: @primary-color;} .ant-picker-dropdown {color: @text-color;} .ant-picker-ranges .ant-picker-preset > .ant-tag-blue {color: @primary-color;background: color(~`colorPalette("@{primary-color}", 1)`);border-color: color(~`colorPalette("@{primary-color}", 3)`);} -.ant-picker-range-arrow {background: linear-gradient(135deg, transparent 40%, @calendar-bg 40%);box-shadow: 2px 2px 6px -2px rgba(0, 0, 0, 0.1);border-radius: 0 0 2px;} +.ant-picker-range-arrow {box-shadow: 2px 2px 6px -2px rgba(0, 0, 0, 0.1);border-radius: 0 0 2px;} .ant-picker-range-arrow::before {background: @calendar-bg;background-repeat: no-repeat;background-position: -10px -10px;} .ant-picker-panel-container {background: @calendar-bg;border-radius: 2px;box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05);} .ant-picker-panel-container .ant-picker-panel {background: transparent;border-width: 0 0 1px 0;border-radius: 0;} @@ -801,7 +814,7 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte .ant-dropdown-menu-item.ant-dropdown-menu-item-danger {color: #ff4d4f;} .ant-dropdown-menu-item.ant-dropdown-menu-item-danger:hover {color: #fff;background-color: #ff4d4f;} .ant-dropdown {color: @text-color;} -.ant-dropdown-arrow {background: linear-gradient(135deg, transparent 40%, @popover-bg 40%);border-radius: 0 0 2px;} +.ant-dropdown-arrow {border-radius: 0 0 2px;} .ant-dropdown-arrow::before {background: @popover-bg;background-repeat: no-repeat;background-position: -10px -10px;} .ant-dropdown-placement-top > .ant-dropdown-arrow, .ant-dropdown-placement-topLeft > .ant-dropdown-arrow, .ant-dropdown-placement-topRight > .ant-dropdown-arrow {box-shadow: 3px 3px 7px -3px rgba(0, 0, 0, 0.1);} .ant-dropdown-placement-bottom > .ant-dropdown-arrow, .ant-dropdown-placement-bottomLeft > .ant-dropdown-arrow, .ant-dropdown-placement-bottomRight > .ant-dropdown-arrow {box-shadow: 2px 2px 5px -2px rgba(0, 0, 0, 0.1);} @@ -936,7 +949,7 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte .ant-input-group.ant-input-group-compact .ant-input-group-wrapper:not(:last-child).ant-input-search > .ant-input-group > .ant-input {border-radius: 2px 0 0 2px;} .ant-input-group > .ant-input-rtl:first-child, .ant-input-group-rtl .ant-input-group-addon:first-child {border-radius: 0 2px 2px 0;} .ant-input-group-rtl .ant-input-group-addon:first-child {border-right: 1px solid @border-color-base;border-left: 0;} -.ant-input-group-rtl .ant-input-group-addon:last-child {border-right: 0;border-left: 1px solid @border-color-base;} +.ant-input-group-rtl .ant-input-group-addon:last-child {border-right: 0;border-left: 1px solid @border-color-base;border-radius: 2px 0 0 2px;} .ant-input-group-rtl.ant-input-group > .ant-input:last-child, .ant-input-group-rtl.ant-input-group-addon:last-child {border-radius: 2px 0 0 2px;} .ant-input-group-rtl.ant-input-group .ant-input-affix-wrapper:not(:first-child) {border-radius: 2px 0 0 2px;} .ant-input-group-rtl.ant-input-group .ant-input-affix-wrapper:not(:last-child) {border-radius: 0 2px 2px 0;} @@ -944,6 +957,10 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte .ant-input-group-rtl.ant-input-group.ant-input-group-compact > *:first-child, .ant-input-group-rtl.ant-input-group.ant-input-group-compact > .ant-select:first-child > .ant-select-selector, .ant-input-group-rtl.ant-input-group.ant-input-group-compact > .ant-select-auto-complete:first-child .ant-input, .ant-input-group-rtl.ant-input-group.ant-input-group-compact > .ant-cascader-picker:first-child .ant-input {border-radius: 0 2px 2px 0;} .ant-input-group-rtl.ant-input-group.ant-input-group-compact > *:last-child, .ant-input-group-rtl.ant-input-group.ant-input-group-compact > .ant-select:last-child > .ant-select-selector, .ant-input-group-rtl.ant-input-group.ant-input-group-compact > .ant-select-auto-complete:last-child .ant-input, .ant-input-group-rtl.ant-input-group.ant-input-group-compact > .ant-cascader-picker:last-child .ant-input, .ant-input-group-rtl.ant-input-group.ant-input-group-compact > .ant-cascader-picker-focused:last-child .ant-input {border-left-width: 1px;border-radius: 2px 0 0 2px;} .ant-input-group.ant-input-group-compact .ant-input-group-wrapper-rtl:not(:last-child).ant-input-search > .ant-input-group > .ant-input {border-radius: 0 2px 2px 0;} +.ant-input-group > .ant-input-rtl:first-child {border-radius: 0 2px 2px 0;} +.ant-input-group > .ant-input-rtl:last-child {border-radius: 2px 0 0 2px;} +.ant-input-group-rtl .ant-input-group-addon:first-child {border-right: 1px solid @border-color-base;border-left: 0;border-radius: 0 2px 2px 0;} +.ant-input-group-rtl .ant-input-group-addon:last-child {border-right: 0;border-left: 1px solid @border-color-base;border-radius: 2px 0 0 2px;} .ant-input-password-icon.anticon {color: @text-color-secondary;} .ant-input-password-icon.anticon:hover {color: @input-icon-hover-color;} .ant-input-textarea-show-count::after {color: @text-color-secondary;} @@ -1029,7 +1046,7 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte .ant-input-number-group.ant-input-number-group-compact .ant-input-group-wrapper:not(:last-child).ant-input-search > .ant-input-group > .ant-input {border-radius: 2px 0 0 2px;} .ant-input-number-group > .ant-input-number-rtl:first-child, .ant-input-number-group-rtl .ant-input-number-group-addon:first-child {border-radius: 0 2px 2px 0;} .ant-input-number-group-rtl .ant-input-number-group-addon:first-child {border-right: 1px solid @border-color-base;border-left: 0;} -.ant-input-number-group-rtl .ant-input-number-group-addon:last-child {border-right: 0;border-left: 1px solid @border-color-base;} +.ant-input-number-group-rtl .ant-input-number-group-addon:last-child {border-right: 0;border-left: 1px solid @border-color-base;border-radius: 2px 0 0 2px;} .ant-input-number-group-rtl.ant-input-number-group > .ant-input-number:last-child, .ant-input-number-group-rtl.ant-input-number-group-addon:last-child {border-radius: 2px 0 0 2px;} .ant-input-number-group-rtl.ant-input-number-group .ant-input-number-affix-wrapper:not(:first-child) {border-radius: 2px 0 0 2px;} .ant-input-number-group-rtl.ant-input-number-group .ant-input-number-affix-wrapper:not(:last-child) {border-radius: 0 2px 2px 0;} @@ -1037,6 +1054,10 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte .ant-input-number-group-rtl.ant-input-number-group.ant-input-number-group-compact > *:first-child, .ant-input-number-group-rtl.ant-input-number-group.ant-input-number-group-compact > .ant-select:first-child > .ant-select-selector, .ant-input-number-group-rtl.ant-input-number-group.ant-input-number-group-compact > .ant-select-auto-complete:first-child .ant-input, .ant-input-number-group-rtl.ant-input-number-group.ant-input-number-group-compact > .ant-cascader-picker:first-child .ant-input {border-radius: 0 2px 2px 0;} .ant-input-number-group-rtl.ant-input-number-group.ant-input-number-group-compact > *:last-child, .ant-input-number-group-rtl.ant-input-number-group.ant-input-number-group-compact > .ant-select:last-child > .ant-select-selector, .ant-input-number-group-rtl.ant-input-number-group.ant-input-number-group-compact > .ant-select-auto-complete:last-child .ant-input, .ant-input-number-group-rtl.ant-input-number-group.ant-input-number-group-compact > .ant-cascader-picker:last-child .ant-input, .ant-input-number-group-rtl.ant-input-number-group.ant-input-number-group-compact > .ant-cascader-picker-focused:last-child .ant-input {border-left-width: 1px;border-radius: 2px 0 0 2px;} .ant-input-number-group.ant-input-number-group-compact .ant-input-group-wrapper-rtl:not(:last-child).ant-input-search > .ant-input-group > .ant-input {border-radius: 0 2px 2px 0;} +.ant-input-number-group > .ant-input-number-rtl:first-child {border-radius: 0 2px 2px 0;} +.ant-input-number-group > .ant-input-number-rtl:last-child {border-radius: 2px 0 0 2px;} +.ant-input-number-group-rtl .ant-input-number-group-addon:first-child {border-right: 1px solid @border-color-base;border-left: 0;border-radius: 0 2px 2px 0;} +.ant-input-number-group-rtl .ant-input-number-group-addon:last-child {border-right: 0;border-left: 1px solid @border-color-base;border-radius: 2px 0 0 2px;} .ant-input-number-handler {color: @text-color-secondary;border-left: 1px solid @border-color-base;} .ant-input-number-handler:active {background: @input-number-handler-active-bg;} .ant-input-number-handler:hover .ant-input-number-handler-up-inner, .ant-input-number-handler:hover .ant-input-number-handler-down-inner {color: color(~`colorPalette("@{primary-color}", 5)`);} @@ -1292,8 +1313,8 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte .ant-pagination-simple .ant-pagination-simple-pager input:hover {border-color: @primary-color;} .ant-pagination-simple .ant-pagination-simple-pager input:focus {border-color: color(~`colorPalette("@{primary-color}", 5)`);box-shadow: 0 0 0 2px fade(@primary-color, 20%);} .ant-pagination-simple .ant-pagination-simple-pager input[disabled] {color: @disabled-color;background: @disabled-bg;border-color: @border-color-base;} -.ant-pagination.mini .ant-pagination-item:not(.ant-pagination-item-active) {background: transparent;border-color: transparent;} -.ant-pagination.mini .ant-pagination-prev .ant-pagination-item-link, .ant-pagination.mini .ant-pagination-next .ant-pagination-item-link {background: transparent;border-color: transparent;} +.ant-pagination.ant-pagination-mini .ant-pagination-item:not(.ant-pagination-item-active) {background: transparent;border-color: transparent;} +.ant-pagination.ant-pagination-mini .ant-pagination-prev .ant-pagination-item-link, .ant-pagination.ant-pagination-mini .ant-pagination-next .ant-pagination-item-link {background: transparent;border-color: transparent;} .ant-pagination.ant-pagination-disabled .ant-pagination-item {background: @disabled-bg;border-color: @border-color-base;} .ant-pagination.ant-pagination-disabled .ant-pagination-item a {color: @disabled-color;background: transparent;border: none;} .ant-pagination.ant-pagination-disabled .ant-pagination-item-active {background: @pagination-item-disabled-bg-active;} @@ -1309,8 +1330,8 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte .ant-popover-message {color: @text-color;} .ant-popover-message > .anticon {color: #faad14;} .ant-popover-arrow {background: transparent;} -.ant-popover-arrow-content {background-color: @popover-bg;border-radius: 0 0 2px;} -.ant-popover-arrow-content::before {background: @popover-bg;background-repeat: no-repeat;background-position: -10px -10px;} +.ant-popover-arrow-content {--antd-arrow-background-color: @popover-bg;border-radius: 0 0 2px;} +.ant-popover-arrow-content::before {background: var(--antd-arrow-background-color);background-repeat: no-repeat;background-position: -10px -10px;} .ant-popover-placement-top .ant-popover-arrow-content, .ant-popover-placement-topLeft .ant-popover-arrow-content, .ant-popover-placement-topRight .ant-popover-arrow-content {box-shadow: 3px 3px 7px rgba(0, 0, 0, 0.07);} .ant-popover-placement-right .ant-popover-arrow-content, .ant-popover-placement-rightTop .ant-popover-arrow-content, .ant-popover-placement-rightBottom .ant-popover-arrow-content {box-shadow: 3px 3px 7px rgba(0, 0, 0, 0.07);} .ant-popover-placement-bottom .ant-popover-arrow-content, .ant-popover-placement-bottomLeft .ant-popover-arrow-content, .ant-popover-placement-bottomRight .ant-popover-arrow-content {box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.06);} @@ -1366,12 +1387,13 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte .ant-radio-wrapper {color: @text-color;} .ant-radio {color: @text-color;} .ant-radio-wrapper:hover .ant-radio, .ant-radio:hover .ant-radio-inner, .ant-radio-input:focus + .ant-radio-inner {border-color: @primary-color;} -.ant-radio-input:focus + .ant-radio-inner {box-shadow: 0 0 0 3px color(~`colorPalette("@{primary-color}", 1)`);} +.ant-radio-input:focus + .ant-radio-inner {box-shadow: 0 0 0 3px fade(@primary-color, 12%);} .ant-radio-checked::after {border: 1px solid @primary-color;border-radius: 50%;animation-fill-mode: both;} .ant-radio-inner {background-color: @btn-default-bg;border-color: @border-color-base;border-style: solid;border-width: 1px;border-radius: 50%;} .ant-radio-inner::after {background-color: @primary-color;border-top: 0;border-left: 0;border-radius: 16px;} +.ant-radio.ant-radio-disabled .ant-radio-inner {border-color: @border-color-base;} .ant-radio-checked .ant-radio-inner {border-color: @primary-color;} -.ant-radio-disabled .ant-radio-inner {background-color: @disabled-bg;border-color: @border-color-base !important;} +.ant-radio-disabled .ant-radio-inner {background-color: @disabled-bg;} .ant-radio-disabled .ant-radio-inner::after {background-color: @radio-dot-disabled-color;} .ant-radio-disabled + span {color: @disabled-color;} .ant-radio-button-wrapper {color: @text-color;background: @btn-default-bg;border: 1px solid @border-color-base;border-top-width: 1.02px;border-left-width: 0;} @@ -1381,7 +1403,7 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte .ant-radio-button-wrapper:last-child {border-radius: 0 2px 2px 0;} .ant-radio-button-wrapper:first-child:last-child {border-radius: 2px;} .ant-radio-button-wrapper:hover {color: @primary-color;} -.ant-radio-button-wrapper:focus-within {box-shadow: 0 0 0 3px color(~`colorPalette("@{primary-color}", 1)`);} +.ant-radio-button-wrapper:focus-within {box-shadow: 0 0 0 3px fade(@primary-color, 12%);} .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled) {color: @primary-color;background: @btn-default-bg;border-color: @primary-color;} .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled)::before {background-color: @primary-color;} .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):first-child {border-color: @primary-color;} @@ -1389,11 +1411,11 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):hover::before {background-color: color(~`colorPalette("@{primary-color}", 5)`);} .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):active {color: color(~`colorPalette("@{primary-color}", 7)`);border-color: color(~`colorPalette("@{primary-color}", 7)`);} .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):active::before {background-color: color(~`colorPalette("@{primary-color}", 7)`);} -.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):focus-within {box-shadow: 0 0 0 3px color(~`colorPalette("@{primary-color}", 1)`);} +.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):focus-within {box-shadow: 0 0 0 3px fade(@primary-color, 12%);} .ant-radio-group-solid .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled) {color: @radio-solid-checked-color;background: @primary-color;border-color: @primary-color;} .ant-radio-group-solid .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):hover {color: @radio-solid-checked-color;background: color(~`colorPalette("@{primary-color}", 5)`);border-color: color(~`colorPalette("@{primary-color}", 5)`);} .ant-radio-group-solid .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):active {color: @radio-solid-checked-color;background: color(~`colorPalette("@{primary-color}", 7)`);border-color: color(~`colorPalette("@{primary-color}", 7)`);} -.ant-radio-group-solid .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):focus-within {box-shadow: 0 0 0 3px color(~`colorPalette("@{primary-color}", 1)`);} +.ant-radio-group-solid .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):focus-within {box-shadow: 0 0 0 3px fade(@primary-color, 12%);} .ant-radio-button-wrapper-disabled {color: @disabled-color;background-color: @disabled-bg;border-color: @border-color-base;} .ant-radio-button-wrapper-disabled:first-child, .ant-radio-button-wrapper-disabled:hover {color: @disabled-color;background-color: @disabled-bg;border-color: @border-color-base;} .ant-radio-button-wrapper-disabled:first-child {border-left-color: @border-color-base;} @@ -1460,14 +1482,11 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte .ant-skeleton-header .ant-skeleton-avatar.ant-skeleton-avatar-circle {border-radius: 50%;} .ant-skeleton-header .ant-skeleton-avatar-lg.ant-skeleton-avatar-circle {border-radius: 50%;} .ant-skeleton-header .ant-skeleton-avatar-sm.ant-skeleton-avatar-circle {border-radius: 50%;} -.ant-skeleton-content .ant-skeleton-title {background: @skeleton-color;border-radius: 4px;} -.ant-skeleton-content .ant-skeleton-paragraph > li {background: @skeleton-color;border-radius: 4px;} +.ant-skeleton-content .ant-skeleton-title {background: @skeleton-color;border-radius: 2px;} +.ant-skeleton-content .ant-skeleton-paragraph > li {background: @skeleton-color;border-radius: 2px;} .ant-skeleton-round .ant-skeleton-content .ant-skeleton-title, .ant-skeleton-round .ant-skeleton-content .ant-skeleton-paragraph > li {border-radius: 100px;} -.ant-skeleton.ant-skeleton-active .ant-skeleton-content .ant-skeleton-title, .ant-skeleton.ant-skeleton-active .ant-skeleton-content .ant-skeleton-paragraph > li {background: linear-gradient(90deg, @skeleton-color 25%, @skeleton-to-color 37%, @skeleton-color 63%);background-size: 400% 100%;} -.ant-skeleton.ant-skeleton-active .ant-skeleton-avatar {background: linear-gradient(90deg, @skeleton-color 25%, @skeleton-to-color 37%, @skeleton-color 63%);background-size: 400% 100%;} -.ant-skeleton.ant-skeleton-active .ant-skeleton-button {background: linear-gradient(90deg, @skeleton-color 25%, @skeleton-to-color 37%, @skeleton-color 63%);background-size: 400% 100%;} -.ant-skeleton.ant-skeleton-active .ant-skeleton-input {background: linear-gradient(90deg, @skeleton-color 25%, @skeleton-to-color 37%, @skeleton-color 63%);background-size: 400% 100%;} -.ant-skeleton.ant-skeleton-active .ant-skeleton-image {background: linear-gradient(90deg, @skeleton-color 25%, @skeleton-to-color 37%, @skeleton-color 63%);background-size: 400% 100%;} +.ant-skeleton-active .ant-skeleton-title, .ant-skeleton-active .ant-skeleton-paragraph > li, .ant-skeleton-active .ant-skeleton-avatar, .ant-skeleton-active .ant-skeleton-button, .ant-skeleton-active .ant-skeleton-input, .ant-skeleton-active .ant-skeleton-image {background: transparent;} +.ant-skeleton-active .ant-skeleton-title::after, .ant-skeleton-active .ant-skeleton-paragraph > li::after, .ant-skeleton-active .ant-skeleton-avatar::after, .ant-skeleton-active .ant-skeleton-button::after, .ant-skeleton-active .ant-skeleton-input::after, .ant-skeleton-active .ant-skeleton-image::after {background: linear-gradient(90deg, @skeleton-color 25%, @skeleton-to-color 37%, @skeleton-color 63%);} .ant-skeleton-element .ant-skeleton-button {background: @skeleton-color;border-radius: 2px;} .ant-skeleton-element .ant-skeleton-button.ant-skeleton-button-circle {border-radius: 50%;} .ant-skeleton-element .ant-skeleton-button.ant-skeleton-button-round {border-radius: 32px;} @@ -1584,7 +1603,7 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte .ant-table.ant-table-bordered.ant-table-scroll-horizontal > .ant-table-container > .ant-table-body > table > tbody > tr.ant-table-expanded-row > td, .ant-table.ant-table-bordered.ant-table-scroll-horizontal > .ant-table-container > .ant-table-body > table > tbody > tr.ant-table-placeholder > td {border-right: 0;} .ant-table.ant-table-bordered > .ant-table-footer {border: 1px solid @border-color-split;border-top: 0;} .ant-table-cell .ant-table-container:first-child {border-top: 0;} -.ant-table-cell-scrollbar {box-shadow: 0 1px 0 1px @table-header-bg;} +.ant-table-cell-scrollbar:not([rowspan]) {box-shadow: 0 1px 0 1px @table-header-bg;} .ant-table {color: @text-color;background: @component-background;border-radius: 2px;} .ant-table table {border-radius: 2px 2px 0 0;border-collapse: separate;border-spacing: 0;} .ant-table-footer {color: @heading-color;background: @background-color-light;} @@ -1635,10 +1654,10 @@ tr.ant-table-expanded-row:hover > td {background: @table-expanded-row-bg;} .ant-table-empty .ant-table-tbody > tr.ant-table-placeholder {color: @disabled-color;} .ant-table-tbody > tr.ant-table-placeholder:hover > td {background: @component-background;} .ant-table-cell-fix-left, .ant-table-cell-fix-right {background: @component-background;} -.ant-table-ping-left:not(.ant-table-has-fix-left) .ant-table-container::before {box-shadow: inset 10px 0 8px -8px darken(@shadow-color, 5%);} +.ant-table-ping-left:not(.ant-table-has-fix-left) > .ant-table-container::before {box-shadow: inset 10px 0 8px -8px darken(@shadow-color, 5%);} .ant-table-ping-left .ant-table-cell-fix-left-first::after, .ant-table-ping-left .ant-table-cell-fix-left-last::after {box-shadow: inset 10px 0 8px -8px darken(@shadow-color, 5%);} .ant-table-ping-left .ant-table-cell-fix-left-last::before {background-color: transparent !important;} -.ant-table-ping-right:not(.ant-table-has-fix-right) .ant-table-container::after {box-shadow: inset -10px 0 8px -8px darken(@shadow-color, 5%);} +.ant-table-ping-right:not(.ant-table-has-fix-right) > .ant-table-container::after {box-shadow: inset -10px 0 8px -8px darken(@shadow-color, 5%);} .ant-table-ping-right .ant-table-cell-fix-right-first::after, .ant-table-ping-right .ant-table-cell-fix-right-last::after {box-shadow: inset -10px 0 8px -8px darken(@shadow-color, 5%);} .ant-table-sticky-holder {background: @component-background;} .ant-table-sticky-scroll {background: lighten(@table-border-color, 80%);border-top: 1px solid @border-color-split;} @@ -1647,6 +1666,7 @@ tr.ant-table-expanded-row:hover > td {background: @table-expanded-row-bg;} .ant-table-sticky-scroll-bar-active {background-color: fade(@table-sticky-scroll-bar-bg, 80%);} .ant-table-title {border-radius: 2px 2px 0 0;} .ant-table-title + .ant-table-container {border-top-left-radius: 0;border-top-right-radius: 0;} +.ant-table-title + .ant-table-container table {border-radius: 0;} .ant-table-title + .ant-table-container table > thead > tr:first-child th:first-child {border-radius: 0;} .ant-table-title + .ant-table-container table > thead > tr:first-child th:last-child {border-radius: 0;} .ant-table-container {border-top-left-radius: 2px;border-top-right-radius: 2px;} @@ -1710,23 +1730,23 @@ tr.ant-table-expanded-row:hover > td {background: @table-expanded-row-bg;} .ant-tag-red-inverse {color: #fff;background: #f5222d;border-color: #f5222d;} .ant-tag-volcano {color: #d4380d;background: #fff2e8;border-color: #ffbb96;} .ant-tag-volcano-inverse {color: #fff;background: #fa541c;border-color: #fa541c;} -.ant-tag-orange {color: #d46b08;background: color(~`colorPalette("@{select-background}", 3)`);border-color: #ffd591;} +.ant-tag-orange {color: #d46b08;background: #fff7e6;border-color: #ffd591;} .ant-tag-orange-inverse {color: #fff;background: #fa8c16;border-color: #fa8c16;} -.ant-tag-yellow {color: #d4b106;background: color(~`colorPalette("@{skeleton-to-color}", 1)`);border-color: #fffb8f;} +.ant-tag-yellow {color: #d4b106;background: color(~`colorPalette("@{table-fixed-header-sort-active-bg}", 1)`);border-color: #fffb8f;} .ant-tag-yellow-inverse {color: #fff;background: #fadb14;border-color: #fadb14;} .ant-tag-gold {color: #d48806;background: #fffbe6;border-color: #ffe58f;} .ant-tag-gold-inverse {color: #fff;background: #faad14;border-color: #faad14;} -.ant-tag-cyan {color: #08979c;background: color(~`colorPalette("@{comment-author-time-color}", 3)`);border-color: #87e8de;} +.ant-tag-cyan {color: #08979c;background: color(~`colorPalette("@{avatar-bg}", 1)`);border-color: #87e8de;} .ant-tag-cyan-inverse {color: #fff;background: #13c2c2;border-color: #13c2c2;} -.ant-tag-lime {color: #7cb305;background: color(~`colorPalette("@{item-active-bg}", 1)`);border-color: #eaff8f;} +.ant-tag-lime {color: #7cb305;background: #fcffe6;border-color: #eaff8f;} .ant-tag-lime-inverse {color: #fff;background: #a0d911;border-color: #a0d911;} .ant-tag-green {color: #389e0d;background: #f6ffed;border-color: #b7eb8f;} .ant-tag-green-inverse {color: #fff;background: #52c41a;border-color: #52c41a;} -.ant-tag-blue {color: #096dd9;background: #e6f7ff;border-color: #91d5ff;} +.ant-tag-blue {color: #096dd9;background: color(~`colorPalette("@{radio-dot-disabled-color}", 1)`);border-color: #91d5ff;} .ant-tag-blue-inverse {color: #fff;background: #1890ff;border-color: #1890ff;} -.ant-tag-geekblue {color: #1d39c4;background: color(~`colorPalette("@{modal-content-bg}", 1)`);border-color: #adc6ff;} +.ant-tag-geekblue {color: #1d39c4;background: color(~`colorPalette("@{descriptions-bg}", 2)`);border-color: #adc6ff;} .ant-tag-geekblue-inverse {color: #fff;background: #2f54eb;border-color: #2f54eb;} -.ant-tag-purple {color: #531dab;background: color(~`colorPalette("@{disabled-color}", 2)`);border-color: #d3adf7;} +.ant-tag-purple {color: #531dab;background: color(~`colorPalette("@{calendar-bg}", 1)`);border-color: #d3adf7;} .ant-tag-purple-inverse {color: #fff;background: #722ed1;border-color: #722ed1;} .ant-tag-success {color: #52c41a;background: @success-color-deprecated-bg;border-color: @success-color-deprecated-border;} .ant-tag-processing {color: @primary-color;background: @info-color-deprecated-bg;border-color: @info-color-deprecated-border;} @@ -1749,7 +1769,7 @@ tr.ant-table-expanded-row:hover > td {background: @table-expanded-row-bg;} .ant-tooltip {color: @text-color;} .ant-tooltip-inner {color: #fff;background-color: @tooltip-bg;border-radius: 2px;box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05);} .ant-tooltip-arrow {background: transparent;} -.ant-tooltip-arrow-content {--antd-arrow-background-color: linear-gradient(to right bottom, fadeout(@tooltip-bg, 10%), @tooltip-bg);background-color: transparent;border-radius: 0 0 2px;} +.ant-tooltip-arrow-content {--antd-arrow-background-color: linear-gradient(to right bottom, fadeout(@tooltip-bg, 10%), @tooltip-bg);border-radius: 0 0 2px;} .ant-tooltip-arrow-content::before {background: var(--antd-arrow-background-color);background-repeat: no-repeat;background-position: -10px -10px;} .ant-tooltip-placement-top .ant-tooltip-arrow-content, .ant-tooltip-placement-topLeft .ant-tooltip-arrow-content, .ant-tooltip-placement-topRight .ant-tooltip-arrow-content {box-shadow: 3px 3px 7px rgba(0, 0, 0, 0.07);} .ant-tooltip-placement-right .ant-tooltip-arrow-content, .ant-tooltip-placement-rightTop .ant-tooltip-arrow-content, .ant-tooltip-placement-rightBottom .ant-tooltip-arrow-content {box-shadow: -3px 3px 7px rgba(0, 0, 0, 0.07);} @@ -1939,6 +1959,7 @@ a.ant-typography.ant-typography-disabled:hover, .ant-typography a.ant-typography .ant-typography pre code {background: transparent;border: 0;} .ant-typography blockquote {border-left: 4px solid rgba(100, 100, 100, 0.2);} .ant-upload {color: @text-color;} +.ant-upload.ant-upload-disabled {color: @disabled-color;} .ant-upload.ant-upload-select-picture-card {background-color: @background-color-light;border: 1px dashed @border-color-base;border-radius: 2px;} .ant-upload.ant-upload-select-picture-card:hover {border-color: @primary-color;} .ant-upload-disabled.ant-upload.ant-upload-select-picture-card:hover {border-color: @border-color-base;} @@ -1963,13 +1984,12 @@ a.ant-typography.ant-typography-disabled:hover, .ant-typography a.ant-typography .ant-upload-list-picture .ant-upload-list-item-error, .ant-upload-list-picture-card .ant-upload-list-item-error {border-color: #ff4d4f;} .ant-upload-list-picture .ant-upload-list-item:hover .ant-upload-list-item-info, .ant-upload-list-picture-card .ant-upload-list-item:hover .ant-upload-list-item-info {background: transparent;} .ant-upload-list-picture .ant-upload-list-item-uploading, .ant-upload-list-picture-card .ant-upload-list-item-uploading {border-style: dashed;} -.ant-upload-list-picture .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill='#e6f7ff'], .ant-upload-list-picture-card .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill='#e6f7ff'] {fill: @error-color-deprecated-bg;} +.ant-upload-list-picture .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill='color(~`colorPalette("@{radio-dot-disabled-color}", 1)`)'], .ant-upload-list-picture-card .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill='color(~`colorPalette("@{radio-dot-disabled-color}", 1)`)'] {fill: @error-color-deprecated-bg;} .ant-upload-list-picture .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill='#1890ff'], .ant-upload-list-picture-card .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill='#1890ff'] {fill: #ff4d4f;} .ant-upload-list-picture-card .ant-upload-list-item-info::before {background-color: rgba(0, 0, 0, 0.5);} .ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-eye, .ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-download, .ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-delete {color: rgba(255, 255, 255, 0.85);} .ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-eye:hover, .ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-download:hover, .ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-delete:hover {color: #fff;} .ant-upload-list-picture-card .ant-upload-list-item-uploading.ant-upload-list-item {background-color: @background-color-light;} -.ant-upload-list .ant-upload-animate-inline-appear, .ant-upload-list .ant-upload-animate-inline-enter, .ant-upload-list .ant-upload-animate-inline-leave {animation-fill-mode: cubic-bezier(0.78, 0.14, 0.15, 0.86);} .ant-pro-table-search {background-color: @component-background !important;} .bezierEasingMixin() { @functions: ~`(function() {var NEWTON_ITERATIONS = 4;var NEWTON_MIN_SLOPE = 0.001;var SUBDIVISION_PRECISION = 0.0000001;var SUBDIVISION_MAX_ITERATIONS = 10;var kSplineTableSize = 11;var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);var float32ArraySupported = typeof Float32Array === 'function';function A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; } @@ -2419,7 +2439,8 @@ this.tinycolor = tinycolor;})()`;} .colorPaletteMixin() { @functions: ~`(function() {var hueStep = 2;var saturationStep = 0.16;var saturationStep2 = 0.05;var brightnessStep1 = 0.05;var brightnessStep2 = 0.15;var lightColorCount = 5;var darkColorCount = 4;var getHue = function(hsv, i, isLight) {var hue;if (hsv.h >= 60 && hsv.h <= 240) {hue = isLight ? hsv.h - hueStep * i : hsv.h + hueStep * i;} else {hue = isLight ? hsv.h + hueStep * i : hsv.h - hueStep * i;} if (hue < 0) {hue += 360;} else if (hue >= 360) {hue -= 360;} - return Math.round(hue);};var getSaturation = function(hsv, i, isLight) {var saturation;if (isLight) {saturation = hsv.s - saturationStep * i;} else if (i === darkColorCount) {saturation = hsv.s + saturationStep;} else {saturation = hsv.s + saturationStep2 * i;} + return Math.round(hue);};var getSaturation = function(hsv, i, isLight) {if (hsv.h === 0 && hsv.s === 0) {return hsv.s;} + var saturation;if (isLight) {saturation = hsv.s - saturationStep * i;} else if (i === darkColorCount) {saturation = hsv.s + saturationStep;} else {saturation = hsv.s + saturationStep2 * i;} if (saturation > 1) {saturation = 1;} if (isLight && i === lightColorCount && saturation > 0.1) {saturation = 0.1;} if (saturation < 0.06) {saturation = 0.06;} @@ -2876,7 +2897,7 @@ this.tinycolor = tinycolor;})()`;} @cascader-dropdown-line-height: @dropdown-line-height; @anchor-bg: transparent; @anchor-border-color: @border-color-split; -@anchor-link-top: 7px; +@anchor-link-top: 4px; @anchor-link-left: 16px; @anchor-link-padding: @anchor-link-top 0 @anchor-link-top @anchor-link-left; @tooltip-max-width: 250px; @@ -2901,7 +2922,7 @@ this.tinycolor = tinycolor;})()`;} @modal-header-border-style: @border-style-base; @modal-header-title-line-height: 22px; @modal-header-title-font-size: @font-size-lg; -@modal-header-close-size: 56px; +@modal-header-close-size: @modal-header-title-line-height + 2 * @modal-header-padding-vertical; @modal-heading-color: @heading-color; @modal-close-color: @text-color-secondary; @modal-footer-bg: transparent; @@ -2912,6 +2933,7 @@ this.tinycolor = tinycolor;})()`;} @modal-mask-bg: fade(@black, 45%); @modal-confirm-body-padding: 32px 32px 24px; @modal-confirm-title-font-size: @font-size-lg; +@modal-border-radius: @border-radius-base; @progress-default-color: @processing-color; @progress-remaining-color: @background-color-base; @progress-info-text-color: @progress-text-color; diff --git a/web/client/src/sections copy/auth/actions/auth.js b/web/client/src/sections copy/auth/actions/auth.js deleted file mode 100644 index 95e112b4..00000000 --- a/web/client/src/sections copy/auth/actions/auth.js +++ /dev/null @@ -1,69 +0,0 @@ -'use strict'; - -import { ApiTable } from '$utils' -import { Request } from '@peace/utils' - -export const INIT_AUTH = 'INIT_AUTH'; -export function initAuth() { - const user = JSON.parse(sessionStorage.getItem('user')) || {}; - return { - type: INIT_AUTH, - payload: { - user: user - } - }; -} - -export const REQUEST_LOGIN = 'REQUEST_LOGIN'; -export const LOGIN_SUCCESS = 'LOGIN_SUCCESS'; -export const LOGIN_ERROR = 'LOGIN_ERROR'; -export function login(username, password) { - return dispatch => { - dispatch({ type: REQUEST_LOGIN }); - - if (!username || !password) { - dispatch({ - type: LOGIN_ERROR, - payload: { error: '请输入账号名和密码' } - }); - return Promise.resolve(); - } - - const url = ApiTable.login; - return Request.post(url, { username, password, p: '456' }) - .then(user => { - sessionStorage.setItem('user', JSON.stringify(user)); - dispatch({ - type: LOGIN_SUCCESS, - payload: { user: user }, - }); - }, error => { - let { body } = error.response; - dispatch({ - type: LOGIN_ERROR, - payload: { - error: body && body.message ? body.message : '登录失败' - } - }) - }); - } -} - -export const LOGOUT = 'LOGOUT'; -export function logout(user) { - const token = user.token; - const url = ApiTable.logout; - sessionStorage.removeItem('user'); - Request.put(url, { - token: token - }); - return { - type: LOGOUT - }; -} - -export default { - initAuth, - login, - logout -} \ No newline at end of file diff --git a/web/client/src/sections copy/auth/actions/index.js b/web/client/src/sections copy/auth/actions/index.js deleted file mode 100644 index d44996ec..00000000 --- a/web/client/src/sections copy/auth/actions/index.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Created by liu.xinyi - * on 2016/4/1. - */ -'use strict'; -import auth from './auth'; - -export default { - ...auth -}; \ No newline at end of file diff --git a/web/client/src/sections copy/auth/containers/index.js b/web/client/src/sections copy/auth/containers/index.js deleted file mode 100644 index 9229b945..00000000 --- a/web/client/src/sections copy/auth/containers/index.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; -import Login from './login'; - -export { Login }; \ No newline at end of file diff --git a/web/client/src/sections copy/auth/containers/login.js b/web/client/src/sections copy/auth/containers/login.js deleted file mode 100644 index 4bca2741..00000000 --- a/web/client/src/sections copy/auth/containers/login.js +++ /dev/null @@ -1,108 +0,0 @@ -'use strict'; -import React, { useState, useEffect } from 'react'; -import { connect } from 'react-redux'; -import { push } from 'react-router-redux'; -import { Button, Input, Form, Row, Col, message } from 'antd'; -import { login } from '../actions/auth'; -import './style.less'; - -const FormItem = Form.Item; -const Login = props => { - const { dispatch, user, error, isRequesting } = props - const [username, setUserName] = useState('') - const [password, setPassword] = useState('') - const [inputChanged, setInputChanged] = useState(false) - - useEffect(() => { - - }, []) - - useEffect(() => { - if (error) { - message.error(error); - setPassword('') - } - }, [error]) - - useEffect(() => { - user && user.authorized ? dispatch(push('/fillion/infor')) : null - }, [user]) - - const enterHandler = e => { - if (e.key === 'Enter') { - setInputChanged(false) - dispatch(login(username, password)); - } - }; - - - const handleLogin = () => { - let reg_user = "SuperAdmin"; - let reg_tel = /^1([358][0-9]|4[579]|66|7[0135678]|9[89])[0-9]{8}$/; //11位手机号码正则 - if (username == reg_user || reg_tel.test(username)) { - setInputChanged(false) - dispatch(login(username, password)) - return - } - if (username == "" || password == "") { - setInputChanged(false) - dispatch(login(username, password)) - return - } - setInputChanged(false) - dispatch(login("12345678912564589", "123456789")) - } - - - return ( -
-
-
-
-

智慧应急

-
- - -
用户名
- { - setUserName(e.target.value) - setInputChanged(true) - }} - /> -
-
密码
- - { - setPassword(e.target.value) - setInputChanged(true) - }} - /> - -
- -
-
-
- ); -} - -function mapStateToProps(state) { - const { auth } = state; - return { - user: auth.user, - error: auth.error, - isRequesting: auth.isRequesting - } -} - -export default connect(mapStateToProps)(Login); \ No newline at end of file diff --git a/web/client/src/sections copy/auth/containers/style.less b/web/client/src/sections copy/auth/containers/style.less deleted file mode 100644 index 0a710814..00000000 --- a/web/client/src/sections copy/auth/containers/style.less +++ /dev/null @@ -1,81 +0,0 @@ -.login { - width: 100%; - height: 100%; - position: absolute; - top: 0; - left: 0; - - .left { - background-image: url('/assets/images/loginBg.jpg'); - background-size: 100% 100%; - background-repeat: no-repeat; - width: 55%; - height: 100%; - float: left; - top: 0px; - left: 0px; - } - - .right { - width: 45%; - height: 100%; - background-color: #000066; - float: left; - right: 0px; - bottom: 0px; - } -} - -@media screen and (max-height:1440px) { - .loginBox { - top: 25%; - } -} - -@media screen and (max-height: 768px) { - .loginBox { - top: 20%; - } -} - -@media screen and (max-height: 630px) { - .loginBox { - top: 10%; - } -} - -.loginBox { - height: 50%; - width: 25%; - position: absolute; - right: 6.5%; - z-index: 20; - - h1 { - color: #fff; - font-size: 58px; - } - - .loginFormTit { - width: 20%; - font-size: 18px; - color: rgb(255, 255, 255); - margin-bottom: 10px; - } - - .loginInp { - width: 80%; - height: 50px; - background: #ffffff; - border: 1px solid #C2C2C2; - border-radius: 5px; - } - - .loginBtn { - width: 80%; - height: 50px; - margin-top: 20px; - border-radius: 5px; - font-size: 16px; - } -} \ No newline at end of file diff --git a/web/client/src/sections copy/auth/index.js b/web/client/src/sections copy/auth/index.js deleted file mode 100644 index f8e40fbc..00000000 --- a/web/client/src/sections copy/auth/index.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -import routes from './routes'; -import reducers from './reducers'; -import actions from './actions'; - -export default { - key: 'auth', - reducers: reducers, - routes: routes, - actions: actions -}; \ No newline at end of file diff --git a/web/client/src/sections copy/auth/reducers/auth.js b/web/client/src/sections copy/auth/reducers/auth.js deleted file mode 100644 index edeebff8..00000000 --- a/web/client/src/sections copy/auth/reducers/auth.js +++ /dev/null @@ -1,40 +0,0 @@ -'use strict'; -import * as actionTypes from '../actions/auth'; -import Immutable from 'immutable'; - -const initState = { - user: {}, - isRequesting: false, - error: null -}; - -function auth(state = initState, action) { - const payload = action.payload; - switch (action.type){ - case actionTypes.INIT_AUTH: - return Immutable.fromJS(state).set('user', payload.user).toJS(); - case actionTypes.REQUEST_LOGIN: - return Immutable.fromJS(state).merge({ - isRequesting: true, - error: null - }).toJS(); - case actionTypes.LOGIN_SUCCESS: - return Immutable.fromJS(state).merge({ - isRequesting: false, - user: payload.user - }).toJS(); - case actionTypes.LOGIN_ERROR: - return Immutable.fromJS(state).merge({ - isRequesting: false, - error: payload.error - }).toJS(); - case actionTypes.LOGOUT: - return Immutable.fromJS(state).merge({ - user: null - }).toJS(); - default: - return state; - } -} - -export default auth; \ No newline at end of file diff --git a/web/client/src/sections copy/auth/reducers/index.js b/web/client/src/sections copy/auth/reducers/index.js deleted file mode 100644 index ba81f11c..00000000 --- a/web/client/src/sections copy/auth/reducers/index.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; -import auth from './auth' - -export default { - auth -}; \ No newline at end of file diff --git a/web/client/src/sections copy/auth/routes.js b/web/client/src/sections copy/auth/routes.js deleted file mode 100644 index ca844919..00000000 --- a/web/client/src/sections copy/auth/routes.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -import { Login } from './containers'; - -export default [{ - type: 'dapin', - route: { - key: 'signin', - path: "/signin", - component: Login - } -}]; \ No newline at end of file diff --git a/web/client/src/sections copy/example/containers/example.js b/web/client/src/sections copy/example/containers/example.js deleted file mode 100644 index 483cb1da..00000000 --- a/web/client/src/sections copy/example/containers/example.js +++ /dev/null @@ -1,43 +0,0 @@ -import React, { useEffect } from 'react'; -import { connect } from 'react-redux'; -import { Spin, Card } from 'antd'; -import '../style.less'; -import ProTable, { TableDropdown } from '@ant-design/pro-table'; - -const Example = (props) => { - const { dispatch, actions, user, loading } = props - - useEffect(() => { - dispatch(actions.example.getMembers(user.orgId)) - }, []) - - return ( - -
-

STYLE EXAMPLE

-
- - - -
- ) -} - -function mapStateToProps(state) { - const { auth, global, members } = state; - return { - loading: members.isRequesting, - user: auth.user, - actions: global.actions, - members: members.data - }; -} - -export default connect(mapStateToProps)(Example); diff --git a/web/client/src/sections copy/example/containers/index.js b/web/client/src/sections copy/example/containers/index.js deleted file mode 100644 index 19e6695d..00000000 --- a/web/client/src/sections copy/example/containers/index.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -import Example from './example'; - -export { Example }; \ No newline at end of file diff --git a/web/client/src/sections copy/example/routes.js b/web/client/src/sections copy/example/routes.js deleted file mode 100644 index 591e4ce8..00000000 --- a/web/client/src/sections copy/example/routes.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; -import { Example, } from './containers'; - -export default [{ - type: 'inner', - route: { - path: '/example', - key: 'example', - breadcrumb: '栗子', - // 不设置 component 则面包屑禁止跳转 - childRoutes: [{ - path: '/e1', - key: 'e1', - component: Example, - breadcrumb: '棒子', - }] - } -}]; \ No newline at end of file diff --git a/web/client/src/sections copy/fillion/actions/compile.js b/web/client/src/sections copy/fillion/actions/compile.js deleted file mode 100644 index b1cdd18c..00000000 --- a/web/client/src/sections copy/fillion/actions/compile.js +++ /dev/null @@ -1,37 +0,0 @@ -// 'use strict'; - -// import { basicAction } from '@peace/utils' -// import { ApiTable } from '$utils' - -// export function reportRectify (timeRange) { -// return dispatch => basicAction({ -// type: 'get', -// dispatch: dispatch, -// actionType: 'GET_REPORT_RECTIFY', -// url: `${ApiTable.getReportRectify}?startTime=${timeRange ? timeRange[0] : ''}&endTime=${timeRange ? timeRange[1] : ''}`, -// msg: {}, -// reducer: { name: 'reportRectify' } -// }); -// } - -// export function reportRectifyDetail (day, depId) { -// return dispatch => basicAction({ -// type: 'get', -// dispatch: dispatch, -// actionType: 'GET_REPORT_RECTIFY_DETAIL', -// url: `${ApiTable.getReportRectifyDetail}?day=${day}&depId=${depId}`, -// msg: {}, -// reducer: { name: 'reportRectifyDetail' } -// }); -// } - -// export function compileReportRectifyDetail (data) { -// return dispatch => basicAction({ -// type: 'post', -// dispatch: dispatch, -// data, -// actionType: 'COMPILE_REPORT_RECTIFY_DETAIL', -// url: `${ApiTable.compileReportRectifyDetail}`, -// msg: { option: '保存信息' }, -// }); -// } \ No newline at end of file diff --git a/web/client/src/sections copy/fillion/actions/config.js b/web/client/src/sections copy/fillion/actions/config.js deleted file mode 100644 index adf6ce97..00000000 --- a/web/client/src/sections copy/fillion/actions/config.js +++ /dev/null @@ -1,59 +0,0 @@ -// 'use strict'; - -// import { basicAction } from '@peace/utils' -// import { ApiTable } from '$utils' - -// export function allAreas (orgId) { -// return dispatch => basicAction({ -// type: 'get', -// dispatch: dispatch, -// actionType: 'GET_ALL_AREAS', -// url: `${ApiTable.allAreas}`, -// msg: {}, -// reducer: { name: 'allAreas' } -// }); -// } - -// export function addReportConfig (data) { -// return dispatch => basicAction({ -// type: 'post', -// dispatch: dispatch, -// data: data, -// actionType: 'POST_REPORT_CONFIGS', -// url: `${ApiTable.addReportConfig}`, -// msg: { option: '添加报表配置' }, -// }); -// } - -// export function getReportConfig () { -// return dispatch => basicAction({ -// type: 'get', -// dispatch: dispatch, -// actionType: 'GET_REPORT_CONFIGS', -// url: `${ApiTable.getReportConfig}`, -// msg: { error: '获取报表配置失败' }, -// reducer: { name: 'reportConfig' } -// }); -// } - -// export function editReportConfig (data, configId) { -// return dispatch => basicAction({ -// type: 'put', -// dispatch: dispatch, -// data: data, -// actionType: 'EDIT_REPORT_CONFIGS', -// url: `${ApiTable.editReportConfig.replace('{reportId}', configId)}`, -// msg: { option: '编辑报表配置' }, -// }); -// } - -// export function delReportConfig (configId) { -// return dispatch => basicAction({ -// type: 'del', -// dispatch: dispatch, -// actionType: 'DEL_REPORT_CONFIGS', -// url: `${ApiTable.delReportConfig.replace('{reportId}', configId)}`, -// msg: { option: '删除报表配置' }, -// }); -// } - diff --git a/web/client/src/sections copy/fillion/actions/index.js b/web/client/src/sections copy/fillion/actions/index.js deleted file mode 100644 index 0a9ea5a1..00000000 --- a/web/client/src/sections copy/fillion/actions/index.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -import * as infor from './infor' -export default { - ...infor, -} \ No newline at end of file diff --git a/web/client/src/sections copy/fillion/actions/infor.js b/web/client/src/sections copy/fillion/actions/infor.js deleted file mode 100644 index 17872957..00000000 --- a/web/client/src/sections copy/fillion/actions/infor.js +++ /dev/null @@ -1,24 +0,0 @@ -import { basicAction } from '@peace/utils' -import { ApiTable } from '$utils' - -export function getDepMessage() { - return dispatch => basicAction({ - type: 'get', - dispatch: dispatch, - actionType: 'GET_DEPARTMENT_MESSAGE', - url: ApiTable.getDepMessage, - msg: { error: '获取部门信息失败' }, - reducer: { name: 'depMessage' } - }); -} -export function getReportStatistic(query) { - return dispatch => basicAction({ - type: 'get', - dispatch: dispatch, - query: query, - actionType: 'GET_DEPARTMENT_STATIS', - url: ApiTable.getReportStatistic, - msg: { error: '获取填报信息失败' }, - reducer: { name: 'reportstatistic' } - }); -} \ No newline at end of file diff --git a/web/client/src/sections copy/fillion/components/compileDrawer.js b/web/client/src/sections copy/fillion/components/compileDrawer.js deleted file mode 100644 index 6c22aa9b..00000000 --- a/web/client/src/sections copy/fillion/components/compileDrawer.js +++ /dev/null @@ -1,118 +0,0 @@ -// import React, { useEffect, useState } from 'react'; -// import { connect } from 'react-redux'; -// import { Spin, Drawer, Button } from 'antd'; -// import '../style.less'; -// import { EditableProTable } from '@ant-design/pro-table'; - -// const CompileDrawer = (props) => { -// const { dispatch, actions, user, loading, visible, checkRow, close, reportRectifyDetail, checkAction } = props -// const [requesting, setRequesting] = useState(false) -// const [dataSource, setDataSource] = useState([]) -// const { report } = actions -// const isCheck = checkAction == 'check' - -// useEffect(() => { -// if (checkRow.day) { -// dispatch(report.reportRectifyDetail(checkRow.day, checkRow.depId)) -// } -// }, [checkRow]) - -// useEffect(() => { -// let data = reportRectifyDetail -// let i = 1 -// for (let d of data) { -// d.index_ = i++ -// } -// setDataSource(data) -// }, [reportRectifyDetail]) - -// return ( -// { -// close() -// }} -// visible={visible} -// width={'82%'} -// > -// -// r.id) -// }} -// toolBarRender={() => [ -// isCheck ? '' : -// -// ]} -// > - -// -// -// -// ) -// } - -// function mapStateToProps (state) { -// const { auth, global, members, reportRectifyDetail } = state; -// return { -// loading: reportRectifyDetail.isRequesting, -// user: auth.user, -// actions: global.actions, -// members: members.data, -// reportRectifyDetail: reportRectifyDetail.data || [] -// }; -// } - -// export default connect(mapStateToProps)(CompileDrawer); diff --git a/web/client/src/sections copy/fillion/components/configModal.js b/web/client/src/sections copy/fillion/components/configModal.js deleted file mode 100644 index f2ad4352..00000000 --- a/web/client/src/sections copy/fillion/components/configModal.js +++ /dev/null @@ -1,124 +0,0 @@ -// import React, { useEffect, useRef } from 'react'; -// import { connect } from 'react-redux'; -// import { Spin, Button, Modal, Form, Switch } from 'antd'; -// import ProForm, { ProFormText, ProFormSelect } from '@ant-design/pro-form'; -// import { useState } from 'react'; - -// const ConfigModal = (props) => { -// const { dispatch, actions, user, loading, visible, close, editData, allAreas, reportType } = props -// const [excuteTimeOptions, setExcuteTimeOptions] = useState([]) -// const formRef = useRef() -// const { report } = actions - -// useEffect(() => { -// let excuteTimeOptions = [] -// for (let i = 0; i < 24; i++) { -// let curT = i -// if (curT < 10) { -// curT = '0' + curT -// } -// excuteTimeOptions.push({ -// value: curT + ':00', -// label: curT + ':00', -// }) -// excuteTimeOptions.push({ -// value: curT + ':30', -// label: curT + ':30', -// }) -// } -// setExcuteTimeOptions(excuteTimeOptions); -// }, []) - -// return ( -// { -// formRef.current.validateFields().then(v => { -// v.excuteTime = String(v.excuteTime) -// console.log(v); -// dispatch(editData ? report.editReportConfig(v, editData.id) : report.addReportConfig(v)).then(res => { -// if (res.success) { -// dispatch(report.getReportConfig()) -// close() -// } -// }) -// }) -// }} -// onCancel={() => { -// close() -// }} -// > -// -// -// -// { -// return { -// value: a.id, -// label: a.name, -// } -// })} -// cacheForSwr -// name="regionId" -// label="区域" -// required -// rules={[{ required: true, message: '请选择区域' }]} -// /> -// -// -// -// -// -// -// ) -// } - -// function mapStateToProps (state) { -// const { auth, global, allAreas } = state; -// console.log(allAreas); -// return { -// user: auth.user, -// actions: global.actions, -// allAreas: allAreas.data || [] -// }; -// } - -// export default connect(mapStateToProps)(ConfigModal); diff --git a/web/client/src/sections copy/fillion/components/infor/details.js b/web/client/src/sections copy/fillion/components/infor/details.js deleted file mode 100644 index 4522a774..00000000 --- a/web/client/src/sections copy/fillion/components/infor/details.js +++ /dev/null @@ -1,132 +0,0 @@ -import React from 'react'; -import { connect } from 'react-redux'; -import { Spin, Table } from 'antd'; -import { ModalForm } from '@ant-design/pro-form'; -import moment from 'moment'; -const UserModal = (props) => { - const { visible, onVisibleChange } = props - const datas = props.modalRecord || {} - const scopeOfExamination = { ...datas }.hiddenDangerItem12 - const arr = [ - ' 1、合用场所的所有权人、使用人是否遵守消防法律、法规、规章;', - ' 2、住宿场所是否违规搭建;', - ' 3、合用场所是否配置灭火器、消防应急照明等消防器材和设施;', - ' 4、合用场所的电器产品的安装、使用及其线路和管路的设计、敷设、维护保养、检测,是否符合消防技术标准和管理规定;', - ' 5、合用场所住宿是否超过2人;(judge_0) 若超过,人员住宿是否设置在首层,并直通室外安全出口。(judge_1)', - ' 6、电动自行车是否违规室内充电、停放;', - ' 7、合用场所是否违规生产、储存、经营易燃易爆危险品;', - ' 8、合用场所除厨房外是否违规使用或者放置瓶装液化石油气、可燃液体;', - ' 9、放置瓶装液化石油气的厨房是否采取防火分隔措施,并设置自然排风窗;', - ' 10、合用场所疏散通道、安全出口是否保持畅通;', - ' 11、合用场所的外窗或阳台是否设置金属栅栏;(judge_0) 若设置,是否能从内部易于开启。(judge_1)', - ' 12、存在其他安全隐患;', - ] - const columns = [ - { - title: '场所名称', - dataIndex: 'reportName', - hideInSearch: true, - render: () => { - return
{datas.placeName}
- } - }, { - title: '场所基本情况', - dataIndex: 'reportName', - hideInSearch: true, - render: () => { - return
-
  • 使用性质:{datas.placeType}
  • -
  • 地址:{datas.address}
  • -
  • 负责人:{datas.placeOwner}
  • -
  • 电话:{datas.phone}
  • -
  • 面积:{datas.dimension}
  • -
  • 层数:{datas.floors}
  • -
  • 常驻人口:{datas.numberOfPeople}
  • -
    - } - }, { - title: '检查内容', - dataIndex: 'reportName', - hideInSearch: true, - render: () => { - return datas.hiddenDangerItem12 ? - scopeOfExamination.map((item, index) => { - let message = arr[index] - if (arr[index].indexOf('judge_') > -1) { - if (item.value == true && index === 4) { - message = message.replace(`judge_1`, item.child.value ? "是" : "否") - } else { - message = message.replace(`若超过,人员住宿是否设置在首层,并直通室外安全出口。(judge_1)`, '') - - - } - if (item.value == true && index === 10) { - message = message.replace(`judge_1`, item.child.value ? "是" : "否") - } else { - - message = message.replace(`若设置,是否能从内部易于开启。(judge_1)`, '') - - } - if (arr[index].indexOf('judge_0') > -1) { - return
  • {message.replace(`judge_0`, item.value ? "是" : "否")}
  • - } - } - return
  • {message}({item.value ? "是" : "否"})
  • - }) - : '---' - } - }, { - title: '存在具体问题', - dataIndex: 'reportName', - hideInSearch: true, - render: () => { - return
    {datas.description ? datas.description : '---'}
    - } - }, - ] - const data = [ - { - key: '1', - - address: 'New York No. 1 Lake Park', - tags: ['nice', 'developer'], - }, - ]; - return ( - - -
    排查单位:{(datas || {}).checkAreaName || ''} - 填报日期:{moment((datas || {}).time).format('YYYY-MM-DD') || ''}
    - -
    - 排查人:{(datas || {}).checkUserName || ''} - 手机号:{(datas || {}).checkUserPhone || ''}
    - - - ) -} -function mapStateToProps(state) { - const { depMessage } = state; - const pakData = (dep) => { - return dep.map((d) => { - return { - title: d.name, - value: d.id, - children: pakData(d.subordinate) - } - }) - } - let depData = pakData(depMessage.data || []) - return { - loading: depMessage.isRequesting, - depData, - }; -} -export default connect(mapStateToProps)(UserModal); \ No newline at end of file diff --git a/web/client/src/sections copy/fillion/components/inforTable.js b/web/client/src/sections copy/fillion/components/inforTable.js deleted file mode 100644 index d7c55160..00000000 --- a/web/client/src/sections copy/fillion/components/inforTable.js +++ /dev/null @@ -1,223 +0,0 @@ -import React, { useEffect, useState } from 'react'; -import { connect } from 'react-redux'; -import { Spin, Button, Popconfirm, TreeSelect } from 'antd'; -import ProTable from '@ant-design/pro-table'; - -import moment from 'moment'; -import { getReportStatistic } from "../actions/infor" -const InForTable = (props) => { - const { dispatch, user, depData, depMessage, depLoading } = props - const [rowSelected, setRowSelected] = useState([]) - const [regionId, setRegionId] = useState()//区域id - const [placeType, setPlaceType] = useState()//场所 - const [day, setDay] = useState([moment('2022-03-01').format('YYYY-MM-DD'), moment().format('YYYY-MM-DD')])//日期 - const [sitename, setSitename] = useState()//场所名称 - const [counts, setCounts] = useState()//shuju - useEffect(() => { - setRegionId(user.departmentId) - }, [user]) - useEffect(() => { - setDay([moment('2022-03-01').format('YYYY-MM-DD'), moment().format('YYYY-MM-DD')]) - }, [depData]) - const onChange = (value) => { - // setRegionName(value) - setRegionId(value) - } - const columns = [ - { - title: '场所名称', - dataIndex: 'placeName', - formItemProps: { - label: '场所名称', - }, - fieldProps: { - onChange: (value, cs) => { - setSitename(value.currentTarget.value) - }, - placeholder: '请输入场所名称进行搜索', - getPopupContainer: (triggerNode) => triggerNode.parentNode, - }, - }, - { - title: '场所地址', - search: false, - dataIndex: 'time', - valueType: 'dateRange', - initialValue: day, - order: 4, - render: (dom, record) => { - return record.address - }, - fieldProps: { - getPopupContainer: (triggerNode) => triggerNode.parentNode, - } - }, - { - title: '隐患场所', - dataIndex: 'regionName', - valueType: 'select', - initialValue: -1, - fieldProps: { - label: null, - onChange: (value, cs) => { - setPlaceType(value); - }, - options: [{ - - label: '全部', - value: -1 - }, - { - label: '隐患场所', - value: 0 - }, { - label: '非隐患场所', - value: 1 - }, { - label: '非合用场所', - value: 2 - },], - getPopupContainer: (triggerNode) => triggerNode.parentNode, - }, - order: 5, - render: (dom, record) => { - let flag = "是" - if (record.hiddenDangerItem12 == null) { - flag = / - } - if (record.hiddenDangerItem12 && record.correctiveAction == null && record.punishment == null) { - flag = - } - return flag - } - }, - { - title: '排查日期', - dataIndex: 'time', - valueType: 'dateRange', - initialValue: day, - order: 4, - fieldProps: { - onChange: (value, cs) => { - setDay(cs) - }, - getPopupContainer: (triggerNode) => triggerNode.parentNode, - }, - render: (dom, record) => { - return [moment(record.time).format('YYYY-MM-DD HH:mm:ss'),] - } - }, - { - title: '操作', - dataIndex: 'creatTime', - valueType: 'dateTimeRange', - hideInSearch: true, - render: (dom, record) => { - return - } - }, - ] - return ( - -

    区域:

    - { - return depData - }} - expandedKeys={["title"]} - notFoundContent={ - depLoading ? -

    - -

    : -

    暂无数据

    - } - getPopupContainer={(triggerNode) => triggerNode.parentNode} - /> -
    - { - const { id } = depMessage[0] - console.log(id) - setRegionId(id) - setPlaceType(-1) - setDay([moment('2022-03-01').format('YYYY-MM-DD'), moment().format('YYYY-MM-DD')]) - setSitename('') - }} - rowSelection={{ - selectedRowKeys: rowSelected, - onChange: (selectedRowKeys) => { - setRowSelected(selectedRowKeys); - }, - }} - columns={columns} - options={false} - dataSource={(counts || {}).rows || []} - request={async (params) => { - const query = { - startDate: day[0], - endDate: day[1], - placeType: placeType, - regionId: regionId, - placeName: sitename, - limit: params.pageSize, - offset: ((params.current ? params.current : 1) - 1) * params.pageSize - } - setRowSelected([]); - const res = await dispatch(getReportStatistic(query)); - setCounts(res.payload.data) - return { - ...res, - total: res.payload.data ? res.payload.data.count : 0 - } - }} - search={{ - defaultCollapsed: false, - optionRender: (searchConfig, formProps, dom) => [ - ...dom.reverse(), - { props.exports(rowSelected, counts) }}> - - - ], - }} - > -
    - -
    - ) -} -function mapStateToProps(state) { - const { auth, depMessage } = state; - const pakData = (dep) => { - return dep.map((d) => { - return { - title: d.name, - value: d.id, - // children: d.type >= 2 ? [] : pakData(d.subordinate) - children: pakData(d.subordinate) - } - }) - } - let depData = pakData(depMessage.data || []) - return { - user: auth.user, - depMessage: depMessage.data || [], - depLoading: depMessage.isRequesting, - depData, - }; -} -export default connect(mapStateToProps)(InForTable); \ No newline at end of file diff --git a/web/client/src/sections copy/fillion/containers/index.js b/web/client/src/sections copy/fillion/containers/index.js deleted file mode 100644 index 3cfa6ecf..00000000 --- a/web/client/src/sections copy/fillion/containers/index.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -import infor from './infor'; - - -export { infor }; \ No newline at end of file diff --git a/web/client/src/sections copy/fillion/containers/infor.js b/web/client/src/sections copy/fillion/containers/infor.js deleted file mode 100644 index 4e2c3b21..00000000 --- a/web/client/src/sections copy/fillion/containers/infor.js +++ /dev/null @@ -1,59 +0,0 @@ -import React, { useEffect, useState } from 'react'; -import { connect } from 'react-redux'; -import '../style.less'; -import { getDepMessage, getReportStatistic } from "../actions/infor" -import InForTable from '../components/inforTable'; -import UserModal from '../components/infor/details'; -const superagent = require('superagent'); -const infor = (props) => { - const { dispatch, user} = props - const [data, setData] = useState() - const [modalVisible, setModalVisible] = useState(false); - const [modalRecord, setModalRecord] = useState(); - useEffect(() => { - // dispatch(getDepMessage()) - dispatch(getReportStatistic()) - setData(props) - }, []); - //打开弹窗 - const openModal = (type, record) => { - setModalVisible(true); - // setModalType(type); - if (type == 'edit') { - setModalRecord(record); - } else { - setModalRecord(null); - } - } - //批量导出 - const exports = (ids,counts) => { - // console.log(user); - let reportIds = []; - if (ids.length) - reportIds = ids - else - reportIds = (counts || {}).ids || []; - superagent.post('/_report/http') - .send({ id: reportIds.map(i => Number(i)) }).end((err, res) => { - const resTextIs = res.text.split('/').pop() - window.open( - '/_api/' + - `attachments?src=files/${resTextIs}&filename=${encodeURIComponent(resTextIs)}&token=${user.token}`) - }) - } - return ( - <> - - ) -} -function mapStateToProps(state) { - const {auth}=state - return { - user: auth.user, - } -} -export default connect(mapStateToProps)(infor); \ No newline at end of file diff --git a/web/client/src/sections copy/fillion/containers/infor/details.js b/web/client/src/sections copy/fillion/containers/infor/details.js deleted file mode 100644 index 016b8288..00000000 --- a/web/client/src/sections copy/fillion/containers/infor/details.js +++ /dev/null @@ -1,124 +0,0 @@ -// import React from 'react'; -// import { connect } from 'react-redux'; -// import { Spin, Table } from 'antd'; -// import { ModalForm } from '@ant-design/pro-form'; -// import moment from 'moment'; -// const UserModal = (props) => { -// const { visible, onVisibleChange } = props -// const datas = props.modalRecord || {} -// const scopeOfExamination = { ...datas }.hiddenDangerItem12 -// const arr = [ -// ' 1、合用场所的所有权人、使用人是否遵守消防法律、法规、规章;', -// ' 2、住宿场所是否违规搭建;', -// ' 3、合用场所是否配置灭火器、消防应急照明等消防器材和设施;', -// ' 4、合用场所的电器产品的安装、使用及其线路和管路的设计、敷设、维护保养、检测,是否符合消防技术标准和管理规定;', -// ' 5、合用场所住宿是否超过2人;(judge_0) 若超过,人员住宿是否设置在首层,并直通室外安全出口;(judge_1)', -// ' 6、电动自行车是否违规室内充电、停放;', -// ' 7、合用场所是否违规生产、储存、经营易燃易爆危险品;', -// ' 8、合用场所除厨房外是否违规使用或者放置瓶装液化石油气、可燃液体;', -// ' 9、放置瓶装液化石油气的厨房是否采取防火分隔措施,并设置自然排风窗;', -// ' 10、合用场所疏散通道、安全出口是否保持畅通;', -// ' 11、合用场所的外窗或阳台是否设置金属栅栏;(judge_0) 若设置,是否能从内部易于开启。(judge_1)', -// ' 12、存在其他安全隐患;', -// ] -// const columns = [ -// { -// title: '场所名称', -// dataIndex: 'reportName', -// hideInSearch: true, -// render: () => { -// return
    {datas.placeName}
    -// } -// }, { -// title: '场所基本情况', -// dataIndex: 'reportName', -// hideInSearch: true, -// render: () => { -// return
    -//
  • 使用性质:{datas.placeType}
  • -//
  • 地址:{datas.address}
  • -//
  • 负责人:{datas.placeOwner}
  • -//
  • 电话:{datas.phone}
  • -//
  • 面积:{datas.dimension}
  • -//
  • 层数:{datas.floors}
  • -//
  • 常驻人口:{datas.numberOfPeople}
  • -//
    -// } -// }, { -// title: '检查内容', -// dataIndex: 'reportName', -// hideInSearch: true, -// render: () => { -// return datas.hiddenDangerItem12 ? -// scopeOfExamination.map((item, index) => { -// let message = arr[index] -// if (arr[index].indexOf('judge_') > -1) { -// if (item.child && item.child.itemIndex) { -// message = message.replace(`judge_${item.child.itemIndex}`, item.child.value ? "是" : "否") -// } else { -// message = message.replace(`judge_1`, '---') -// } - -// if (arr[index].indexOf('judge_0') > -1) { -// return
  • {message.replace(`judge_0`, item.value ? "是" : "否")}
  • -// } -// } -// return
  • {message}({item.value ? "是" : "否"})
  • -// }) -// : '---' -// } -// }, { -// title: '存在具体问题', -// dataIndex: 'reportName', -// hideInSearch: true, -// render: () => { -// return
    {datas.description ? datas.description : '---'}
    -// } -// }, -// ] -// const data = [ -// { -// key: '1', - -// address: 'New York No. 1 Lake Park', -// tags: ['nice', 'developer'], -// }, -// ]; -// return ( -// -// -//
    排查单位:{(datas || {}).checkAreaName || ''} -// 填报日期:{moment((datas || {}).time).format('YYYY-MM-DD') || ''}
    -//
    -//
    -// 排查人:{(datas || {}).checkUserName || ''} -// 手机号:{(datas || {}).checkUserPhone || ''}
    -// -// -// ) -// } -// function mapStateToProps (state) { -// const { depMessage } = state; -// const pakData = (dep) => { -// return dep.map((d) => { -// return { -// title: d.name, -// value: d.id, -// children: pakData(d.subordinate) -// } -// }) -// } -// let depData = pakData(depMessage.data || []) -// return { -// loading: depMessage.isRequesting, -// depData, -// }; -// } -// export default connect(mapStateToProps)(UserModal); \ No newline at end of file diff --git a/web/client/src/sections copy/fillion/index.js b/web/client/src/sections copy/fillion/index.js deleted file mode 100644 index 5efd3ee5..00000000 --- a/web/client/src/sections copy/fillion/index.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; -import reducers from './reducers'; -import routes from './routes'; -import actions from './actions'; -import { getNavItem } from './nav-item'; -export default { - key: 'fillion', - name: '填报管理', - reducers: reducers, - routes: routes, - actions: actions, - getNavItem: getNavItem -}; \ No newline at end of file diff --git a/web/client/src/sections copy/fillion/nav-item.js b/web/client/src/sections copy/fillion/nav-item.js deleted file mode 100644 index 70b55fd6..00000000 --- a/web/client/src/sections copy/fillion/nav-item.js +++ /dev/null @@ -1,14 +0,0 @@ -import React from 'react'; -import { Link } from 'react-router-dom'; -import { Menu } from 'antd'; -import { ReadOutlined } from '@ant-design/icons'; -const SubMenu = Menu.SubMenu; -export function getNavItem(user, dispatch) { - return ( - } title={'填报管理'}> - - 填报信息 - - - ); -} \ No newline at end of file diff --git a/web/client/src/sections copy/fillion/reducers/index.js b/web/client/src/sections copy/fillion/reducers/index.js deleted file mode 100644 index 7ed10886..00000000 --- a/web/client/src/sections copy/fillion/reducers/index.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -export default { - -} \ No newline at end of file diff --git a/web/client/src/sections copy/fillion/routes.js b/web/client/src/sections copy/fillion/routes.js deleted file mode 100644 index 693ca601..00000000 --- a/web/client/src/sections copy/fillion/routes.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; -import { infor } from './containers'; -export default [{ - type: 'inner', - route: { - path: '/fillion', - key: 'fillion', - breadcrumb: '填报管理', - menuSelectKeys: ['fillion'], - menuOpenKeys: ['fillion'], - childRoutes: [ { - path: '/infor', - key: 'fillioninfor', - menuSelectKeys:['fillioninfor'], - component: infor, - breadcrumb: '填报信息', - }] - } -}]; \ No newline at end of file diff --git a/web/client/src/sections copy/fillion/style.less b/web/client/src/sections copy/fillion/style.less deleted file mode 100644 index 33234528..00000000 --- a/web/client/src/sections copy/fillion/style.less +++ /dev/null @@ -1,3 +0,0 @@ -#example:hover { - font-size: larger; -} \ No newline at end of file diff --git a/web/client/src/sections copy/middleground/actions/data.js b/web/client/src/sections copy/middleground/actions/data.js deleted file mode 100644 index 73080b05..00000000 --- a/web/client/src/sections copy/middleground/actions/data.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict'; - -import { basicAction } from '@peace/utils' -import { ApiTable } from '$utils' -export function getFundamental() { - return dispatch => basicAction({ - type: 'get', - dispatch: dispatch, - actionType: 'GET_DATA', - url: ApiTable.getFundamental, - msg: { error: '获取数据失败' }, - reducer: { name: 'datas' } - }); -} - - -export function getsortord(zuo, day) { - return dispatch => basicAction({ - type: 'get', - dispatch: dispatch, - actionType: 'GET_PATIENTIA', - url: ApiTable.getsortord.replace('{zuo}', zuo).replace('{day}', day), - msg: { error: '日期更新失败' }, - reducer: { name: 'Patientia' } - }); -} -export default { - getFundamental, - getsortord -} \ No newline at end of file diff --git a/web/client/src/sections copy/middleground/actions/index.js b/web/client/src/sections copy/middleground/actions/index.js deleted file mode 100644 index 077a957b..00000000 --- a/web/client/src/sections copy/middleground/actions/index.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -import * as date from "./data" - -export default { - ...date -} \ No newline at end of file diff --git a/web/client/src/sections copy/middleground/components/dateModal.js b/web/client/src/sections copy/middleground/components/dateModal.js deleted file mode 100644 index 5b83cbed..00000000 --- a/web/client/src/sections copy/middleground/components/dateModal.js +++ /dev/null @@ -1,118 +0,0 @@ -import React, { useState, useEffect } from 'react' -import { connect } from 'react-redux'; -import { getFundamental } from '../actions/data'; -import * as echarts from "echarts" -import "../style.less" - -const DateModal = (props) => { - const { dispatch } = props - const [lists, setLists] = useState([]) - const [keys, setKeys] = useState([]) - const [days, setDays] = useState() - const [unkeys, setUnkeys] = useState([]) - const [num, setNum] = useState(1) - useEffect(() => { - // 获取数据 - dispatch(getFundamental()).then(res => { - setDays(res.payload.data.date) - - }) - }, [true]) - - const op = () => { - // 把获取的数据进行加工 - if (days && num == 1) { - - var daysValues = Object.values(days) - var daysKeys = Object.keys(days) - var list = [] - var arr = [] - var months = [] - for (let index = 6; index >= 0; index--) { - list.push(daysValues[index]) - } - setLists(list) - for (let index = 6; index >= 0; index--) { - arr.push(daysKeys[index].substring(8)) - } - for (let index = 6; index >= 0; index--) { - months.push(daysKeys[index].charAt(5) + "" + daysKeys[index].charAt(6)) - } - setUnkeys(months) - setKeys(arr) - setNum(2) - } - } - op() - useEffect(() => { - let a = ([...keys]) - let list = [] - for (let index = 0; index < 7; index++) { - list.push(a[index]) - } - for (let index = 0; index < 7; index++) { - list[index] = list[index] + "日" - } - var myChart = echarts.init(document.getElementById('echarts')); - // window.onresize在重复使用过程中会被覆盖 - // window.onresize = myChart.resize; - // addEventListener来添加监听resize的事件,将能避免onresize的覆盖问题,并能实现对窗口的监听操作 - window.addEventListener("resize", function () { - myChart.resize() - }) - var option = { - title: { - text: '近七日填报数量', - left: "7%" - }, - grid: { - left: '3%', - right: '4%', - bottom: '3%', - containLabel: true - }, - tooltip: { - trigger: 'item', - formatter: function (params) { - var htmlStr = `填报数量:${params.value}条
    ${unkeys[params.dataIndex] + "月" + params.name}
    ` - return htmlStr; - } - }, - xAxis: { - type: 'category', - data: list, - axisTick: { - alignWithLabel: true - } - }, - yAxis: { - type: "value", - }, - series: [ - { - name: '填报数量', - type: 'bar', - data: lists, - barWidth: 40 - } - ] - }; - - // 使用刚指定的配置项和数据显示图表。 - myChart.setOption(option); - }, [lists]) - return ( -
    - ) -} -function mapStateToProps(state) { - const { auth, depMessage, depUser, global } = state; - return { - user: auth.user, - clientHeight: global.clientHeight, - loading: depMessage.isRequesting, - depMessage: depMessage.data || [], - depUser: depUser.data || [] - }; -} -export default connect(mapStateToProps)(DateModal) \ No newline at end of file diff --git a/web/client/src/sections copy/middleground/components/index.js b/web/client/src/sections copy/middleground/components/index.js deleted file mode 100644 index 70405b5b..00000000 --- a/web/client/src/sections copy/middleground/components/index.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -import DateModal from './dateModal'; - -export { DateModal }; \ No newline at end of file diff --git a/web/client/src/sections copy/middleground/containers/data.js b/web/client/src/sections copy/middleground/containers/data.js deleted file mode 100644 index 72a46915..00000000 --- a/web/client/src/sections copy/middleground/containers/data.js +++ /dev/null @@ -1,157 +0,0 @@ -import React, { useEffect, useState } from "react"; -import { connect } from "react-redux"; -import { Space, Row, Col, DatePicker, Spin } from "antd"; -import { getFundamental, getsortord } from "../actions/data"; -import { DateModal } from "../components"; -import moment from "moment"; -import "../style.less"; -const { RangePicker } = DatePicker; -const UserManage = (props) => { - const { dispatch, loading, datas, Patientias } = props; - const dateFormat = "YYYY/MM/DD"; - const [data, setData] = useState(); - const [Patientia, setPatientia] = useState(); - useEffect(() => { - // 获取数据 - dispatch(getFundamental()).then((res) => { - setData(res); - }); - }, [true]); - useEffect(() => { - // 根据接口获取规定时间内获取到的数据 - var customField = [ - moment().add(-6, "day").format("YYYY-MM-DD"), - moment(new Date(), dateFormat).format("YYYY-MM-DD"), - ]; - dispatch(getsortord(customField[0], customField[1])).then((res) => { - setPatientia(res.payload.data); - }); - }, [true]); - // useEffect(() => { - /* Patientia ? setPatientia(Patientia */ /* .sort(sortByKey("count")) */ /* ) : null */ - // }, [Patientia]) - // 根据数组里面对象的key值进行排序 - // const sortByKey = (key) => { - // return function (a, b) { - // var value1 = a[key]; - // var value2 = b[key]; - // return value2 - value1; - // } - // } - const disabledDate = (current) => { - return ( - (current && current < moment("2022/03/01").subtract("day")) || - current > moment(new Date()).subtract("days") - ); - }; - const getTime = (date) => { - // 根据时间框时间获取数据进行展示 - if (date) { - var ao = []; - ao.push(date[0].format("YYYY/MM/DD")); - ao.push(date[1].format("YYYY/MM/DD")); - } - dispatch(getsortord(ao[0], ao[1])).then((res) => { - setPatientia(res.payload.data /* .sort(sortByKey("count")) */); - }); - }; - - return ( -
    - {/* 此处进行了loding的效果 */} - - {/* 页面上部分代码 */} -
    - -
    - 今日新增填报 -

    {datas.data ? datas.data.added : null}

    - - - 今日已审填报 -

    - {datas.data ? datas.data.checked : null} - /{datas.data ? datas.data.unChecked : null} -

    - - - 隐患场所总数 -

    {datas.data ? datas.data.danger_place : null}

    - - - 历史填报 -

    {datas.data ? datas.data.history : null}

    - - - - {/* 页面下部分代码 */} -
    - {/* echarts柱状图 */} -
    {datas ? : null}
    - {/* 根据时间进行的排序 */} -
    -

    各区县合用场所填报数量

    - - - -
    - {Patientias - ? Patientias.map((item, index) => { - return ( -
  • - {index >= 3 ? ( -
    {index + 1}
    - ) : ( -
    {index + 1}
    - )} - {item.name} - {item.count} -
  • - ); - }) - : null} -
    -
    -
    - - - ); -}; -function mapStateToProps(state) { - // console.log(state); - const { auth, depMessage, depUser, global, datas, Patientia } = state; - // 在reducer中进行数据处理 - const sortByKey = (key) => { - return function (a, b) { - var value1 = a[key]; - var value2 = b[key]; - return value2 - value1; - }; - }; - return { - user: auth.user, - clientHeight: global.clientHeight, - loading: datas.isRequesting && Patientia.isRequesting, - depMessage: depMessage.data || [], - depUser: depUser.data || [], - datas: datas || [], - Patientias: Patientia.data - ? Patientia.data.sort(sortByKey("count")) - : null || [], - }; -} - -export default connect(mapStateToProps)(UserManage); diff --git a/web/client/src/sections copy/middleground/containers/index.js b/web/client/src/sections copy/middleground/containers/index.js deleted file mode 100644 index fb6c0ef3..00000000 --- a/web/client/src/sections copy/middleground/containers/index.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -import UserManage from './data'; - -export { UserManage }; \ No newline at end of file diff --git a/web/client/src/sections copy/middleground/index.js b/web/client/src/sections copy/middleground/index.js deleted file mode 100644 index fe3e7793..00000000 --- a/web/client/src/sections copy/middleground/index.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -import reducers from './reducers'; -import routes from './routes'; -import actions from './actions'; -import { getNavItem } from './nav-item'; - -export default { - key: 'middleground', - name: '', - reducers: reducers, - routes: routes, - actions: actions, - getNavItem: getNavItem -}; \ No newline at end of file diff --git a/web/client/src/sections copy/middleground/nav-item.js b/web/client/src/sections copy/middleground/nav-item.js deleted file mode 100644 index 51ca9557..00000000 --- a/web/client/src/sections copy/middleground/nav-item.js +++ /dev/null @@ -1,18 +0,0 @@ -import React from 'react'; -import { Link } from 'react-router-dom'; -import { Menu } from 'antd'; -import { BarChartOutlined } from '@ant-design/icons'; -import { push } from 'react-router-redux'; - - -export function getNavItem(user, dispatch) { - if (user.type != 1) { - dispatch(push('/fillion/infor')); - return null - } - return ( - }> - 数据中心 - - ); -} \ No newline at end of file diff --git a/web/client/src/sections copy/middleground/reducers/index.js b/web/client/src/sections copy/middleground/reducers/index.js deleted file mode 100644 index 0203d01b..00000000 --- a/web/client/src/sections copy/middleground/reducers/index.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -export default { - -}; \ No newline at end of file diff --git a/web/client/src/sections copy/middleground/routes.js b/web/client/src/sections copy/middleground/routes.js deleted file mode 100644 index 0d75430b..00000000 --- a/web/client/src/sections copy/middleground/routes.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; -import { UserManage } from './containers'; - -export default [{ - type: 'inner', - route: { - path: '/middleground', - key: 'middleground', - breadcrumb: '数据中心', - menuSelectKeys: ['userManage'], - component: UserManage, - menuOpenKeys: ['middleground'], - } -}]; \ No newline at end of file diff --git a/web/client/src/sections copy/middleground/style.less b/web/client/src/sections copy/middleground/style.less deleted file mode 100644 index 659824ed..00000000 --- a/web/client/src/sections copy/middleground/style.less +++ /dev/null @@ -1,86 +0,0 @@ -.shuju-top{ - width: 100%; - min-Width: 1110px; - height: 20vh; - border: 1px solid #F2F2F2; - border-Right: 0; - margin-top: 5vh; - overflow: auto; - .wrap{ - min-Height: 100%; - span{ - color: #959595; - font-Size: 18px; - } - p{ - font-Size: 34px; - } - } -} -.shuju-floer{ - width: 100%; - height: 500px; - float: left; - margin-Top: 50px; - min-Width: 1110px; - .shuju-floer-left{ - height: 500px; - float: left; - #echarts{ - width: calc(75vw - 200px ); - min-Width: 810px; - height: 500px; - } - } - .shuju-floer-reght{ - width: calc(32vw - 200px ); - min-Width: 290px; - height: 100%; - float: left; - p{ - color: #464646; - font-Size: 18px; - font-Weight: 600; - } - .dataDisplay{ - width: 340px; - height: 75%; - overflow-y: auto; - .traverse{ - width: 300px; - height: 30px; - list-style: none; - .topThree{ - width: 20px; - height: 20px; - background-Color: #f0f2f5; - float: left; - color: rgba(0, 0, 0, 0.6470588235294118); - border-Radius: 50%; - text-align: center; - line-Height: 20px; - font-Size: 12px; - } - .untopThree{ - width: 20px; - height: 20px; - background-Color: #314559; - float: left; - color: #FFFFFF; - border-radius: 50%; - text-align: center; - line-height: 20px; - font-size: 12px; - } - .siteName{ - margin-left: 20px; - } - .sitePeople{ - float: right; - margin-right: 10px; - } - } - } - - } -} \ No newline at end of file diff --git a/web/client/src/sections copy/organization/actions/authority.js b/web/client/src/sections copy/organization/actions/authority.js deleted file mode 100644 index d5f07191..00000000 --- a/web/client/src/sections copy/organization/actions/authority.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict'; - -import { basicAction } from '@peace/utils' -import { ApiTable } from '$utils' - -export function getAuthority(orgId) { - return dispatch => basicAction({ - type: 'get', - dispatch: dispatch, - actionType: 'GET_MEMBERS', - url: `${ApiTable.getEnterprisesMembers.replace('{enterpriseId}', orgId)}`, - msg: { error: '获取用户列表失败' }, - reducer: { name: 'members' } - }); -} -export function getResource(userId) { - return dispatch => basicAction({ - type: 'get', - dispatch: dispatch, - actionType: 'GET_RESOURCE', - url: `${ApiTable.getResource}`, - msg: { error: '获取权限失败' }, - reducer: { name: 'resource' } - }); -} -export function getUserResource(userId) { - return dispatch => basicAction({ - type: 'get', - dispatch: dispatch, - actionType: 'GET_USER_RESOURCE', - url: `${ApiTable.getUserResource}?userId=${userId}`, - msg: { error: '获取用户权限失败' }, - reducer: { name: 'userResource' } - }); -} -export function postUserRes(body) { - return dispatch => basicAction({ - type: 'post', - dispatch: dispatch, - actionType: 'UPDATE_USER_RESOURCE', - url: `${ApiTable.postUserRes}`, - data: body, - msg: { success: '更新用户权限' } - }); -} -export default { - getAuthority, - getResource, - getUserResource, - postUserRes -} \ No newline at end of file diff --git a/web/client/src/sections copy/organization/actions/index.js b/web/client/src/sections copy/organization/actions/index.js deleted file mode 100644 index b44cd454..00000000 --- a/web/client/src/sections copy/organization/actions/index.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -import * as authority from './authority' -import { getDepMessage, getDepUser, createUser } from './user' - -export default { - ...authority, - getDepMessage, - getDepUser, - createUser, -} \ No newline at end of file diff --git a/web/client/src/sections copy/organization/actions/user.js b/web/client/src/sections copy/organization/actions/user.js deleted file mode 100644 index e24913a4..00000000 --- a/web/client/src/sections copy/organization/actions/user.js +++ /dev/null @@ -1,78 +0,0 @@ -'use strict'; - -import { basicAction } from '@peace/utils' -import { ApiTable } from '$utils' - -export function getDepMessage() { - return dispatch => basicAction({ - type: 'get', - dispatch: dispatch, - actionType: 'GET_DEPARTMENT_MESSAGE', - url: ApiTable.getDepMessage, - msg: { error: '获取部门信息失败' }, - reducer: { name: 'depMessage' } - }); -} - -export function getDepUser(depId) { - return dispatch => basicAction({ - type: 'get', - dispatch: dispatch, - actionType: 'GET_DEPARTMENT_USER', - url: ApiTable.getDepUser.replace('{depId}', depId), - msg: { error: '获取部门下用户信息失败' }, - reducer: { name: 'depUser' } - }); -} - -export function createUser(data) { - return dispatch => basicAction({ - type: 'post', - data, - dispatch: dispatch, - actionType: 'CREATE_DEPARTMENT_USER', - url: ApiTable.createUser, - msg: { option: '新建用户' }, - }); -} - -export function updateUser(id, data) { - return dispatch => basicAction({ - type: 'put', - data, - dispatch: dispatch, - actionType: 'UPDATE_DEPARTMENT_USER', - url: ApiTable.updateUser.replace('{id}', id), - msg: { option: '修改用户' }, - }); -} - -export function delUser(ids) { - return dispatch => basicAction({ - type: 'del', - dispatch: dispatch, - actionType: 'DEL_DEPARTMENT_USER', - url: ApiTable.delUser.replace('{ids}', ids), - msg: { option: '删除用户' }, - }); -} - -export function resetPwd(id, data) { - return dispatch => basicAction({ - type: 'put', - data, - dispatch: dispatch, - actionType: 'CREATE_DEPARTMENT_USER', - url: ApiTable.resetPwd.replace('{id}', id), - msg: { option: '重置用户密码' }, - }); -} - -export default { - getDepMessage, - getDepUser, - createUser, - updateUser, - delUser, - resetPwd -} \ No newline at end of file diff --git a/web/client/src/sections copy/organization/components/resetPwd.js b/web/client/src/sections copy/organization/components/resetPwd.js deleted file mode 100644 index 14135e0b..00000000 --- a/web/client/src/sections copy/organization/components/resetPwd.js +++ /dev/null @@ -1,74 +0,0 @@ -import React, { useRef, useState } from 'react'; -import { connect } from 'react-redux'; -import { Spin, Card, Modal, TreeSelect } from 'antd'; -import ProForm, { ProFormText, ModalForm, ProFormSwitch, ProFormTreeSelect } from '@ant-design/pro-form'; - -const ResetPwd = (props) => { - const { visible, onVisibleChange, onConfirm } = props; - const formRef = useRef(); - - const onFinish = (values) => { - if (onConfirm) { - onConfirm(values); - } - } - - return ( - - - - { - const pwd = formRef.current.getFieldValue('password'); - if (!value) { - callback(); - } - if (pwd == value) { - callback(); - } else { - callback('两次输入的密码不一致'); - } - } - } - ]} - /> - - - ) -} - -function mapStateToProps(state) { - return {}; -} - -export default connect(mapStateToProps)(ResetPwd); \ No newline at end of file diff --git a/web/client/src/sections copy/organization/components/resource.js b/web/client/src/sections copy/organization/components/resource.js deleted file mode 100644 index 84ca1dd9..00000000 --- a/web/client/src/sections copy/organization/components/resource.js +++ /dev/null @@ -1,119 +0,0 @@ -import React, { useEffect } from 'react'; -import { Checkbox, Table } from 'antd'; -import { useState } from 'react'; - -const CheckboxGroup = Checkbox.Group; - -const Resource = props => { - const { roleData, userRole, userSelected, setResCode, userType } = props; - const [indeterminate, setIndeterminate] = useState({}); - const [roleCheck, setRoleCheck] = useState({});//一级权限码 - const [parentRoleCheck, setParentRoleCheck] = useState({}); //二级权限码 - useEffect(() => { - const check = {} - const parentCheck = {} - const initInd = {} - roleData && roleData.map && roleData.map(r => { - let currentInd = false; - let sum = 0; - if (r.resources) { - check[r.code] = [] - r.resources.map(child => { - if (userRole.find(code => code.resourceId == child.code)) { - currentInd = true; - sum++; - check[r.code].push(child.code); - } - }) - } - parentCheck[r.code] = r.resources.length === sum - initInd[r.code] = parentCheck[r.code] ? false : currentInd - }); - setParentRoleCheck(parentCheck) - setRoleCheck(check); - setIndeterminate(initInd); - }, [userRole]); - - const setResData = (role) => { - let codes = []; - // Object.keys(partRole).map(r => { - // if (partRole[r]) codes.push(r) - // }) - Object.keys(role).map(r => { - if (role[r].length) { - codes.push(r); - } - codes = codes.concat(role[r]) - }) - setResCode(codes) - } - return ( -
    { - const parentCode = record.code - return { - const currentParCheck = JSON.parse(JSON.stringify(parentRoleCheck)); - currentParCheck[parentCode] = e.target.checked; - const currentCode = JSON.parse(JSON.stringify(roleCheck)); - currentCode[parentCode] = e.target.checked ? roleData.find(r => r.code == parentCode).resources.map(r => r.code) : [] - const currentInd = JSON.parse(JSON.stringify(indeterminate)); - currentInd[parentCode] = false; - - setParentRoleCheck(currentParCheck); - setRoleCheck(currentCode); - setIndeterminate(currentInd); - setResData(currentCode) - }} - checked={parentRoleCheck[parentCode] || false} - disabled={userSelected === "SuperAdmin" || userType === 4} - options={''} - > - {text} - - } - }, { - title: '列表', - key: 'resources', - dataIndex: 'resources', - render: (text, record) => { - let data = []; - console.log() - text.map(s => { s.name !== "整治汇总编辑" ? data.push({ label: s.name, value: s.code }) : '' }) - let parentCode = record.code; - - return { - const checkArr = JSON.parse(JSON.stringify(roleCheck)); - const parentCheck = JSON.parse(JSON.stringify(parentRoleCheck)); - const ind = JSON.parse(JSON.stringify(indeterminate)); - const currentCode = roleData.find(r => r.code == parentCode) || {} - - checkArr[parentCode] = value; - ind[parentCode] = !!value.length && value.length < currentCode.resources.length - parentCheck[parentCode] = value.length === currentCode.resources.length - - setRoleCheck(checkArr); - setIndeterminate(ind); - setParentRoleCheck(parentCheck); - setResData(checkArr) - }} - /> - } - }]} - >
    - ) -} -export default Resource \ No newline at end of file diff --git a/web/client/src/sections copy/organization/components/userModal.js b/web/client/src/sections copy/organization/components/userModal.js deleted file mode 100644 index 45c085bb..00000000 --- a/web/client/src/sections copy/organization/components/userModal.js +++ /dev/null @@ -1,172 +0,0 @@ -import React from 'react'; -import { connect } from 'react-redux'; -import { Spin, Card, Modal, TreeSelect, message } from 'antd'; -import ProForm, { ProFormText, ModalForm, ProFormSwitch, ProFormTreeSelect } from '@ant-design/pro-form'; - -const UserModal = (props) => { - const { visible, modalType, depData, onVisibleChange, onConfirm, editData } = props - const reg_tel = /^1([358][0-9]|4[579]|66|7[0135678]|9[89])[0-9]{8}$/; - const onFinish = (values) => { - if (onConfirm) { - onConfirm(values); - } - } - const mobile = (value) => { - if (reg_tel.test(value)) { - return - } - return message('请输入姓名') - } - return ( - - - - - { - return event.target.value.replace(/\D/g, '') - }} - placeholder="请输入用户名(手机号)" - rules={[ - { required: true, valueType: Number, max: 11 }, { pattern: /^1([358][0-9]|4[579]|66|7[0135678]|9[89])[0-9]{8}$/, message: "请输入正确的手机号" } - ]} - /> - - - { - if (selected) { - setDepSelectedKeys(selectedKeys) - setDepSelected(selectedNodes[0].name || "") - dispatch(getDepUser(selectedKeys[0])) - } - }} - fieldProps={{ - fieldNames: { - label: 'title', - }, - treeDefaultExpandAll: false, - }} - rules={[{ required: true, message: '请选择所属部门' }]} - request={async () => { - console.log(depData); - return depData - }} - expandedKeys={["title"]} - /> - < ProFormText - name={['contract', 'post']} - width="md" - label="职位" - // required - placeholder="请输入职位" - /> - - - - {modalType == 'edit' ? null : } - - - - - - - ) -} - -function mapStateToProps(state) { - const { depMessage } = state; - - const pakData = (dep) => { - // console.log(dep); - return dep.map((d) => { - return { - title: d.name, - value: d.id, - // key: d.id, - children: pakData(d.subordinate) - } - }) - } - let depData = pakData(depMessage.data || []) - - return { - loading: depMessage.isRequesting, - depData, - }; -} - -export default connect(mapStateToProps)(UserModal); \ No newline at end of file diff --git a/web/client/src/sections copy/organization/containers/authority.js b/web/client/src/sections copy/organization/containers/authority.js deleted file mode 100644 index 0f29d81c..00000000 --- a/web/client/src/sections copy/organization/containers/authority.js +++ /dev/null @@ -1,147 +0,0 @@ -import React, { useEffect, useState } from 'react'; -import { connect } from 'react-redux'; -import { Spin, Row, Col, Card, Button, Tree, Empty } from 'antd'; -import { getDepMessage, getDepUser } from '../actions/user'; -import { getResource, getUserResource, postUserRes } from '../actions/authority'; -import Resource from '../components/resource'; - -const Authority = (props) => { - const { dispatch, loading, depMessage, depUser, resource, userResource, clientHeight } = props - const [depSelectedKeys, setDepSelectedKeys] = useState([]) - const [userSelectedKeys, setUserSelectedKeys] = useState([]) - const [depSelected, setDepSelected] = useState() - const [userSelected, setUserSelected] = useState() - const [resCode, setResCode] = useState({}) - const [useName, setUseName] = useState()// 选中名字 - const [userType,setUserType]=useState() - useEffect(() => { - dispatch(getResource()) - if (!(depMessage && depMessage.length)) { - dispatch(getDepMessage()) - } - - }, []) - useEffect(() => { - if (depMessage.length) { - setDepSelectedKeys([depMessage[0].id]) - setDepSelected([depMessage[0].name]) - dispatch(getDepUser(depMessage[0].id)) - } - - }, [depMessage]) - useEffect(() => { - if (depUser.length) { - setUserSelectedKeys([depUser[0].id]) - setUserSelected(depUser[0].username) - dispatch(getUserResource(depUser[0].id)) - setUseName(depUser[0].name) - } - }, [depUser]) - - const handleSave = () => { - dispatch(postUserRes({ userId: userSelectedKeys[0], resCode: resCode })).then(res => { - if (res.success) { - dispatch(getUserResource(userSelectedKeys[0])) - } - }) - } - return ( - - - - - { - depMessage.length ? - { - setUserType(selectedNodes[0].type) - if (selected) { - setDepSelectedKeys(selectedKeys) - setDepSelected(selectedNodes[0].name || "") - dispatch(getDepUser(selectedKeys[0])) - } - - }} - treeData={depMessage} - fieldNames={{ - title: 'name', - key: 'id', - children: 'subordinate' - }} - /> : '' - } - - - - - { - depUser.length ? - { - const name = node.name - setUseName(name) - - if (selected) { - setUserSelectedKeys(selectedKeys) - setUserSelected(selectedNodes[0].username || '') - dispatch(getUserResource(selectedKeys[0])) - } - - }} - treeData={depUser} - fieldNames={{ - title: 'name', - key: 'id' - }} - /> : - } - - - - {depUser.length ? - - - - - - - - : - - - } - - - - ) -} - -function mapStateToProps(state) { - const { userResource, resource, depMessage, depUser, global } = state; - return { - clientHeight: global.clientHeight, - loading: depMessage.isRequesting || depUser.isRequesting || resource.isRequesting, - userResource: userResource.data || [], - resource: resource.data || [], - depMessage: depMessage.data || [], - depUser: depUser.data || [] - }; -} - -export default connect(mapStateToProps)(Authority); \ No newline at end of file diff --git a/web/client/src/sections copy/organization/containers/index.js b/web/client/src/sections copy/organization/containers/index.js deleted file mode 100644 index e1a69b05..00000000 --- a/web/client/src/sections copy/organization/containers/index.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -import Authority from './authority'; -import UserManage from './user'; - -export { Authority, UserManage }; \ No newline at end of file diff --git a/web/client/src/sections copy/organization/containers/user.js b/web/client/src/sections copy/organization/containers/user.js deleted file mode 100644 index ea4e9993..00000000 --- a/web/client/src/sections copy/organization/containers/user.js +++ /dev/null @@ -1,231 +0,0 @@ -import React, { useEffect, useState } from 'react'; -import { connect } from 'react-redux'; -import { EllipsisOutlined } from '@ant-design/icons'; -import { Spin, Space, Button, Popconfirm, Row, Col, Tree, Table, Card, Switch } from 'antd'; -import ProTable from '@ant-design/pro-table'; -import { getDepMessage, getDepUser, createUser, updateUser, delUser, resetPwd } from '../actions/user'; -import UserModal from '../components/userModal'; -import ResetPwd from '../components/resetPwd'; - -const TreeNode = Tree.TreeNode; - -const UserManage = (props) => { - const { dispatch, loading, depMessage, depUser, clientHeight } = props - const [modalVisible, setModalVisible] = useState(false); - const [modalType, setModalType] = useState(); - const [modalRecord, setModalRecord] = useState(); - const [pwdModalVisible, setPwdModalVisible] = useState(false); - const [depSelectedKeys, setDepSelectedKeys] = useState([]) - const [rowSelected, setRowSelected] = useState([]) - useEffect(() => { - dispatch(getDepMessage()) - }, []) - - useEffect(() => { - if (depMessage.length) { - setDepSelectedKeys([depMessage[0].id]) - dispatch(getDepUser(depMessage[0].id)) - } - }, [depMessage]) - - const columns = - [ - { - title: '姓名', - dataIndex: 'name', - }, { - title: '用户名(手机号)', - dataIndex: 'username', - }, - { - title: '职位', - dataIndex: 'post', - }, { - title: '邮箱', - dataIndex: 'email', - }, { - title: '启用状态', - dataIndex: 'enable', - render: (_, r) => { - return - } - }, { - title: '操作', - dataIndex: 'action', - render: (dom, record) => { - - return record.username == 'SuperAdmin' ? '' : [ - , - { - delUsers([record.id]) - }} - > - - , - - ] - }, - }, - ]; - - //弹窗确认 - const onConfirm = (values) => { - if (modalType == 'edit') { - dispatch(updateUser(modalRecord.id, values.contract)).then(res => { - if (res.success) { - setModalVisible(false); - dispatch(getDepUser(depSelectedKeys[0])); - } - }); - } else { - dispatch(createUser(values.contract)).then(res => { - if (res.success) { - setModalVisible(false); - dispatch(getDepUser(depSelectedKeys[0])); - } - }); - } - - } - - //打开弹窗 - const openModal = (type, record) => { - setModalVisible(true); - setModalType(type); - if (type == 'edit') { - setModalRecord(record); - } else { - setModalRecord(null); - } - } - - //删除用户 - const delUsers = (ids, type) => { - dispatch(delUser(ids)).then(res => { - dispatch(getDepUser(depSelectedKeys[0])); - if (type == 'batch') { - setRowSelected([]); - } - }); - } - - //重置密码 - const onPwdConfirm = (values) => { - dispatch(resetPwd(modalRecord.id, { password: values.password })).then(res => { - if (res.success) { - setPwdModalVisible(false); - dispatch(getDepUser(depSelectedKeys[0])); - } - }); - } - - return (
    - - - - - { - depMessage.length ? - { - if (e.selected) { - setDepSelectedKeys(selectedKeys) - dispatch(getDepUser(selectedKeys[0])) - } - }} - treeData={depMessage} - fieldNames={{ - title: 'name', - key: 'id', - children: 'subordinate' - }} - /> : '' - } - - - - - - { - setRowSelected(selectedRowKeys); - - }, - getCheckboxProps: (record) => { - return { - disabled: record.username === 'SuperAdmin', - } - }, - }} - options={false} - search={false} - rowKey="id" - toolBarRender={() => [ - - - - { delUsers(rowSelected, 'batch') }}> - - - - ]} - /> - - - { - depMessage.length && modalVisible ? - - : '' - } - {pwdModalVisible ? : ''} - - - - -
    - - ) -} - -function mapStateToProps(state) { - const { depMessage, depUser, global } = state; - // console.log(state); - return { - clientHeight: global.clientHeight, - loading: depMessage.isRequesting, - depMessage: depMessage.data || [], - depUser: depUser.data || [] - - }; -} - -export default connect(mapStateToProps)(UserManage); \ No newline at end of file diff --git a/web/client/src/sections copy/organization/index.js b/web/client/src/sections copy/organization/index.js deleted file mode 100644 index 412ced64..00000000 --- a/web/client/src/sections copy/organization/index.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -import reducers from './reducers'; -import routes from './routes'; -import actions from './actions'; -import { getNavItem } from './nav-item'; - -export default { - key: 'organization', - name: '', - reducers: reducers, - routes: routes, - actions: actions, - getNavItem: getNavItem -}; \ No newline at end of file diff --git a/web/client/src/sections copy/organization/nav-item.js b/web/client/src/sections copy/organization/nav-item.js deleted file mode 100644 index 19a8d2c5..00000000 --- a/web/client/src/sections copy/organization/nav-item.js +++ /dev/null @@ -1,31 +0,0 @@ -import React from 'react'; -import { Link } from 'react-router-dom'; -import { Menu } from 'antd'; -import { SettingOutlined } from '@ant-design/icons'; -import { Func } from '$utils'; -import { push } from 'react-router-redux'; - - -const SubMenu = Menu.SubMenu; - -export function getNavItem(user, dispatch) { - if (!Func.isAuthorized("ORG_MANAGE")) { - return null - } - // console.log(!Func.isAuthorized("ORG_MANAGE")); - if (user.type != 1 && user.type != 2 && user.type != 3) { - dispatch(push('/fillion/infor')); - return null - } - return ( - } title={'组织管理'}> - {Func.isAuthorized("ORG_MEMBER") && - 用户管理 - - } - {Func.isAuthorized("ORG_AUTH") && - 权限配置 - } - - ); -} \ No newline at end of file diff --git a/web/client/src/sections copy/organization/reducers/index.js b/web/client/src/sections copy/organization/reducers/index.js deleted file mode 100644 index 0203d01b..00000000 --- a/web/client/src/sections copy/organization/reducers/index.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -export default { - -}; \ No newline at end of file diff --git a/web/client/src/sections copy/organization/routes.js b/web/client/src/sections copy/organization/routes.js deleted file mode 100644 index 67d59793..00000000 --- a/web/client/src/sections copy/organization/routes.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; -import { UserManage, Authority } from './containers'; - -export default [{ - type: 'inner', - route: { - path: '/organization', - key: 'organization', - breadcrumb: '组织管理', - menuSelectKeys: ['userManage'], - menuOpenKeys: ['organization'], - childRoutes: [{ - path: '/user', - key: 'userManage', - menuSelectKeys: ['userManage'], - component: UserManage, - breadcrumb: '用户管理', - }, { - path: '/authority', - key: 'authority', - component: Authority, - menuSelectKeys: ['authority'], - breadcrumb: '权限配置', - }] - } -}]; \ No newline at end of file diff --git a/web/client/src/sections copy/report/actions/compile.js b/web/client/src/sections copy/report/actions/compile.js deleted file mode 100644 index 339bca22..00000000 --- a/web/client/src/sections copy/report/actions/compile.js +++ /dev/null @@ -1,37 +0,0 @@ -'use strict'; - -import { basicAction } from '@peace/utils' -import { ApiTable } from '$utils' - -export function reportRectify (timeRange) { - return dispatch => basicAction({ - type: 'get', - dispatch: dispatch, - actionType: 'GET_REPORT_RECTIFY', - url: `${ApiTable.getReportRectify}?startTime=${timeRange ? timeRange[0] : ''}&endTime=${timeRange ? timeRange[1] : ''}`, - msg: {}, - reducer: { name: 'reportRectify' } - }); -} - -export function reportRectifyDetail (day, depId) { - return dispatch => basicAction({ - type: 'get', - dispatch: dispatch, - actionType: 'GET_REPORT_RECTIFY_DETAIL', - url: `${ApiTable.getReportRectifyDetail}?day=${day}&depId=${depId}`, - msg: {}, - reducer: { name: 'reportRectifyDetail' } - }); -} - -export function compileReportRectifyDetail (data) { - return dispatch => basicAction({ - type: 'post', - dispatch: dispatch, - data, - actionType: 'COMPILE_REPORT_RECTIFY_DETAIL', - url: `${ApiTable.compileReportRectifyDetail}`, - msg: { option: '保存信息' }, - }); -} \ No newline at end of file diff --git a/web/client/src/sections copy/report/actions/config.js b/web/client/src/sections copy/report/actions/config.js deleted file mode 100644 index d8a66a79..00000000 --- a/web/client/src/sections copy/report/actions/config.js +++ /dev/null @@ -1,59 +0,0 @@ -'use strict'; - -import { basicAction } from '@peace/utils' -import { ApiTable } from '$utils' - -export function allAreas (orgId) { - return dispatch => basicAction({ - type: 'get', - dispatch: dispatch, - actionType: 'GET_ALL_AREAS', - url: `${ApiTable.allAreas}`, - msg: {}, - reducer: { name: 'allAreas' } - }); -} - -export function addReportConfig (data) { - return dispatch => basicAction({ - type: 'post', - dispatch: dispatch, - data: data, - actionType: 'POST_REPORT_CONFIGS', - url: `${ApiTable.addReportConfig}`, - msg: { option: '添加报表配置' }, - }); -} - -export function getReportConfig () { - return dispatch => basicAction({ - type: 'get', - dispatch: dispatch, - actionType: 'GET_REPORT_CONFIGS', - url: `${ApiTable.getReportConfig}`, - msg: { error: '获取报表配置失败' }, - reducer: { name: 'reportConfig' } - }); -} - -export function editReportConfig (data, configId) { - return dispatch => basicAction({ - type: 'put', - dispatch: dispatch, - data: data, - actionType: 'EDIT_REPORT_CONFIGS', - url: `${ApiTable.editReportConfig.replace('{reportId}', configId)}`, - msg: { option: '编辑报表配置' }, - }); -} - -export function delReportConfig (configId) { - return dispatch => basicAction({ - type: 'del', - dispatch: dispatch, - actionType: 'DEL_REPORT_CONFIGS', - url: `${ApiTable.delReportConfig.replace('{reportId}', configId)}`, - msg: { option: '删除报表配置' }, - }); -} - diff --git a/web/client/src/sections copy/report/actions/download.js b/web/client/src/sections copy/report/actions/download.js deleted file mode 100644 index 3879fae4..00000000 --- a/web/client/src/sections copy/report/actions/download.js +++ /dev/null @@ -1,26 +0,0 @@ -import { basicAction } from '@peace/utils' -import { ApiTable } from '$utils' - -export function getReportList(query) { - return dispatch => basicAction({ - type: 'get', - dispatch: dispatch, - query: query, - actionType: 'GET_REPORT_LIST', - url: ApiTable.getReportList, - msg: { error: '获取报表数据失败' }, - reducer: { name: 'reportList' } - }); -} - -export function getRegionList(query) { - return dispatch => basicAction({ - type: 'get', - dispatch: dispatch, - query: query, - actionType: 'GET_REGION_LIST', - url: ApiTable.allAreas, - msg: { error: '获取区域数据失败' }, - reducer: { name: 'regionList' } - }); -} \ No newline at end of file diff --git a/web/client/src/sections copy/report/actions/index.js b/web/client/src/sections copy/report/actions/index.js deleted file mode 100644 index 01665ba2..00000000 --- a/web/client/src/sections copy/report/actions/index.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -import * as config from './config' -import * as download from './download' -import * as compile from './compile' - -export default { - ...config, - ...download, - ...compile, -} \ No newline at end of file diff --git a/web/client/src/sections copy/report/components/compileDrawer.js b/web/client/src/sections copy/report/components/compileDrawer.js deleted file mode 100644 index 2b2cb107..00000000 --- a/web/client/src/sections copy/report/components/compileDrawer.js +++ /dev/null @@ -1,118 +0,0 @@ -import React, { useEffect, useState } from 'react'; -import { connect } from 'react-redux'; -import { Spin, Drawer, Button } from 'antd'; -import '../style.less'; -import { EditableProTable } from '@ant-design/pro-table'; - -const CompileDrawer = (props) => { - const { dispatch, actions, user, loading, visible, checkRow, close, reportRectifyDetail, checkAction } = props - const [requesting, setRequesting] = useState(false) - const [dataSource, setDataSource] = useState([]) - const { report } = actions - const isCheck = checkAction == 'check' - - useEffect(() => { - if (checkRow.day) { - dispatch(report.reportRectifyDetail(checkRow.day, checkRow.depId)) - } - }, [checkRow]) - - useEffect(() => { - let data = reportRectifyDetail - let i = 1 - for (let d of data) { - d.index_ = i++ - } - setDataSource(data) - }, [reportRectifyDetail]) - - return ( - { - close() - }} - visible={visible} - width={'82%'} - > - - r.id) - }} - toolBarRender={() => [ - isCheck ? '' : - - ]} - > - - - - - ) -} - -function mapStateToProps (state) { - const { auth, global, members, reportRectifyDetail } = state; - return { - loading: reportRectifyDetail.isRequesting, - user: auth.user, - actions: global.actions, - members: members.data, - reportRectifyDetail: reportRectifyDetail.data || [] - }; -} - -export default connect(mapStateToProps)(CompileDrawer); diff --git a/web/client/src/sections copy/report/components/configModal.js b/web/client/src/sections copy/report/components/configModal.js deleted file mode 100644 index aa5d344f..00000000 --- a/web/client/src/sections copy/report/components/configModal.js +++ /dev/null @@ -1,124 +0,0 @@ -import React, { useEffect, useRef } from 'react'; -import { connect } from 'react-redux'; -import { Spin, Button, Modal, Form, Switch } from 'antd'; -import ProForm, { ProFormText, ProFormSelect } from '@ant-design/pro-form'; -import { useState } from 'react'; - -const ConfigModal = (props) => { - const { dispatch, actions, user, loading, visible, close, editData, allAreas, reportType } = props - const [excuteTimeOptions, setExcuteTimeOptions] = useState([]) - const formRef = useRef() - const { report } = actions - - useEffect(() => { - let excuteTimeOptions = [] - for (let i = 0; i < 24; i++) { - let curT = i - if (curT < 10) { - curT = '0' + curT - } - excuteTimeOptions.push({ - value: curT + ':00', - label: curT + ':00', - }) - excuteTimeOptions.push({ - value: curT + ':30', - label: curT + ':30', - }) - } - setExcuteTimeOptions(excuteTimeOptions); - }, []) - - return ( - { - formRef.current.validateFields().then(v => { - v.excuteTime = String(v.excuteTime) - console.log(v); - dispatch(editData ? report.editReportConfig(v, editData.id) : report.addReportConfig(v)).then(res => { - if (res.success) { - dispatch(report.getReportConfig()) - close() - } - }) - }) - }} - onCancel={() => { - close() - }} - > - - - - { - return { - value: a.id, - label: a.name, - } - })} - cacheForSwr - name="regionId" - label="区域" - required - rules={[{ required: true, message: '请选择区域' }]} - /> - - - - - - - ) -} - -function mapStateToProps (state) { - const { auth, global, allAreas } = state; - console.log(allAreas); - return { - user: auth.user, - actions: global.actions, - allAreas: allAreas.data || [] - }; -} - -export default connect(mapStateToProps)(ConfigModal); diff --git a/web/client/src/sections copy/report/containers/compile.js b/web/client/src/sections copy/report/containers/compile.js deleted file mode 100644 index def77e7b..00000000 --- a/web/client/src/sections copy/report/containers/compile.js +++ /dev/null @@ -1,111 +0,0 @@ -// 报表编辑 - -import React, { useEffect, useState } from 'react'; -import { connect } from 'react-redux'; -import moment from 'moment' -import CompileDrawer from '../components/compileDrawer' -import { Spin, Button, DatePicker, Space, Switch } from 'antd'; -import ProTable from '@ant-design/pro-table'; -import { Func } from '$utils'; - -const { RangePicker } = DatePicker; - -const Compile = (props) => { - const { dispatch, actions, user, loading, reportRectify } = props - const [searchTime, setSearchTime] = useState([moment(), moment()]) - const [compileDrawerVis, setCompileDrawerVis] = useState(false) - const [checkRow, setCheckRow] = useState({}) - const [checkAction, setCheckAction] = useState('') - const { report } = actions - - const getReportRectify = (searchTime) => { - dispatch(report.reportRectify([moment(searchTime[0]).format('YYYY-MM-DD'), moment(searchTime[1]).format('YYYY-MM-DD')])) - } - - useEffect(() => { - getReportRectify(searchTime) - }, []) - - const showCompileDrawerVis = (row, action) => { - setCompileDrawerVis(true) - setCheckRow(row) - setCheckAction(action) - } - - return ( - - { - return - } - }, { - title: '操作', - dataIndex: 'option', - render: (_, r) => { - return [ - - {/* {Func.isAuthorized("REPORT_EDIT") && - - } */} - - - ] - } - },]} - dataSource={reportRectify} - rowKey="index" - search={false} - options={false} - headerTitle="合用场所安全隐患排查整治汇总表" - toolBarRender={() => [ - { - setSearchTime(date) - getReportRectify(dateString) - }} - />, - ]} - > - - - { - setCompileDrawerVis(false) - setCheckRow({}) - setCheckAction('') - - getReportRectify(searchTime) - }} - checkRow={checkRow} - checkAction={checkAction} - /> - - ) -} - -function mapStateToProps(state) { - const { auth, global, reportRectify } = state; - console.log(reportRectify); - return { - user: auth.user, - actions: global.actions, - loading: reportRectify.isRequesting, - reportRectify: reportRectify.data || [] - }; -} - -export default connect(mapStateToProps)(Compile); diff --git a/web/client/src/sections copy/report/containers/config.js b/web/client/src/sections copy/report/containers/config.js deleted file mode 100644 index 40fa411b..00000000 --- a/web/client/src/sections copy/report/containers/config.js +++ /dev/null @@ -1,157 +0,0 @@ -import React, { useEffect, useState } from 'react'; -import { connect } from 'react-redux'; -import ConfigModal from '../components/configModal' -import { Spin, Button, Space, Popconfirm, Switch } from 'antd'; -import ProTable from '@ant-design/pro-table'; -import '../style.less'; -import Pinyin from '../../../utils/pinyin' -const reportType = [{ - value: 1, - label: '县区排查整治汇总表', -}, { - value: 2, - label: '各县区每日汇总表', -}, { - value: 3, - label: '隐患场所汇总表', -},] -var pinyin = null -var as = null -var bs = null -const Config = (props) => { - const { dispatch, actions, loading, reportConfig, allAreas } = props - const [configModalVis, setConfigModalVis] = useState(false) - const [editData, setEditData] = useState(null) - const { report } = actions - useEffect(() => { - dispatch(report.getReportConfig()) - dispatch(report.allAreas()) - - }, []) - useEffect(()=>{ - pinyin=new Pinyin() - }) - return ( - - { - let regionOne = allAreas.find(item => item.id == a.regionId) - let regionTwo = allAreas.find(item => item.id == b.regionId) - - if (regionOne) { - as = pinyin.getCamelChars(regionOne.name).toLowerCase() - - } if (regionTwo) { - bs = pinyin.getCamelChars(regionTwo.name).toLowerCase() - - } else { - return '' - } - let codeOne=as.substr(0,1).charCodeAt() - let codeTwo=bs.substr(0,1).charCodeAt() - return codeOne-codeTwo - }, - render: (_, row, index, action) => { - let curRegion = allAreas.find(a => a.id == row.regionId) - return curRegion ? curRegion.name : '' - }, - }, { - title: '类型', - dataIndex: 'reportType', - - render: (_, r) => { - let curType = reportType.find(t => t.value == r.reportTypeId) - return curType ? curType.label : '' - }, - - }, { - title: '生成时间', - dataIndex: 'index', - render: (_, row) => { - return `每日 ${row.excuteTime.indexOf(':') > -1 ? row.excuteTime : row.excuteTime + ':00'}` - } - }, { - title: '启用状态', - dataIndex: 'isEnable', - render: (_, row) => { - return - - } - }, { - title: '操作', - dataIndex: 'option', - render: (_, row) => { - return [ - - - { - dispatch(report.delReportConfig(row.id)).then(res => { - if (res.success) { - dispatch(report.getReportConfig()) - } - }) - }} - > - - - - ] - } - },]} - dataSource={reportConfig} - rowKey="id" - search={false} - options={false} - toolBarRender={() => [ - , - ]} - > - - - { - configModalVis ? - { - setConfigModalVis(false) - setEditData(null) - }} - reportType={reportType} - editData={editData} - /> : '' - } - - ) -} - -function mapStateToProps(state) { - const { auth, global, reportConfig, allAreas } = state; - return { - loading: reportConfig.isRequesting, - user: auth.user, - actions: global.actions, - reportConfig: reportConfig.data || [], - allAreas: allAreas.data || [] - }; -} - -export default connect(mapStateToProps)(Config); diff --git a/web/client/src/sections copy/report/containers/download.js b/web/client/src/sections copy/report/containers/download.js deleted file mode 100644 index ff379d21..00000000 --- a/web/client/src/sections copy/report/containers/download.js +++ /dev/null @@ -1,129 +0,0 @@ -import React, { useEffect } from 'react'; -import { connect } from 'react-redux'; -import { Spin, Button } from 'antd'; -import ProTable from '@ant-design/pro-table'; -import '../style.less'; -import moment from 'moment'; -import { Func } from '$utils'; - -const Download = (props) => { - const { dispatch, actions, reportList, regionList, user } = props - - useEffect(() => { - dispatch(actions.report.getRegionList()); - }, []); - - const columns = [{ - title: '报表名称', - dataIndex: 'reportName', - formItemProps: { - label: null, - }, - fieldProps: { - placeholder: '输入报表名称' - } - }, { - title: '区域名称', - dataIndex: 'regionName', - valueType: 'select', - initialValue: -1, - fieldProps: { - label: null, - options: [{ - label: '全部', - value: -1 - }].concat(regionList) - }, - order: 5, - render: (dom, record) => { - return record.department ? record.department.name : null - } - }, { - title: '类型', - dataIndex: 'reportType', - hideInSearch: true, - render: (dom, record) => { - return record.reportType ? record.reportType.name : null - } - }, { - title: '生成时间', - dataIndex: 'creatTime', - valueType: 'dateTimeRange', - order: 4, - render: (dom, record) => { - return moment(record.creatTime).format('YYYY-MM-DD HH:mm') - } - }] - if (Func.isAuthorized("REPORT_DOWN")) { - columns.push({ - title: '操作', - key: 'option', - hideInSearch: true, - render: (dom, record) => { - // const ApiRoot = localStorage.getItem('tyApiRoot'); - const filePathArr = record.filePath.split('/') - - const fileName = filePathArr.pop() - // console.log(fileName); - return [ - // 下载 - - 下载 - - ] - } - }) - } - - return ( - - { - const query = { - limit: params.pageSize, - offset: params.pageSize * (params.current - 1), - creatTime: params.creatTime, - reportName: params.reportName, - regionName: params.regionName - } - const res = await dispatch(actions.report.getReportList(query)); - return { - ...res, - total: res.payload.data ? res.payload.data.count : 0 - } - }} - > - - - ) -} - -function mapStateToProps (state) { - const { auth, global, reportList, regionList } = state; - const { count, rows } = reportList.data || {}; - let regions = []; - if (regionList.data && regionList.data.length > 0) { - regions = regionList.data.map(v => { - return { - label: v.name, - value: v.id, - } - }); - } - return { - user: auth.user, - actions: global.actions, - reportList: rows || [], - regionList: regions - }; -} - -export default connect(mapStateToProps)(Download); \ No newline at end of file diff --git a/web/client/src/sections copy/report/containers/index.js b/web/client/src/sections copy/report/containers/index.js deleted file mode 100644 index 0b3cead7..00000000 --- a/web/client/src/sections copy/report/containers/index.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -import Config from './config'; -import Download from './download'; -import Compile from './compile' - -export { Config, Download, Compile }; \ No newline at end of file diff --git a/web/client/src/sections copy/report/index.js b/web/client/src/sections copy/report/index.js deleted file mode 100644 index 68dac209..00000000 --- a/web/client/src/sections copy/report/index.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -import reducers from './reducers'; -import routes from './routes'; -import actions from './actions'; -import { getNavItem } from './nav-item'; - -export default { - key: 'report', - name: '报表管理', - reducers: reducers, - routes: routes, - actions: actions, - getNavItem: getNavItem -}; \ No newline at end of file diff --git a/web/client/src/sections copy/report/nav-item.js b/web/client/src/sections copy/report/nav-item.js deleted file mode 100644 index 29c57396..00000000 --- a/web/client/src/sections copy/report/nav-item.js +++ /dev/null @@ -1,35 +0,0 @@ -import React from 'react'; -import { Link } from 'react-router-dom'; -import { Menu } from 'antd'; -import { FileTextOutlined } from '@ant-design/icons'; -import { Func } from '$utils'; -import { push } from 'react-router-redux'; - - -const SubMenu = Menu.SubMenu; - -export function getNavItem(user, dispatch) { - if (user.type != 1 && user.type != 2) { - dispatch(push('/fillion/infor')); - return null - } - if (!Func.isAuthorized("REPORT_MANAGE")) { - return null - } - return ( - } title={'报表管理'}> - {Func.isAuthorized("REPROT_CONFIG") && - 报表配置 - } - {Func.isAuthorized("REPORT_DOWN") && - 报表下载 - } - {Func.isAuthorized("REPORT_LIST") && - - 整治汇总表 - - } - - - ); -} \ No newline at end of file diff --git a/web/client/src/sections copy/report/reducers/index.js b/web/client/src/sections copy/report/reducers/index.js deleted file mode 100644 index 7ed10886..00000000 --- a/web/client/src/sections copy/report/reducers/index.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -export default { - -} \ No newline at end of file diff --git a/web/client/src/sections copy/report/routes.js b/web/client/src/sections copy/report/routes.js deleted file mode 100644 index 1d55966d..00000000 --- a/web/client/src/sections copy/report/routes.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict'; -import { Config, Download, Compile } from './containers'; - -export default [{ - type: 'inner', - route: { - path: '/report', - key: 'report', - breadcrumb: '报表管理', - menuSelectKeys: ['config'], - menuOpenKeys: ['report'], - // 不设置 component 则面包屑禁止跳转 - childRoutes: [{ - path: '/config', - key: 'reportConfig', - component: Config, - menuSelectKeys:['reportConfig'], - breadcrumb: '报表配置', - }, { - path: '/download', - key: 'reportDownload', - menuSelectKeys:['reportDownload'], - component: Download, - breadcrumb: '报表下载', - }, { - path: '/compile', - key: 'reportCompile', - menuSelectKeys:['reportCompile'], - component: Compile, - breadcrumb: '整治汇总表', - }] - } -}]; \ No newline at end of file diff --git a/web/client/src/sections copy/report/style.less b/web/client/src/sections copy/report/style.less deleted file mode 100644 index 33234528..00000000 --- a/web/client/src/sections copy/report/style.less +++ /dev/null @@ -1,3 +0,0 @@ -#example:hover { - font-size: larger; -} \ No newline at end of file diff --git a/web/client/src/sections/auth/containers/login.js b/web/client/src/sections/auth/containers/login.js index 13a01a91..7b4a98bb 100644 --- a/web/client/src/sections/auth/containers/login.js +++ b/web/client/src/sections/auth/containers/login.js @@ -59,7 +59,7 @@ const Login = props => {
    -

    智慧应急

    +

    四好公路

    diff --git a/web/client/src/sections/quanju/containers/footer/build/index.js b/web/client/src/sections/quanju/containers/footer/build/index.js index 1b0f3f0f..7340f12a 100644 --- a/web/client/src/sections/quanju/containers/footer/build/index.js +++ b/web/client/src/sections/quanju/containers/footer/build/index.js @@ -2,7 +2,7 @@ import React from 'react' const Build = () => { return ( - <>Build + <>建设 ) } export default Build diff --git a/web/client/src/sections/quanju/containers/footer/conserve/index.js b/web/client/src/sections/quanju/containers/footer/conserve/index.js index e48f40cb..aacec5c8 100644 --- a/web/client/src/sections/quanju/containers/footer/conserve/index.js +++ b/web/client/src/sections/quanju/containers/footer/conserve/index.js @@ -2,7 +2,7 @@ import React from 'react' const Conserve = () => { return ( - <>1212121 + <>养护 ) } export default Conserve \ No newline at end of file diff --git a/web/client/src/sections/quanju/containers/footer/leadership/centerLeft.js b/web/client/src/sections/quanju/containers/footer/leadership/centerLeft.js index f5745538..49e2c97b 100644 --- a/web/client/src/sections/quanju/containers/footer/leadership/centerLeft.js +++ b/web/client/src/sections/quanju/containers/footer/leadership/centerLeft.js @@ -7,7 +7,7 @@ import Centerleftbottom from "./centerleft/center-left-bottom" const CenterLeft = () => { return ( <> -
    +
    diff --git a/web/client/src/sections/quanju/containers/footer/leadership/centerleft/center-left-bottom.js b/web/client/src/sections/quanju/containers/footer/leadership/centerleft/center-left-bottom.js index cd33b97d..b9d6d319 100644 --- a/web/client/src/sections/quanju/containers/footer/leadership/centerleft/center-left-bottom.js +++ b/web/client/src/sections/quanju/containers/footer/leadership/centerleft/center-left-bottom.js @@ -2,11 +2,11 @@ import React from 'react' import Module from '../../../public/module' const Leftbottom = () => { - const style = { height: "23%", marginTop: "5%" } + const style = { height: "28%", marginTop: "2%" } return ( <> -
    +
    ) diff --git a/web/client/src/sections/quanju/containers/footer/leadership/centerleft/center-left-top.js b/web/client/src/sections/quanju/containers/footer/leadership/centerleft/center-left-top.js index 9c7e922c..fada6e84 100644 --- a/web/client/src/sections/quanju/containers/footer/leadership/centerleft/center-left-top.js +++ b/web/client/src/sections/quanju/containers/footer/leadership/centerleft/center-left-top.js @@ -3,11 +3,11 @@ import Module from '../../../public/module' const Lefttop = (props) => { const { } = props - const style = { height: "23%" } + const style = { height: "68%" } return ( <> -
    +
    ) diff --git a/web/client/src/sections/quanju/containers/footer/leadership/left/echarts/leftbottomecharts.js b/web/client/src/sections/quanju/containers/footer/leadership/left/echarts/leftbottomecharts.js new file mode 100644 index 00000000..bfec0134 --- /dev/null +++ b/web/client/src/sections/quanju/containers/footer/leadership/left/echarts/leftbottomecharts.js @@ -0,0 +1,71 @@ +import React, { useEffect, useRef } from 'react' +import * as echarts from 'echarts'; + +const Leftbottomecharts = () => { + const chartRef = useRef(null); + + useEffect(() => { + let chartInstance = echarts.init(chartRef.current); + const option = { + + xAxis: { + type: "category", + data: ["街道1", "街道2", "街道3", "街道4", "街道5", "街道6", "街道7"], + }, + yAxis: [ + { type: "value" }, + { + type: "value", + nameTextStyle: { + color: "#ccc", + }, + splitNumber: 5, + splitLine: { + show: true, + lineStyle: { + type: "dashed", + width: 1, + color: ["#ccc", "#ccc"], + }, + }, + axisLabel: { + show: true, + textStyle: { + fontSize: 12, + }, + }, + }, + ], + tooltip: { + trigger: "axis", + axisPointer: { + type: "shadow", + }, + textStyle: { + color: "#fff", + align: "left", + fontSize: 14, + }, + backgroundColor: "rgba(0,0,0,0.8)", + }, + series: [ + { + name: "完成率", + data: [50, 130, 124, 18, 35, 47, 160], + yAxisIndex: 1, + type: "line", + smooth: true, + }, + ], + }; + chartInstance.setOption(option); + }, []); + + return ( + <> +
    + + ); +} + +export default Leftbottomecharts \ No newline at end of file diff --git a/web/client/src/sections/quanju/containers/footer/leadership/left/left-bottom.js b/web/client/src/sections/quanju/containers/footer/leadership/left/left-bottom.js index bd992c86..1164dab6 100644 --- a/web/client/src/sections/quanju/containers/footer/leadership/left/left-bottom.js +++ b/web/client/src/sections/quanju/containers/footer/leadership/left/left-bottom.js @@ -1,12 +1,13 @@ import React from 'react' import Module from '../../../public/module' +import Echartes from "./echarts/leftbottomecharts" const Leftbottom = () => { - const style = { height: "25%", marginTop: "5%" } + const style = { height: "28%", marginTop: "5%" } return ( <> - + ) diff --git a/web/client/src/sections/quanju/containers/footer/leadership/left/left-center.js b/web/client/src/sections/quanju/containers/footer/leadership/left/left-center.js index 767e2d38..9beb1113 100644 --- a/web/client/src/sections/quanju/containers/footer/leadership/left/left-center.js +++ b/web/client/src/sections/quanju/containers/footer/leadership/left/left-center.js @@ -6,7 +6,7 @@ const Leftcenter = () => { return ( <> -
    +
    ) diff --git a/web/client/src/sections/quanju/containers/footer/leadership/left/left-top.js b/web/client/src/sections/quanju/containers/footer/leadership/left/left-top.js index 14af9db5..f879054b 100644 --- a/web/client/src/sections/quanju/containers/footer/leadership/left/left-top.js +++ b/web/client/src/sections/quanju/containers/footer/leadership/left/left-top.js @@ -2,7 +2,7 @@ import React from 'react' import Module from '../../../public/module' const Lefttop = () => { - const style = { height: "25%" } + const style = { height: "25%", height: "35%" } return ( <> diff --git a/web/client/src/sections/quanju/containers/footer/leadership/right/right-bottom.js b/web/client/src/sections/quanju/containers/footer/leadership/right/right-bottom.js index f6a8aa24..1b534859 100644 --- a/web/client/src/sections/quanju/containers/footer/leadership/right/right-bottom.js +++ b/web/client/src/sections/quanju/containers/footer/leadership/right/right-bottom.js @@ -2,11 +2,11 @@ import React from 'react' import Module from '../../../public/module' const Rightbottom = () => { - const style = { height: "45%", marginTop: "5%" } + const style = { height: "28%", marginTop: "4%" } return ( <> -
    +
    ) diff --git a/web/client/src/sections/quanju/containers/footer/leadership/right/right-top.js b/web/client/src/sections/quanju/containers/footer/leadership/right/right-top.js index d1955b88..239b7815 100644 --- a/web/client/src/sections/quanju/containers/footer/leadership/right/right-top.js +++ b/web/client/src/sections/quanju/containers/footer/leadership/right/right-top.js @@ -2,7 +2,7 @@ import React from 'react' import Module from '../../../public/module' const Righttop = () => { - const style = { height: "45%" } + const style = { height: "68%" } return ( <> diff --git a/web/client/src/sections/quanju/routes.js b/web/client/src/sections/quanju/routes.js index cb7dd73a..e5d203a2 100644 --- a/web/client/src/sections/quanju/routes.js +++ b/web/client/src/sections/quanju/routes.js @@ -6,16 +6,9 @@ export default [{ route: { path: '/quanju', key: 'quanju', - breadcrumb: '栗子222', + breadcrumb: '全局展示', exact: false, component: Example, - // 不设置 component 则面包屑禁止跳转 - // childRoutes: [{ - // path: '/e2', - // key: 'e2', - // exact: false, - // component: Build, - // breadcrumb: '棒子', - // }] + } }]; \ No newline at end of file diff --git a/web/client/src/themes/light.json b/web/client/src/themes/light.json index a7c012cd..c59ee5e5 100644 --- a/web/client/src/themes/light.json +++ b/web/client/src/themes/light.json @@ -1 +1 @@ -{"@line-height-base":"1.66667","@mode":"compact","@font-size-base":"12px","@font-size-lg":"@font-size-base + 2px","@default-padding-lg":"24px","@default-padding-md":"16px","@default-padding-sm":"12px","@default-padding-xs":"8px","@default-padding-xss":"4px","@padding-lg":"16px","@padding-md":"8px","@padding-sm":"8px","@padding-xs":"4px","@padding-xss":"0px","@control-padding-horizontal":"@padding-sm","@control-padding-horizontal-sm":"@default-padding-xs","@margin-lg":"16px","@margin-md":"8px","@margin-sm":"8px","@margin-xs":"4px","@margin-xss":"0px","@height-base":"28px","@height-lg":"32px","@height-sm":"22px","@btn-padding-horizontal-base":"@default-padding-sm - 1px","@btn-padding-horizontal-lg":"@btn-padding-horizontal-base","@btn-padding-horizontal-sm":"@default-padding-xs - 1px","@btn-square-only-icon-size-lg":"16px","@btn-square-only-icon-size":"14px","@btn-square-only-icon-size-sm":"12px","@breadcrumb-font-size":"@font-size-base","@breadcrumb-icon-font-size":"@font-size-base","@dropdown-line-height":"18px","@menu-item-padding":"0 12px","@menu-horizontal-line-height":"38px","@menu-inline-toplevel-item-height":"32px","@menu-item-height":"32px","@menu-item-vertical-margin":"0px","@menu-item-boundary-margin":"0px","@menu-icon-margin-right":"8px","@checkbox-size":"14px","@checkbox-group-item-margin-right":"6px","@picker-panel-cell-height":"22px","@picker-panel-cell-width":"32px","@picker-text-height":"32px","@picker-time-panel-cell-height":"24px","@picker-panel-without-time-cell-height":"48px","@form-item-margin-bottom":"16px","@form-vertical-label-padding":"0 0 4px","@rate-star-size":"16px","@radio-size":"14px","@radio-wrapper-margin-right":"6px","@switch-height":"20px","@switch-sm-height":"14px","@switch-min-width":"40px","@switch-sm-min-width":"24px","@switch-inner-margin-min":"4px","@switch-inner-margin-max":"22px","@slider-handle-size":"12px","@slider-handle-margin-top":"-4px","@input-padding-vertical-base":"round(\n max(\n (round(((@input-height-base - @font-size-base * @line-height-base) / 2) * 10) / 10) -\n @border-width-base,\n 2px\n )\n)","@input-padding-horizontal-lg":"11px","@page-header-padding":"16px","@page-header-padding-vertical":"8px","@page-header-heading-title":"16px","@page-header-heading-sub-title":"12px","@page-header-tabs-tab-font-size":"14px","@pagination-mini-options-size-changer-top":"1px","@pagination-item-size-sm":"22px","@cascader-dropdown-line-height":"@dropdown-line-height","@select-dropdown-height":"@height-base","@select-single-item-height-lg":"32px","@select-multiple-item-height":"@input-height-base - max(@input-padding-vertical-base, 4) * 2","@select-multiple-item-height-lg":"24px","@select-multiple-item-spacing-half":"3px","@tree-title-height":"20px","@transfer-item-padding-vertical":"3px","@transfer-list-search-icon-top":"8px","@transfer-header-height":"36px","@comment-actions-margin-bottom":"0px","@comment-actions-margin-top":"@margin-xs","@comment-content-detail-p-margin-bottom":"0px","@steps-icon-size":"24px","@steps-icon-custom-size":"20px","@steps-icon-custom-font-size":"20px","@steps-icon-custom-top":"2px","@steps-icon-margin":"2px 8px 2px 0","@steps-icon-font-size":"@font-size-base","@steps-dot-top":"4px","@steps-icon-top":"0px","@steps-small-icon-size":"20px","@steps-vertical-icon-width":"12px","@steps-vertical-tail-width":"12px","@steps-vertical-tail-width-sm":"10px","@collapse-header-padding-extra":"32px","@collapse-content-padding":"@padding-md @padding-lg","@list-item-meta-description-font-size":"@font-size-sm","@list-item-padding-sm":"4px 12px","@list-item-padding-lg":"12px 16px","@drawer-header-padding":"11px @padding-lg","@drawer-footer-padding-vertical":"@padding-sm","@drawer-footer-padding-horizontal":"@padding-sm","@drawer-header-close-size":"44px","@modal-header-padding":"11px @modal-header-padding-horizontal","@modal-footer-padding-vertical":"@padding-sm","@modal-header-close-size":"44px","@modal-confirm-body-padding":"24px 24px 16px","@message-notice-content-padding":"8px 16px","@popover-min-height":"28px","@popover-padding-horizontal":"@default-padding-sm","@card-padding-base":"12px","@card-head-height":"36px","@card-head-font-size":"@card-head-font-size-sm","@card-head-padding":"8.5px","@card-padding-base-sm":"@card-padding-base","@card-head-height-sm":"30px","@card-head-padding-sm":"6px","@card-actions-li-margin":"4px 0","@card-head-tabs-margin-bottom":"-9px","@table-padding-vertical":"12px","@table-padding-horizontal":"8px","@table-padding-vertical-md":"8px","@table-padding-horizontal-md":"8px","@table-padding-vertical-sm":"4px","@table-padding-horizontal-sm":"4px","@table-selection-column-width":"32px","@statistic-content-font-size":"20px","@alert-with-description-no-icon-padding-vertical":"7px","@alert-with-description-padding-vertical":"11px","@alert-icon-top":"7px + @font-size-base * (@line-height-base / 2) - (@font-size-base / 2)","@alert-with-description-icon-size":"20px","@skeleton-paragraph-margin-top":"20px","@skeleton-paragraph-li-margin-top":"12px","@skeleton-paragraph-li-height":"14px","@skeleton-title-height":"14px","@skeleton-title-paragraph-margin-top":"20px","@descriptions-title-margin-bottom":"8px","@descriptions-default-padding":"12px @padding-lg","@descriptions-item-padding-bottom":"@padding-xs","@avatar-size-base":"28px","@avatar-size-lg":"32px","@avatar-size-sm":"22px","@avatar-font-size-base":"16px","@avatar-font-size-lg":"20px","@avatar-font-size-sm":"12px","@badge-height":"18px","@tag-line-height":"18px","@notification-padding-vertical":"12px","@notification-padding-horizontal":"16px","@result-title-font-size":"20px","@result-icon-font-size":"64px","@result-extra-margin":"24px 0 0 0","@anchor-link-top":"4px","@anchor-link-left":"16px","@anchor-link-padding":"@anchor-link-top 0 @anchor-link-top @anchor-link-left","@tabs-card-horizontal-padding":"4px @padding-md","@progress-circle-text-font-size":"0.833333em","@image-size-base":"48px","@image-font-size-base":"24px","@primary-color":"@blue-6","@layout-header-background":"#fff"} \ No newline at end of file +{"@line-height-base":"1.66667","@mode":"compact","@font-size-base":"12px","@font-size-lg":"@font-size-base + 2px","@default-padding-lg":"24px","@default-padding-md":"16px","@default-padding-sm":"12px","@default-padding-xs":"8px","@default-padding-xss":"4px","@padding-lg":"16px","@padding-md":"8px","@padding-sm":"8px","@padding-xs":"4px","@padding-xss":"0px","@control-padding-horizontal":"@padding-sm","@control-padding-horizontal-sm":"@default-padding-xs","@margin-lg":"16px","@margin-md":"8px","@margin-sm":"8px","@margin-xs":"4px","@margin-xss":"0px","@height-base":"28px","@height-lg":"32px","@height-sm":"22px","@btn-padding-horizontal-base":"@default-padding-sm - 1px","@btn-padding-horizontal-lg":"@btn-padding-horizontal-base","@btn-padding-horizontal-sm":"@default-padding-xs - 1px","@btn-square-only-icon-size-lg":"16px","@btn-square-only-icon-size":"14px","@btn-square-only-icon-size-sm":"12px","@breadcrumb-font-size":"@font-size-base","@breadcrumb-icon-font-size":"@font-size-base","@dropdown-line-height":"18px","@menu-item-padding":"0 12px","@menu-horizontal-line-height":"38px","@menu-inline-toplevel-item-height":"32px","@menu-item-height":"32px","@menu-item-vertical-margin":"0px","@menu-item-boundary-margin":"0px","@menu-icon-margin-right":"8px","@checkbox-size":"14px","@checkbox-group-item-margin-right":"6px","@picker-panel-cell-height":"22px","@picker-panel-cell-width":"32px","@picker-text-height":"32px","@picker-time-panel-cell-height":"24px","@picker-panel-without-time-cell-height":"48px","@form-item-margin-bottom":"16px","@form-vertical-label-padding":"0 0 4px","@rate-star-size":"16px","@radio-size":"14px","@radio-wrapper-margin-right":"6px","@switch-height":"20px","@switch-sm-height":"14px","@switch-min-width":"40px","@switch-sm-min-width":"24px","@switch-inner-margin-min":"4px","@switch-inner-margin-max":"22px","@slider-handle-size":"12px","@slider-handle-margin-top":"-4px","@input-padding-vertical-base":"round(\n max(\n (round(((@input-height-base - @font-size-base * @line-height-base) / 2) * 10) / 10) -\n @border-width-base,\n 2px\n )\n)","@input-padding-horizontal-lg":"11px","@page-header-padding":"16px","@page-header-padding-vertical":"8px","@page-header-heading-title":"16px","@page-header-heading-sub-title":"12px","@page-header-tabs-tab-font-size":"14px","@pagination-mini-options-size-changer-top":"1px","@pagination-item-size-sm":"22px","@cascader-dropdown-line-height":"@dropdown-line-height","@select-dropdown-height":"@height-base","@select-single-item-height-lg":"32px","@select-multiple-item-height":"@input-height-base - max(@input-padding-vertical-base, 4) * 2","@select-multiple-item-height-lg":"24px","@select-multiple-item-spacing-half":"3px","@tree-title-height":"20px","@transfer-item-padding-vertical":"3px","@transfer-list-search-icon-top":"8px","@transfer-header-height":"36px","@comment-actions-margin-bottom":"0px","@comment-actions-margin-top":"@margin-xs","@comment-content-detail-p-margin-bottom":"0px","@steps-icon-size":"24px","@steps-icon-custom-size":"20px","@steps-icon-custom-font-size":"20px","@steps-icon-custom-top":"2px","@steps-icon-margin":"2px 8px 2px 0","@steps-icon-font-size":"@font-size-base","@steps-dot-top":"4px","@steps-icon-top":"0px","@steps-small-icon-size":"20px","@steps-vertical-icon-width":"12px","@steps-vertical-tail-width":"12px","@steps-vertical-tail-width-sm":"10px","@collapse-header-padding-extra":"32px","@collapse-content-padding":"@padding-md @padding-lg","@list-item-meta-description-font-size":"@font-size-sm","@list-item-padding-sm":"4px 12px","@list-item-padding-lg":"12px 16px","@drawer-header-padding":"11px @padding-lg","@drawer-footer-padding-vertical":"@padding-sm","@drawer-footer-padding-horizontal":"@padding-sm","@drawer-header-close-size":"44px","@modal-header-padding-vertical":"11px","@modal-header-padding":"@modal-header-padding-vertical @modal-header-padding-horizontal","@modal-footer-padding-vertical":"@padding-sm","@modal-header-close-size":"@modal-header-title-line-height + 2 * @modal-header-padding-vertical","@modal-confirm-body-padding":"24px 24px 16px","@message-notice-content-padding":"8px 16px","@popover-min-height":"28px","@popover-padding-horizontal":"@default-padding-sm","@card-padding-base":"12px","@card-head-height":"36px","@card-head-font-size":"@card-head-font-size-sm","@card-head-padding":"8.5px","@card-padding-base-sm":"@card-padding-base","@card-head-height-sm":"30px","@card-head-padding-sm":"6px","@card-actions-li-margin":"4px 0","@card-head-tabs-margin-bottom":"-9px","@table-padding-vertical":"12px","@table-padding-horizontal":"8px","@table-padding-vertical-md":"8px","@table-padding-horizontal-md":"8px","@table-padding-vertical-sm":"4px","@table-padding-horizontal-sm":"4px","@table-selection-column-width":"32px","@statistic-content-font-size":"20px","@alert-with-description-no-icon-padding-vertical":"7px","@alert-with-description-padding-vertical":"11px","@alert-icon-top":"7px + @font-size-base * (@line-height-base / 2) - (@font-size-base / 2)","@alert-with-description-icon-size":"20px","@skeleton-paragraph-margin-top":"20px","@skeleton-paragraph-li-margin-top":"12px","@skeleton-paragraph-li-height":"14px","@skeleton-title-height":"14px","@skeleton-title-paragraph-margin-top":"20px","@descriptions-title-margin-bottom":"8px","@descriptions-default-padding":"12px @padding-lg","@descriptions-item-padding-bottom":"@padding-xs","@avatar-size-base":"28px","@avatar-size-lg":"32px","@avatar-size-sm":"22px","@avatar-font-size-base":"16px","@avatar-font-size-lg":"20px","@avatar-font-size-sm":"12px","@badge-height":"18px","@tag-line-height":"18px","@notification-padding-vertical":"12px","@notification-padding-horizontal":"16px","@result-title-font-size":"20px","@result-icon-font-size":"64px","@result-extra-margin":"24px 0 0 0","@anchor-link-top":"4px","@anchor-link-left":"16px","@anchor-link-padding":"@anchor-link-top 0 @anchor-link-top @anchor-link-left","@tabs-card-horizontal-padding":"4px @padding-md","@progress-circle-text-font-size":"0.833333em","@image-size-base":"48px","@image-font-size-base":"24px","@primary-color":"@blue-6","@layout-header-background":"#fff"} \ No newline at end of file diff --git a/web/log/development.txt b/web/log/development.txt index 95fc9315..b79ade1c 100644 --- a/web/log/development.txt +++ b/web/log/development.txt @@ -3415,3 +3415,5 @@ 2022-07-18 17:40:02.984 - info: [Router] Inject api: attachment/index 2022-07-19 09:38:20.086 - debug: [FS-LOGGER] Init. 2022-07-19 09:38:20.998 - info: [Router] Inject api: attachment/index +2022-07-20 19:49:25.720 - debug: [FS-LOGGER] Init. +2022-07-20 19:49:25.776 - info: [Router] Inject api: attachment/index