From f2f3a497d005dc7426f04f058a82d3e3b91033ac Mon Sep 17 00:00:00 2001
From: SHAOJIAHAO <55341701@qq.com>
Date: Fri, 12 Nov 2021 17:25:36 +0800
Subject: [PATCH] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=E5=AE=8C=E6=88=90=E6=B2=B9?=
=?UTF-8?q?=E7=AB=99=E4=BF=A1=E6=81=AF=E7=AE=A1=E7=90=86=EF=BC=8C=E6=96=B0?=
=?UTF-8?q?=E5=A2=9E=E6=9F=B1=E7=8A=B6=E5=9B=BE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
package-lock.json | 5 +
package.json | 1 +
.../criminal-records-admin.component.html | 18 +-
.../criminal-records-admin.component.scss | 29 +-
.../criminal-records-admin.component.ts | 113 +++++-
.../editequipment.component.html | 10 +-
.../editequipment/editequipment.component.ts | 3 +
.../equipment-info.component.html | 12 +-
.../equipment-info.component.scss | 2 +-
.../equipment-info.component.ts | 35 +-
.../oil-station-info.component.html | 352 ++++++++++++++----
.../oil-station-info.component.scss | 85 ++++-
.../oil-station-info.component.ts | 231 +++++++++++-
src/app/service/objectsSimple.service.ts | 85 +++++
.../navigation/navigation.component.ts | 5 +-
.../organization/editor/editor.component.html | 19 +-
.../organization/editor/editor.component.ts | 4 +-
.../organization/organization.component.ts | 39 +-
.../user/edituser/edituser.component.ts | 2 +-
.../user/user.component.html | 6 +-
.../user/user.component.scss | 5 +
.../system-management/user/user.component.ts | 19 +-
src/styles.scss | 1 +
src/theme.less | 50 ++-
24 files changed, 969 insertions(+), 162 deletions(-)
create mode 100644 src/app/service/objectsSimple.service.ts
diff --git a/package-lock.json b/package-lock.json
index bb5548a..9f9c12a 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -11456,6 +11456,11 @@
}
}
},
+ "moment": {
+ "version": "2.29.1",
+ "resolved": "https://registry.nlark.com/moment/download/moment-2.29.1.tgz",
+ "integrity": "sha1-sr52n6MZQL6e7qZGnAdeNQBvo9M="
+ },
"monotone-convex-hull-2d": {
"version": "1.0.1",
"resolved": "https://registry.npm.taobao.org/monotone-convex-hull-2d/download/monotone-convex-hull-2d-1.0.1.tgz",
diff --git a/package.json b/package.json
index 5c417c2..97ac929 100644
--- a/package.json
+++ b/package.json
@@ -40,6 +40,7 @@
"echarts": "^4.9.0",
"firebase": "^7.6.2",
"install": "^0.13.0",
+ "moment": "^2.29.1",
"ng-zorro-antd": "^9.3.0",
"ngx-cookie-service": "^3.0.2",
"ngx-countdown": "^11.0.0",
diff --git a/src/app/pages/criminal-records-admin/criminal-records-admin.component.html b/src/app/pages/criminal-records-admin/criminal-records-admin.component.html
index 050e9bd..6d3af71 100644
--- a/src/app/pages/criminal-records-admin/criminal-records-admin.component.html
+++ b/src/app/pages/criminal-records-admin/criminal-records-admin.component.html
@@ -1,4 +1,4 @@
-
+
@@ -76,6 +76,14 @@

违规趋势
+
+
+
+
+
+
@@ -143,8 +151,8 @@
{{item.time}}
-
@@ -156,4 +164,4 @@
-
+
\ No newline at end of file
diff --git a/src/app/pages/criminal-records-admin/criminal-records-admin.component.scss b/src/app/pages/criminal-records-admin/criminal-records-admin.component.scss
index 74cb622..acc5a25 100644
--- a/src/app/pages/criminal-records-admin/criminal-records-admin.component.scss
+++ b/src/app/pages/criminal-records-admin/criminal-records-admin.component.scss
@@ -88,7 +88,7 @@
.piechart {}
.barchart {
- border: 1px solid rgba(145, 204, 255, 0.95);
+ // border: 1px solid rgba(145, 204, 255, 0.95);
}
}
@@ -124,6 +124,33 @@
.rightbox {
flex: 1;
+ position: relative;
+
+ .btnbox {
+ position: absolute;
+ right: 5px;
+ top: 5px;
+ display: flex;
+ flex-direction: row;
+ z-index: 999;
+
+ button {
+ border: 1px solid #91CCFF;
+ color: #91CCFF;
+ border-radius: 0px;
+ box-shadow: 0 0 5px 0 #2399FF inset;
+ background: none;
+ }
+
+ .rankingBtn {
+ margin-right: 16px;
+ }
+
+ .selectedbtn {
+ background: linear-gradient(180deg, #000D21 0%, #001331 27%, #2399FF 100%);
+ color: white;
+ }
+ }
}
}
}
diff --git a/src/app/pages/criminal-records-admin/criminal-records-admin.component.ts b/src/app/pages/criminal-records-admin/criminal-records-admin.component.ts
index 683423a..0d23606 100644
--- a/src/app/pages/criminal-records-admin/criminal-records-admin.component.ts
+++ b/src/app/pages/criminal-records-admin/criminal-records-admin.component.ts
@@ -85,14 +85,113 @@ export class CriminalRecordsAdminComponent implements OnInit {
};
// 绘制图表
myChart.setOption(option);
+
+ let mybarChart = echarts.init(document.getElementById('barchart'));
+ let baroption = {
+ xAxis: {
+ type: 'category',
+ data: this.getThirtyDays(),
+ axisLine: {
+ show: false,
+ lineStyle: {
+ color: '#91CCFF'
+ }
+ },
+ axisTick: {//刻度线
+ show: false
+ }
+ },
+ yAxis: {
+ type: 'value',
+ nameTextStyle: {
+ color: '#C4E2FC'
+ },
+ splitLine: {//分割线
+ lineStyle: {
+ color: ['#0f4374'],
+ width: 2
+ }
+ },
+ axisTick: {//刻度线
+ show: false
+ },
+ axisLine: {//轴线
+ show: false,
+ lineStyle: {
+ color: '#C4E2FC'
+ }
+ }
+ },
+ series: [
+ {
+ data: [120, 200, 150, 80, 70, 110, 130, 120, 200, 150, 80, 70, 110, 130, 120, 200, 150, 80, 70, 110, 130, 120, 200, 150, 80, 70, 110, 130, 100, 101],
+ type: 'bar',
+ itemStyle: {
+ color: {
+ type: 'linear',
+ x: 0,
+ y: 0,
+ x2: 0,
+ y2: 1,
+ colorStops: [{
+ offset: 0, color: '#23F0FF' // 0% 处的颜色
+ }, {
+ offset: 1, color: 'rgba(35, 153, 255, 0.1)' // 100% 处的颜色
+ }],
+ global: false // 缺省为 false
+ }
+ },
+ barWidth: '28%'
+ }
+ ],
+ grid: {
+ left: '36px',
+ right: '30px',
+ bottom: '50px',
+ top: '45px'
+ }
+ };
+ mybarChart.setOption(baroption);
+ }
+ getThirtyDays() {
+ //获取当前日期
+ let myDate = new Date();
+ var nowY = myDate.getFullYear();
+ var nowM = myDate.getMonth() + 1;
+ var nowD = myDate.getDate();
+ var enddateStr = nowY + "-" + (nowM < 10 ? "0" + nowM : nowM) + "-" + (nowD < 10 ? "0" + nowD : nowD);//当前日期
+ var enddate = new Date(enddateStr);
+
+
+ //获取三十天前日期
+ var lw = new Date(new Date().getTime() - 1000 * 60 * 60 * 24 * 30);//最后一个数字30可改,30天的意思
+ var lastY = lw.getFullYear();
+ var lastM = lw.getMonth() + 1;
+ var lastD = lw.getDate();
+ var startdateStr = lastY + "-" + (lastM < 10 ? "0" + lastM : lastM) + "-" + (lastD < 10 ? "0" + lastD : lastD);//三十天之前日期
+ var startDate = new Date(startdateStr);
+
+ const dateList = []
+ while (true) {
+ startDate.setDate(startDate.getDate() + 1)
+ if (startDate.getTime() <= enddate.getTime()) {
+ if (startDate.getDate() < 10) {
+ // startDate.getFullYear() 获取年,此处没加上年份
+ dateList.push((startDate.getMonth() + 1) + '.0' + startDate.getDate())
+ } else {
+ dateList.push((startDate.getMonth() + 1) + '.' + startDate.getDate())
+ }
+ } else {
+ break
+ }
+ }
+ return dateList;
}
submitForm(): void {
for (const i in this.validateForm.controls) {
this.validateForm.controls[i].markAsDirty();
this.validateForm.controls[i].updateValueAndValidity();
}
-
- console.log(this.validateForm)
}
resetForm(e: MouseEvent): void {
e.preventDefault();
@@ -128,4 +227,14 @@ export class CriminalRecordsAdminComponent implements OnInit {
look() {
this.router.navigate(['home/records/petrolStation'])
}
+
+
+ selectedType = '分布'
+ selectedRankingType = '站点排名'
+ echartClick(type){
+ this.selectedType = type
+ }
+ echartClick2(type){
+ this.selectedRankingType = type
+ }
}
diff --git a/src/app/pages/equipment-info/editequipment/editequipment.component.html b/src/app/pages/equipment-info/editequipment/editequipment.component.html
index 8e25462..253b2d8 100644
--- a/src/app/pages/equipment-info/editequipment/editequipment.component.html
+++ b/src/app/pages/equipment-info/editequipment/editequipment.component.html
@@ -10,7 +10,7 @@
-
+
@@ -18,26 +18,26 @@
-
+
购入日期
-
+
生产日期
-
+
有效期至
-
+
diff --git a/src/app/pages/equipment-info/editequipment/editequipment.component.ts b/src/app/pages/equipment-info/editequipment/editequipment.component.ts
index f980ed2..3ddba8e 100644
--- a/src/app/pages/equipment-info/editequipment/editequipment.component.ts
+++ b/src/app/pages/equipment-info/editequipment/editequipment.component.ts
@@ -14,6 +14,8 @@ export class EditequipmentComponent implements OnInit {
validateForm!: FormGroup;
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient) { }
+
+ data2
ngOnInit(): void {
this.validateForm = this.fb.group({
name: [null, [Validators.required]],
@@ -22,6 +24,7 @@ export class EditequipmentComponent implements OnInit {
prodtime: [null, [Validators.required]],
validitytime: [null, [Validators.required]]
});
+ this.data2 = JSON.parse(JSON.stringify(this.data))
}
destroyModal(){
diff --git a/src/app/pages/equipment-info/equipment-info.component.html b/src/app/pages/equipment-info/equipment-info.component.html
index 4ae0464..7261383 100644
--- a/src/app/pages/equipment-info/equipment-info.component.html
+++ b/src/app/pages/equipment-info/equipment-info.component.html
@@ -45,21 +45,21 @@
-
+
- 干粉灭火器
+ {{item.name}}
- 普通
+ {{item.specification}}
- 2021.01.05
+ {{item.purchaseDate | date:"yyyy-MM-dd"}}
- 2021.01.05
+ {{item.productionDate | date:"yyyy-MM-dd"}}
- 2021.01.05
+ {{item.validityEndTime | date:"yyyy-MM-dd"}}
diff --git a/src/app/pages/equipment-info/equipment-info.component.scss b/src/app/pages/equipment-info/equipment-info.component.scss
index 251eb3c..7d58fc2 100644
--- a/src/app/pages/equipment-info/equipment-info.component.scss
+++ b/src/app/pages/equipment-info/equipment-info.component.scss
@@ -73,7 +73,7 @@
color: #23D9FF;
background: rgba(35, 153, 255, 0.2);
border: 1px solid rgba(35, 217, 255, 0.4);
- // box-shadow: 0 0 3px 1px rgba(35, 217, 255, 0.4);
+ box-shadow: 0 0 3px 0px #23D9FF inset;
}
.tbody {
diff --git a/src/app/pages/equipment-info/equipment-info.component.ts b/src/app/pages/equipment-info/equipment-info.component.ts
index 690c819..238dcd3 100644
--- a/src/app/pages/equipment-info/equipment-info.component.ts
+++ b/src/app/pages/equipment-info/equipment-info.component.ts
@@ -19,7 +19,7 @@ export class EquipmentInfoComponent implements OnInit {
search: [null]
});
this.getEquipment()
- console.log(JSON.parse(sessionStorage.getItem('userdata')))
+ // console.log(JSON.parse(sessionStorage.getItem('userdata')))
}
//获取装备列表
@@ -28,10 +28,13 @@ export class EquipmentInfoComponent implements OnInit {
getEquipment() {
this.http.get('/api/services/app/FireEquipment/GetAll', {
params: {
- OrganizationId: JSON.parse(sessionStorage.getItem('userdata')).organizationIds[0]
+ Name:this.validateForm.value.search ? this.validateForm.value.search : '',
+ OrganizationId: JSON.parse(JSON.parse(sessionStorage.getItem('userdata'))).organization.id,
+ SkipCount: String(this.SkipCount),
+ MaxResultCount: String(this.MaxResultCount)
}
}).subscribe((data: any) => {
- // console.log(data)
+ console.log('装备列表', data)
this.equipmentList = data.result.items
this.equipmentNum = data.result.totalCount
})
@@ -46,11 +49,10 @@ export class EquipmentInfoComponent implements OnInit {
submitForm() {
-
+ this.getEquipment()
}
add() {
const modal = this.modal.create({
- // nzTitle: '新增角色',
nzContent: AddequipmentComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 380,
@@ -73,11 +75,10 @@ export class EquipmentInfoComponent implements OnInit {
productionDate: instance.validateForm.value.prodtime,
purchaseDate: instance.validateForm.value.buytime,
validityEndTime: instance.validateForm.value.validitytime,
- organizationId: JSON.parse(sessionStorage.getItem('userdata')).organizationIds[0]
+ organizationId: JSON.parse(sessionStorage.getItem('userdata')).organization.id
}
this.http.post('/api/services/app/FireEquipment/Create', body).subscribe(data => {
resolve(data)
- this.getEquipment()
this.message.create('success', '创建成功!');
return true
})
@@ -86,13 +87,13 @@ export class EquipmentInfoComponent implements OnInit {
this.message.create('warning', '请填写完整!');
return false
}
- console.log(instance.validateForm.value)
- return false
- }
+ },
});
+ modal.afterClose.subscribe(result => this.getEquipment());
const instance = modal.getContentComponent();
}
edit(item) {
+ console.log(item)
const modal = this.modal.create({
// nzTitle: '新增角色',
nzContent: EditequipmentComponent,
@@ -114,18 +115,18 @@ export class EquipmentInfoComponent implements OnInit {
if (instance.validateForm.valid) {
await new Promise(resolve => {
let body = {
+ id: item.id,
name: instance.validateForm.value.name,
specification: instance.validateForm.value.specification,
productionDate: instance.validateForm.value.prodtime,
purchaseDate: instance.validateForm.value.buytime,
validityEndTime: instance.validateForm.value.validitytime,
- organizationId: JSON.parse(sessionStorage.getItem('userdata')).organizationIds[0]
+ organizationId: item.organizationId
}
- this.http.post('/api/services/app/FireEquipment/Create', body).subscribe(data => {
+ this.http.put('/api/services/app/FireEquipment/Update', body).subscribe(data => {
resolve(data)
- this.message.create('success', '创建成功!');
- // return true
- this.modal.closeAll()
+ this.message.create('success', '修改成功!');
+ return true
})
})
} else {
@@ -143,13 +144,13 @@ export class EquipmentInfoComponent implements OnInit {
nzOkText: '确定',
nzOkType: 'danger',
nzOnOk: () => {
- this.http.delete('', {
+ this.http.delete('/api/services/app/FireEquipment/Delete', {
params: {
Id: item.id
}
}).subscribe(data => {
this.message.create('success', '删除成功!');
-
+ this.getEquipment()
})
},
nzCancelText: '取消',
diff --git a/src/app/pages/oil-station-info/oil-station-info.component.html b/src/app/pages/oil-station-info/oil-station-info.component.html
index b0437db..39f76ab 100644
--- a/src/app/pages/oil-station-info/oil-station-info.component.html
+++ b/src/app/pages/oil-station-info/oil-station-info.component.html
@@ -4,85 +4,279 @@
-
-
-
- 所属组织机构 |
- |
- 开业时间 |
- |
-
-
- 油站类型 |
- |
- 车道数量 |
- |
-
-
- 地址 |
- |
-
-
-
-
- 辖区派出所 |
- |
- 地址 |
- |
-
-
- 距离 |
- |
- 联系方式 |
- |
-
-
-
-
- 辖区医院 |
- |
- 地址 |
- |
-
-
- 距离 |
- |
- 联系方式 |
- |
-
-
-
-
- 辖区消防队 |
- |
- 地址 |
- |
-
-
- 距离 |
- |
- 联系方式 |
- |
-
-
-
-
- 营业执照 |
- |
-
-
- 危险化学品 经营许可证 |
- |
-
-
- 成品油零售 经营许可证 |
- |
-
-
-
-
-
+
\ No newline at end of file
diff --git a/src/app/pages/oil-station-info/oil-station-info.component.scss b/src/app/pages/oil-station-info/oil-station-info.component.scss
index 5be00df..0964eb4 100644
--- a/src/app/pages/oil-station-info/oil-station-info.component.scss
+++ b/src/app/pages/oil-station-info/oil-station-info.component.scss
@@ -51,7 +51,15 @@
text-overflow: ellipsis;
color: #C4E2FC;
box-sizing: border-box;
- padding: 0 16px;
+
+ input {
+ color: #fff;
+ height: 100%;
+ background: none;
+ text-align: left;
+ border: 0px;
+ }
+
}
.head {
@@ -59,11 +67,18 @@
background: #0b3863;
color: #23D9FF;
text-align: right;
+ padding: 0 16px;
}
.text {
width: 33%;
}
+
+ .organizations {
+ text-align: left;
+ color: #fff;
+ padding: 0 11px;
+ }
}
}
@@ -73,6 +88,74 @@
td {
height: 98px;
}
+
+ .imgbox {
+ .uploadDivbox {
+ width: 100%;
+ height: 100%;
+ box-sizing: border-box;
+ padding: 0 16px;
+ display: flex;
+ align-items: center;
+ }
+
+ .uploadDiv {
+ margin-left: 16px;
+ width: 120px;
+ height: 80px;
+ // border: 1px solid red;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ position: relative;
+
+ .fileinput {
+ width: 114px;
+ height: 32px;
+ position: absolute;
+ z-index: 100;
+ opacity: 0;
+ top: 23px;
+ cursor: pointer;
+ }
+
+ button {
+ z-index: 99;
+ width: 114px;
+ height: 32px;
+ background: rgba(0, 129, 255, 0.3);
+ border: 1px solid #36A2FF;
+ opacity: 1;
+ border-radius: 0px;
+ color: #91CCFF;
+ }
+ }
+ }
+ }
+ }
+
+ .btnbox {
+ height: 40px;
+ width: 100%;
+ margin-bottom: 24px;
+ display: flex;
+ justify-content: flex-end;
+
+ button {
+ height: 40px;
+ background: rgba(0, 129, 255, 0.3);
+ border: 1px solid #36A2FF;
+ opacity: 1;
+ border-radius: 0px;
+ color: #91CCFF;
+ }
+ button:nth-child(1) {
+ width: 100px;
+ margin-left: 16px;
+ }
+ button:nth-child(2) {
+ width: 130px;
+ margin-left: 16px;
}
}
}
diff --git a/src/app/pages/oil-station-info/oil-station-info.component.ts b/src/app/pages/oil-station-info/oil-station-info.component.ts
index 30e2d0e..25c6d36 100644
--- a/src/app/pages/oil-station-info/oil-station-info.component.ts
+++ b/src/app/pages/oil-station-info/oil-station-info.component.ts
@@ -1,15 +1,242 @@
+import { HttpClient } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
-
+import { FormBuilder, FormGroup, Validators } from '@angular/forms';
+import { ObjectsSimpleService } from 'src/app/service/objectsSimple.service';
+import { NzMessageService } from 'ng-zorro-antd/message';
+import * as moment from 'moment';
@Component({
selector: 'app-oil-station-info',
templateUrl: './oil-station-info.component.html',
styleUrls: ['./oil-station-info.component.scss']
})
export class OilStationInfoComponent implements OnInit {
+ validateForm!: FormGroup;
+ constructor(private fb: FormBuilder, private objectsSrv: ObjectsSimpleService, private http: HttpClient, private message: NzMessageService) { }
- constructor() { }
+ userdata: any
+ dateFormat = 'yyyy-MM-dd';
ngOnInit(): void {
+ this.userdata = JSON.parse(sessionStorage.getItem('userdata'))
+ this.validateForm = this.fb.group({
+ oilStation: this.fb.group({
+ organization: [this.userdata.organization.displayName],
+ startBusinessTime: [null, [Validators.required]],
+ oilStationType: [null],
+ laneNumber: [null],
+ address: [null],
+ validityTime: [null, [Validators.required]]//营业执照有效期
+ }),
+ policeStation: this.fb.group({
+ name: [null],
+ address: [null],
+ distance: [null],
+ contactInformation: [null]
+ }),
+ hospital: this.fb.group({
+ name: [null],
+ address: [null],
+ distance: [null],
+ contactInformation: [null]
+ }),
+ fireBrigade: this.fb.group({
+ name: [null],
+ address: [null],
+ distance: [null],
+ contactInformation: [null]
+ })
+ });
+
+ this.getInfo()
+
+ }
+
+
+ validityTime: any = []//营业执照有效期
+
+ //获取油站信息
+ getInfo() {
+ this.http.get('/api/services/app/GasStation/Get', {
+ params: {
+ organizationId: this.userdata.organization.id
+ }
+ }).subscribe((data: any) => {
+ console.log('油站信息', data)
+ this.httpBody = data.result
+ this.httpBody.govUnitDetail = JSON.parse(data.result.govUnitDetail)
+ this.policeStation = data.result.govUnitDetail.policeStation
+ this.hospital = data.result.govUnitDetail.hospital
+ this.fireBrigade = data.result.govUnitDetail.fireBrigade
+ this.httpBody.stationType = String(this.httpBody.stationType)
+ this.validityTime[0] = data.result.validityStartTime
+ this.validityTime[1] = data.result.validityEndTime
+ this.validityTime = [...this.validityTime]
+ console.log(this.validityTime)
+ }, err => {
+ console.log('油站错误信息', err.error.error.message)
+ })
+ }
+
+
+
+ policeStation = {
+ name: '',
+ address: '',
+ distance: '',
+ contactInformation: ''
+ }
+ hospital = {
+ name: '',
+ address: '',
+ distance: '',
+ contactInformation: ''
+ }
+ fireBrigade = {
+ name: '',
+ address: '',
+ distance: '',
+ contactInformation: ''
+ }
+ httpBody = {
+ id: null,
+ stationName: JSON.parse(sessionStorage.getItem('userdata')).organization.displayName,
+ organizationId: JSON.parse(sessionStorage.getItem('userdata')).organization.id,
+ validityStartTime: '',
+ validityEndTime: '',
+ openTime: '',
+ stationType: '',
+ laneCount: '',
+ address: '',
+ govUnitDetail: {
+ policeStation: {},
+ hospital: {},
+ fireBrigade: {}
+ },
+ businessLicenseImage: '',
+ dangerousChemicalLicenseImage: '',
+ gasSellLicenseImage: ''
}
+
+ submitForm() {
+
+ console.log(this.validateForm)
+ console.log(this.httpBody)
+ if (this.validateForm.valid) {
+ this.isLoadingSave = true
+ this.httpBody.openTime = moment(this.httpBody.openTime).format('YYYY-MM-MM')//开业时间格式化
+ this.httpBody.validityStartTime = moment(this.validityTime[0]).format('YYYY-MM-MM')//开业时间格式化
+ this.httpBody.validityEndTime = moment(this.validityTime[1]).format('YYYY-MM-MM')//开业时间格式化
+ this.httpBody.govUnitDetail.policeStation = this.validateForm.value.policeStation
+ this.httpBody.govUnitDetail.hospital = this.validateForm.value.hospital
+ this.httpBody.govUnitDetail.fireBrigade = this.validateForm.value.fireBrigade
+
+ let body = JSON.parse(JSON.stringify(this.httpBody))
+ body.stationType
+ body.govUnitDetail = JSON.stringify(this.httpBody.govUnitDetail)
+
+ if (this.httpBody.id) {
+ this.http.put('/api/services/app/GasStation/Update', body).subscribe((data: any) => {
+ this.isLoadingSave = false
+ this.message.create('success', '保存成功!');
+ }, err => {
+ this.isLoadingSave = false
+ this.message.create('error', '保存失败!');
+ })
+ } else {
+ this.http.post('/api/services/app/GasStation/Create', body).subscribe((data: any) => {
+ this.httpBody.id = data.result.id
+ this.isLoadingSave = false
+ this.message.create('success', '保存成功!');
+ }, err => {
+ this.isLoadingSave = false
+ this.message.create('error', '保存失败!');
+ })
+ }
+ } else {
+ this.message.create('warning', '请填写完整!');
+ return false
+ }
+
+ }
+
+ isLoadingOne: boolean = false
+ isLoadingTwo: boolean = false
+ isLoadingThree: boolean = false
+ isLoadingSave: boolean = false
+ uploadType: string
+ filechange(e, type) {
+ let file = e.target.files[0] || null //获取上传的文件
+ this.uploadType = type
+ if (this.uploadType == 'businessLicense') {//营业执照
+ this.isLoadingOne = true
+ }
+ if (this.uploadType == 'dangerousChemical') {//危化品销售
+ this.isLoadingTwo = true
+ }
+ if (this.uploadType == 'retailOfRefinedOil') {//成品油零售
+ this.isLoadingThree = true
+ }
+ this.openFileSelect(file, `stationPhotos/${this.userdata.organization.id}/`)
+ }
+ //设置文件路径并上传
+ postFilePath
+ openFileSelect(file: File, extensionPath: string) {
+ this.postFilePath = extensionPath;
+ let fileSize = file.size || null //上传文件的总大小
+ let shardSize = 5 * 1024 * 1024 //5MB 超过5MB要分块上传
+ if (fileSize >= shardSize) // 超过5MB要分块上传
+ {
+ this.postFileByMul(file);
+ }
+ else //普通上传
+ {
+ this.postFile(file);
+ }
+ }
+ //上传文件
+ async postFile(file: File) {
+ await new Promise((resolve, reject) => {
+ this.objectsSrv.postFile(this.postFilePath, file).subscribe(data => {
+ let dataObj = data as any;
+ let filePath: string = ObjectsSimpleService.baseUrl + dataObj.objectName;
+ if (this.uploadType == 'businessLicense') {//营业执照
+ this.httpBody.businessLicenseImage = filePath
+ this.isLoadingOne = false
+ }
+ if (this.uploadType == 'dangerousChemical') {//危化品
+ this.httpBody.dangerousChemicalLicenseImage = filePath
+ this.isLoadingTwo = false
+ }
+ if (this.uploadType == 'retailOfRefinedOil') {//成品油
+ this.httpBody.gasSellLicenseImage = filePath
+ this.isLoadingThree = false
+ }
+ resolve('success')
+ });
+ })
+ }
+
+ /**
+ * 分块上传
+ * @param file
+ */
+ postFileByMul(file: File) {
+ this.objectsSrv.postFile_MultipartUpload(this.postFilePath, file).then((value) => {
+ let dataObj = value as any;
+ if (this.uploadType == 'businessLicense') {//营业执照
+ this.httpBody.businessLicenseImage = dataObj.filePath
+ this.isLoadingOne = false
+ }
+ if (this.uploadType == 'dangerousChemical') {//危化品
+ this.httpBody.dangerousChemicalLicenseImage = dataObj.filePath
+ this.isLoadingTwo = false
+ }
+ if (this.uploadType == 'retailOfRefinedOil') {//成品油
+ this.httpBody.gasSellLicenseImage = dataObj.filePath
+ this.isLoadingThree = false
+ }
+ });
+
+ }
}
diff --git a/src/app/service/objectsSimple.service.ts b/src/app/service/objectsSimple.service.ts
new file mode 100644
index 0000000..25a5fcf
--- /dev/null
+++ b/src/app/service/objectsSimple.service.ts
@@ -0,0 +1,85 @@
+import { HttpClient } from '@angular/common/http';
+import { Injectable } from '@angular/core';
+import { Observable } from 'rxjs';
+
+@Injectable({
+ providedIn: 'root'
+})
+export class ObjectsSimpleService {
+
+ static readonly c_apiRoot = "/api/";//普通上传的API根路径
+ static readonly c_apiRoot_Multipart = "/api/";//分块上传的API根路径
+
+ // static testPath = "f1/f2";//测试路径
+
+ constructor(private http: HttpClient) { }
+
+
+
+ //普通上传,单个文件上限5M
+ static baseUrl = ObjectsSimpleService.c_apiRoot + 'Objects/sinochemweb/';
+ postFile(extensionPath: string, file: File): Observable
diff --git a/src/app/system-management/organization/editor/editor.component.ts b/src/app/system-management/organization/editor/editor.component.ts
index c7a7805..e097924 100644
--- a/src/app/system-management/organization/editor/editor.component.ts
+++ b/src/app/system-management/organization/editor/editor.component.ts
@@ -13,11 +13,13 @@ export class EditorComponent implements OnInit {
validateForm!: FormGroup;
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient) { }
+ datacopy:any
ngOnInit(): void {
this.validateForm = this.fb.group({
name: [null, [Validators.required]],
- power: [null, [Validators.required]]
+ code: [null, [Validators.required]]
});
+ this.datacopy = JSON.parse(JSON.stringify(this.data))
}
destroyModal(): void {
this.modal.destroy({ data: 'this the result data' });
diff --git a/src/app/system-management/organization/organization.component.ts b/src/app/system-management/organization/organization.component.ts
index 8bfae24..4a35595 100644
--- a/src/app/system-management/organization/organization.component.ts
+++ b/src/app/system-management/organization/organization.component.ts
@@ -40,15 +40,12 @@ export class OrganizationComponent implements OnInit {
this.totalCount = data.result.totalCount
// console.log('组织机构',data.result.totalCount)
data.result.items.forEach(element => {
- element.key = element.code
+ element.key = element.id
element.title = element.displayName
element.selectable = false
});
this.nodes = [...this.toTree.toTree(data.result.items)]
- // this.nzExpandAll = true;
- this.nzTreeComponent.getExpandedNodeList().forEach((item) => {
- this.defaultExpandedKeys.push(item.key)
- })
+ this.defaultExpandedKeys = [...this.defaultExpandedKeys]
})
}
@@ -88,7 +85,7 @@ export class OrganizationComponent implements OnInit {
}
addOr(node?: any) {
- console.log(node)
+ // console.log(node)
const modal = this.modal.create({
nzTitle: node ? '新增组织机构' : '新增一级组织机构',
nzContent: AddorComponent,
@@ -102,11 +99,14 @@ export class OrganizationComponent implements OnInit {
let body = {
parentId: node ? Number(node.key) : null,
code: instance.validateForm.value.code,
- displayName: instance.validateForm.value.name,
+ displayName: instance.validateForm.value.name,
}
this.http.post('/api/services/app/Organization/Create', body).subscribe(data => {
resolve(data)
this.message.create('success', '创建成功!');
+ this.nzTreeComponent.getExpandedNodeList().forEach((item) => {
+ this.defaultExpandedKeys.push(item.key)
+ })
this.getAllOrganization()
return true
}, err => {
@@ -125,29 +125,36 @@ export class OrganizationComponent implements OnInit {
}
editOr(node) {
- console.log(node)
+ // console.log(node)
const modal = this.modal.create({
nzTitle: '编辑组织机构',
nzContent: EditorComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 288,
nzComponentParams: {
- data: node,
+ data: node.origin,
},
nzOnOk: async () => {
console.log('hhhhhhh', instance.validateForm)
if (instance.validateForm.valid) {
await new Promise(resolve => {
let body = {
-
+ id: node.origin.id,
+ parentId: node.origin.parentId,
+ code: instance.validateForm.value.code,
+ displayName: instance.validateForm.value.name,
}
- this.http.post('/api/services/app/User/Create', body).subscribe(data => {
+ this.http.put('/api/services/app/Organization/Update', body).subscribe(data => {
resolve(data)
this.message.create('success', '编辑成功!');
+ this.nzTreeComponent.getExpandedNodeList().forEach((item) => {
+ this.defaultExpandedKeys.push(item.key)
+ })
+ this.getAllOrganization()
return true
}, err => {
resolve(err)
- this.message.create('warning', '创建失败');
+ this.message.create('warning', '编辑失败');
return false
})
})
@@ -166,11 +173,15 @@ export class OrganizationComponent implements OnInit {
nzOkText: '确定',
nzOkType: 'danger',
nzOnOk: () => {
- this.http.delete('/api/services/app/Role/Delete', {
+ this.http.delete('/api/services/app/Organization/Delete', {
params: {
- Id: item.id
+ Id: item.origin.id
}
}).subscribe(data => {
+ this.nzTreeComponent.getExpandedNodeList().forEach((item) => {
+ this.defaultExpandedKeys.push(item.key)
+ })
+ this.getAllOrganization()
this.message.create('success', '删除成功!');
})
},
diff --git a/src/app/system-management/user/edituser/edituser.component.ts b/src/app/system-management/user/edituser/edituser.component.ts
index 89b8f2b..c39c449 100644
--- a/src/app/system-management/user/edituser/edituser.component.ts
+++ b/src/app/system-management/user/edituser/edituser.component.ts
@@ -47,7 +47,7 @@ export class EdituserComponent implements OnInit {
getAllOrganization() {
this.http.get('/api/services/app/Organization/GetAll').subscribe((data: any) => {
data.result.items.forEach(element => {
- element.key = element.code
+ element.key = element.id
element.title = element.displayName
});
this.nodes = [...this.toTree.toTree(data.result.items)]
diff --git a/src/app/system-management/user/user.component.html b/src/app/system-management/user/user.component.html
index 9077a79..c6f9069 100644
--- a/src/app/system-management/user/user.component.html
+++ b/src/app/system-management/user/user.component.html
@@ -40,10 +40,10 @@
{{item}}
-
+
+ {{data.organizationName}}
|
编辑
diff --git a/src/app/system-management/user/user.component.scss b/src/app/system-management/user/user.component.scss
index 2cf35a9..73aefe3 100644
--- a/src/app/system-management/user/user.component.scss
+++ b/src/app/system-management/user/user.component.scss
@@ -65,6 +65,11 @@
.tablebox {
flex: 1;
overflow-y: auto;
+
+ //滚动条样式
+ ::-webkit-scrollbar {
+ display: none;
+ }
}
.pagination {
diff --git a/src/app/system-management/user/user.component.ts b/src/app/system-management/user/user.component.ts
index 54965e1..eabc922 100644
--- a/src/app/system-management/user/user.component.ts
+++ b/src/app/system-management/user/user.component.ts
@@ -26,9 +26,10 @@ export class UserComponent implements OnInit {
usersLIst: any = []
usersNum: string
-
+
getAllUsers() {
let params = {
+ Keyword: this.validateForm.value.search ? this.validateForm.value.search : '',
SkipCount: String(this.SkipCount),
MaxResultCount: String(this.MaxResultCount)
}
@@ -51,11 +52,11 @@ export class UserComponent implements OnInit {
//搜索框提交
submitForm(): void {
- console.log(12345)
for (const i in this.validateForm.controls) {
this.validateForm.controls[i].markAsDirty();
this.validateForm.controls[i].updateValueAndValidity();
}
+ this.getAllUsers()
}
//新增用户
@@ -70,7 +71,6 @@ export class UserComponent implements OnInit {
subtitle: ''
},
nzOnOk: async () => {
- console.log('hhhhhhh', instance.validateForm)
if (instance.validateForm.valid) {
await new Promise(resolve => {
let body = {
@@ -89,7 +89,8 @@ export class UserComponent implements OnInit {
return true
}, err => {
resolve(err)
- this.message.create('warning', '创建失败');
+ console.log(4444, err)
+ this.message.create('warning', err.error.error.message);
return false
})
})
@@ -155,13 +156,11 @@ export class UserComponent implements OnInit {
nzOkText: '确定',
nzOkType: 'primary',
nzOnOk: () => {
- this.http.post('/api/services/app/User/ResetPassword', {
- params: {
- userId: item.id
- }
- }).subscribe(data => {
+ let body = {
+ userId: item.id
+ }
+ this.http.post('/api/services/app/User/ResetPassword', body).subscribe(data => {
this.message.create('success', '重置成功!');
- this.getAllUsers()
})
},
nzCancelText: '取消',
diff --git a/src/styles.scss b/src/styles.scss
index e2f0095..49a6cce 100644
--- a/src/styles.scss
+++ b/src/styles.scss
@@ -102,6 +102,7 @@ h1 {
font-size: 16px;
}
+
//滚动条样式
::-webkit-scrollbar {
width: 5px;
diff --git a/src/theme.less b/src/theme.less
index 9fa14b8..4880919 100644
--- a/src/theme.less
+++ b/src/theme.less
@@ -111,8 +111,11 @@
}
-//登录页input
-#login,#equipmentInfo,#addequipment {
+
+//深蓝色input
+#login,
+#equipmentInfo,
+#addequipment {
nz-input-group,
input {
@@ -200,3 +203,46 @@
position: relative;
}
}
+
+
+//input填充100%
+#oilStationInfo {
+ nz-form-item {
+ margin-bottom: 0px;
+ height: 100%;
+
+ .ant-form-item-control-input,
+ .ant-form-item-control-input-content,
+ nz-input-group {
+ height: 100%;
+ }
+ }
+
+ nz-date-picker,
+ nz-range-picker {
+ background: none;
+ width: 100%;
+ height: 100%;
+ color: #fff;
+ border: none;
+
+ input,
+ .ant-picker-suffix,
+ .ant-picker-separator {
+ color: #fff;
+ }
+ }
+
+ nz-select {
+ text-align: left;
+ color: #fff;
+ height: 100%;
+ }
+
+ nz-select-top-control {
+ height: 100%;
+ padding-left: 10px;
+ padding-top: 4px;
+ border: none;
+ }
+}
|