巴林闲侠
2 years ago
52 changed files with 15340 additions and 54260 deletions
@ -0,0 +1,147 @@ |
|||||
|
'use strict'; |
||||
|
|
||||
|
'use strict'; |
||||
|
const moment = require('moment'); |
||||
|
const { QueryTypes } = require('sequelize'); |
||||
|
|
||||
|
async function getLastMonthCost(ctx) { |
||||
|
const { fourceUpdate } = ctx.query; |
||||
|
let rslt = []; |
||||
|
try { |
||||
|
const startTime = new Date(moment().startOf('year')), endTime = new Date(moment().endOf('year').valueOf()); |
||||
|
const models = ctx.fs.dc.models; |
||||
|
const costList = await models.RoadMaintenanceCost.findAll({ |
||||
|
where: { |
||||
|
maintenanceDate: { '$between': [startTime, endTime] }, |
||||
|
countyName: { $not: '南昌县*' } |
||||
|
} |
||||
|
}) |
||||
|
if (!costList || !costList.length || fourceUpdate) { |
||||
|
const dataList = await models.RoadMaintenance.findAll(); |
||||
|
if (fourceUpdate) { |
||||
|
await models.RoadMaintenanceCost.destroy({ where: { id: { $not: null } } }); |
||||
|
} |
||||
|
for (var i = 0; i < 12; i++) { |
||||
|
const dateTime = new Date(moment().month(i)); |
||||
|
|
||||
|
let nanChang = { |
||||
|
countyName: '南昌县*', |
||||
|
roadLengthCounty: 0, |
||||
|
roadLengthTownship: 0, |
||||
|
roadLengthVillage: 0, |
||||
|
roadCostCounty: 0, |
||||
|
roadCostTownship: 0, |
||||
|
roadCostVillage: 0, |
||||
|
maintenanceDate: dateTime |
||||
|
}; |
||||
|
dataList.map(item => { |
||||
|
const { countyHighway, townshipRoad, villageRoad, responsibleUnitForManagementAndMaintenance } = item; |
||||
|
const randomNum = 0.1 * (0.8 + Math.random() / 2); |
||||
|
|
||||
|
let data = { |
||||
|
countyName: responsibleUnitForManagementAndMaintenance, |
||||
|
roadLengthCounty: countyHighway ? countyHighway * randomNum : 0, |
||||
|
roadLengthTownship: townshipRoad ? townshipRoad * randomNum : 0, |
||||
|
roadLengthVillage: villageRoad ? villageRoad * randomNum : 0, |
||||
|
maintenanceDate: dateTime |
||||
|
} |
||||
|
data.roadCostCounty = typeof data.roadLengthCounty == 'number' && !isNaN(data.roadLengthCounty) ? data.roadLengthCounty * 15000 / 12 : 0, |
||||
|
data.roadCostTownship = typeof data.roadLengthTownship == 'number' && !isNaN(data.roadLengthTownship) ? data.roadLengthTownship * 7500 / 12 : 0, |
||||
|
data.roadCostVillage = typeof data.roadLengthVillage == 'number' && !isNaN(data.roadLengthVillage) ? data.roadLengthVillage * 3900 / 12 : 0; |
||||
|
|
||||
|
rslt.push(data) |
||||
|
nanChang.roadLengthCounty += data.roadLengthCounty; |
||||
|
nanChang.roadLengthTownship += data.roadLengthTownship; |
||||
|
nanChang.roadLengthVillage += data.roadLengthVillage; |
||||
|
nanChang.roadCostCounty += data.roadCostCounty; |
||||
|
nanChang.roadCostTownship += data.roadCostTownship; |
||||
|
nanChang.roadCostVillage += data.roadCostVillage; |
||||
|
|
||||
|
models.RoadMaintenanceCost.create(data) |
||||
|
}) |
||||
|
models.RoadMaintenanceCost.create(nanChang) |
||||
|
} |
||||
|
|
||||
|
} else { |
||||
|
rslt = costList |
||||
|
} |
||||
|
|
||||
|
|
||||
|
ctx.status = 200; |
||||
|
ctx.body = rslt; |
||||
|
} catch (error) { |
||||
|
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
||||
|
ctx.status = 400; |
||||
|
ctx.body = { |
||||
|
message: typeof error == 'string' ? error : undefined |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
async function getConcatData(ctx) { |
||||
|
try { |
||||
|
let startTime = new Date(moment().startOf('year')), |
||||
|
endTime = new Date(moment().endOf('month')); |
||||
|
|
||||
|
if (moment().year() == 2022) { |
||||
|
startTime = new Date(moment().startOf('year').month(3)) |
||||
|
} |
||||
|
const models = ctx.fs.dc.models; |
||||
|
const costList = await models.RoadMaintenanceCost.findAll({ |
||||
|
where: { |
||||
|
maintenanceDate: { '$between': [startTime, endTime] }, |
||||
|
countyName: '南昌县*' |
||||
|
}, |
||||
|
order: [['maintenanceDate', 'DESC']] |
||||
|
}) |
||||
|
ctx.status = 200; |
||||
|
ctx.body = costList; |
||||
|
} catch (error) { |
||||
|
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
||||
|
ctx.status = 400; |
||||
|
ctx.body = { |
||||
|
message: typeof error == 'string' ? error : undefined |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
async function getRoadMaintenanceList(ctx) { |
||||
|
try { |
||||
|
const models = ctx.fs.dc.models; |
||||
|
const list = await models.RoadMaintenance.findAll(); |
||||
|
ctx.status = 200; |
||||
|
ctx.body = list; |
||||
|
} catch (error) { |
||||
|
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
||||
|
ctx.status = 400; |
||||
|
ctx.body = { |
||||
|
message: typeof error == 'string' ? error : undefined |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
async function updateRoadMaintenanceList(ctx) { |
||||
|
try { |
||||
|
const data = ctx.request.body; |
||||
|
const models = ctx.fs.dc.models; |
||||
|
// const list = await models.RoadMaintenance.findAll();
|
||||
|
await models.RoadMaintenance.update(data, { where: { id: data.id } }) |
||||
|
|
||||
|
ctx.status = 200; |
||||
|
ctx.body = {message:'编辑成功'}; |
||||
|
} catch (error) { |
||||
|
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
||||
|
ctx.status = 400; |
||||
|
ctx.body = { |
||||
|
message: typeof error == 'string' ? error : undefined |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
module.exports = { |
||||
|
getLastMonthCost, |
||||
|
getConcatData, |
||||
|
getRoadMaintenanceList, |
||||
|
updateRoadMaintenanceList, |
||||
|
} |
@ -0,0 +1,115 @@ |
|||||
|
/* eslint-disable*/ |
||||
|
'use strict'; |
||||
|
|
||||
|
module.exports = dc => { |
||||
|
const DataTypes = dc.ORM; |
||||
|
const sequelize = dc.orm; |
||||
|
const RoadMaintenance = sequelize.define("roadMaintenance", { |
||||
|
id: { |
||||
|
type: DataTypes.INTEGER, |
||||
|
allowNull: false, |
||||
|
defaultValue: null, |
||||
|
comment: null, |
||||
|
primaryKey: true, |
||||
|
field: "id", |
||||
|
autoIncrement: true, |
||||
|
unique: "road_maintenance_id_uindex" |
||||
|
}, |
||||
|
serialNumber: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "序号", |
||||
|
primaryKey: false, |
||||
|
field: "serial_number", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
responsibleUnitForManagementAndMaintenance: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "管养责任单位", |
||||
|
primaryKey: false, |
||||
|
field: "responsible_unit_for_management_and_maintenance", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
maintenanceUnit: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "养护单位", |
||||
|
primaryKey: false, |
||||
|
field: "maintenance_unit", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
management: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "管理人员", |
||||
|
primaryKey: false, |
||||
|
field: "management", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
worker: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "工人", |
||||
|
primaryKey: false, |
||||
|
field: "worker", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
publicWelfarePost: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "公益岗位", |
||||
|
primaryKey: false, |
||||
|
field: "public_welfare_post", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
countyHighway: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "县道", |
||||
|
primaryKey: false, |
||||
|
field: "county_highway", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
townshipRoad: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "乡道 ", |
||||
|
primaryKey: false, |
||||
|
field: "township_road", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
villageRoad: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "村道", |
||||
|
primaryKey: false, |
||||
|
field: "village_road", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
bridge: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "桥梁 ", |
||||
|
primaryKey: false, |
||||
|
field: "bridge", |
||||
|
autoIncrement: false |
||||
|
} |
||||
|
}, { |
||||
|
tableName: "road_maintenance", |
||||
|
comment: "", |
||||
|
indexes: [] |
||||
|
}); |
||||
|
dc.models.RoadMaintenance = RoadMaintenance; |
||||
|
return RoadMaintenance; |
||||
|
}; |
@ -0,0 +1,110 @@ |
|||||
|
/* eslint-disable*/ |
||||
|
'use strict'; |
||||
|
|
||||
|
module.exports = dc => { |
||||
|
const DataTypes = dc.ORM; |
||||
|
const sequelize = dc.orm; |
||||
|
const RoadMaintenanceCost = sequelize.define("roadMaintenanceCost", { |
||||
|
id: { |
||||
|
type: DataTypes.INTEGER, |
||||
|
allowNull: false, |
||||
|
defaultValue: null, |
||||
|
comment: null, |
||||
|
primaryKey: true, |
||||
|
field: "id", |
||||
|
autoIncrement: true, |
||||
|
}, |
||||
|
mId: { |
||||
|
type: DataTypes.INTEGER, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "养护id", |
||||
|
primaryKey: false, |
||||
|
field: "mId", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
countyName: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "管养责任单位", |
||||
|
primaryKey: false, |
||||
|
field: "county_name", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
|
||||
|
roadLengthCounty: { |
||||
|
type: DataTypes.FLOAT, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "养护长度", |
||||
|
primaryKey: false, |
||||
|
field: "road_length_county", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
roadCostCounty: { |
||||
|
type: DataTypes.DOUBLE, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "养护费用", |
||||
|
primaryKey: false, |
||||
|
field: "road_cost_county", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
roadLengthVillage: { |
||||
|
type: DataTypes.FLOAT, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "养护长度", |
||||
|
primaryKey: false, |
||||
|
field: "road_length_village", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
roadCostVillage: { |
||||
|
type: DataTypes.DOUBLE, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "养护费用", |
||||
|
primaryKey: false, |
||||
|
field: "road_cost_village", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
roadLengthTownship: { |
||||
|
type: DataTypes.FLOAT, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "养护长度", |
||||
|
primaryKey: false, |
||||
|
field: "road_length_township", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
roadCostTownship: { |
||||
|
type: DataTypes.DOUBLE, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "养护费用", |
||||
|
primaryKey: false, |
||||
|
field: "road_cost_township", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
maintenanceDate: { |
||||
|
type: DataTypes.DATE, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "养护日期", |
||||
|
primaryKey: false, |
||||
|
field: "maintenance_date", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
}, { |
||||
|
tableName: "road_maintenance_cost", |
||||
|
comment: "", |
||||
|
indexes: [] |
||||
|
}); |
||||
|
dc.models.RoadMaintenanceCost = RoadMaintenanceCost; |
||||
|
return RoadMaintenanceCost; |
||||
|
}; |
@ -0,0 +1,19 @@ |
|||||
|
'use strict'; |
||||
|
|
||||
|
const roadMaintenance = require('../../controllers/roadMaintenance'); |
||||
|
|
||||
|
module.exports = function (app, router, opts) { |
||||
|
|
||||
|
app.fs.api.logAttr['GET/road/maintenance/cost/query'] = { content: '获取上月道路养护费用', visible: false }; |
||||
|
router.get('/road/maintenance/cost/query', roadMaintenance.getLastMonthCost); |
||||
|
|
||||
|
app.fs.api.logAttr['GET/road/maintenance/cost/nanchang/query'] = { content: '获取南昌县道路养护费用', visible: false }; |
||||
|
router.get('/road/maintenance/cost/nanchang/query', roadMaintenance.getConcatData); |
||||
|
|
||||
|
app.fs.api.logAttr['GET/road/maintenance'] = { content: '获取南昌县道路养护数据', visible: false }; |
||||
|
router.get('/road/maintenance', roadMaintenance.getRoadMaintenanceList); |
||||
|
|
||||
|
app.fs.api.logAttr['POST/road/maintenance'] = { content: '更新南昌县道路养护数据', visible: false }; |
||||
|
router.post('/road/maintenance', roadMaintenance.updateRoadMaintenanceList); |
||||
|
|
||||
|
} |
Binary file not shown.
@ -0,0 +1,21 @@ |
|||||
|
{"序号" : "serialNumber", |
||||
|
|
||||
|
"管养责任单位" : "responsibleUnitForManagementAndMaintenance", |
||||
|
|
||||
|
"养护单位" : "maintenanceUnit", |
||||
|
|
||||
|
"管理人员" : "management", |
||||
|
|
||||
|
"工人" : "worker", |
||||
|
|
||||
|
"公益岗位" : "publicWelfarePost", |
||||
|
|
||||
|
"县道" : "countyHighway", |
||||
|
|
||||
|
"乡道 " : "townshipRoad", |
||||
|
|
||||
|
"村道" : "villageRoad", |
||||
|
|
||||
|
"桥梁 " : "bridge" |
||||
|
|
||||
|
} |
@ -0,0 +1,21 @@ |
|||||
|
{ "serialNumber":"序号", |
||||
|
|
||||
|
"responsibleUnitForManagementAndMaintenance":"管养责任单位", |
||||
|
|
||||
|
"maintenanceUnit":"养护单位", |
||||
|
|
||||
|
"management":"管理人员", |
||||
|
|
||||
|
"worker":"工人", |
||||
|
|
||||
|
"publicWelfarePost":"公益岗位", |
||||
|
|
||||
|
"countyHighway":"县道", |
||||
|
|
||||
|
"townshipRoad":"乡道 ", |
||||
|
|
||||
|
"villageRoad":"村道", |
||||
|
|
||||
|
"bridge":"桥梁 " |
||||
|
|
||||
|
} |
@ -0,0 +1,21 @@ |
|||||
|
{"序号" : "serial_number", |
||||
|
|
||||
|
"管养责任单位" : "responsible_unit_for_management_and_maintenance", |
||||
|
|
||||
|
"养护单位" : "maintenance_unit", |
||||
|
|
||||
|
"管理人员" : "management", |
||||
|
|
||||
|
"工人" : "worker", |
||||
|
|
||||
|
"公益岗位" : "public_welfare_post", |
||||
|
|
||||
|
"县道" : "county_Highway", |
||||
|
|
||||
|
"乡道 " : "township_Road", |
||||
|
|
||||
|
"村道" : "village_Road", |
||||
|
|
||||
|
"桥梁 " : "bridge" |
||||
|
|
||||
|
} |
@ -0,0 +1,44 @@ |
|||||
|
|
||||
|
-- 养护 |
||||
|
create table if not exists "road_maintenance" |
||||
|
( |
||||
|
id serial not null |
||||
|
); |
||||
|
|
||||
|
create unique index if not exists road_maintenance_id_uindex |
||||
|
on road_maintenance (id); |
||||
|
|
||||
|
alter table road_maintenance |
||||
|
add constraint road_maintenance_pk |
||||
|
primary key (id); |
||||
|
|
||||
|
alter table road_maintenance add Serial_Number varchar(1024); |
||||
|
comment on column road_maintenance.Serial_Number is '序号'; |
||||
|
|
||||
|
alter table road_maintenance add Responsible_Unit_For_Management_And_Maintenance varchar(1024); |
||||
|
comment on column road_maintenance.Responsible_Unit_For_Management_And_Maintenance is '管养责任单位'; |
||||
|
|
||||
|
alter table road_maintenance add Maintenance_Unit varchar(1024); |
||||
|
comment on column road_maintenance.Maintenance_Unit is '养护单位'; |
||||
|
|
||||
|
alter table road_maintenance add Management varchar(1024); |
||||
|
comment on column road_maintenance.Management is '管理人员'; |
||||
|
|
||||
|
alter table road_maintenance add Worker varchar(1024); |
||||
|
comment on column road_maintenance.Worker is '工人'; |
||||
|
|
||||
|
alter table road_maintenance add Public_Welfare_Post varchar(1024); |
||||
|
comment on column road_maintenance.Public_Welfare_Post is '公益岗位'; |
||||
|
|
||||
|
alter table road_maintenance add County_Highway varchar(1024); |
||||
|
comment on column road_maintenance.County_Highway is '县道'; |
||||
|
|
||||
|
alter table road_maintenance add Township_Road varchar(1024); |
||||
|
comment on column road_maintenance.Township_Road is '乡道 '; |
||||
|
|
||||
|
alter table road_maintenance add Village_Road varchar(1024); |
||||
|
comment on column road_maintenance.Village_Road is '村道'; |
||||
|
|
||||
|
alter table road_maintenance add Bridge varchar(1024); |
||||
|
comment on column road_maintenance.Bridge is '桥梁 '; |
||||
|
|
@ -0,0 +1,23 @@ |
|||||
|
|
||||
|
-- ---------------------------- |
||||
|
-- Table structure for road_maintenance_cost |
||||
|
-- ---------------------------- |
||||
|
DROP TABLE IF EXISTS "public"."road_maintenance_cost"; |
||||
|
CREATE TABLE "public"."road_maintenance_cost" ( |
||||
|
"id" serial NOT NULL, |
||||
|
"mId" int4, |
||||
|
"county_name" varchar(15) COLLATE "pg_catalog"."default", |
||||
|
"road_length_county" float8, |
||||
|
"road_cost_county" numeric(10,2), |
||||
|
"road_length_village" float8, |
||||
|
"road_cost_village" numeric(10,2), |
||||
|
"road_length_township" float8, |
||||
|
"road_cost_township" numeric(10,2), |
||||
|
"maintenance_date" timestamptz(6) |
||||
|
) |
||||
|
; |
||||
|
|
||||
|
-- ---------------------------- |
||||
|
-- Foreign Keys structure for table road_maintenance_cost |
||||
|
-- ---------------------------- |
||||
|
ALTER TABLE "public"."road_maintenance_cost" ADD CONSTRAINT "road_maintenance_cost_mId_fkey" FOREIGN KEY ("mId") REFERENCES "public"."road_maintenance" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION; |
@ -0,0 +1,25 @@ |
|||||
|
|
||||
|
-- ---------------------------- |
||||
|
-- Records of road_maintenance |
||||
|
-- ---------------------------- |
||||
|
BEGIN; |
||||
|
INSERT INTO "public"."road_maintenance" ("id", "serial_number", "responsible_unit_for_management_and_maintenance", "maintenance_unit", "management", "worker", "public_welfare_post", "county_highway", "township_road", "village_road", "bridge") VALUES (19, '1', '县交通运输事业发展中心', '南昌旭日公路桥梁工程有限公司', '3', '20', '4', '207.829', NULL, NULL, '26'); |
||||
|
INSERT INTO "public"."road_maintenance" ("id", "serial_number", "responsible_unit_for_management_and_maintenance", "maintenance_unit", "management", "worker", "public_welfare_post", "county_highway", "township_road", "village_road", "bridge") VALUES (20, '2', '南新乡人民政府', '鑫洲控股集团股份有限公司', '2', '8', '3', NULL, '93.342', '178.356', '12'); |
||||
|
INSERT INTO "public"."road_maintenance" ("id", "serial_number", "responsible_unit_for_management_and_maintenance", "maintenance_unit", "management", "worker", "public_welfare_post", "county_highway", "township_road", "village_road", "bridge") VALUES (21, '3', '蒋巷镇人民政府', '南昌旭日公路桥梁工程有限公司', '4', '20', '2', NULL, '131.394', '165.29', '46'); |
||||
|
INSERT INTO "public"."road_maintenance" ("id", "serial_number", "responsible_unit_for_management_and_maintenance", "maintenance_unit", "management", "worker", "public_welfare_post", "county_highway", "township_road", "village_road", "bridge") VALUES (22, '4', '塘南镇人民政府', '江西辉弘欣盛建设工程有限公司', '2', '10', '4', NULL, '67.968', '216.124', '28'); |
||||
|
INSERT INTO "public"."road_maintenance" ("id", "serial_number", "responsible_unit_for_management_and_maintenance", "maintenance_unit", "management", "worker", "public_welfare_post", "county_highway", "township_road", "village_road", "bridge") VALUES (23, '5', '泾口乡人民政府', '江西悦美环境治理有限公司', NULL, NULL, NULL, NULL, '105.482', '149.772', '7'); |
||||
|
INSERT INTO "public"."road_maintenance" ("id", "serial_number", "responsible_unit_for_management_and_maintenance", "maintenance_unit", "management", "worker", "public_welfare_post", "county_highway", "township_road", "village_road", "bridge") VALUES (24, '6', '幽兰镇人民政府', '南昌贝之鑫建筑工程有限公司', '1', '10', '2', NULL, '57.919', '146.34', '3'); |
||||
|
INSERT INTO "public"."road_maintenance" ("id", "serial_number", "responsible_unit_for_management_and_maintenance", "maintenance_unit", "management", "worker", "public_welfare_post", "county_highway", "township_road", "village_road", "bridge") VALUES (25, '7', '塔城乡人民政府', NULL, NULL, NULL, NULL, NULL, '20.591', '87.339', '3'); |
||||
|
INSERT INTO "public"."road_maintenance" ("id", "serial_number", "responsible_unit_for_management_and_maintenance", "maintenance_unit", "management", "worker", "public_welfare_post", "county_highway", "township_road", "village_road", "bridge") VALUES (26, '8', '武阳镇人民政府', '江西泰冠建设工程有限公司', '3', '4', '2', NULL, '21.363', '105.94', '7'); |
||||
|
INSERT INTO "public"."road_maintenance" ("id", "serial_number", "responsible_unit_for_management_and_maintenance", "maintenance_unit", "management", "worker", "public_welfare_post", "county_highway", "township_road", "village_road", "bridge") VALUES (27, '9', '八一乡人民政府', '江西然镜建筑工程有限公司', '2', '10', '4', NULL, '19.795', '60.038', '8'); |
||||
|
INSERT INTO "public"."road_maintenance" ("id", "serial_number", "responsible_unit_for_management_and_maintenance", "maintenance_unit", "management", "worker", "public_welfare_post", "county_highway", "township_road", "village_road", "bridge") VALUES (28, '10', '银三角管委会', NULL, NULL, NULL, NULL, NULL, '10.379', '28.743', '1'); |
||||
|
INSERT INTO "public"."road_maintenance" ("id", "serial_number", "responsible_unit_for_management_and_maintenance", "maintenance_unit", "management", "worker", "public_welfare_post", "county_highway", "township_road", "village_road", "bridge") VALUES (29, '11', '莲塘镇人民政府', NULL, NULL, NULL, NULL, NULL, '4.583', '80.429', '1'); |
||||
|
INSERT INTO "public"."road_maintenance" ("id", "serial_number", "responsible_unit_for_management_and_maintenance", "maintenance_unit", "management", "worker", "public_welfare_post", "county_highway", "township_road", "village_road", "bridge") VALUES (30, '12', '富山乡人民政府', '江西聚道建筑工程有限公司', '1', '4', NULL, NULL, '37.003', '34.778', '1'); |
||||
|
INSERT INTO "public"."road_maintenance" ("id", "serial_number", "responsible_unit_for_management_and_maintenance", "maintenance_unit", "management", "worker", "public_welfare_post", "county_highway", "township_road", "village_road", "bridge") VALUES (31, '13', '冈上镇人民政府', NULL, NULL, NULL, NULL, NULL, '23.67', '107.632', '5'); |
||||
|
INSERT INTO "public"."road_maintenance" ("id", "serial_number", "responsible_unit_for_management_and_maintenance", "maintenance_unit", "management", "worker", "public_welfare_post", "county_highway", "township_road", "village_road", "bridge") VALUES (32, '14', '广福镇人民政府', '江西泰地建筑工程有限公司', '2', '4', '4', NULL, '17.729', '105.496', '3'); |
||||
|
INSERT INTO "public"."road_maintenance" ("id", "serial_number", "responsible_unit_for_management_and_maintenance", "maintenance_unit", "management", "worker", "public_welfare_post", "county_highway", "township_road", "village_road", "bridge") VALUES (33, '15', '向塘镇人民政府', NULL, NULL, NULL, NULL, NULL, '57.904', '246.382', '14'); |
||||
|
INSERT INTO "public"."road_maintenance" ("id", "serial_number", "responsible_unit_for_management_and_maintenance", "maintenance_unit", "management", "worker", "public_welfare_post", "county_highway", "township_road", "village_road", "bridge") VALUES (34, '16', '三江镇人民政府', '庐山白鹿建筑工程有限公司', '2', '7', '1', NULL, '13.119', '71.693', '1'); |
||||
|
INSERT INTO "public"."road_maintenance" ("id", "serial_number", "responsible_unit_for_management_and_maintenance", "maintenance_unit", "management", "worker", "public_welfare_post", "county_highway", "township_road", "village_road", "bridge") VALUES (35, '17', '黄马乡人民政府', NULL, NULL, NULL, NULL, NULL, '47.703', '138.547', '5'); |
||||
|
INSERT INTO "public"."road_maintenance" ("id", "serial_number", "responsible_unit_for_management_and_maintenance", "maintenance_unit", "management", "worker", "public_welfare_post", "county_highway", "township_road", "village_road", "bridge") VALUES (36, '18', '金湖管理处', '江西聚道建筑工程有限公司', '1', '2', NULL, NULL, '/', '15.161', '/'); |
||||
|
COMMIT; |
||||
|
|
@ -0,0 +1,76 @@ |
|||||
|
[33m2adac9cb[m[33m ([m[1;36mHEAD -> [m[1;32mdev[m[33m)[m HEAD@{0}: reset: moving to HEAD^^^ |
||||
|
[33me5135673[m[33m ([m[1;31morigin/dev_backup[m[33m)[m HEAD@{1}: reset: moving to HEAD^^ |
||||
|
[33m020d4eda[m[33m ([m[1;31morigin/dev[m[33m)[m HEAD@{2}: reset: moving to HEAD |
||||
|
[33m020d4eda[m[33m ([m[1;31morigin/dev[m[33m)[m HEAD@{3}: reset: moving to HEAD |
||||
|
[33m020d4eda[m[33m ([m[1;31morigin/dev[m[33m)[m HEAD@{4}: commit: 12151 |
||||
|
[33md13b52a9[m HEAD@{5}: reset: moving to HEAD |
||||
|
[33md13b52a9[m HEAD@{6}: pull --tags origin dev: Fast-forward |
||||
|
[33m2d649d8e[m HEAD@{9}: pull --tags origin dev: Merge made by the 'ort' strategy. |
||||
|
[33m1a9dd433[m HEAD@{10}: commit: 清除log |
||||
|
[33ma9d12cd8[m HEAD@{11}: pull --tags origin dev: Merge made by the 'ort' strategy. |
||||
|
[33m8573588e[m HEAD@{12}: commit: 五分钟刷新 |
||||
|
[33m39b8e12b[m HEAD@{13}: pull --tags origin dev: Fast-forward |
||||
|
[33m6aba4d7a[m HEAD@{14}: pull --tags origin dev: Merge made by the 'ort' strategy. |
||||
|
[33m2e6dc29a[m HEAD@{15}: commit: 提交 |
||||
|
[33m283a16ae[m HEAD@{16}: pull --tags origin dev: Merge made by the 'ort' strategy. |
||||
|
[33m590ec5dd[m HEAD@{17}: commit: 提交 |
||||
|
[33m8eb418ae[m HEAD@{19}: commit: 日期去掉了日,加上了百分号 |
||||
|
[33mbf01c153[m HEAD@{20}: commit: 提交 |
||||
|
[33m76ad089b[m HEAD@{21}: pull --tags origin dev: Merge made by the 'ort' strategy. |
||||
|
[33m45f58fda[m HEAD@{22}: commit: 代码提交 |
||||
|
[33md9079d38[m HEAD@{23}: commit: 提交日期处理 |
||||
|
[33m8e0048ac[m HEAD@{24}: pull --tags origin dev: Fast-forward |
||||
|
[33mc1607d94[m HEAD@{25}: pull --tags origin dev: Fast-forward |
||||
|
[33m670dcf18[m HEAD@{26}: pull --tags origin dev: Merge made by the 'ort' strategy. |
||||
|
[33mec02aeb9[m HEAD@{27}: commit: nan优化 |
||||
|
[33m974e3c67[m HEAD@{28}: commit: 换成定位了 |
||||
|
[33ma61dc4e9[m HEAD@{29}: pull --tags origin dev: Fast-forward |
||||
|
[33md77627f9[m HEAD@{30}: pull --tags origin dev: Merge made by the 'ort' strategy. |
||||
|
[33m01ef6b5a[m HEAD@{31}: commit: 柱体问题解决 |
||||
|
[33me9424d3e[m HEAD@{32}: pull --tags origin dev: Merge made by the 'ort' strategy. |
||||
|
[33mc276432d[m HEAD@{33}: commit: 样式和颜色提交 |
||||
|
[33m45c415e6[m[33m ([m[1;31morigin/release_0.0.4[m[33m)[m HEAD@{34}: pull --tags origin dev: Fast-forward |
||||
|
[33m79723f61[m HEAD@{35}: commit: 线条 |
||||
|
[33m9c81764c[m HEAD@{36}: pull --tags origin dev: Merge made by the 'ort' strategy. |
||||
|
[33m3f398ea2[m HEAD@{37}: commit: 提交bug |
||||
|
[33m502b068d[m HEAD@{38}: pull --tags origin dev: Merge made by the 'ort' strategy. |
||||
|
[33m7a5b8b64[m HEAD@{39}: commit: 提交 |
||||
|
[33maeff1fe5[m HEAD@{40}: commit: 路由修改 |
||||
|
[33m11da9451[m HEAD@{41}: pull --tags origin dev: Merge made by the 'ort' strategy. |
||||
|
[33med7ab5a8[m HEAD@{42}: commit: 完成 |
||||
|
[33m06063067[m HEAD@{43}: pull --tags origin dev: Merge made by the 'ort' strategy. |
||||
|
[33m755a333f[m HEAD@{44}: commit: 接口调用 |
||||
|
[33m2b153823[m HEAD@{45}: pull --tags origin dev: Merge made by the 'ort' strategy. |
||||
|
[33mf0558530[m HEAD@{46}: commit: 路政统计 |
||||
|
[33m50eb042e[m HEAD@{47}: pull --tags origin dev: Merge made by the 'ort' strategy. |
||||
|
[33ma1dfeddb[m HEAD@{48}: commit: 提交鼠标移出事件 |
||||
|
[33m5469d9df[m HEAD@{49}: commit (merge): Merge branch 'dev' of https://gitea.anxinyun.cn/gao.zhiyuan/Highways4Good into dev |
||||
|
[33m49a0b5d7[m HEAD@{50}: commit: 提交 |
||||
|
[33m11279671[m HEAD@{51}: commit: 提交领导驾驶舱 |
||||
|
[33m3919e2c3[m HEAD@{52}: pull --tags origin dev: Merge made by the 'ort' strategy. |
||||
|
[33mb9302fdf[m HEAD@{53}: commit: 提交代码 |
||||
|
[33m79328f49[m HEAD@{54}: commit (merge): Merge branch 'dev' of https://gitea.anxinyun.cn/gao.zhiyuan/Highways4Good into dev |
||||
|
[33mc6a3b352[m HEAD@{55}: commit: 提交样式 |
||||
|
[33m14ed5747[m HEAD@{56}: pull --tags origin dev: Fast-forward |
||||
|
[33m80e11974[m HEAD@{57}: pull --tags origin dev: Merge made by the 'ort' strategy. |
||||
|
[33ma561e62b[m HEAD@{58}: commit (merge): Merge branch 'dev' of https://gitea.anxinyun.cn/gao.zhiyuan/Highways4Good into dev |
||||
|
[33m163ce6c1[m HEAD@{59}: commit: 提交left.less的更改 |
||||
|
[33m4de26fc7[m HEAD@{60}: pull: Fast-forward |
||||
|
[33m4a1ae175[m HEAD@{61}: pull --tags origin dev: Fast-forward |
||||
|
[33me7a01d52[m HEAD@{62}: commit (merge): Merge branch 'dev' of https://gitea.anxinyun.cn/gao.zhiyuan/Highways4Good into dev |
||||
|
[33mc7e7cd4c[m HEAD@{63}: commit: 提交领导驾驶舱 |
||||
|
[33mfc3f2a92[m HEAD@{64}: commit (merge): Merge branch 'dev' of https://gitea.anxinyun.cn/gao.zhiyuan/Highways4Good into dev |
||||
|
[33mf166aa29[m HEAD@{65}: commit: 领导驾驶舱提交代码 |
||||
|
[33me6030bcf[m HEAD@{66}: commit: 上传 |
||||
|
[33mb299cd97[m HEAD@{67}: pull --tags origin dev: Merge made by the 'ort' strategy. |
||||
|
[33m69e7f3b6[m HEAD@{68}: commit: 删除冗余,提交 |
||||
|
[33ma74afb8f[m HEAD@{69}: commit: 文件 |
||||
|
[33m68c13e99[m HEAD@{70}: commit: 文件上传 |
||||
|
[33mdacf49b4[m HEAD@{71}: commit: 文件上传 |
||||
|
[33m1190cc0d[m HEAD@{72}: commit (merge): Merge branch 'dev' of https://gitea.anxinyun.cn/gao.zhiyuan/Highways4Good into dev |
||||
|
[33m0c57a227[m HEAD@{73}: commit: 头部样式完成 |
||||
|
[33m8ab4f5f2[m HEAD@{74}: pull --tags origin dev: Merge made by the 'ort' strategy. |
||||
|
[33m50714cbf[m HEAD@{75}: commit: 公共组件图标样式修改 |
||||
|
[33m34413ac0[m HEAD@{76}: commit: test |
||||
|
[33meee5aedf[m HEAD@{77}: commit: test |
||||
|
[33mcbdfefa3[m[33m ([m[1;32mmaster[m[33m)[m HEAD@{79}: clone: from https://gitea.anxinyun.cn/gao.zhiyuan/Highways4Good.git |
@ -1,25 +1,12 @@ |
|||||
FROM registry.cn-hangzhou.aliyuncs.com/fs-devops/node:12-dev as builder |
#FROM node:12-alpine |
||||
|
FROM repository.anxinyun.cn/base-images/nodejs12:20.10.12.2 |
||||
|
|
||||
COPY . /var/app |
MAINTAINER liuxinyi "liu.xinyi@free-sun.com.cn" |
||||
|
|
||||
WORKDIR /var/app |
COPY . /var/app |
||||
|
|
||||
EXPOSE 8080 |
|
||||
|
|
||||
RUN npm config set registry=http://10.8.30.22:7000 |
|
||||
RUN echo "{\"time\":\"$BUILD_TIMESTAMP\",\"build\": \"$BUILD_NUMBER\",\"revision\": \"$SVN_REVISION_1\",\"URL\":\"$SVN_URL_1\"}" > version.json |
|
||||
RUN npm cache clean -f |
|
||||
RUN rm -rf package-lock.json |
|
||||
RUN npm install --registry http://10.8.30.22:7000 |
|
||||
RUN npm run build |
|
||||
RUN rm -rf client/src |
|
||||
RUN rm -rf node_modules |
|
||||
RUN npm install --production --registry http://10.8.30.22:7000 |
|
||||
|
|
||||
FROM registry.cn-hangzhou.aliyuncs.com/fs-devops/node:12 |
WORKDIR /var/app |
||||
|
|
||||
COPY --from=builder --chown=node /var/app /home/node/app |
|
||||
|
|
||||
WORKDIR /home/node/app |
EXPOSE 5000 |
||||
|
|
||||
CMD ["node", "server.js"] |
ENTRYPOINT [ "node", "server.js" ] |
After Width: | Height: | Size: 183 B |
After Width: | Height: | Size: 239 B |
@ -0,0 +1,113 @@ |
|||||
|
import React, { useEffect, useState } from 'react'; |
||||
|
import { connect } from 'react-redux'; |
||||
|
import { Form, Spin, Table } from 'antd'; |
||||
|
import { ModalForm, ProForm, ProFormText, ProFormSelect } from '@ant-design/pro-form'; |
||||
|
import { putOperaTional, postCustodyunit, getCustodyunitOne,getxiuyangas } from "../../actions/infor" |
||||
|
|
||||
|
|
||||
|
import _ from 'lodash' |
||||
|
|
||||
|
const Guanli = (props) => { |
||||
|
const { visible, onVisibleChange, typecard, rewkeys, recortd, dispatch, setRecortd, setDelet } = props |
||||
|
const [success, setSuccess] = useState() |
||||
|
useEffect(() => { |
||||
|
return () => { |
||||
|
setRecortd() |
||||
|
} |
||||
|
}, [setRecortd]) |
||||
|
return ( |
||||
|
<Spin spinning={false}> |
||||
|
{/* { |
||||
|
newlysay ? */} |
||||
|
<ModalForm |
||||
|
width={'90rem'} |
||||
|
visible={visible} |
||||
|
onVisibleChange={onVisibleChange} |
||||
|
onFinish={(values) => { |
||||
|
setDelet(values) |
||||
|
const query = { ...values, id: recortd?.id, serialNumber: recortd?.id } |
||||
|
dispatch(postCustodyunit(query)).then((res) => { |
||||
|
if (res.success === true) { |
||||
|
let date = { fourceUpdate: false } |
||||
|
dispatch(getxiuyangas(date)).then((res) => { |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
return true |
||||
|
}} |
||||
|
initialValues={recortd} |
||||
|
> |
||||
|
<ProForm.Group> |
||||
|
<ProFormText |
||||
|
name='responsibleUnitForManagementAndMaintenance' |
||||
|
width="md" |
||||
|
label='管养责任单位' |
||||
|
placeholder="请输入管养责任单位" |
||||
|
disabled |
||||
|
/><ProFormText |
||||
|
name='maintenanceUnit' |
||||
|
width="md" |
||||
|
label='养护单位' |
||||
|
placeholder="请输入养护单位" |
||||
|
/><ProFormText |
||||
|
name='management' |
||||
|
width="md" |
||||
|
label='管理人员' |
||||
|
placeholder="请输入管理人员" |
||||
|
|
||||
|
/><ProFormText |
||||
|
name='worker' |
||||
|
width="md" |
||||
|
label='工人' |
||||
|
placeholder="请输入工人" |
||||
|
/><ProFormText |
||||
|
name='publicWelfarePost' |
||||
|
width="md" |
||||
|
label='公益岗位' |
||||
|
placeholder="请输入公益岗位" |
||||
|
/><ProFormText |
||||
|
name='countyHighway' |
||||
|
width="md" |
||||
|
label='县道' |
||||
|
placeholder="请输入县道" |
||||
|
/><ProFormText |
||||
|
name='townshipRoad' |
||||
|
width="md" |
||||
|
label='乡道' |
||||
|
placeholder="请输入乡道" |
||||
|
/><ProFormText |
||||
|
name='villageRoad' |
||||
|
width="md" |
||||
|
label='村道' |
||||
|
placeholder="请输入村道" |
||||
|
/><ProFormText |
||||
|
name='bridge' |
||||
|
width="md" |
||||
|
label='桥梁' |
||||
|
placeholder="请输入桥梁" |
||||
|
/> |
||||
|
</ProForm.Group> |
||||
|
|
||||
|
</ModalForm> |
||||
|
|
||||
|
</Spin> |
||||
|
) |
||||
|
} |
||||
|
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)(Guanli); |
@ -0,0 +1,101 @@ |
|||||
|
import React, { useState, useEffect } from 'react' |
||||
|
import Module from '../../../public/module' |
||||
|
import { Spin } from 'antd' |
||||
|
import Lun from "../../leadership/right/lunbo" |
||||
|
import "../../leadership/right/left.less" |
||||
|
import { getZhichaodata } from "../../../../actions/example" |
||||
|
|
||||
|
const Lefttbottoms = (props) => { |
||||
|
const { data } = props |
||||
|
|
||||
|
const style = { height: "28%", marginTop: "4%" } |
||||
|
const [beijing, setBeijing] = useState() |
||||
|
const [rightDatas, setrightDatas] = useState([]) |
||||
|
const [nums, setNums] = useState([]) |
||||
|
const [num, setNum] = useState() |
||||
|
const datas=data?.filter((item)=>{ |
||||
|
return item.maintenanceUnit!==null |
||||
|
}) |
||||
|
// const requestRightDatas = async () => {
|
||||
|
// const res = await dispatch(getZhichaodata())
|
||||
|
// var pattern = /[\u4e00-\u9fa5]*/;
|
||||
|
// let d = res.payload.data?.overSpeeddata?.filter((item, index) => {
|
||||
|
// return /.*[\u4e00-\u9fa5_a-zA-Z]+.*$/.test(item.processingTime) == false
|
||||
|
// })
|
||||
|
// console.log(res);
|
||||
|
// d.map((item, index) => {
|
||||
|
// if (parseInt(item.processingTime.match(/([^.]*)$/)[0]) < 10) {
|
||||
|
// return item.processingTime = `${(item.processingTime.match(/^([^.]*)(.[^.]*)/)[0])}.0${parseInt(item.processingTime.match(/([^.]*)$/)[0])}`
|
||||
|
// }
|
||||
|
// })
|
||||
|
// d.sort((a, b) => b.processingTime.localeCompare(a.processingTime))
|
||||
|
// // setrightDatas(res.payload.data)
|
||||
|
// setdata(d)
|
||||
|
// }
|
||||
|
// useEffect(() => {
|
||||
|
// const zhichaodata = dispatch(getZhichaodata()).then((res) => {
|
||||
|
// setNums(res.payload?.data?.processed)
|
||||
|
|
||||
|
// })
|
||||
|
// requestRightDatas()
|
||||
|
// }, [])
|
||||
|
const renderBody = () => { |
||||
|
return ( |
||||
|
<div style={{ width: "100%", height: "50%" }}> |
||||
|
{datas?.map((item, index) => { |
||||
|
return <li style={{ width: "100%", height: "3vh", marginTop: "5px", position: "relative", }} onMouseEnter={() => { |
||||
|
setBeijing(index) |
||||
|
setNum(index) |
||||
|
}} onMouseLeave={() => { |
||||
|
setBeijing() |
||||
|
setNum() |
||||
|
}}> |
||||
|
{beijing == index ? <img src='/assets/images/leadership/bei.png' style={{ width: "100%", height: "100%", position: "absolute" }} /> : ""} |
||||
|
<div style={{ width: "25%", height: "100%", textAlign: "center", lineHeight: "3vh", fontSize: "14px", color: beijing == index ? "#FFFFFF" : "rgba(216,240,255,0.8000)", position: "absolute", left: "3%", whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }}>{item.maintenanceUnit}</div> |
||||
|
<div style={{ width: "12%", height: "100%", textAlign: "center", lineHeight: "3vh", fontSize: "14px", color: beijing == index ? "#FFFFFF" : "rgba(216,240,255,0.8000)", position: "absolute", left: "33%" }}>{item.management||'--'}</div> |
||||
|
<div style={{ width: "12%", height: "100%", textAlign: "center", lineHeight: "3vh", fontSize: "14px", color: beijing == index ? "#FFFFFF" : "rgba(216,240,255,0.8000)", position: "absolute", left: "52%" }}>{item.worker||'--'}</div> |
||||
|
<div style={{ width: "12%", height: "100%", textAlign: "center", lineHeight: "3vh", fontSize: "14px", color: beijing == index ? "#FFFFFF" : "rgba(216,240,255,0.8000)", position: "absolute", left: "70%" }}>{item.publicWelfarePost||'--'}</div> |
||||
|
{/* <div style={{ width: "15%", height: "100%", textAlign: "center", lineHeight: "3vh", fontSize: "14px", color: beijing == index ? "#FFFFFF" : "rgba(216,240,255,0.8000)", position: "absolute", left: "76%" }}>{item.qiao}</div> */} |
||||
|
{/* { |
||||
|
num == index ? <div style={{ position: "fixed", width: "400px", height: "200px", zIndex: 100, left: "55%", marginTop: "0", top: "78%" }}> |
||||
|
<img src='/assets/images/leadership/beijinglan.png' style={{ width: "100%", height: "100%" }} /> |
||||
|
<div style={{ position: "absolute", top: "0", width: "50%", padding: "20px" }}> |
||||
|
<img src='/assets/images/leadership/yuanxing.png' style={{ width: "100%", height: "100%" }} /> |
||||
|
<p style={{ color: "#09BAFF", position: "absolute", top: "42%", left: "27%", fontSize: "29px", fontFamily: "YouSheBiaoTiHei" }}>{item.overrunRate ? item.overrunRate + "%" : "--"}</p> |
||||
|
<p style={{ color: "rgba(216,240,255,0.8)", position: "absolute", top: "60%", left: "43%", fontSize: "14px" }}>超限</p> |
||||
|
</div> |
||||
|
<div style={{ position: "absolute", top: "0", width: "50%", left: "50%", paddingRight: "10px" }}> |
||||
|
<p style={{ color: "rgba(216,240,255,0.8)", marginTop: "10px", fontSize: "14px", fontFamily: "PingFangSC-Regular, PingFang SC" }}>车牌号<span style={{ color: "#EEF4FF", marginLeft: "33px", fontFamily: " PingFangSC-Medium, PingFang SC" }}>{item.danwei}</span></p> |
||||
|
<p style={{ color: "rgba(216,240,255,0.8)", fontSize: "14px", fontFamily: "PingFangSC-Regular, PingFang SC" }}>检测点<span style={{ color: "#EEF4FF", marginLeft: "30px", fontFamily: " PingFangSC-Medium, PingFang SC" }}>{item.xian}</span></p> |
||||
|
<p style={{ color: "rgba(216,240,255,0.8)", fontSize: "14px", fontFamily: "PingFangSC-Regular, PingFang SC" }}>处罚<span style={{ color: "#FF0001", marginLeft: "50px", fontFamily: " PingFangSC-Medium, PingFang SC" }}>{item.xiang}</span></p> |
||||
|
<p style={{ color: "rgba(216,240,255,0.8)", fontSize: "14px", fontFamily: "PingFangSC-Regular, PingFang SC" }}>日期<span style={{ color: "#EEF4FF", marginLeft: "50px", fontFamily: " PingFangSC-Medium, PingFang SC" }}>{item.cun}</span></p> |
||||
|
<p style={{ color: "rgba(216,240,255,0.8)", fontSize: "14px", fontFamily: "PingFangSC-Regular, PingFang SC" }}>日期<span style={{ color: "#EEF4FF", marginLeft: "50px", fontFamily: " PingFangSC-Medium, PingFang SC" }}>{item.qiao}</span></p> |
||||
|
</div> |
||||
|
</div> : "" |
||||
|
} */} |
||||
|
</li> |
||||
|
}) |
||||
|
|
||||
|
} |
||||
|
</div> |
||||
|
) |
||||
|
} |
||||
|
return ( |
||||
|
<> |
||||
|
<div style={{ width: "90%", height: "3vh", backgroundColor: "rgba(21,77,160,0.2)", position: "relative", left: "5%", top: "5%" }}> |
||||
|
<p style={{ width: "35%", fontSize: "12px", color: "#FFFFFF", height: "100%", textAlign: "center", position: "absolute", lineHeight: "3vh", left: "-5%" }}>养护单位</p> |
||||
|
<p style={{ width: "25%", fontSize: "12px", color: "#FFFFFF", height: "100%", textAlign: "center", position: "absolute", lineHeight: "3vh", left: "30%" }}>管理人员(人)</p> |
||||
|
<p style={{ width: "20%", fontSize: "12px", color: "#FFFFFF", height: "100%", textAlign: "center", position: "absolute", lineHeight: "3vh", left: "54%" }}>工人(人)</p> |
||||
|
<p style={{ width: "25%", fontSize: "12px", color: "#FFFFFF", height: "100%", textAlign: "center", position: "absolute", lineHeight: "3vh", left: "73%" }}>公益岗位(人)</p> |
||||
|
{/* <p style={{ width: "20%", fontSize: "12px", color: "#FFFFFF", height: "100%", textAlign: "center", position: "absolute", lineHeight: "3vh", left: "82%" }}>桥梁(座)</p> */} |
||||
|
</div> |
||||
|
<Lun |
||||
|
content={renderBody()} |
||||
|
containerStyle={{ position: "relative", height: "80%", width: "100%", left: "5%", top: "8%" }} |
||||
|
divHeight={"100%"} |
||||
|
divId={"screen-slope-midde-tops"} |
||||
|
/> |
||||
|
</> |
||||
|
) |
||||
|
} |
||||
|
export default Lefttbottoms |
@ -0,0 +1,7 @@ |
|||||
|
.dian{ |
||||
|
// width: 9.09%; |
||||
|
height: 100%; |
||||
|
|
||||
|
// background-color: pink; |
||||
|
float: left; |
||||
|
} |
@ -0,0 +1,110 @@ |
|||||
|
import React, { useEffect, useRef, useState } from 'react'; |
||||
|
import Module from '../../../public/module' |
||||
|
import * as echarts from 'echarts'; |
||||
|
import { Badge, Spin } from 'antd'; |
||||
|
import Leftbottom from "./lunbozujian" |
||||
|
import PieChart from "./shituzujian" |
||||
|
import Lun from "./zidong" |
||||
|
import { back } from 'koa-convert'; |
||||
|
import "./lun.less" |
||||
|
import { getxiugai } from "../action/index" |
||||
|
|
||||
|
const Lunbo = (props) => { |
||||
|
const { data } = props |
||||
|
if (!data || !data.length) { |
||||
|
return '' |
||||
|
} |
||||
|
console.log(data) |
||||
|
const style = { height: "31%", marginTop: "3%" } |
||||
|
const [list, setList] = useState([]) |
||||
|
const [num, setNum] = useState({ value: 0 }) |
||||
|
const [falg, setFalg] = useState(2) |
||||
|
const [namedata, setNamedata] = useState() |
||||
|
const [state, setState] = useState([ |
||||
|
{ value: data ? data[0].roadLengthCounty || 0 : 0, name: "县道" }, |
||||
|
{ value: data ? data[0].roadLengthTownship || 0 : 0, name: "乡道" }, |
||||
|
{ value: data ? data[0].roadLengthVillage || 0 : 0, name: "村道" }, |
||||
|
|
||||
|
]) |
||||
|
const [mon, setMon] = useState([ |
||||
|
{ value: data ? data[0].roadCostCounty || 0 : 0, name: "县费用" }, |
||||
|
{ value: data ? data[0].roadCostTownship || 0 : 0, name: "乡费用" }, |
||||
|
{ value: data ? data[0].roadCostVillage || 0 : 0, name: "村费用" } |
||||
|
]) |
||||
|
const [lenght, setLenght] = useState(data ? data.length : "") |
||||
|
const ref = useRef() |
||||
|
const renderBody = (num) => { |
||||
|
setState([{ value: data ? data[num].roadLengthCounty || 0 : 0, name: "县道" }, { value: data ? data[num].roadLengthTownship || 0 : 0, name: "乡道" }, { value: data ? data[num].roadLengthVillage || 0 : 0, name: "村道" }]) |
||||
|
setMon([ |
||||
|
{ value: data ? data[num].roadCostCounty || 0 : 0, name: "县费用" }, |
||||
|
{ value: data ? data[num].roadCostTownship || 0 : 0, name: "乡费用" }, |
||||
|
{ value: data ? data[num].roadCostVillage || 0 : 0, name: "村费用" } |
||||
|
]) |
||||
|
} |
||||
|
const timerStart = () => { |
||||
|
clearTimer() |
||||
|
ref.current = setTimeout(() => { |
||||
|
let n_num = { value: num.value + 1 } |
||||
|
if (num.value >= (data?.length - 1)) { |
||||
|
setNum({ value: 1 }) |
||||
|
renderBody(1) |
||||
|
} else { |
||||
|
if (num.value == 1) { |
||||
|
renderBody(2) |
||||
|
} else { |
||||
|
renderBody(num.value + 1) |
||||
|
} |
||||
|
setNum(n_num) |
||||
|
} |
||||
|
|
||||
|
// renderBody(num.value)
|
||||
|
}, 5000) |
||||
|
} |
||||
|
const dianji = (num) => { |
||||
|
renderBody(num) |
||||
|
} |
||||
|
useEffect(() => { |
||||
|
renderBody(0) |
||||
|
timerStart() |
||||
|
return () => { |
||||
|
clearTimer() |
||||
|
} |
||||
|
}, [num]) |
||||
|
// renderBody(num.value)
|
||||
|
|
||||
|
|
||||
|
const clearTimer = () => { |
||||
|
if (ref.current) { |
||||
|
clearTimeout(ref.current) |
||||
|
ref.current = null |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
return ( |
||||
|
<div onMouseOver={clearTimer} |
||||
|
onMouseOut={timerStart} |
||||
|
style={{}} |
||||
|
> |
||||
|
<div></div> |
||||
|
<div style={{position:'absolute',color:'#ffffff',top:'45%',left:'59%',fontSize:24,fontFamily: 'YouSheBiaoTiHei',}}>{data[num.value].countyName}</div> |
||||
|
<PieChart state={state} num={num.value} mon={mon} namedata={namedata} /> |
||||
|
<div style={{ width: "90%", height: "1.5vh", backgroundColor: "rgba(176,215,255,0.12)", marginLeft: "5%", position: "absolute", bottom: "36%" }}> |
||||
|
{ |
||||
|
data ? data.map((item, index) => { |
||||
|
return <div className='dian' style={{ |
||||
|
width: (1 / data?.length) * 100 + "%", |
||||
|
// marginLeft: (100 / data ? data.lenght : 10) * index - (100 / data ? data.lenght : 10) + "%",
|
||||
|
backgroundColor: num.value == index ? "rgba(25,138,229,0.4)" : "rgba(176,215,255,0.12)", |
||||
|
borderLeft: num.value == index ? "5px #0992FF solid" : "rgba(176,215,255,0.12)", |
||||
|
borderRight: num.value == index ? "5px #0992FF solid" : "rgba(176,215,255,0.12)" |
||||
|
}} onClick={() => { |
||||
|
setNum({ value: index }) |
||||
|
dianji(index) |
||||
|
}}></div> |
||||
|
}) : "" |
||||
|
} |
||||
|
</div> |
||||
|
</div> |
||||
|
) |
||||
|
} |
||||
|
export default Lunbo |
@ -0,0 +1,99 @@ |
|||||
|
import React, { useState, useEffect } from 'react' |
||||
|
import Module from '../../../public/module' |
||||
|
import { Spin } from 'antd' |
||||
|
import Lun from "../../leadership/right/lunbo" |
||||
|
import "../../leadership/right/left.less" |
||||
|
import { getZhichaodata } from "../../../../actions/example" |
||||
|
|
||||
|
const Lefttbottom = (props) => { |
||||
|
const { data } = props |
||||
|
const style = { height: "28%", marginTop: "4%" } |
||||
|
const [beijing, setBeijing] = useState() |
||||
|
// const [data, setdata] = useState(data)
|
||||
|
const [rightDatas, setrightDatas] = useState([]) |
||||
|
const [nums, setNums] = useState([]) |
||||
|
const [num, setNum] = useState() |
||||
|
|
||||
|
// const requestRightDatas = async () => {
|
||||
|
// const res = await dispatch(getZhichaodata())
|
||||
|
// var pattern = /[\u4e00-\u9fa5]*/;
|
||||
|
// let d = res.payload.data?.overSpeeddata?.filter((item, index) => {
|
||||
|
// return /.*[\u4e00-\u9fa5_a-zA-Z]+.*$/.test(item.processingTime) == false
|
||||
|
// })
|
||||
|
// console.log(res);
|
||||
|
// d.map((item, index) => {
|
||||
|
// if (parseInt(item.processingTime.match(/([^.]*)$/)[0]) < 10) {
|
||||
|
// return item.processingTime = `${(item.processingTime.match(/^([^.]*)(.[^.]*)/)[0])}.0${parseInt(item.processingTime.match(/([^.]*)$/)[0])}`
|
||||
|
// }
|
||||
|
// })
|
||||
|
// d.sort((a, b) => b.processingTime.localeCompare(a.processingTime))
|
||||
|
// // setrightDatas(res.payload.data)
|
||||
|
// setdata(d)
|
||||
|
// }
|
||||
|
// useEffect(() => {
|
||||
|
// const zhichaodata = dispatch(getZhichaodata()).then((res) => {
|
||||
|
// setNums(res.payload?.data?.processed)
|
||||
|
|
||||
|
// })
|
||||
|
// requestRightDatas()
|
||||
|
// }, [])
|
||||
|
const renderBody = () => { |
||||
|
return ( |
||||
|
<div style={{ width: "100%", height: "50%" }}> |
||||
|
{data?.map((item, index) => { |
||||
|
return <li style={{ width: "100%", height: "3vh", marginTop: "5px", position: "relative", }} onMouseEnter={() => { |
||||
|
setBeijing(index) |
||||
|
setNum(index) |
||||
|
}} onMouseLeave={() => { |
||||
|
setBeijing() |
||||
|
setNum() |
||||
|
}}> |
||||
|
{beijing == index ? <img src='/assets/images/leadership/bei.png' style={{ width: "100%", height: "100%", position: "absolute" }} /> : ""} |
||||
|
<div style={{ width: "20%", height: "100%", textAlign: "center", lineHeight: "3vh", fontSize: "14px", color: beijing == index ? "#FFFFFF" : "rgba(216,240,255,0.8000)", position: "absolute", left: "3%", whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }}>{item.responsibleUnitForManagementAndMaintenance}</div> |
||||
|
<div style={{ width: "15%", height: "100%", textAlign: "center", lineHeight: "3vh", fontSize: "14px", color: beijing == index ? "#FFFFFF" : "rgba(216,240,255,0.8000)", position: "absolute", left: "23%" }}>{item.countyHighway||'--'}</div> |
||||
|
<div style={{ width: "15%", height: "100%", textAlign: "center", lineHeight: "3vh", fontSize: "14px", color: beijing == index ? "#FFFFFF" : "rgba(216,240,255,0.8000)", position: "absolute", left: "40%" }}>{item.townshipRoad||'--'}</div> |
||||
|
<div style={{ width: "15%", height: "100%", textAlign: "center", lineHeight: "3vh", fontSize: "14px", color: beijing == index ? "#FFFFFF" : "rgba(216,240,255,0.8000)", position: "absolute", left: "58%" }}>{item.villageRoad||'--'}</div> |
||||
|
<div style={{ width: "15%", height: "100%", textAlign: "center", lineHeight: "3vh", fontSize: "14px", color: beijing == index ? "#FFFFFF" : "rgba(216,240,255,0.8000)", position: "absolute", left: "76%" }}>{item.bridge||'--'}</div> |
||||
|
{/* { |
||||
|
num == index ? <div style={{ position: "fixed", width: "400px", height: "200px", zIndex: 100, left: "55%", marginTop: "0", top: "78%" }}> |
||||
|
<img src='/assets/images/leadership/beijinglan.png' style={{ width: "100%", height: "100%" }} /> |
||||
|
<div style={{ position: "absolute", top: "0", width: "50%", padding: "20px" }}> |
||||
|
<img src='/assets/images/leadership/yuanxing.png' style={{ width: "100%", height: "100%" }} /> |
||||
|
<p style={{ color: "#09BAFF", position: "absolute", top: "42%", left: "27%", fontSize: "29px", fontFamily: "YouSheBiaoTiHei" }}>{item.overrunRate ? item.overrunRate + "%" : "--"}</p> |
||||
|
<p style={{ color: "rgba(216,240,255,0.8)", position: "absolute", top: "60%", left: "43%", fontSize: "14px" }}>超限</p> |
||||
|
</div> |
||||
|
<div style={{ position: "absolute", top: "0", width: "50%", left: "50%", paddingRight: "10px" }}> |
||||
|
<p style={{ color: "rgba(216,240,255,0.8)", marginTop: "10px", fontSize: "14px", fontFamily: "PingFangSC-Regular, PingFang SC" }}>车牌号<span style={{ color: "#EEF4FF", marginLeft: "33px", fontFamily: " PingFangSC-Medium, PingFang SC" }}>{item.danwei}</span></p> |
||||
|
<p style={{ color: "rgba(216,240,255,0.8)", fontSize: "14px", fontFamily: "PingFangSC-Regular, PingFang SC" }}>检测点<span style={{ color: "#EEF4FF", marginLeft: "30px", fontFamily: " PingFangSC-Medium, PingFang SC" }}>{item.xian}</span></p> |
||||
|
<p style={{ color: "rgba(216,240,255,0.8)", fontSize: "14px", fontFamily: "PingFangSC-Regular, PingFang SC" }}>处罚<span style={{ color: "#FF0001", marginLeft: "50px", fontFamily: " PingFangSC-Medium, PingFang SC" }}>{item.xiang}</span></p> |
||||
|
<p style={{ color: "rgba(216,240,255,0.8)", fontSize: "14px", fontFamily: "PingFangSC-Regular, PingFang SC" }}>日期<span style={{ color: "#EEF4FF", marginLeft: "50px", fontFamily: " PingFangSC-Medium, PingFang SC" }}>{item.cun}</span></p> |
||||
|
<p style={{ color: "rgba(216,240,255,0.8)", fontSize: "14px", fontFamily: "PingFangSC-Regular, PingFang SC" }}>日期<span style={{ color: "#EEF4FF", marginLeft: "50px", fontFamily: " PingFangSC-Medium, PingFang SC" }}>{item.qiao}</span></p> |
||||
|
</div> |
||||
|
</div> : "" |
||||
|
} */} |
||||
|
</li> |
||||
|
}) |
||||
|
|
||||
|
} |
||||
|
</div> |
||||
|
) |
||||
|
} |
||||
|
return ( |
||||
|
<> |
||||
|
<div style={{ width: "90%", height: "3vh", backgroundColor: "rgba(21,77,160,0.2)", position: "relative", left: "5%", top: "5%" }}> |
||||
|
<p style={{ width: "30%", fontSize: "12px", color: "#FFFFFF", height: "100%", textAlign: "center", position: "absolute", lineHeight: "3vh", left: "-3%" }}>管养责任单位</p> |
||||
|
<p style={{ width: "20%", fontSize: "12px", color: "#FFFFFF", height: "100%", textAlign: "center", position: "absolute", lineHeight: "3vh", left: "25%" }}>县道(km)</p> |
||||
|
<p style={{ width: "20%", fontSize: "12px", color: "#FFFFFF", height: "100%", textAlign: "center", position: "absolute", lineHeight: "3vh", left: "44%" }}>乡道(km)</p> |
||||
|
<p style={{ width: "20%", fontSize: "12px", color: "#FFFFFF", height: "100%", textAlign: "center", position: "absolute", lineHeight: "3vh", left: "63%" }}>村道(km)</p> |
||||
|
<p style={{ width: "20%", fontSize: "12px", color: "#FFFFFF", height: "100%", textAlign: "center", position: "absolute", lineHeight: "3vh", left: "82%" }}>桥梁(座)</p> |
||||
|
</div> |
||||
|
<Lun |
||||
|
content={renderBody()} |
||||
|
containerStyle={{ position: "relative", height: "80%", width: "100%", left: "5%", top: "8%" }} |
||||
|
divHeight={"100%"} |
||||
|
divId={"screen-slope-midde-top"} |
||||
|
/> |
||||
|
</> |
||||
|
) |
||||
|
} |
||||
|
export default Lefttbottom |
@ -0,0 +1,168 @@ |
|||||
|
import React,{useState} from 'react' |
||||
|
import { useEffect, useRef } from 'react'; |
||||
|
import * as echarts from 'echarts'; |
||||
|
import _ from 'lodash'; |
||||
|
const PieChart = (props) => { |
||||
|
const { width, height, datas, colorList, underColorList, total, text, textLeft, numLeft, state, num, mon,namedata } = props |
||||
|
const chartRef = useRef(null); |
||||
|
const [styloptr,setStyloptr]=useState()//费用
|
||||
|
const [extent,setExtent]=useState()//长度
|
||||
|
let states = [] |
||||
|
let monstate=[] |
||||
|
useEffect(()=>{ |
||||
|
|
||||
|
// state.map((item) => {
|
||||
|
// states.push({ name: item.name, value: Math.round(item.value * 100) / 100 })
|
||||
|
// })
|
||||
|
let arr=null |
||||
|
|
||||
|
state.map((item)=>{ |
||||
|
arr+=item.value |
||||
|
setExtent(arr.toFixed(3)) |
||||
|
|
||||
|
}) |
||||
|
let aui=null |
||||
|
mon.map((item)=>{ |
||||
|
aui+=Number(item.value) |
||||
|
setStyloptr(Math.ceil(aui)) |
||||
|
}) |
||||
|
},[num]) |
||||
|
const data = [ |
||||
|
{ value: styloptr, name: "金额", bgColor: "#1d2c44", progressColor: "#9494ff",clr:'元' }, |
||||
|
{ value: extent, name: "里程", bgColor: "#2a303a", progressColor: "#f8be15",clr:'km' }, |
||||
|
|
||||
|
]; |
||||
|
useEffect(() => { |
||||
|
let states=[] |
||||
|
state.map((item)=>{ |
||||
|
|
||||
|
states.push({value:item.value.toFixed(3),name:item.name}) |
||||
|
}) |
||||
|
let mons=[] |
||||
|
mon.map((item)=>{ |
||||
|
mons.push({value:Math.ceil(item.value),name:item.name}) |
||||
|
}) |
||||
|
let chartInstance = echarts.init(chartRef.current); |
||||
|
const option = { |
||||
|
tooltip: { |
||||
|
trigger: "item", |
||||
|
formatter: "{a}{b}: {c} ({d}%)", |
||||
|
show: true, |
||||
|
}, |
||||
|
legend: { |
||||
|
orient: "vertical", |
||||
|
right: "5%", |
||||
|
bottom: "15%", |
||||
|
// width: "260px",
|
||||
|
// formatter: (name) => {
|
||||
|
// for (let i = 0; i < option.series[1].data.length; i += 1) {
|
||||
|
// if (name === option.series[1].data[i].name) {
|
||||
|
// let arr = [`{a|${name}}`, `{b|${option.series[1].data[i].value}}`]
|
||||
|
// return arr.join('\t');
|
||||
|
// }
|
||||
|
// }
|
||||
|
show:false, |
||||
|
} , |
||||
|
series: [ |
||||
|
{ |
||||
|
name: "", |
||||
|
type: "pie", |
||||
|
// selectedMode: "single",
|
||||
|
color: ["rgba(4, 251, 240, 1)", "rgba(7, 185, 254, 1)", "rgba(28, 96, 254, 1)"], |
||||
|
radius: [0, "50%"], |
||||
|
center: ['30%', '50%'], |
||||
|
label: { |
||||
|
normal: { |
||||
|
position: "inner", |
||||
|
show: false, |
||||
|
// formatter: "{a}{b}: {c} ({d}%)",
|
||||
|
|
||||
|
}, |
||||
|
|
||||
|
|
||||
|
}, |
||||
|
labelLine: { |
||||
|
normal: { |
||||
|
// show: false,
|
||||
|
}, |
||||
|
}, |
||||
|
data: states, |
||||
|
}, |
||||
|
{ |
||||
|
name: "", |
||||
|
type: "pie", |
||||
|
radius: ["65%", "75%"], |
||||
|
center: ['30%', '50%'], |
||||
|
avoidLabelOverlap: false, |
||||
|
color: ["rgba(4, 251, 240, 1)", "rgba(7, 185, 254, 1)", "rgba(28, 96, 254, 1)"], |
||||
|
data: mons, |
||||
|
label: { |
||||
|
normal: { |
||||
|
// formatter: "{b}:{c}km" + "\n\r" + "({d}%)",
|
||||
|
show: false, |
||||
|
position: "left", |
||||
|
}, |
||||
|
emphasis: { |
||||
|
show: false, |
||||
|
textStyle: { |
||||
|
fontSize: "30", |
||||
|
fontWeight: "bold", |
||||
|
}, |
||||
|
}, |
||||
|
}, |
||||
|
labelLine: { |
||||
|
normal: { |
||||
|
// show: false,
|
||||
|
}, |
||||
|
}, |
||||
|
}, |
||||
|
], |
||||
|
}; |
||||
|
chartInstance.setOption(option); |
||||
|
window.addEventListener('resize', () => { |
||||
|
if (chartInstance) { |
||||
|
chartInstance.resize() |
||||
|
} |
||||
|
}) |
||||
|
}, [num]) |
||||
|
return ( |
||||
|
<div > |
||||
|
<div ref={chartRef} style={{ width: '100%', height: '23vh',position:'relative' }}></div> |
||||
|
<div style={{position:'absolute',top:'53%',left:'59%',flexWrap:' wrap'}}>{data?.map((item, index) => { |
||||
|
|
||||
|
// let bgWid = (c.value / number * 100).toFixed(2) + '%'
|
||||
|
const { progressColor} = item; |
||||
|
return ( |
||||
|
<div style={{ marginBottom: 20 }} key={index}> |
||||
|
<div |
||||
|
style={{ |
||||
|
position: "relative", |
||||
|
display: "flex", |
||||
|
width: 250, |
||||
|
}} |
||||
|
> |
||||
|
<div |
||||
|
style={{ |
||||
|
position: "absolute", |
||||
|
height: 10, |
||||
|
width: 10, |
||||
|
top: 5, |
||||
|
backgroundColor: progressColor, |
||||
|
|
||||
|
}} |
||||
|
></div> |
||||
|
|
||||
|
<div style={{ marginLeft: 20,color:'#ffffff' }}>{item.name}</div> |
||||
|
<div style={{ marginLeft: 10 ,color:'#ffffff'}}>{item.value}</div> |
||||
|
<div style={{ marginLeft: 10 ,color:'#ffffff'}}>{item.clr}</div> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
); |
||||
|
})}</div> |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
) |
||||
|
} |
||||
|
export default PieChart |
@ -0,0 +1,282 @@ |
|||||
|
import React from 'react' |
||||
|
import { useEffect, useRef, useState } from 'react'; |
||||
|
import * as echarts from 'echarts'; |
||||
|
import { Col, Row } from 'antd' |
||||
|
import moment from 'moment'; |
||||
|
|
||||
|
|
||||
|
const ZheXian = (props) => { |
||||
|
const { shuju } = props |
||||
|
if (!shuju || !shuju.length) { |
||||
|
return '' |
||||
|
} |
||||
|
const style = { height: "31%", marginTop: "3%" } |
||||
|
const chartRef = useRef(); |
||||
|
const zhuzhuang='../../../../../../assets/images/zhuzhuang.png' |
||||
|
const zhexian='../../../../../../assets/images/zhexian.png' |
||||
|
useEffect(() => { |
||||
|
|
||||
|
}, [true]) |
||||
|
useEffect(() => { |
||||
|
let columnar = [] |
||||
|
shuju?.map((item) => { |
||||
|
let adhn=item?.roadLengthCounty + item?.roadLengthTownship + item?.roadLengthVillage |
||||
|
|
||||
|
columnar.push(adhn.toFixed(3)) |
||||
|
}) |
||||
|
columnar.reverse() |
||||
|
let broken=[] |
||||
|
shuju?.map((item) => { |
||||
|
console.log(Number(item?.roadCostCounty)) |
||||
|
broken.push(Math.ceil(Number(item?.roadCostCounty) + Number(item?.roadCostTownship) + Number(item?.roadCostVillage))) |
||||
|
}) |
||||
|
broken.reverse() |
||||
|
|
||||
|
let date = new Date() |
||||
|
let year = date.getFullYear() |
||||
|
let month = date.getMonth() + 1 |
||||
|
let newYear = 0 |
||||
|
let newMonth = 0 |
||||
|
let newDateArr = [] |
||||
|
for (let i = 0; i < 7; i++) { //这里是获取前六个月,所以循环6次,根据需要修改
|
||||
|
if (month - i < 1) { //这里的判断是如果当前月份往前推到了去年 需要做的处理
|
||||
|
newYear = year - 1 |
||||
|
newMonth = month - i + 12 >= 10 ? month - i + 12 : '0' + (month - i + 12) |
||||
|
newDateArr.push(newYear + '-' + newMonth) //这里拼接格式化,在时间中间加了个-,根据实际需求来
|
||||
|
} else { |
||||
|
newMonth = month - i >= 10 ? month - i : '0' + (month - i) //这里是对月份小于10做加前面加0处理
|
||||
|
newDateArr.push(year + '-' + newMonth) |
||||
|
} |
||||
|
} |
||||
|
newDateArr.splice(0, 1) |
||||
|
newDateArr.reverse() |
||||
|
|
||||
|
let chartInstance = echarts.init(chartRef.current); |
||||
|
const option = { |
||||
|
// backgroundColor: "#344b58",
|
||||
|
title: { |
||||
|
x: "4%", |
||||
|
|
||||
|
textStyle: { |
||||
|
color: "#fff", |
||||
|
fontSize: "22", |
||||
|
}, |
||||
|
subtextStyle: { |
||||
|
color: "#90979c", |
||||
|
fontSize: "16", |
||||
|
}, |
||||
|
}, |
||||
|
tooltip: { |
||||
|
trigger: "axis", |
||||
|
axisPointer: { |
||||
|
type: "shadow", |
||||
|
textStyle: { |
||||
|
color: "#fff", |
||||
|
}, |
||||
|
}, |
||||
|
formatter: function (params, ticket, callback) { |
||||
|
var res = params[0].name; |
||||
|
|
||||
|
for (var i = 0, l = params.length; i < l; i++) { |
||||
|
if (params[i].seriesType === "line") { |
||||
|
res += |
||||
|
"<br/>" + |
||||
|
params[i].seriesName + |
||||
|
" : " + |
||||
|
(params[i].value ? params[i].value : "-") + |
||||
|
"元"; |
||||
|
} else { |
||||
|
res += |
||||
|
"<br/>" + |
||||
|
params[i].seriesName + |
||||
|
" : " + |
||||
|
(params[i].value ? params[i].value : "-") + |
||||
|
"km"; |
||||
|
} |
||||
|
} |
||||
|
return res; |
||||
|
}, |
||||
|
}, |
||||
|
grid: { |
||||
|
borderWidth: 0, |
||||
|
top: 60, |
||||
|
bottom: 10, |
||||
|
right: 20, |
||||
|
left: 20, |
||||
|
textStyle: { |
||||
|
color: "#fff", |
||||
|
}, |
||||
|
containLabel: true, |
||||
|
}, |
||||
|
legend: { |
||||
|
x: "60%", |
||||
|
top: "5%", |
||||
|
textStyle: { |
||||
|
color: "#90979c", |
||||
|
}, |
||||
|
show: false, |
||||
|
|
||||
|
}, |
||||
|
calculable: true, |
||||
|
xAxis: [ |
||||
|
{ |
||||
|
type: "category", |
||||
|
axisLine: { |
||||
|
lineStyle: { |
||||
|
color: "rgba(216,240,255,0.8)", |
||||
|
}, |
||||
|
}, |
||||
|
splitLine: { |
||||
|
show: false, |
||||
|
}, |
||||
|
axisTick: { |
||||
|
show: false, |
||||
|
}, |
||||
|
splitArea: { |
||||
|
show: false, |
||||
|
}, |
||||
|
axisLabel: { |
||||
|
interval: 0, |
||||
|
}, |
||||
|
data: newDateArr, |
||||
|
}, |
||||
|
], |
||||
|
yAxis: [ |
||||
|
{ |
||||
|
type: "value", |
||||
|
splitLine: { |
||||
|
show: true, |
||||
|
position: "right", |
||||
|
lineStyle: { |
||||
|
color: "rgba(176,215,255,0.2500)", |
||||
|
type: "dashed", |
||||
|
}, |
||||
|
}, |
||||
|
axisLine: { |
||||
|
lineStyle: { |
||||
|
color: "rgba(216,240,255,0.800)", |
||||
|
}, |
||||
|
}, |
||||
|
axisTick: { |
||||
|
show: false, |
||||
|
}, |
||||
|
axisLabel: { |
||||
|
interval: 0, |
||||
|
}, |
||||
|
splitArea: { |
||||
|
show: false, |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
type: "value", |
||||
|
min: 0, |
||||
|
splitLine: { |
||||
|
show: true, |
||||
|
lineStyle: { |
||||
|
color: "rgba(176,215,255,0.2500)", |
||||
|
type: "dashed", |
||||
|
}, |
||||
|
}, |
||||
|
axisLine: { |
||||
|
lineStyle: { |
||||
|
color: "rgba(216,240,255,0.800)", |
||||
|
}, |
||||
|
}, |
||||
|
axisTick: { |
||||
|
show: false, |
||||
|
}, |
||||
|
axisLabel: { |
||||
|
interval: 0, |
||||
|
}, |
||||
|
splitArea: { |
||||
|
show: false, |
||||
|
}, |
||||
|
}, |
||||
|
], |
||||
|
series: [ |
||||
|
{ |
||||
|
name: "里程", |
||||
|
type: "bar", |
||||
|
barWidth: 20, |
||||
|
yAxisIndex: 1, |
||||
|
itemStyle: { |
||||
|
normal: { |
||||
|
color: { |
||||
|
type: "linear", |
||||
|
x: 0, |
||||
|
y: 0, |
||||
|
x2: 0, |
||||
|
y2: 1, |
||||
|
colorStops: [ |
||||
|
{ |
||||
|
offset: 0, |
||||
|
color: "rgba(0,213,255)", // 0% 处的颜色
|
||||
|
}, |
||||
|
{ |
||||
|
offset: 1, |
||||
|
color: "rgba(0,213,255,0.2)", // 100% 处的颜色
|
||||
|
}, |
||||
|
], |
||||
|
global: false, // 缺省为 false
|
||||
|
}, |
||||
|
barBorderRadius: 0, |
||||
|
}, |
||||
|
}, |
||||
|
data: columnar||[], |
||||
|
}, |
||||
|
{ |
||||
|
name: "费用", |
||||
|
type: "line", |
||||
|
symbolSize: 10, |
||||
|
symbol: "circle", |
||||
|
itemStyle: { |
||||
|
normal: { |
||||
|
color: "#1978E5", |
||||
|
barBorderRadius: 0, |
||||
|
label: { |
||||
|
show: true, |
||||
|
position: "top", |
||||
|
textStyle: { |
||||
|
color: "#D8F0FF", |
||||
|
}, |
||||
|
formatter: function (p) { |
||||
|
return p.value > 0 ? p.value : ""; |
||||
|
}, |
||||
|
}, |
||||
|
}, |
||||
|
}, |
||||
|
lineStyle: { |
||||
|
normal: { |
||||
|
width: 2, |
||||
|
color: "#1978E5", |
||||
|
}, |
||||
|
}, |
||||
|
data: broken, |
||||
|
}, |
||||
|
], |
||||
|
}; |
||||
|
chartInstance.setOption(option); |
||||
|
window.addEventListener('resize', () => { |
||||
|
if (chartInstance) { |
||||
|
chartInstance.resize() |
||||
|
} |
||||
|
}) |
||||
|
}, []); |
||||
|
return ( |
||||
|
<div style={{ width: '100%' }}> |
||||
|
<div /* onClick={() => { |
||||
|
setFlag(!flag) |
||||
|
console.log(flag); |
||||
|
}} */ style={{ position: "absolute", top: "38.5%", left: "14%", width: "72px", height: "20px", backgroundColor: "rgba(216,240,255,0.1000)", float: "right", textAlign: "center", zIndex: 100, marginRight: "4%", borderLeft: "solid 2px #6E7A83" }} > |
||||
|
<img style={{marginBottom:4,marginLeft:-32}} src={zhexian} /> |
||||
|
<p style={{ color: "rgba(216,240,255,0.8000)", fontSize: "0.4vh", lineHeight: "20px", position: "absolute", top: "0px",marginLeft:36 }}>元</p></div> |
||||
|
<div /* onClick={() => { |
||||
|
setFlag(false) |
||||
|
}} */style={{ position: "absolute", width: "72px", left: "34%", top: "38.5%", height: "20px", backgroundColor: "rgba(216,240,255,0.1000)", float: "right", textAlign: "center", marginRight: "4%", borderLeft: "solid 2px #6E7A83" }}> |
||||
|
<img style={{marginBottom:4,marginLeft:-32}} src={zhuzhuang}/> |
||||
|
<p style={{ color: "rgba(216,240,255,0.8000)", fontSize: "0.4vh", lineHeight: "20px", position: "absolute", top: "0px",marginLeft:36 }} >km</p></div > |
||||
|
<div ref={chartRef} style={{ width: '100%', height: '23vh' }}></div> |
||||
|
</div> |
||||
|
) |
||||
|
} |
||||
|
export default ZheXian |
@ -0,0 +1,139 @@ |
|||||
|
'use strict' |
||||
|
import React, { Component } from 'react'; |
||||
|
import { Row, Col } from 'antd'; |
||||
|
|
||||
|
export default class AutoRollComponent extends Component { |
||||
|
|
||||
|
constructor(props) { |
||||
|
super(props); |
||||
|
this.scrollElem = null; |
||||
|
this.stopscroll = false; |
||||
|
this.preTop = 0; |
||||
|
this.cloneEle = null; |
||||
|
this.currentTop = 0; |
||||
|
this.marqueesHeight = 0; |
||||
|
this.interval = null; |
||||
|
this.state = { |
||||
|
enabledScroll: false |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
get enabledScroll() { |
||||
|
let scrollElem = document.getElementById(this.props.divId); |
||||
|
let fatherElem = scrollElem?.parentNode || null; |
||||
|
if (scrollElem && fatherElem) { |
||||
|
return scrollElem.scrollHeight > fatherElem.scrollHeight |
||||
|
} |
||||
|
|
||||
|
return false; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
marque = (height) => { |
||||
|
try { |
||||
|
this.scrollElem = document.getElementById(this.props.divId); |
||||
|
this.marqueesHeight = height; |
||||
|
if (this.scrollElem) { |
||||
|
this.scrollElem.style.height = this.marqueesHeight; |
||||
|
this.scrollElem.style.overflow = 'hidden'; |
||||
|
} |
||||
|
this.repeat(); |
||||
|
} catch (e) { } |
||||
|
} |
||||
|
|
||||
|
|
||||
|
repeat = () => { |
||||
|
this.scrollElem.scrollTop = 0; |
||||
|
let offset = 1.5 |
||||
|
|
||||
|
this.interval = setInterval(() => { |
||||
|
if (this.stopscroll) return; |
||||
|
this.currentTop = this.currentTop + offset; |
||||
|
this.preTop = this.scrollElem.scrollTop; |
||||
|
this.scrollElem.scrollTop = this.scrollElem.scrollTop + offset; |
||||
|
// console.log(`this.scrollElem.scrollTop:${this.scrollElem.scrollTop} === this.preTop:${this.preTop}`);
|
||||
|
if (this.preTop === this.scrollElem.scrollTop) { |
||||
|
this.scrollElem.scrollTop = this.marqueesHeight; |
||||
|
this.scrollElem.scrollTop = this.scrollElem.scrollTop + offset; |
||||
|
} |
||||
|
}, 40); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
componentWillUnmount() { |
||||
|
clearInterval(this.interval); |
||||
|
} |
||||
|
|
||||
|
componentWillReceiveProps(nextProps) { |
||||
|
requestAnimationFrame(() => { |
||||
|
if (this.enabledScroll) { |
||||
|
if (!this.state.enabledScroll) { |
||||
|
this.setState({ enabledScroll: true }, () => { |
||||
|
this.marque(10) |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
componentDidMount() { |
||||
|
if (this.enabledScroll) { |
||||
|
this.setState({ enabledScroll: true }, () => { |
||||
|
this.marque(10) |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
onMouseOver = () => { |
||||
|
this.stopscroll = true; |
||||
|
} |
||||
|
|
||||
|
onMouseOut = () => { |
||||
|
this.stopscroll = false; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
render() { |
||||
|
|
||||
|
const { changeStyleCol, heads, spans, data, divId, divHeight, content, containerStyle = {} } = this.props; |
||||
|
|
||||
|
return ( |
||||
|
<div style={{ ...containerStyle, textAlign: 'left' }}> |
||||
|
{ |
||||
|
heads ? |
||||
|
<Row style={{ lineHeight: '40px', height: 40 }}> |
||||
|
{heads.map((c, index) => { |
||||
|
return <Col span={spans[index]} key={index}>{c}</Col> |
||||
|
}) |
||||
|
} |
||||
|
</Row> : '' |
||||
|
} |
||||
|
|
||||
|
<div id={divId} style={{ overflow: 'hidden', height: divHeight }} onMouseOver={this.onMouseOver} onMouseOut={this.onMouseOut}> |
||||
|
<div> |
||||
|
{content ? content : ''} |
||||
|
{this.state.enabledScroll && content ? content : ''} |
||||
|
{ |
||||
|
data ? |
||||
|
data.map((q, idx) => { |
||||
|
return ( |
||||
|
<div key={idx}> |
||||
|
<Row gutter={16} style={{ borderBottom: '0px solid grey' }}> |
||||
|
{heads.map((c, index) => { |
||||
|
return <Col span={spans[index]} key={index} style={{ paddingTop: 8, textAlign: 'left', wordBreak: 'break-word', color: `${c === changeStyleCol ? q.changeColor : ''}` }}> |
||||
|
{index == 1 ? q.data[index] == -1 ? "-" : q.data[index] : index == 2 ? q.data[1] == -1 ? '-' : q.data[index] : q.data[index]}</Col> |
||||
|
}) |
||||
|
} |
||||
|
</Row> |
||||
|
</div> |
||||
|
) |
||||
|
}) : '' |
||||
|
} |
||||
|
<div style={{ margin: 16 }}></div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div > |
||||
|
) |
||||
|
} |
||||
|
} |
@ -0,0 +1,184 @@ |
|||||
|
import React, { Component } from 'react'; |
||||
|
import './left.less'; |
||||
|
class ReactCarousel extends Component { |
||||
|
chunk(arr, size) { |
||||
|
var arr1 = new Array(); |
||||
|
for (var i = 0; i < Math.ceil(arr.length / size); i++) { |
||||
|
arr1[i] = new Array(); |
||||
|
} |
||||
|
var j = 0; |
||||
|
var x = 0; |
||||
|
for (var i = 0; i < arr.length; i++) { |
||||
|
if (!((i % size == 0) && (i != 0))) { |
||||
|
arr1[j][x] = arr[i]; |
||||
|
x++; |
||||
|
// console.log("j=" + j + " " + "x=" + x);
|
||||
|
} else { |
||||
|
j++; |
||||
|
x = 0; |
||||
|
// console.log("else:" + "j=" + j + " " + "x=" + x);
|
||||
|
arr1[j][x] = arr[i]; |
||||
|
// console.log(arr1);
|
||||
|
x++; |
||||
|
} |
||||
|
} |
||||
|
return arr1; |
||||
|
} |
||||
|
|
||||
|
constructor() { |
||||
|
super(); |
||||
|
this.state = { |
||||
|
shuzu: [{ name: "南昌县迎宾大道管制路段", images: "/assets/images/leadership/shiyantu.png" }, |
||||
|
{ name: "南昌县迎宾大道管制路段2", images: "/assets/images/leadership/shiyantu.png" }, |
||||
|
{ name: "南昌县迎宾大道管制路段3", images: "/assets/images/leadership/shiyantu.png" }, |
||||
|
{ name: "南昌县迎宾大道管制路段4", images: "/assets/images/leadership/shiyantu.png" }, |
||||
|
{ name: "南昌县迎宾大道管制路段", images: "/assets/images/leadership/shiyantu.png" }, |
||||
|
{ name: "南昌县迎宾大道管制路段", images: "/assets/images/leadership/shiyantu.png" }, |
||||
|
{ name: "南昌县迎宾大道管制路段", images: "/assets/images/leadership/shiyantu.png" }, |
||||
|
{ name: "南昌县迎宾大道管制路段", images: "/assets/images/leadership/shiyantu.png" }, |
||||
|
{ name: "南昌县迎宾大道管制路段", images: "/assets/images/leadership/shiyantu.png" }], |
||||
|
imgs: [], |
||||
|
showIndex: 0, //显示第几个图片
|
||||
|
timer: null, // 定时器
|
||||
|
show: false, // 前后按钮显示
|
||||
|
// arr1: ""
|
||||
|
} |
||||
|
// console.log(this.state.imgs);
|
||||
|
this.state.imgs = this.chunk((this.state.shuzu), 4) |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
render() { |
||||
|
return ( |
||||
|
<div className="ReactCarousel" style={{ width: "100%", height: "100%" }}> |
||||
|
<div className="contain" |
||||
|
onMouseEnter={() => { this.stop() }} //鼠标进入停止自动播放
|
||||
|
onMouseLeave={() => { this.start() }} //鼠标退出自动播放
|
||||
|
> |
||||
|
<ul className="ul"> |
||||
|
{ |
||||
|
|
||||
|
this.state.imgs.map((value, index) => { |
||||
|
return ( |
||||
|
<li style={{ position: "relative", left: "8%", width: "100%", height: "100%", top: "-5%", fontSize: "12px" }} className={index === this.state.showIndex ? 'show' : ''} |
||||
|
key={index} |
||||
|
> |
||||
|
<div style={{ width: "45%", height: "40%", backgroundColor: "red", position: "absolute", left: "-3%", top: "5%" }}> |
||||
|
<div style={{ width: "100%", height: "100%", position: "absolute", top: "80%" }}> |
||||
|
<div style={{ width: "100%", height: "20%", backgroundColor: "rgba(0,0,0,0.6)", overflow: "hiddden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}> |
||||
|
<img src='/assets/images/leadership/weizhis.png' style={{ width: "6%", height: "80%", marginLeft: "3%", marginRight: "3%" }} /> |
||||
|
{value[0]?.name} |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
{value[1]?.name ? <div style={{ width: "45%", height: "40%", backgroundColor: "#fff", position: "absolute", left: "45%", top: "5%" }}> |
||||
|
<div style={{ width: "100%", height: "100%", position: "absolute", top: "80%" }}> |
||||
|
<div style={{ width: "100%", height: "20%", backgroundColor: "rgba(0,0,0,0.6)", overflow: "hiddden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}> |
||||
|
<img src='/assets/images/leadership/weizhis.png' style={{ width: "6%", height: "80%", marginLeft: "3%", marginRight: "3%" }} /> |
||||
|
{value[1]?.name} |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> : ""} |
||||
|
{value[2]?.name ? <div style={{ width: "45%", height: "40%", backgroundColor: "bule", position: "absolute", left: "-3%", top: "49%" }}> |
||||
|
<div style={{ width: "100%", height: "100%", position: "absolute", top: "80%" }}> |
||||
|
<div style={{ width: "100%", height: "20%", backgroundColor: "rgba(0,0,0,0.6)", overflow: "hiddden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}> |
||||
|
<img src='/assets/images/leadership/weizhis.png' style={{ width: "6%", height: "80%", marginLeft: "3%", marginRight: "3%" }} /> |
||||
|
{value[2]?.name} |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> : ""} |
||||
|
{value[3]?.name ? <div style={{ width: "45%", height: "40%", backgroundColor: "pink", position: "absolute", left: "45%", top: "49%" }}> |
||||
|
<div style={{ width: "100%", height: "100%", position: "absolute", top: "80%" }}> |
||||
|
<div style={{ width: "100%", height: "20%", backgroundColor: "rgba(0,0,0,0.6)", overflow: "hiddden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}> |
||||
|
<img src='/assets/images/leadership/weizhis.png' style={{ width: "6%", height: "80%", marginLeft: "3%", marginRight: "3%" }} /> |
||||
|
{value[3]?.name} |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> : ""} |
||||
|
{/* <div>{value[1].name}</div> |
||||
|
<div>{value[2].name}</div> |
||||
|
<div>{value[3].name}</div> */} |
||||
|
</li> |
||||
|
) |
||||
|
}) |
||||
|
} |
||||
|
</ul> |
||||
|
{/* <ul className="dots" style={{ width: this.state.imgs.length * 20 + 'px' }}> |
||||
|
{ |
||||
|
this.state.imgs.map((value, index) => { |
||||
|
return ( |
||||
|
<li key={index} |
||||
|
className={index === this.state.showIndex ? 'active' : ''} |
||||
|
onClick={() => { this.change(index) }}> |
||||
|
</li>) |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
</ul> */} |
||||
|
<div className="control" style={{ width: "100%", height: "10%" }}> |
||||
|
<span style={{ position: "absolute", top: "86%", width: "3%", height: "8%" }} className="left" onClick={(e) => { this.previous(e) }}> |
||||
|
<img src='/assets/images/leadership/zuofanye.png' style={{ width: "100%", height: "100%" }} /> |
||||
|
</span> |
||||
|
<span style={{ position: "absolute", top: "86%", width: "3%", height: "8%", right: "6%" }} className="right" onClick={(e) => { this.next(e) }}> |
||||
|
<img src='/assets/images/leadership/youofanye.png' style={{ width: "100%", height: "100%" }} /> |
||||
|
</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
) |
||||
|
} |
||||
|
componentDidMount() { //一开始自动播放
|
||||
|
this.start(); |
||||
|
} |
||||
|
|
||||
|
componentWillUnmount() { //销毁前清除定时器
|
||||
|
this.stop(); |
||||
|
} |
||||
|
stop = () => { //暂停
|
||||
|
let { timer } = this.state; |
||||
|
clearInterval(timer); |
||||
|
} |
||||
|
start = () => { //开始
|
||||
|
let { timer } = this.state; |
||||
|
timer = setInterval(() => { |
||||
|
this.next(); |
||||
|
}, 300000); |
||||
|
this.setState({ |
||||
|
timer |
||||
|
}) |
||||
|
} |
||||
|
change = (index) => { //点击下面的按钮切换当前显示的图片
|
||||
|
let { showIndex } = this.state; |
||||
|
showIndex = index; |
||||
|
this.setState({ |
||||
|
showIndex |
||||
|
}) |
||||
|
} |
||||
|
previous = (e) => { //上一张
|
||||
|
let ev = e || window.event; |
||||
|
let { showIndex, imgs } = this.state; |
||||
|
if (showIndex <= 0) { |
||||
|
showIndex = imgs.length - 1; |
||||
|
} else { |
||||
|
showIndex--; |
||||
|
} |
||||
|
this.setState({ |
||||
|
showIndex |
||||
|
}) |
||||
|
} |
||||
|
next = (e) => { //下一张
|
||||
|
let ev = e || window.event; |
||||
|
let { showIndex, imgs } = this.state; |
||||
|
if (showIndex >= imgs.length - 1) { |
||||
|
showIndex = 0; |
||||
|
} else { |
||||
|
showIndex++; |
||||
|
} |
||||
|
this.setState({ |
||||
|
showIndex |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
export default ReactCarousel; |
@ -0,0 +1,98 @@ |
|||||
|
li{ |
||||
|
list-style-type:none |
||||
|
} |
||||
|
|
||||
|
.wy-rightTop{ |
||||
|
.ant-select-selector, .ant-select-selection-placeholder{ |
||||
|
background-color:#011f59 !important; |
||||
|
border:#1E7BD6 1px solid !important; |
||||
|
font-family: PingFangSC-Regular, PingFang SC !important; |
||||
|
height: 25px !important; |
||||
|
// line-height: 25px !important; |
||||
|
}.ant-select-selection-item{ |
||||
|
line-height: 25px !important; |
||||
|
} |
||||
|
.anticon{ |
||||
|
color: #fff !important; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
.contain { |
||||
|
position: relative; |
||||
|
top: 5%; |
||||
|
left: 45%; |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
transition: all 30s; |
||||
|
transform: translateX(-50%); |
||||
|
color: #fff; |
||||
|
overflow: hidden; |
||||
|
cursor: pointer; |
||||
|
} |
||||
|
.contain .ul { |
||||
|
height: 100%; |
||||
|
list-style: none; |
||||
|
} |
||||
|
.contain .ul .items { |
||||
|
position: absolute; |
||||
|
top: 0px; |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
} |
||||
|
.ul li.show{ |
||||
|
display: block; |
||||
|
} |
||||
|
.ul li { |
||||
|
display: none; |
||||
|
} |
||||
|
.ul li img { |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
} |
||||
|
.contain .dots { |
||||
|
position: absolute; |
||||
|
left: 50%; |
||||
|
bottom: 30px; |
||||
|
height: 10px; |
||||
|
transform: translateX(-50%); |
||||
|
} |
||||
|
.dots li { |
||||
|
float: left; |
||||
|
width: 10px; |
||||
|
height: 10px; |
||||
|
margin: 0px 5px; |
||||
|
border-radius: 50%; |
||||
|
transition: all .3s; |
||||
|
// background-color: antiquewhite; |
||||
|
list-style: none; |
||||
|
} |
||||
|
// .dots li.active { |
||||
|
// background-color: blue; |
||||
|
// } |
||||
|
.control .left { |
||||
|
position: absolute; |
||||
|
top: 80%; |
||||
|
left: 85%; |
||||
|
// padding: 5px; |
||||
|
// transform: translateY(-50%); |
||||
|
width: 20px; |
||||
|
height: 50px; |
||||
|
font-size: 20px; |
||||
|
cursor: pointer; |
||||
|
} |
||||
|
// .control .left:hover { |
||||
|
// background-color: #000000, |
||||
|
// } |
||||
|
.control .right { |
||||
|
position: absolute; |
||||
|
top: 80%; |
||||
|
right: 3%; |
||||
|
// padding: 5px; |
||||
|
// transform: translateY(-50%); |
||||
|
font-size: 20px; |
||||
|
cursor: pointer; |
||||
|
} |
||||
|
// .control .right:hover { |
||||
|
// background-color: rgba(0, 0, 0, .3); |
||||
|
// } |
File diff suppressed because it is too large
Loading…
Reference in new issue