diff --git a/api/app/lib/controllers/data/index.js b/api/app/lib/controllers/data/index.js index f4e2cbd1..93c7ac93 100644 --- a/api/app/lib/controllers/data/index.js +++ b/api/app/lib/controllers/data/index.js @@ -7,93 +7,78 @@ async function dataExport (ctx) { try { const models = ctx.fs.dc.models; const { userId } = ctx.fs.api - const { ids } = ctx.query; + const { exp, ids, roadLevel, municipalType } = ctx.query; - const fileList = [ - { - n: '道路', - tableName: 'road', - defaultKey: ['level'], - defaultValue: ['村'], - }, - { - n: '道路', - tableName: 'road', - defaultKey: ['level'], - defaultValue: ['县'], - }, + if (!exp) { + throw '参数错误'; + } + + const modalList = [ { n: '道路', - tableName: 'road', - defaultKey: ['level'], - defaultValue: ['乡'], + k: 'road', + tableName: 'Road', }, { n: '桥梁', - tableName: 'bridge' - }, - { - n: '运政车辆', - tableName: 'municipal_vehicle', - defaultKey: ['type'], - defaultValue: ['出租车'], + k: 'bridge', + tableName: 'Bridge' }, { n: '运政车辆', - tableName: 'municipal_vehicle', - defaultKey: ['type'], - defaultValue: ['危货'], + k: 'vehicle', + tableName: 'MunicipalVehicle', }, { n: '运政业户', - tableName: 'municipal_business', - defaultKey: ['type'], - defaultValue: ['出租车'], - }, - { - n: '运政业户', - tableName: 'municipal_business', - defaultKey: ['type'], - defaultValue: ['危货'], - }, - { - n: '工程一览', - tableName: 'project', - defaultKey: ['done', 'type'], - defaultValue: [false, 'road'], + k: 'business', + tableName: 'MunicipalBusiness', }, { n: '工程一览', - tableName: 'project', - defaultKey: ['done', 'type'], - defaultValue: [false, 'bridge'], + k: 'project', + tableName: 'Project', }, { n: '治超', - tableName: 'overspeed', + k: 'overspeed', + tableName: 'Overspeed', }, { n: '公交线路', - tableName: 'bus_line', + k: 'busLine', + tableName: 'BusLine', }, { n: '公交车辆', - tableName: 'bus_car', + k: 'busCar', + tableName: 'BusCar', }, ] + const modalOption = modalList.find(item => item.k == exp); + if (!modalOption) { + throw '参数错误'; + } + let findOption = { where: {} } if (ids) { findOption.where.id = { $in: ids.split(',') } } + if (roadLevel) { + findOption.where.level = roadLevel + } + if (municipalType) { + findOption.where.type = municipalType + } - const exportData = await models.BusCar.findAll(findOption) - const tableAttributes = models.BusCar.tableAttributes + const exportData = await models[modalOption.tableName].findAll(findOption) + const tableAttributes = models[modalOption.tableName].tableAttributes let header = [] for (let k in tableAttributes) { - if (k != 'id') { + if (k != 'id' && tableAttributes[k].comment) { header.push({ title: tableAttributes[k].comment || '-', key: k, @@ -103,7 +88,7 @@ async function dataExport (ctx) { } header.sort((a, b) => { return a.index - b.index }) - const fileName = `摄像头信息列表_${moment().format('YYYYMMDDHHmmss')}` + '.csv' + const fileName = `${modalOption.n}_${moment().format('YYYYMMDDHHmmss')}` + '.csv' const filePath = await xlsxDownload.simpleExcelDown({ data: exportData, header, fileName: fileName }) const fileData = fs.readFileSync(filePath); diff --git a/api/app/lib/controllers/data/vehicle.js b/api/app/lib/controllers/data/vehicle.js index 4a607072..1cae9b49 100644 --- a/api/app/lib/controllers/data/vehicle.js +++ b/api/app/lib/controllers/data/vehicle.js @@ -115,9 +115,9 @@ async function specificEdit (ctx) { const data = ctx.request.body; if (!data.vehicleId) { - const vehicleRes = await models.Vehicle.create(data) + const vehicleRes = await models.MunicipalVehicle.create(data) } else { - const vehicleRes = await models.Vehicle.update(data, { + const vehicleRes = await models.MunicipalVehicle.update(data, { where: { id: data.vehicleId } @@ -139,7 +139,7 @@ async function specificDel (ctx) { const models = ctx.fs.dc.models; const { vehicleId } = ctx.params; - const vehicleRes = await models.Vehicle.destroy({ + const vehicleRes = await models.MunicipalVehicle.destroy({ where: { id: vehicleId } diff --git a/api/app/lib/models/project.js b/api/app/lib/models/project.js index b20bdfb8..7fab6aa0 100644 --- a/api/app/lib/models/project.js +++ b/api/app/lib/models/project.js @@ -2,123 +2,135 @@ 'use strict'; module.exports = dc => { - const DataTypes = dc.ORM; - const sequelize = dc.orm; - const Project = sequelize.define("project", { - id: { - type: DataTypes.INTEGER, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: true, - field: "id", - autoIncrement: true, - unique: "project_id_uindex" - }, - entryName: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "项目名称", - primaryKey: false, - field: "entry_name", - autoIncrement: false - }, - projectMileage: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "工程里程", - primaryKey: false, - field: "project_mileage", - autoIncrement: false - }, - investment: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "投资", - primaryKey: false, - field: "investment", - autoIncrement: false - }, - buildUnit: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "建设单位", - primaryKey: false, - field: "build_unit", - autoIncrement: false - }, - constructionControlUnit: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "监理单位", - primaryKey: false, - field: "construction_control_unit", - autoIncrement: false - }, - designUnit: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "设计单位", - primaryKey: false, - field: "design_unit", - autoIncrement: false - }, - constructionUnit: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "施工单位", - primaryKey: false, - field: "construction_unit", - autoIncrement: false - }, - supervisorAndSupervisor: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "监督负责人及监督人员", - primaryKey: false, - field: "supervisor_and_supervisor", - autoIncrement: false - }, - projectProgress: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "项目进展情况", - primaryKey: false, - field: "project_progress", - autoIncrement: false - }, - done: { - type: DataTypes.BOOLEAN, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: false, - field: "done", - autoIncrement: false - }, - type: { - type: DataTypes.STRING, - allowNull: false, - defaultValue: null, - comment: "类型 道路:road / 桥梁:bridge", - primaryKey: false, - field: "type", - autoIncrement: false - } - }, { - tableName: "project", - comment: "", - indexes: [] - }); - dc.models.Project = Project; - return Project; + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const Project = sequelize.define("project", { + id: { + index: 1, + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: true, + field: "id", + autoIncrement: true, + unique: "project_id_uindex" + }, + entryName: { + index: 2, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "项目名称", + primaryKey: false, + field: "entry_name", + autoIncrement: false + }, + projectMileage: { + index: 3, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "工程里程", + primaryKey: false, + field: "project_mileage", + autoIncrement: false + }, + investment: { + index: 4, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "投资", + primaryKey: false, + field: "investment", + autoIncrement: false + }, + buildUnit: { + index: 5, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "建设单位", + primaryKey: false, + field: "build_unit", + autoIncrement: false + }, + constructionControlUnit: { + index: 6, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "监理单位", + primaryKey: false, + field: "construction_control_unit", + autoIncrement: false + }, + designUnit: { + index: 7, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "设计单位", + primaryKey: false, + field: "design_unit", + autoIncrement: false + }, + constructionUnit: { + index: 8, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "施工单位", + primaryKey: false, + field: "construction_unit", + autoIncrement: false + }, + supervisorAndSupervisor: { + index: 9, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "监督负责人及监督人员", + primaryKey: false, + field: "supervisor_and_supervisor", + autoIncrement: false + }, + projectProgress: { + index: 10, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "项目进展情况", + primaryKey: false, + field: "project_progress", + autoIncrement: false + }, + done: { + index: 11, + type: DataTypes.BOOLEAN, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: false, + field: "done", + autoIncrement: false + }, + type: { + index: 12, + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "类型 道路:road / 桥梁:bridge", + primaryKey: false, + field: "type", + autoIncrement: false + } + }, { + tableName: "project", + comment: "", + indexes: [] + }); + dc.models.Project = Project; + return Project; }; \ No newline at end of file diff --git a/api/app/lib/models/publicity.js b/api/app/lib/models/publicity.js index 0cd30ded..62a1c77a 100644 --- a/api/app/lib/models/publicity.js +++ b/api/app/lib/models/publicity.js @@ -6,6 +6,7 @@ module.exports = dc => { const sequelize = dc.orm; const Publicity = sequelize.define("publicity", { id: { + index: 1, type: DataTypes.INTEGER, allowNull: false, defaultValue: null, @@ -16,6 +17,7 @@ module.exports = dc => { unique: "publicity_id_uindex" }, name: { + index: 2, type: DataTypes.STRING, allowNull: false, defaultValue: null, @@ -25,6 +27,7 @@ module.exports = dc => { autoIncrement: false }, video: { + index: 3, type: DataTypes.ARRAY(DataTypes.INTEGER), allowNull: true, defaultValue: null, @@ -34,6 +37,7 @@ module.exports = dc => { autoIncrement: false }, enable: { + index: 4, type: DataTypes.BOOLEAN, allowNull: false, defaultValue: true, diff --git a/api/app/lib/models/report.js b/api/app/lib/models/report.js index 9377fdda..2eaa09b6 100644 --- a/api/app/lib/models/report.js +++ b/api/app/lib/models/report.js @@ -6,6 +6,7 @@ module.exports = dc => { const sequelize = dc.orm; const Report = sequelize.define("report", { id: { + index: 1, type: DataTypes.INTEGER, allowNull: false, defaultValue: null, @@ -16,6 +17,7 @@ module.exports = dc => { unique: "report_id_uindex" }, reportType: { + index: 2, type: DataTypes.STRING, allowNull: false, defaultValue: null, @@ -25,6 +27,7 @@ module.exports = dc => { autoIncrement: false }, projectType: { + index: 3, type: DataTypes.STRING, allowNull: false, defaultValue: null, @@ -34,6 +37,7 @@ module.exports = dc => { autoIncrement: false }, road: { + index: 4, type: DataTypes.STRING, allowNull: true, defaultValue: null, @@ -43,6 +47,7 @@ module.exports = dc => { autoIncrement: false }, roadSectionStart: { + index: 5, type: DataTypes.STRING, allowNull: true, defaultValue: null, @@ -52,6 +57,7 @@ module.exports = dc => { autoIncrement: false }, roadSectionEnd: { + index: 6, type: DataTypes.STRING, allowNull: true, defaultValue: null, @@ -61,6 +67,7 @@ module.exports = dc => { autoIncrement: false }, longitude: { + index: 7, type: DataTypes.DOUBLE, allowNull: true, defaultValue: null, @@ -70,6 +77,7 @@ module.exports = dc => { autoIncrement: false }, latitude: { + index: 8, type: DataTypes.DOUBLE, allowNull: true, defaultValue: null, @@ -79,6 +87,7 @@ module.exports = dc => { autoIncrement: false }, content: { + index: 9, type: DataTypes.STRING, allowNull: true, defaultValue: null, @@ -88,6 +97,7 @@ module.exports = dc => { autoIncrement: false }, scenePic: { + index: 10, type: DataTypes.ARRAY(DataTypes.STRING), allowNull: true, defaultValue: null, @@ -97,6 +107,7 @@ module.exports = dc => { autoIncrement: false }, conserveBeforePic: { + index: 11, type: DataTypes.ARRAY(DataTypes.STRING), allowNull: true, defaultValue: null, @@ -106,6 +117,7 @@ module.exports = dc => { autoIncrement: false }, conserveUnderwayPic: { + index: 12, type: DataTypes.ARRAY(DataTypes.STRING), allowNull: true, defaultValue: null, @@ -115,6 +127,7 @@ module.exports = dc => { autoIncrement: false }, conserveAfterPic: { + index: 13, type: DataTypes.ARRAY(DataTypes.STRING), allowNull: true, defaultValue: null, @@ -124,6 +137,7 @@ module.exports = dc => { autoIncrement: false }, userId: { + index: 14, type: DataTypes.INTEGER, allowNull: true, defaultValue: null, @@ -133,6 +147,7 @@ module.exports = dc => { autoIncrement: false }, time: { + index: 15, type: DataTypes.DATE, allowNull: false, defaultValue: null, @@ -142,6 +157,7 @@ module.exports = dc => { autoIncrement: false }, address: { + index: 16, type: DataTypes.STRING, allowNull: true, defaultValue: null, diff --git a/api/app/lib/models/road.js b/api/app/lib/models/road.js index d4dad07e..d1d58d7f 100644 --- a/api/app/lib/models/road.js +++ b/api/app/lib/models/road.js @@ -2,708 +2,785 @@ '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 - }, - routeCodeBeforeRoadNetworkAdjustment: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "路网调整前路线编码", - primaryKey: false, - field: "route_code_before_road_network_adjustment", - autoIncrement: false - }, - serialNumberOfOriginalSection: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "原路段序号", - primaryKey: false, - field: "serial_number_of_original_section", - autoIncrement: false - }, - startingStakeNumberOfTheOriginalRoadSection: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "原路段起点桩号", - primaryKey: false, - field: "starting_stake_number_of_the_original_road_section", - autoIncrement: false - }, - endingPointStakeNoOfTheOriginalRoadSection: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "原路段止点桩号", - primaryKey: false, - field: "ending_point_stake_no_of_the_original_road_section", - autoIncrement: false - }, - routeLevel: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "路线等级", - primaryKey: false, - field: "route_level", - 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 - }, - reconstructionTime: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "改建时间", - primaryKey: false, - field: "reconstruction_time", - autoIncrement: false - }, - natureOfConstruction: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "建设性质", - primaryKey: false, - field: "nature_of_construction", - 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 - }, - tollStation: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "所属收费站", - primaryKey: false, - field: "toll_station", - 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 - }, - plannedFundCategory: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "计划资金类别", - primaryKey: false, - field: "planned_fund_category", - autoIncrement: false - }, - plannedYear: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "计划年度", - primaryKey: false, - field: "planned_year", - autoIncrement: false - }, - planDocumentNo: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "计划文号", - primaryKey: false, - field: "plan_document_no", - autoIncrement: false - }, - planItemUniqueCode: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "计划项目唯一编码", - primaryKey: false, - field: "plan_item_unique_code", - autoIncrement: false - }, - plannedProjectRouteCode: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "计划项目路线编码", - primaryKey: false, - field: "planned_project_route_code", - autoIncrement: false - }, - planProjectName: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "计划项目名称", - primaryKey: false, - field: "plan_project_name", - autoIncrement: false - }, - plannedProjectType: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "计划项目类型", - primaryKey: false, - field: "planned_project_type", - autoIncrement: false - }, - completionStatus: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "完工情况", - primaryKey: false, - field: "completion_status", - autoIncrement: false - }, - yearOfCompletion: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "完工年度", - primaryKey: false, - field: "year_of_completion", - autoIncrement: false - }, - plannedFundCategoryOne: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "计划资金类别_1", - primaryKey: false, - field: "planned_fund_category__one", - autoIncrement: false - }, - plannedYearOne: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "计划年度_1", - primaryKey: false, - field: "planned_year__one", - autoIncrement: false - }, - planDocumentNoOne: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "计划文号_1", - primaryKey: false, - field: "plan_document_no__one", - autoIncrement: false - }, - planItemUniqueCodeOne: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "计划项目唯一编码_1", - primaryKey: false, - field: "plan_item_unique_code__one", - autoIncrement: false - }, - planProjectNameOne: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "计划项目名称_1", - primaryKey: false, - field: "plan_project_name__one", - autoIncrement: false - }, - completionStatusOne: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "完工情况_1", - primaryKey: false, - field: "completion_status__one", - autoIncrement: false - }, - yearOfCompletionOne: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "完工年度_1", - primaryKey: false, - field: "year_of_completion__one", - autoIncrement: false - }, - stationRange: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "桩号范围", - primaryKey: false, - field: "station_range", - 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 - }, - lastRepairAndMaintenanceYear: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "最近一次修复养护年度", - primaryKey: false, - field: "last_repair_and_maintenance_year", - 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: null, - primaryKey: false, - field: "level", - autoIncrement: false - }, - surfaceThickness: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "面层厚度", - primaryKey: false, - field: "surface_thickness", - autoIncrement: false - } - }, { - tableName: "road", - comment: "", - indexes: [] - }); - dc.models.Road = Road; - return Road; + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const Road = sequelize.define("road", { + id: { + index: 1, + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: true, + field: "id", + autoIncrement: true, + unique: "road_id_uindex" + }, + routeName: { + index: 2, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "路线名称", + primaryKey: false, + field: "route_name", + autoIncrement: false + }, + routeCode: { + index: 3, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "路线代码", + primaryKey: false, + field: "route_code", + autoIncrement: false + }, + sectionNo: { + index: 4, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "路段序号", + primaryKey: false, + field: "section_no", + autoIncrement: false + }, + townshipCode: { + index: 5, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "乡镇编码", + primaryKey: false, + field: "township_code", + autoIncrement: false + }, + startingPlaceName: { + index: 6, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "起点地名", + primaryKey: false, + field: "starting_place_name", + autoIncrement: false + }, + startStation: { + index: 7, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "起点桩号", + primaryKey: false, + field: "start_station", + autoIncrement: false + }, + categoryOfStartingPointAndDividingPoint: { + index: 8, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "起点分界点类别", + primaryKey: false, + field: "category_of_starting_point_and_dividing_point", + autoIncrement: false + }, + stopPlaceName: { + index: 9, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "止点地名", + primaryKey: false, + field: "stop_place_name", + autoIncrement: false + }, + categoryOfDeadCenterAndDividingPoint: { + index: 10, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "止点分界点类别", + primaryKey: false, + field: "category_of_dead_center_and_dividing_point", + autoIncrement: false + }, + stopStation: { + index: 11, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "止点桩号", + primaryKey: false, + field: "stop_station", + autoIncrement: false + }, + sectionType: { + index: 12, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "路段类型", + primaryKey: false, + field: "section_type", + autoIncrement: false + }, + routeCodeBeforeRoadNetworkAdjustment: { + index: 13, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "路网调整前路线编码", + primaryKey: false, + field: "route_code_before_road_network_adjustment", + autoIncrement: false + }, + serialNumberOfOriginalSection: { + index: 14, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "原路段序号", + primaryKey: false, + field: "serial_number_of_original_section", + autoIncrement: false + }, + startingStakeNumberOfTheOriginalRoadSection: { + index: 15, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "原路段起点桩号", + primaryKey: false, + field: "starting_stake_number_of_the_original_road_section", + autoIncrement: false + }, + endingPointStakeNoOfTheOriginalRoadSection: { + index: 16, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "原路段止点桩号", + primaryKey: false, + field: "ending_point_stake_no_of_the_original_road_section", + autoIncrement: false + }, + routeLevel: { + index: 17, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "路线等级", + primaryKey: false, + field: "route_level", + autoIncrement: false + }, + natureOfRoadSection: { + index: 18, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "路段性质", + primaryKey: false, + field: "nature_of_road_section", + autoIncrement: false + }, + completionTime: { + index: 19, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "建成时间", + primaryKey: false, + field: "completion_time", + autoIncrement: false + }, + reconstructionTime: { + index: 20, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "改建时间", + primaryKey: false, + field: "reconstruction_time", + autoIncrement: false + }, + natureOfConstruction: { + index: 21, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "建设性质", + primaryKey: false, + field: "nature_of_construction", + autoIncrement: false + }, + gbmAndCivilizedModelRoad: { + index: 22, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "GBM及文明样板路", + primaryKey: false, + field: "gbm_and_civilized_model_road", + autoIncrement: false + }, + landforms: { + index: 23, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "地貌", + primaryKey: false, + field: "landforms", + autoIncrement: false + }, + natureOfCharges: { + index: 24, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "收费性质", + primaryKey: false, + field: "nature_of_charges", + autoIncrement: false + }, + tollStation: { + index: 25, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "所属收费站", + primaryKey: false, + field: "toll_station", + autoIncrement: false + }, + numberOfCulverts: { + index: 26, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "涵洞数量", + primaryKey: false, + field: "number_of_culverts", + autoIncrement: false + }, + technicalLevel: { + index: 27, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "技术等级", + primaryKey: false, + field: "technical_level", + autoIncrement: false + }, + pavementType: { + index: 28, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "路面类型", + primaryKey: false, + field: "pavement_type", + autoIncrement: false + }, + pavementWidth: { + index: 29, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "路面宽度", + primaryKey: false, + field: "pavement_width", + autoIncrement: false + }, + subgradeWidth: { + index: 30, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "路基宽度", + primaryKey: false, + field: "subgrade_width", + autoIncrement: false + }, + laneCharacteristics: { + index: 31, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "车道特征", + primaryKey: false, + field: "lane_characteristics", + autoIncrement: false + }, + whetherItIsOpenToTrafficInSunnyOrRainyDays: { + index: 32, + 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: { + index: 33, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "设计时速", + primaryKey: false, + field: "design_speed_per_hour", + autoIncrement: false + }, + urbanManagementSectionOrNot: { + index: 34, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "是否城管路段", + primaryKey: false, + field: "urban_management_section_or_not", + autoIncrement: false + }, + managementAndMaintenanceUnit: { + index: 35, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "管养单位", + primaryKey: false, + field: "management_and_maintenance_unit", + autoIncrement: false + }, + roadAdministrationUnit: { + index: 36, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "路政管理单位", + primaryKey: false, + field: "road_administration_unit", + autoIncrement: false + }, + alimentation: { + index: 37, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "列养情况", + primaryKey: false, + field: "alimentation", + autoIncrement: false + }, + sourceOfListedMaintenanceFunds: { + index: 38, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "列养资金来源", + primaryKey: false, + field: "source_of_listed_maintenance_funds", + autoIncrement: false + }, + curingTime: { + index: 39, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "养护时间", + primaryKey: false, + field: "curing_time", + autoIncrement: false + }, + greeningMileage: { + index: 40, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "可绿化里程", + primaryKey: false, + field: "greening_mileage", + autoIncrement: false + }, + greeningMileaged: { + index: 41, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "已绿化里程", + primaryKey: false, + field: "greening_mileaged", + autoIncrement: false + }, + typeOfRepeatedRoadSection: { + index: 42, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "重复道路路段类型", + primaryKey: false, + field: "type_of_repeated_road_section", + autoIncrement: false + }, + serialNumberOfRepeatedSection: { + index: 43, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "重复路段序号", + primaryKey: false, + field: "serial_number_of_repeated_section", + autoIncrement: false + }, + repeatedSectionRouteCode: { + index: 44, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "重复路段路线编码", + primaryKey: false, + field: "repeated_section_route_code", + autoIncrement: false + }, + plannedFundCategory: { + index: 45, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "计划资金类别", + primaryKey: false, + field: "planned_fund_category", + autoIncrement: false + }, + plannedYear: { + index: 46, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "计划年度", + primaryKey: false, + field: "planned_year", + autoIncrement: false + }, + planDocumentNo: { + index: 47, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "计划文号", + primaryKey: false, + field: "plan_document_no", + autoIncrement: false + }, + planItemUniqueCode: { + index: 48, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "计划项目唯一编码", + primaryKey: false, + field: "plan_item_unique_code", + autoIncrement: false + }, + plannedProjectRouteCode: { + index: 49, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "计划项目路线编码", + primaryKey: false, + field: "planned_project_route_code", + autoIncrement: false + }, + planProjectName: { + index: 50, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "计划项目名称", + primaryKey: false, + field: "plan_project_name", + autoIncrement: false + }, + plannedProjectType: { + index: 51, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "计划项目类型", + primaryKey: false, + field: "planned_project_type", + autoIncrement: false + }, + completionStatus: { + index: 52, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "完工情况", + primaryKey: false, + field: "completion_status", + autoIncrement: false + }, + yearOfCompletion: { + index: 53, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "完工年度", + primaryKey: false, + field: "year_of_completion", + autoIncrement: false + }, + plannedFundCategoryOne: { + index: 54, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "计划资金类别_1", + primaryKey: false, + field: "planned_fund_category__one", + autoIncrement: false + }, + plannedYearOne: { + index: 55, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "计划年度_1", + primaryKey: false, + field: "planned_year__one", + autoIncrement: false + }, + planDocumentNoOne: { + index: 56, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "计划文号_1", + primaryKey: false, + field: "plan_document_no__one", + autoIncrement: false + }, + planItemUniqueCodeOne: { + index: 57, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "计划项目唯一编码_1", + primaryKey: false, + field: "plan_item_unique_code__one", + autoIncrement: false + }, + planProjectNameOne: { + index: 58, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "计划项目名称_1", + primaryKey: false, + field: "plan_project_name__one", + autoIncrement: false + }, + completionStatusOne: { + index: 59, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "完工情况_1", + primaryKey: false, + field: "completion_status__one", + autoIncrement: false + }, + yearOfCompletionOne: { + index: 60, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "完工年度_1", + primaryKey: false, + field: "year_of_completion__one", + autoIncrement: false + }, + stationRange: { + index: 61, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "桩号范围", + primaryKey: false, + field: "station_range", + autoIncrement: false + }, + reportingUnit: { + index: 62, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "填报单位", + primaryKey: false, + field: "reporting_unit", + autoIncrement: false + }, + reasonForChange: { + index: 63, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "变更原因", + primaryKey: false, + field: "reason_for_change", + autoIncrement: false + }, + changeTime: { + index: 64, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "变更时间", + primaryKey: false, + field: "change_time", + autoIncrement: false + }, + lastRepairAndMaintenanceYear: { + index: 65, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "最近一次修复养护年度", + primaryKey: false, + field: "last_repair_and_maintenance_year", + autoIncrement: false + }, + whetherMaintenanceManagedHighway: { + index: 66, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "是否按干线公路管理接养", + primaryKey: false, + field: "whether_maintenance_managed_highway", + autoIncrement: false + }, + remarks: { + index: 67, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "备注", + primaryKey: false, + field: "remarks", + autoIncrement: false + }, + routeCodeOfLastYear: { + index: 68, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "上年路线编码", + primaryKey: false, + field: "route_code_of_last_year", + autoIncrement: false + }, + routeNameOfLastYear: { + index: 69, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "上年路线名称", + primaryKey: false, + field: "route_name_of_last_year", + autoIncrement: false + }, + startingStationOfLastYear: { + index: 70, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "上年起点桩号", + primaryKey: false, + field: "starting_station_of_last_year", + autoIncrement: false + }, + lastYearsEndingPointStakeNumber: { + index: 71, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "上年止点桩号", + primaryKey: false, + field: "last_years_ending_point_stake_number", + autoIncrement: false + }, + graphicMileage: { + index: 72, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "图形里程", + primaryKey: false, + field: "graphic_mileage", + autoIncrement: false + }, + chainageMileage: { + index: 73, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "桩号里程", + primaryKey: false, + field: "chainage_mileage", + autoIncrement: false + }, + districtcounty: { + index: 74, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "所在区县", + primaryKey: false, + field: "districtcounty", + autoIncrement: false + }, + locationCity: { + index: 75, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "所在地市", + primaryKey: false, + field: "location_city", + autoIncrement: false + }, + level: { + index: 76, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: null, + primaryKey: false, + field: "level", + autoIncrement: false + }, + surfaceThickness: { + index: 77, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "面层厚度", + primaryKey: false, + field: "surface_thickness", + 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/statistic.js b/api/app/lib/models/statistic.js index b7e0b248..9e811f1a 100644 --- a/api/app/lib/models/statistic.js +++ b/api/app/lib/models/statistic.js @@ -2,51 +2,55 @@ 'use strict'; module.exports = dc => { - const DataTypes = dc.ORM; - const sequelize = dc.orm; - const Statistic = sequelize.define("statistic", { - id: { - type: DataTypes.INTEGER, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: true, - field: "id", - autoIncrement: true, - unique: "vehicle_id_uindex" - }, - name: { - type: DataTypes.STRING, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: false, - field: "name", - autoIncrement: false - }, - count: { - type: DataTypes.INTEGER, - allowNull: false, - defaultValue: "0", - comment: null, - primaryKey: false, - field: "count", - autoIncrement: false - }, - type: { - type: DataTypes.STRING, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: false, - field: "type", - autoIncrement: false - } - }, { - tableName: "statistic", - comment: "", - indexes: [] - }); - dc.models.Statistic = Statistic; - return Statistic; + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const Statistic = sequelize.define("statistic", { + id: { + index: 1, + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: true, + field: "id", + autoIncrement: true, + unique: "vehicle_id_uindex" + }, + name: { + index: 2, + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: false, + field: "name", + autoIncrement: false + }, + count: { + index: 3, + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: "0", + comment: null, + primaryKey: false, + field: "count", + autoIncrement: false + }, + type: { + index: 4, + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: false, + field: "type", + autoIncrement: false + } + }, { + tableName: "statistic", + comment: "", + indexes: [] + }); + dc.models.Statistic = Statistic; + return Statistic; }; \ No newline at end of file diff --git a/api/log/development.log b/api/log/development.log index 405078ef..2999be3e 100644 --- a/api/log/development.log +++ b/api/log/development.log @@ -9999,3 +9999,12 @@ 2022-07-27 14:42:45.566 - info: [FS-ATTACHMENT] Inject attachment mw into router. 2022-07-27 14:42:45.566 - info: [FS-AUTH] Inject auth and api mv into router. 2022-07-27 14:42:48.376 - error: path: /data/export, error: ReferenceError: fs is not defined +2022-07-27 15:29:53.136 - debug: [FS-LOGGER] Init. +2022-07-27 15:29:53.285 - info: [FS-ATTACHMENT] Inject attachment mw into router. +2022-07-27 15:29:53.285 - info: [FS-AUTH] Inject auth and api mv into router. +2022-07-27 15:47:39.653 - error: path: /vehicle/1/specific, error: TypeError: Cannot read property 'destroy' of undefined +2022-07-27 15:47:55.412 - error: path: /vehicle/1/specific, error: TypeError: Cannot read property 'destroy' of undefined +2022-07-27 15:48:01.737 - error: path: /vehicle/4/specific, error: TypeError: Cannot read property 'destroy' of undefined +2022-07-27 15:49:28.071 - error: path: /vehicle/3/specific, error: TypeError: Cannot read property 'destroy' of undefined +2022-07-27 15:50:36.847 - error: path: /vehicle/3/specific, error: TypeError: Cannot read property 'destroy' of undefined +2022-07-27 15:51:05.608 - error: path: /vehicle/3/specific, error: TypeError: Cannot read property 'destroy' of undefined diff --git a/api/sequelize-automate.config.js b/api/sequelize-automate.config.js index c93074d5..e741521e 100644 --- a/api/sequelize-automate.config.js +++ b/api/sequelize-automate.config.js @@ -18,6 +18,7 @@ module.exports = { timestamps: false, }, }, + // !!! 所有 model 都有自定义脚本所不能生成的内容 执行此脚本需谨慎 options: { type: 'freesun', // 指定 models 代码风格 camelCase: true, // Models 文件中代码是否使用驼峰命名 @@ -27,7 +28,7 @@ module.exports = { typesDir: 'models', // 指定输出 TypeScript 类型定义的文件目录,只有 TypeScript / Midway 等会有类型定义 emptyDir: false, // !!! 谨慎操作 生成 models 之前是否清空 `dir` 以及 `typesDir` tables: null, // 指定生成哪些表的 models,如 ['user', 'user_post'];如果为 null,则忽略改属性 - skipTables: ['report', 'publicity'], // 指定跳过哪些表的 models,如 ['user'];如果为 null,则忽略改属性 + skipTables: [], // 指定跳过哪些表的 models,如 ['user'];如果为 null,则忽略改属性 tsNoCheck: false, // 是否添加 `@ts-nocheck` 注释到 models 文件中 ignorePrefix: [], // 生成的模型名称忽略的前缀,因为 项目中有以下表名是以 t_ 开头的,在实际模型中不需要, 可以添加多个 [ 't_data_', 't_',] ,长度较长的 前缀放前面 attrLength: false, // 在生成模型的字段中 是否生成 如 var(128)这种格式,公司一般使用 String ,则配置为 false diff --git a/weapp/src/packages/changePassword/index.jsx b/weapp/src/packages/changePassword/index.jsx index 04579469..69d57b4c 100644 --- a/weapp/src/packages/changePassword/index.jsx +++ b/weapp/src/packages/changePassword/index.jsx @@ -14,10 +14,10 @@ function Index() { function confirm() { if (!password) { - Taro.showToast({ title: '请输入密码' }) + Taro.showToast({ title: '请输入密码', icon: 'none' }) return } else if (password !== password2) { - Taro.showToast({ title: '两次输入的密码不一致' }) + Taro.showToast({ title: '两次输入的密码不一致', icon: 'none' }) return } else { Taro.showModal({ @@ -50,11 +50,11 @@ function Index() { 新的密码: - setPassword(e.detail.value)} /> + setPassword(e.detail.value)} /> 再次输入新的密码: - setPassword2(e.detail.value)} /> + setPassword2(e.detail.value)} /> 确认 diff --git a/weapp/src/packages/patrolView/index.jsx b/weapp/src/packages/patrolView/index.jsx index e152cb07..44a05fb7 100644 --- a/weapp/src/packages/patrolView/index.jsx +++ b/weapp/src/packages/patrolView/index.jsx @@ -79,7 +79,6 @@ function Index() { // 监听上拉触底 useReachBottom(() => { - console.log('onReachBottom') setPage(page + 1) setNum(Math.random()) }) diff --git a/weapp/src/pages/home/index.jsx b/weapp/src/pages/home/index.jsx index 30856ce5..3df1e359 100644 --- a/weapp/src/pages/home/index.jsx +++ b/weapp/src/pages/home/index.jsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from 'react'; +import React, { useEffect } from 'react'; import Taro from '@tarojs/taro'; import { View } from '@tarojs/components'; import { useIndustry } from '@/actions/business'; @@ -6,8 +6,26 @@ import './index.scss'; const Index = () => { const userInfo = Taro.getStorageSync('userInfo') || {}; + const token = Taro.getStorageSync('token') || null; const isSuperAdmin = userInfo && userInfo.username === 'SuperAdmin' ? true : false + useEffect(() => { + if (!userInfo || !token) { + Taro.showModal({ + title: '提示', + content: '未获取用户信息,请重新登录', + showCancel: false, + success: (res) => { + if (res.confirm) { + Taro.reLaunch({ + url: '/pages/auth/login/login' + }); + } + } + }); + } + }, []) + function toPatrol() { Taro.navigateTo({ url: '/packages/patrol/index?type=edit' @@ -19,14 +37,25 @@ const Index = () => { }) } + function toVideo() { + + } + return ( - + 巡 查 养 护 {isSuperAdmin ? '查看' : '填报'} + { + isSuperAdmin && + + 视 频 监 控 + 查看 + + } ); } diff --git a/weapp/src/pages/home/index.scss b/weapp/src/pages/home/index.scss index d9f40d1e..ad17ea81 100644 --- a/weapp/src/pages/home/index.scss +++ b/weapp/src/pages/home/index.scss @@ -3,15 +3,23 @@ flex-direction: column; align-items: center; - .fill { + .card { margin-top: 30px; padding: 10px; width: 94%; height: 360px; + } + + .fill { background: url('../../static/img/home/fill-bg.svg') no-repeat; background-size: 100% 100%; } + .video { + background: url('../../static/img/home/video-bg.svg') no-repeat; + background-size: 100% 100%; + } + .title { margin: 50px 0 0 48px; color: #fff; diff --git a/weapp/src/static/img/home/video-bg.svg b/weapp/src/static/img/home/video-bg.svg new file mode 100644 index 00000000..b3c53501 --- /dev/null +++ b/weapp/src/static/img/home/video-bg.svg @@ -0,0 +1,88 @@ + + + 椭圆形 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/weapp/src/static/img/tabbar/shouye-active.png b/weapp/src/static/img/tabbar/shouye-active.png index ffad3ff8..2ed7f16b 100644 Binary files a/weapp/src/static/img/tabbar/shouye-active.png and b/weapp/src/static/img/tabbar/shouye-active.png differ diff --git a/weapp/src/static/img/tabbar/shouye.png b/weapp/src/static/img/tabbar/shouye.png index 35efae98..5ba92d0b 100644 Binary files a/weapp/src/static/img/tabbar/shouye.png and b/weapp/src/static/img/tabbar/shouye.png differ diff --git a/weapp/src/static/img/tabbar/wode-active.png b/weapp/src/static/img/tabbar/wode-active.png index d51ee6ec..d6b7a222 100644 Binary files a/weapp/src/static/img/tabbar/wode-active.png and b/weapp/src/static/img/tabbar/wode-active.png differ diff --git a/weapp/src/static/img/tabbar/wode.png b/weapp/src/static/img/tabbar/wode.png index 292c7460..28575a11 100644 Binary files a/weapp/src/static/img/tabbar/wode.png and b/weapp/src/static/img/tabbar/wode.png differ diff --git a/web/client/assets/color.less b/web/client/assets/color.less index 0d45e9f2..a522fd49 100644 --- a/web/client/assets/color.less +++ b/web/client/assets/color.less @@ -1150,6 +1150,7 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte .ant-menu-item-danger.ant-menu-item {color: #ff4d4f;} .ant-menu-item-danger.ant-menu-item:hover, .ant-menu-item-danger.ant-menu-item-active {color: #ff4d4f;} <<<<<<< Updated upstream +<<<<<<< Updated upstream .ant-menu-item-danger.ant-menu-item:active {background: color(~`colorPalette("@{modal-header-border-color-split}", 1)`);} .ant-menu-item-danger.ant-menu-item-selected {color: #ff4d4f;} @@ -1161,6 +1162,12 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte .ant-menu-item-danger.ant-menu-item-selected > a, .ant-menu-item-danger.ant-menu-item-selected > a:hover {color: #ff4d4f;} .ant-menu:not(.ant-menu-horizontal) .ant-menu-item-danger.ant-menu-item-selected {background-color: color(~`colorPalette("@{segmented-label-hover-color}", 1)`);} >>>>>>> Stashed changes +======= +.ant-menu-item-danger.ant-menu-item:active {background: #fff1f0;} +.ant-menu-item-danger.ant-menu-item-selected {color: #ff4d4f;} +.ant-menu-item-danger.ant-menu-item-selected > a, .ant-menu-item-danger.ant-menu-item-selected > a:hover {color: #ff4d4f;} +.ant-menu:not(.ant-menu-horizontal) .ant-menu-item-danger.ant-menu-item-selected {background-color: #fff1f0;} +>>>>>>> Stashed changes .ant-menu-inline .ant-menu-item-danger.ant-menu-item::after {border-right-color: #ff4d4f;} .ant-menu-dark .ant-menu-item-danger.ant-menu-item, .ant-menu-dark .ant-menu-item-danger.ant-menu-item:hover, .ant-menu-dark .ant-menu-item-danger.ant-menu-item > a {color: #ff4d4f;} .ant-menu-dark.ant-menu-dark:not(.ant-menu-horizontal) .ant-menu-item-danger.ant-menu-item-selected {color: #fff;background-color: #ff4d4f;} @@ -1731,9 +1738,12 @@ tr.ant-table-expanded-row:hover > td {background: @table-expanded-row-bg;} .ant-tag-checkable-checked {background-color: @primary-color;} .ant-tag-checkable:active {background-color: color(~`colorPalette("@{primary-color}", 7)`);} <<<<<<< Updated upstream +<<<<<<< Updated upstream .ant-tag-pink {color: #c41d7f;background: color(~`colorPalette("@{component-background}", 1)`);border-color: #ffadd2;} +======= +>>>>>>> Stashed changes ======= >>>>>>> Stashed changes .ant-tag-pink {color: #c41d7f;background: #fff0f6;border-color: #ffadd2;} @@ -1743,6 +1753,7 @@ tr.ant-table-expanded-row:hover > td {background: @table-expanded-row-bg;} .ant-tag-magenta-inverse {color: #fff;background: #eb2f96;border-color: #eb2f96;} <<<<<<< Updated upstream .ant-tag-red {color: #cf1322;background: #fff1f0;border-color: #ffa39e;} +<<<<<<< Updated upstream .ant-tag-pink {color: #c41d7f;background: color(~`colorPalette("@{success-color-deprecated-bg}", 1)`);border-color: #ffadd2;} .ant-tag-pink-inverse {color: #fff;background: #eb2f96;border-color: #eb2f96;} @@ -1753,6 +1764,8 @@ tr.ant-table-expanded-row:hover > td {background: @table-expanded-row-bg;} ======= .ant-tag-red {color: #cf1322;background: color(~`colorPalette("@{segmented-label-hover-color}", 1)`);border-color: #ffa39e;} >>>>>>> Stashed changes +======= +>>>>>>> Stashed changes .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;} @@ -1769,6 +1782,7 @@ tr.ant-table-expanded-row:hover > td {background: @table-expanded-row-bg;} .ant-tag-green {color: #389e0d;background: #f6ffed;border-color: #b7eb8f;} .ant-tag-green-inverse {color: #fff;background: #52c41a;border-color: #52c41a;} <<<<<<< Updated upstream +<<<<<<< Updated upstream .ant-tag-blue {color: #096dd9;background: #e6f7ff;border-color: #91d5ff;} .ant-tag-blue-inverse {color: #fff;background: #1890ff;border-color: #1890ff;} @@ -1788,6 +1802,13 @@ tr.ant-table-expanded-row:hover > td {background: @table-expanded-row-bg;} .ant-tag-geekblue-inverse {color: #fff;background: #2f54eb;border-color: #2f54eb;} .ant-tag-purple {color: #531dab;background: color(~`colorPalette("@{alert-error-bg-color}", 1)`);border-color: #d3adf7;} >>>>>>> Stashed changes +======= +.ant-tag-blue {color: #096dd9;background: #e6f7ff;border-color: #91d5ff;} +.ant-tag-blue-inverse {color: #fff;background: #1890ff;border-color: #1890ff;} +.ant-tag-geekblue {color: #1d39c4;background: color(~`colorPalette("@{info-color-deprecated-bg}", 1)`);border-color: #adc6ff;} +.ant-tag-geekblue-inverse {color: #fff;background: #2f54eb;border-color: #2f54eb;} +.ant-tag-purple {color: #531dab;background: color(~`colorPalette("@{background-color-light}", 1)`);border-color: #d3adf7;} +>>>>>>> Stashed changes .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;} @@ -2026,14 +2047,16 @@ a.ant-typography.ant-typography-disabled:hover, .ant-typography a.ant-typography .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;} <<<<<<< Updated upstream +<<<<<<< Updated upstream .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='#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='#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;} +======= >>>>>>> Stashed changes +.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='#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);} diff --git a/web/client/src/components/index.js b/web/client/src/components/index.js index 2bbffa47..906a55e4 100644 --- a/web/client/src/components/index.js +++ b/web/client/src/components/index.js @@ -9,6 +9,7 @@ import FlowRecordTable from './flowRecordTable' import Table from './table' import Search from './search' import SketchColor from './sketchColor' +import SimpleFileDownButton from './simpleFileDownButton' export { Upload, @@ -18,5 +19,6 @@ export { FlowRecordTable, Table, Search, - SketchColor + SketchColor, + SimpleFileDownButton }; diff --git a/web/client/src/components/simpleFileDownButton.js b/web/client/src/components/simpleFileDownButton.js new file mode 100644 index 00000000..3878d345 --- /dev/null +++ b/web/client/src/components/simpleFileDownButton.js @@ -0,0 +1,40 @@ +import React, { useState, useEffect, useRef } from "react"; +import { connect } from "react-redux"; +import moment from 'moment' +import { Button } from "antd"; + +const SimpleFileDownButton = (props) => { + const { src, user } = props + const [downloadUrl, setDownloadUrl] = useState('') + + return ( + <> + + { + downloadUrl ?