Browse Source

[完善]中台对接

test-assets
邵佳豪 6 months ago
parent
commit
c2237a44d6
  1. 4
      proxy.config.json
  2. 517
      src/app/pages/oil-station-info/oil-station-info.component.ts
  3. 99
      src/app/pages/singlelogin/singlelogin.component.ts
  4. 2
      src/app/system-management/navigation/navigation.component.scss
  5. 5
      src/app/system-management/navigation/navigation.component.ts
  6. 0
      src/app/system-management/or-binding/or-binding-model/or-binding-model.component.html
  7. 224
      src/app/system-management/or-binding/or-binding-model/or-binding-model.component.scss
  8. 15
      src/app/system-management/or-binding/or-binding-model/or-binding-model.component.ts
  9. 62
      src/app/system-management/or-binding/or-binding.component.html
  10. 173
      src/app/system-management/or-binding/or-binding.component.scss
  11. 106
      src/app/system-management/or-binding/or-binding.component.ts
  12. 2
      src/app/system-management/organization/organization.component.ts
  13. 2
      src/app/system-management/system-management-routing.module.ts
  14. 4
      src/app/system-management/system-management.module.ts
  15. 2
      src/app/system-management/user-binding/user-binding.component.scss
  16. 2
      src/app/system-management/user/edituser/edituser.component.ts
  17. 2
      src/app/system-management/user/user.component.ts

4
proxy.config.json

@ -13,8 +13,8 @@
"ws": true,
"logLevel": "debug"
},
"/p3p": {
"target": "https://test-uomsp.sinochemoilmarketing.com/sagframe-portal/",
"/sagframe-portal": {
"target": "https://test-uomsp.sinochemoilmarketing.com/",
"secure": false,
"changeOrigin": true
}

517
src/app/pages/oil-station-info/oil-station-info.component.ts

@ -1,25 +1,31 @@
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';
import Viewer from 'viewerjs';
import { Router, ActivatedRoute } from '@angular/router'
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";
import Viewer from "viewerjs";
import { Router, ActivatedRoute } from "@angular/router";
@Component({
selector: 'app-oil-station-info',
templateUrl: './oil-station-info.component.html',
styleUrls: ['./oil-station-info.component.scss']
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 router: Router, private fb: FormBuilder, private objectsSrv: ObjectsSimpleService, private http: HttpClient, private message: NzMessageService, public route: ActivatedRoute) { }
userdata: any
dateFormat = 'yyyy-MM-dd';
constructor(
private router: Router,
private fb: FormBuilder,
private objectsSrv: ObjectsSimpleService,
private http: HttpClient,
private message: NzMessageService,
public route: ActivatedRoute
) {}
userdata: any;
dateFormat = "yyyy-MM-dd";
ngOnInit(): void {
this.userdata = JSON.parse(sessionStorage.getItem('userdata'))
this.userdata = JSON.parse(sessionStorage.getItem("userdata"));
this.validateForm = this.fb.group({
oilStation: this.fb.group({
organization: [],
@ -40,243 +46,306 @@ export class OilStationInfoComponent implements OnInit {
name: [null],
address: [null],
distance: [null],
contactInformation: [null]
contactInformation: [null],
}),
hospital: this.fb.group({
name: [null],
address: [null],
distance: [null],
contactInformation: [null]
contactInformation: [null],
}),
fireBrigade: this.fb.group({
name: [null],
address: [null],
distance: [null],
contactInformation: [null]
})
contactInformation: [null],
}),
});
this.getInfo()
this.getInfo();
}
//获取油站信息
// gallery
getInfo() {
this.http.get('/api/services/app/GasStation/Get', {
params: {
organizationUnitId: this.route.snapshot.queryParams.id
}
}).subscribe((data: any) => {
this.httpBody.locationName ? null : this.httpBody.locationName = this.httpBody.proposalAreaName
this.httpBody.companyName ? null : this.httpBody.companyName = this.httpBody.proposalCompanyName
if (new Date(data.result.openTime).getTime() == -62135625943000) {
data.result.openTime = null
}
this.httpBody = data.result
if (!this.httpBody.govUnitDetail) {
this.httpBody.govUnitDetail = {
policeStation: {},
hospital: {},
fireBrigade: {}
this.http
.get("/api/services/app/GasStation/Get", {
params: {
organizationUnitId: this.route.snapshot.queryParams.id,
},
})
.subscribe(
(data: any) => {
this.httpBody.locationName
? null
: (this.httpBody.locationName = this.httpBody.proposalAreaName);
this.httpBody.companyName
? null
: (this.httpBody.companyName = this.httpBody.proposalCompanyName);
if (new Date(data.result.openTime).getTime() == -62135625943000) {
data.result.openTime = null;
}
this.httpBody = data.result;
if (!this.httpBody.govUnitDetail) {
this.httpBody.govUnitDetail = {
policeStation: {},
hospital: {},
fireBrigade: {},
};
} else {
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;
}
if (this.httpBody.otherData) {
this.otherInfoData = JSON.parse(this.httpBody.otherData);
}
console.log("油站信息", this.httpBody);
},
(err) => {
console.log("油站错误信息", err.error.error.message);
}
} else {
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
}
if (this.httpBody.otherData) {
this.otherInfoData = JSON.parse(this.httpBody.otherData)
}
console.log('油站信息', this.httpBody)
}, err => {
console.log('油站错误信息', err.error.error.message)
})
);
}
exportExcel() {
const httpOptions = {
responseType: 'blob' as 'json'
responseType: "blob" as "json",
};
this.http.get(`/api/services/app/GasStation/ExportExcelFile?gasStationId=${this.httpBody.id}`, httpOptions).subscribe((data: any) => {
// console.log('导出成功')
// 文件名中有中文 则对文件名进行转码
const link = document.createElement('a');
const blob = new Blob([data], { type: 'application/vnd.ms-excel' });
link.setAttribute('href', window.URL.createObjectURL(blob));
link.setAttribute('download', this.httpBody.stationName + '基本信息' + '.xls');
link.style.visibility = 'hidden';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
this.message.create('success', '导出成功!');
}, err => {
this.message.create('error', '导出失败!');
})
this.http
.get(
`/api/services/app/GasStation/ExportExcelFile?gasStationId=${this.httpBody.id}`,
httpOptions
)
.subscribe(
(data: any) => {
// console.log('导出成功')
// 文件名中有中文 则对文件名进行转码
const link = document.createElement("a");
const blob = new Blob([data], { type: "application/vnd.ms-excel" });
link.setAttribute("href", window.URL.createObjectURL(blob));
link.setAttribute(
"download",
this.httpBody.stationName + "基本信息" + ".xls"
);
link.style.visibility = "hidden";
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
this.message.create("success", "导出成功!");
},
(err) => {
this.message.create("error", "导出失败!");
}
);
}
policeStation = {
name: '',
address: '',
distance: '',
contactInformation: ''
}
name: "",
address: "",
distance: "",
contactInformation: "",
};
hospital = {
name: '',
address: '',
distance: '',
contactInformation: ''
}
name: "",
address: "",
distance: "",
contactInformation: "",
};
fireBrigade = {
name: '',
address: '',
distance: '',
contactInformation: ''
}
name: "",
address: "",
distance: "",
contactInformation: "",
};
httpBody = {
id: null,
stationName: JSON.parse(sessionStorage.getItem('userdata')).organization.displayName,
organizationUnitId: JSON.parse(sessionStorage.getItem('userdata')).organization.id,
stationName: JSON.parse(sessionStorage.getItem("userdata")).organization
.displayName,
organizationUnitId: JSON.parse(sessionStorage.getItem("userdata"))
.organization.id,
auditLog: {
auditStatusDesc: null,
rejectReason: null
rejectReason: null,
},
auditStatus: null,
openTime: '',
stationType: '',
laneCount: '',
address: '',
locationName: '',
companyName: '',
leaderName: '',
proposalAreaName: '',
proposalCompanyName: '',
leaderContact: '',
stationLevel: '',
sellVariety: '',
gasStationCount: '',
tankVolume: '',
openTime: "",
stationType: "",
laneCount: "",
address: "",
locationName: "",
companyName: "",
leaderName: "",
proposalAreaName: "",
proposalCompanyName: "",
leaderContact: "",
stationLevel: "",
sellVariety: "",
gasStationCount: "",
tankVolume: "",
govUnitDetail: {
policeStation: {},
hospital: {},
fireBrigade: {}
fireBrigade: {},
},
hasBuildingInfo: true,
businessLicenseImage: '',
dangerousChemicalLicenseImage: '',
gasSellLicenseImage: '',
licenses: [
],
otherData: null
}
businessLicenseImage: "",
dangerousChemicalLicenseImage: "",
gasSellLicenseImage: "",
licenses: [],
otherData: null,
};
otherInfoData = {
oilingMachine: [
{ name: '', brand: '', oilGunNum: '', oilsArticleNum: '', oilGunSerialNum: '' }
{
name: "",
brand: "",
oilGunNum: "",
oilsArticleNum: "",
oilGunSerialNum: "",
},
],
tankEquipment: [
{ name: '', oilsArticleNum: '', oilGunSerialNum: '', oilOmeterVolume: '', safetyVolume: '', oilOmeterType: 0, oilPumpType: 0 }
{
name: "",
oilsArticleNum: "",
oilGunSerialNum: "",
oilOmeterVolume: "",
safetyVolume: "",
oilOmeterType: 0,
oilPumpType: 0,
},
],
oilDeliveryPipe: [
{ name: '', connectTanker: '', connectOilTank: '', designPaper: '' }
{ name: "", connectTanker: "", connectOilTank: "", designPaper: "" },
],
oilVaporRecovery: [
{ name: '油气回收管线', onceSystemType: '将卸油时产生的油气进行回收', twiceSystemType: 1, twicePumpType: 'mini9000', thriceProcessingUnit: '冷凝+吸附', monitoringDevice: '监测气液比、密闭性,出现异常可及时预警', designPaper: '' }
{
name: "油气回收管线",
onceSystemType: "将卸油时产生的油气进行回收",
twiceSystemType: 1,
twicePumpType: "mini9000",
thriceProcessingUnit: "冷凝+吸附",
monitoringDevice: "监测气液比、密闭性,出现异常可及时预警",
designPaper: "",
},
],
valve: [
{ name: 'P/V阀(机械呼吸阀)', description: '阀内设计双向开启功能,阀门处于常闭状态,当油罐压力/真空达到阀门预设压力/真空值时,阀门自行打开进行排气/吸气,以维持油罐内压力与大气压保持平衡。' }
]
}
{
name: "P/V阀(机械呼吸阀)",
description:
"阀内设计双向开启功能,阀门处于常闭状态,当油罐压力/真空达到阀门预设压力/真空值时,阀门自行打开进行排气/吸气,以维持油罐内压力与大气压保持平衡。",
},
],
};
addTable(tableData, type) {
if (type == 'oilingMachine') {
tableData.push({ name: '', brand: '', oilGunNum: '', oilsArticleNum: '', oilGunSerialNum: '' })
if (type == "oilingMachine") {
tableData.push({
name: "",
brand: "",
oilGunNum: "",
oilsArticleNum: "",
oilGunSerialNum: "",
});
}
if (type == 'tankEquipment') {
tableData.push({ name: '', oilsArticleNum: '', oilGunSerialNum: '', oilOmeterVolume: '', safetyVolume: '', oilOmeterType: 0, oilPumpType: 0 })
if (type == "tankEquipment") {
tableData.push({
name: "",
oilsArticleNum: "",
oilGunSerialNum: "",
oilOmeterVolume: "",
safetyVolume: "",
oilOmeterType: 0,
oilPumpType: 0,
});
}
if (type == 'oilDeliveryPipe') {
tableData.push({ name: '', connectTanker: '', connectOilTank: '', designPaper: '' })
if (type == "oilDeliveryPipe") {
tableData.push({
name: "",
connectTanker: "",
connectOilTank: "",
designPaper: "",
});
}
}
deleteTable(tableData, key) {
tableData.splice(key, 1)
tableData.splice(key, 1);
}
uploadType: string
isUploadLoading = false
uploadType: string;
isUploadLoading = false;
filechange(e, type, item) {
this.isUploadLoading = true
let file = e.target.files[0] || null //获取上传的文件
this.uploadType = type
this.openFileSelect(file, `stationPhotos/${this.route.snapshot.queryParams.id}/`, item)
this.isUploadLoading = true;
let file = e.target.files[0] || null; //获取上传的文件
this.uploadType = type;
this.openFileSelect(
file,
`stationPhotos/${this.route.snapshot.queryParams.id}/`,
item
);
}
//设置文件路径并上传
postFilePath
postFilePath;
async openFileSelect(file: File, extensionPath: string, item) {
this.postFilePath = extensionPath;
let fileSize = file.size || null //上传文件的总大小
let shardSize = 5 * 1024 * 1024 //5MB 超过5MB要分块上传
if (fileSize >= shardSize) // 超过5MB要分块上传
{
let fileSize = file.size || null; //上传文件的总大小
let shardSize = 5 * 1024 * 1024; //5MB 超过5MB要分块上传
if (fileSize >= shardSize) {
// 超过5MB要分块上传
await this.postFileByMul(file, item);
}
else //普通上传
{
} //普通上传
else {
await this.postFile(file, item);
}
}
//上传文件
async postFile(file: File, item) {
await new Promise((resolve, reject) => {
this.objectsSrv.postFile(this.postFilePath, file).subscribe(data => {
this.objectsSrv.postFile(this.postFilePath, file).subscribe((data) => {
let dataObj = data as any;
let filePath: string = ObjectsSimpleService.baseUrl + dataObj.objectName;
item.designPaper = filePath
this.isUploadLoading = false
resolve('success')
let filePath: string =
ObjectsSimpleService.baseUrl + dataObj.objectName;
item.designPaper = filePath;
this.isUploadLoading = false;
resolve("success");
});
})
});
}
/**
*
* @param file
* @param file
*/
postFileByMul(file: File, item) {
this.objectsSrv.postFile_MultipartUpload(this.postFilePath, file).then((value) => {
let dataObj = value as any;
item.designPaper = dataObj.filePath
this.isUploadLoading = false
});
this.objectsSrv
.postFile_MultipartUpload(this.postFilePath, file)
.then((value) => {
let dataObj = value as any;
item.designPaper = dataObj.filePath;
this.isUploadLoading = false;
});
}
//查看图片
viewImg(url) {
let dom = document.getElementById(`viewerjs`)
let dom = document.getElementById(`viewerjs`);
let pObjs = dom.childNodes;
let node = document.createElement("img")
let node = document.createElement("img");
node.style.display = "none";
node.src = url;
node.id = 'img'
dom.appendChild(node)
node.id = "img";
dom.appendChild(node);
setTimeout(() => {
let viewer = new Viewer(document.getElementById(`viewerjs`), {
hidden: () => {
dom.removeChild(pObjs[0]);
viewer.destroy();
}
},
});
node.click();
}, 0);
@ -286,78 +355,92 @@ export class OilStationInfoComponent implements OnInit {
history.go(-1);
}
isLoadingSave: boolean = false
isLoadingSave: boolean = false;
async submitForm() {
if (this.validateForm.valid) {
this.isLoadingSave = true
this.httpBody.openTime = moment(this.httpBody.openTime).format('YYYY-MM-DD')//开业时间格式化
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)
this.isLoadingSave = true;
this.httpBody.openTime = moment(this.httpBody.openTime).format(
"YYYY-MM-DD"
); //开业时间格式化
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 (!body.hasBuildingInfo) {
body.otherData = JSON.stringify(this.otherInfoData)
body.otherData = JSON.stringify(this.otherInfoData);
}
body.licenses.forEach(item => {
delete item.isPerpetual
})
body.licenses.forEach((item) => {
delete item.isPerpetual;
});
// body.stationName = "太原东服务区东区加油站";
await new Promise<void>((resolve, reject) => {
this.http.put('/api/services/app/GasStation/Update', body).subscribe((data: any) => {
resolve(data)
this.isLoadingSave = false
this.message.create('success', '保存成功!');
}, err => {
reject(err)
this.isLoadingSave = false
this.message.create('error', '保存失败!');
})
})
this.http.put("/api/services/app/GasStation/Update", body).subscribe(
(data: any) => {
resolve(data);
this.isLoadingSave = false;
this.message.create("success", "保存成功!");
},
(err) => {
reject(err);
this.isLoadingSave = false;
this.message.create("error", "保存失败!");
}
);
});
} else {
this.message.create('warning', '请填写完整!');
return false
this.message.create("warning", "请填写完整!");
return false;
}
}
isSubmitAuditLoading: boolean = false
isSubmitAuditLoading: boolean = false;
async submitAudit() {
await this.submitForm()
await this.submitForm();
if (this.validateForm.valid) {
let params = {
id: this.httpBody.id
}
this.http.post('/api/services/app/GasStation/Commit', null, { params: params }).subscribe((data: any) => {
this.isSubmitAuditLoading = false
this.getInfo()
this.message.create('success', '提交审核成功!');
}, err => {
this.isSubmitAuditLoading = false
this.message.create('error', '提交审核失败!');
})
id: this.httpBody.id,
};
this.http
.post("/api/services/app/GasStation/Commit", null, { params: params })
.subscribe(
(data: any) => {
this.isSubmitAuditLoading = false;
this.getInfo();
this.message.create("success", "提交审核成功!");
},
(err) => {
this.isSubmitAuditLoading = false;
this.message.create("error", "提交审核失败!");
}
);
}
}
isRevocationAuditLoading: boolean = false
isRevocationAuditLoading: boolean = false;
revocationAudit() {
let params = {
id: this.httpBody.id
}
this.http.post('/api/services/app/GasStation/Uncommit', null, { params: params }).subscribe((data: any) => {
this.isRevocationAuditLoading = false
this.getInfo()
this.message.create('success', '撤销审核成功!');
}, err => {
this.isRevocationAuditLoading = false
this.message.create('error', '撤销审核失败!');
})
id: this.httpBody.id,
};
this.http
.post("/api/services/app/GasStation/Uncommit", null, { params: params })
.subscribe(
(data: any) => {
this.isRevocationAuditLoading = false;
this.getInfo();
this.message.create("success", "撤销审核成功!");
},
(err) => {
this.isRevocationAuditLoading = false;
this.message.create("error", "撤销审核失败!");
}
);
}
}

99
src/app/pages/singlelogin/singlelogin.component.ts

@ -21,9 +21,10 @@ export class SingleloginComponent implements OnInit {
) {}
sinToken;
pageType;
async ngOnInit(): Promise<void> {
console.log("查询参数", this.route.snapshot.queryParams.page);
this.pageType = this.route.snapshot.queryParams.page;
// let obj = {
// SAG_USER_TOKEN:
// "hrtwsc5737z6LYr67e2e0PvinLXvo0Pk8ffAp8qxOLXt9CtSLGg61cZv9IDjKybQ%3D%3D",
@ -80,7 +81,7 @@ export class SingleloginComponent implements OnInit {
getCurrentUserInfo() {
return new Promise<void>((resolve, reject) => {
this.http
.get("/p3p/auth/getCurrentUserInfo", {
.get("/sagframe-portal/p3p/auth/getCurrentUserInfo", {
params: {
token: this.sinToken,
},
@ -101,7 +102,7 @@ export class SingleloginComponent implements OnInit {
getAuthOrganInfos() {
return new Promise<void>((resolve, reject) => {
this.http
.get("/p3p/auth/getAuthOrganInfos", {
.get("/sagframe-portal/p3p/auth/getAuthOrganInfos", {
params: {
token: this.sinToken,
},
@ -152,7 +153,12 @@ export class SingleloginComponent implements OnInit {
};
this.http.post("/api/TokenAuth/SinochemLogin", body).subscribe(
(data: any) => {
this.enterPage(data);
if (this.pageType == "ai") {
this.enterPage(data);
} else {
this.enterPageSystem(data);
}
resolve();
},
(err) => {
@ -163,6 +169,81 @@ export class SingleloginComponent implements OnInit {
});
}
enterPageSystem(tokenData) {
sessionStorage.setItem("token", tokenData.result.accessToken);
sessionStorage.setItem(
"encryptedAccessToken",
tokenData.result.encryptedAccessToken
);
this.http
.get("/api/services/app/Session/GetCurrentLoginInformations")
.subscribe(
async (data: any) => {
console.log("当前登录账号的信息", data.result);
sessionStorage.setItem("userdata", JSON.stringify(data.result.user));
sessionStorage.setItem(
"userdataOfgasstation",
JSON.stringify(data.result.user)
);
if (data.result.user.menus.length == 0) {
alert("当前用户未分配菜单");
return;
}
if (!data.result.user.organization) {
alert("当前用户没有组织机构信息");
return;
}
if (data.result.user.organization.isGasStation) {
alert("油站用户无系统管理权限");
return;
}
//跳转页面
this.toPageSystem();
},
(err) => {
alert("获取用户信息错误");
}
);
}
menu3 = [
{ name: "组织机构管理", url: "/system/organization" },
{ name: "用户管理", url: "/system/user" },
{ name: "角色管理", url: "/system/role" },
{ name: "分析主机管理", url: "/system/host" },
{ name: "推送管理", url: "/system/push" },
{ name: "经营类证照管理", url: "/system/updateOfLicense" },
{ name: "资产类证照管理", url: "/system/fileOfLicense" },
{ name: "菜单管理", url: "/system/menu" },
];
userMenu = [];
tap = [];
menuList2 = [];
toPageSystem() {
let a = sessionStorage.getItem("userdata");
this.userMenu = JSON.parse(a).menus;
for (let index = 0; index < this.userMenu.length; index++) {
let a = this.userMenu[index].name;
this.tap.push(a);
}
for (let index = 0; index < this.menu3.length; index++) {
for (let k = 0; k < this.tap.length; k++) {
if (this.tap[k] == this.menu3[index].name) {
this.menuList2.push(this.menu3[index]);
}
}
}
if (this.menuList2.length == 0) {
this.message.create("warning", "未分配系统管理菜单");
return;
} else {
// window.open(this.menuList2[0].url);
this.router.navigate([this.menuList2[0].url]);
}
}
enterPage(tokenData) {
sessionStorage.setItem("token", tokenData.result.accessToken);
sessionStorage.setItem(
@ -174,6 +255,11 @@ export class SingleloginComponent implements OnInit {
.subscribe(
async (data: any) => {
console.log("当前登录账号的信息", data.result);
sessionStorage.setItem("userdata", JSON.stringify(data.result.user));
sessionStorage.setItem(
"userdataOfgasstation",
JSON.stringify(data.result.user)
);
if (data.result.user.menus.length == 0) {
alert("当前用户未分配菜单");
return;
@ -196,11 +282,6 @@ export class SingleloginComponent implements OnInit {
return;
}
}
sessionStorage.setItem("userdata", JSON.stringify(data.result.user));
sessionStorage.setItem(
"userdataOfgasstation",
JSON.stringify(data.result.user)
);
//跳转页面
this.toPage(data);

2
src/app/system-management/navigation/navigation.component.scss

@ -16,7 +16,7 @@ nz-sider {
width: 100%;
display: flex;
justify-content: center;
margin-top: 40px;
margin-top: 0px;
}
.headPortrait {

5
src/app/system-management/navigation/navigation.component.ts

@ -72,6 +72,11 @@ export class NavigationComponent implements OnInit {
url: "/system/userbinding",
img: "../../../assets/images/icon/license.png",
},
{
name: "中台机构绑定",
url: "/system/orbinding",
img: "../../../assets/images/icon/license.png",
},
];
name;

0
src/app/system-management/or-binding/or-binding-model/or-binding-model.component.html

224
src/app/system-management/or-binding/or-binding-model/or-binding-model.component.scss

@ -0,0 +1,224 @@
.userBox {
width: 100%;
max-height: 680px;
background: #FFFFFF;
overflow: hidden;
display: flex;
position: relative;
.treebox {
display: flex;
flex: 1;
overflow: auto;
flex-direction: column;
box-sizing: border-box;
padding: 10px 0;
}
.topbox2 {
width: 100%;
height: 36px;
display: flex;
align-items: center;
margin-top: 20px;
.lefttop {
height: 36px;
line-height: 36px;
color: #000;
margin-right: 10px;
font-size: 15px;
}
.righttop {
flex: 1;
height: 36px;
display: flex;
nz-input-group {
height: 36px;
}
}
}
.orbox {
width: 260px;
min-width: 250px;
overflow-y: auto;
margin-right: 10px;
display: flex;
flex-direction: column;
}
.treeTitle {
width: 100%;
height: 55px;
line-height: 55px;
margin-top: 12px;
display: flex;
justify-content: space-between;
color: #000D21;
box-sizing: border-box;
padding: 0 10px;
background: rgba(145, 204, 255, 0.2);
border: 1px solid rgba(145, 204, 255, 0.2);
span {
font-size: 14px;
}
div {
flex: 1;
width: 100px;
margin-left: 55px;
}
}
.nodebox {
display: flex;
justify-content: space-between;
}
tbody {
tr {
td:nth-child(1) {
text-align: right;
}
}
.operation {
i {
cursor: pointer;
margin-right: 8px;
}
}
}
}
.box {
flex: 1;
padding-top: 20px;
display: flex;
flex-direction: column;
overflow: hidden;
}
.topbox {
width: 100%;
height: 36px;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 12px;
.lefttop {
span:nth-child(1) {
color: #000D21;
margin-right: 16px;
}
span:nth-child(2) {
color: rgba(36, 36, 36, 0.24);
}
}
.righttop {
display: flex;
button {
margin-left: 16px;
}
nz-input-group {
height: 32px;
}
}
}
.tablebox {
flex: 1;
overflow-y: auto;
}
.pagination {
margin: 15px 0;
display: flex;
align-items: center;
justify-content: center;
}
.ortype {
width: 36px;
height: 20px;
background: #2399FF;
opacity: 1;
border-radius: 2px;
font-size: 12px;
margin-right: 8px;
color: #fff;
text-align: center;
}
.resetPasswordContent {
z-index: 999;
width: 380px;
height: 138px;
position: absolute;
left: 30%;
top: 30%;
display: flex;
flex-direction: column;
justify-content: center;
box-sizing: border-box;
padding-left: 40px;
color: #000;
border-radius: 5px;
border-radius: 2px;
box-shadow: 0 3px 6px -4px rgb(0 0 0 / 12%), 0 6px 16px 0 rgb(0 0 0 / 8%), 0 9px 28px 8px rgb(0 0 0 / 5%);
background: #fff;
.titlebox {
display: flex;
align-items: center;
position: relative;
span {
font-size: 18px;
font-weight: 600;
}
i {
font-size: 26px;
margin-right: 6px;
}
.close {
position: absolute;
right: 2px;
top: -22px;
font-size: 16px;
cursor: pointer;
}
.move {
position: absolute;
left: -32px;
top: -22px;
cursor: move;
}
}
.message {
margin-top: 20px;
i {
cursor: pointer;
}
i:hover {
color: #18bb18;
}
}
}

15
src/app/system-management/or-binding/or-binding-model/or-binding-model.component.ts

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-or-binding-model',
templateUrl: './or-binding-model.component.html',
styleUrls: ['./or-binding-model.component.scss']
})
export class OrBindingModelComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}

62
src/app/system-management/or-binding/or-binding.component.html

@ -0,0 +1,62 @@
<div class="userBox" id="userBox">
<div class="box">
<div class="topbox">
<div class="lefttop">
<span>中台组织机构列表</span>
<span><i nz-icon nzType="search"></i> {{listConfig.totalCount}}名用户</span>
</div>
<div class="righttop">
<label class="isBinding" nz-checkbox [(ngModel)]="listConfig.IsBindingLocal"
(ngModelChange)="submitForm()">是否绑定本地用户</label>
<form nz-form [formGroup]="validateForm" (ngSubmit)="submitForm()">
<nz-form-item>
<nz-form-control>
<nz-input-group nzPrefixIcon="search">
<input type="text" nz-input placeholder="请输入用户名" formControlName="search" />
</nz-input-group>
</nz-form-control>
<button style="display: none;" type="submit"></button>
</nz-form-item>
</form>
</div>
</div>
<div class="tablebox" #tablebox>
<nz-table #basicTable [nzLoading]="listConfig.loading" [nzData]="listConfig.usersLIst" [nzShowPagination]='false'
[nzPageSize]='16'>
<thead>
<tr>
<th [width]="'5%'"></th>
<th>账号</th>
<th>账号id</th>
<th>绑定的本地用户id</th>
<th [width]="'8%'">备注</th>
<th [width]="'10%'">操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of basicTable.data">
<td><img src="../../../assets/images/user.png" alt=""></td>
<td>{{ data.loginName }}</td>
<td>{{ data.userId }}</td>
<td>
{{data.localUserId}}
</td>
<td>
{{data.detail}}
</td>
<td class="operation">
<span class="blueColor" (click)="binding(data)">绑定本地用户</span>
</td>
</tr>
</tbody>
</nz-table>
</div>
<div class="pagination">
<nz-pagination [nzHideOnSinglePage]="false" [nzPageIndex]="1" [nzTotal]="listConfig.totalCount" [nzPageSize]="16"
[nzShowTotal]="totalTemplate" nzShowQuickJumper (nzPageIndexChange)="pageChange($event)">
</nz-pagination>
<ng-template #totalTemplate let-total> 16条/页,共{{listConfig.totalCount}}条 </ng-template>
</div>
</div>
</div>

173
src/app/system-management/or-binding/or-binding.component.scss

@ -0,0 +1,173 @@
.userBox {
width: 100%;
height: 100%;
background: #ffffff;
box-sizing: border-box;
padding: 20px;
overflow: hidden;
display: flex;
position: relative;
.treebox {
display: flex;
flex: 1;
overflow: auto;
flex-direction: column;
box-sizing: border-box;
padding: 10px 0;
}
.check {
width: 100%;
float: right;
}
.topbox2 {
width: 100%;
height: 36px;
display: flex;
align-items: center;
margin-top: 20px;
.lefttop {
height: 36px;
line-height: 36px;
color: #000;
margin-right: 10px;
font-size: 15px;
}
.righttop {
flex: 1;
height: 36px;
display: flex;
nz-input-group {
height: 36px;
}
}
}
.orbox {
width: 260px;
min-width: 250px;
overflow-y: auto;
margin-right: 10px;
display: flex;
flex-direction: column;
}
.treeTitle {
width: 100%;
height: 55px;
line-height: 55px;
margin-top: 12px;
display: flex;
justify-content: space-between;
color: #000d21;
box-sizing: border-box;
padding: 0 10px;
background: rgba(145, 204, 255, 0.2);
border: 1px solid rgba(145, 204, 255, 0.2);
span {
font-size: 14px;
}
div {
flex: 1;
width: 100px;
margin-left: 55px;
}
}
.nodebox {
display: flex;
justify-content: space-between;
}
tbody {
tr {
td:nth-child(1) {
text-align: right;
}
}
.operation {
i {
cursor: pointer;
margin-right: 8px;
}
}
}
}
.box {
flex: 1;
// overflow: auto;
padding-top: 20px;
overflow-y: auto;
display: flex;
flex-direction: column;
height: 100%;
}
.topbox {
width: 100%;
height: 36px;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 12px;
.lefttop {
span:nth-child(1) {
color: #000d21;
margin-right: 16px;
}
span:nth-child(2) {
color: rgba(36, 36, 36, 0.24);
}
}
.righttop {
display: flex;
// align-items: center;
.isBinding {
margin-top: 6px;
}
button {
margin-left: 16px;
}
nz-input-group {
height: 32px;
}
}
}
.tablebox {
flex: 1;
overflow-y: auto;
overflow: auto;
}
.pagination {
margin: 15px 0;
display: flex;
align-items: center;
justify-content: center;
}
.ortype {
width: 36px;
height: 20px;
background: #2399ff;
opacity: 1;
border-radius: 2px;
font-size: 12px;
margin-right: 8px;
color: #fff;
text-align: center;
}

106
src/app/system-management/or-binding/or-binding.component.ts

@ -0,0 +1,106 @@
import {
Component,
OnInit,
TemplateRef,
ViewChild,
ViewContainerRef,
} from "@angular/core";
import { FormBuilder, FormGroup } from "@angular/forms";
import { NzFormatEmitEvent } from "ng-zorro-antd/tree";
import { NzModalService } from "ng-zorro-antd/modal";
import { NzMessageService } from "ng-zorro-antd/message";
import { HttpClient } from "@angular/common/http";
import { TreeService } from "src/app/service/tree.service";
import { NzNotificationService } from "ng-zorro-antd/notification";
// import { BindingComponent } from "./binding/binding.component";
@Component({
selector: "app-or-binding",
templateUrl: "./or-binding.component.html",
styleUrls: ["./or-binding.component.scss"],
})
export class OrBindingComponent implements OnInit {
validateForm!: FormGroup;
constructor(
private fb: FormBuilder,
private http: HttpClient,
private toTree: TreeService,
private modal: NzModalService,
private viewContainerRef: ViewContainerRef
) {}
ngOnInit(): void {
this.validateForm = this.fb.group({
search: [null],
});
this.getAllUsers();
// this.getAllOrganization();
}
listConfig = {
loading: false,
usersLIst: [],
totalCount: 0,
IsContainsChildren: true,
searchValue: "",
OrganizationUnitId: "",
IsBindingLocal: true,
};
getAllUsers() {
this.listConfig.loading = true;
let params = {
Keyword: this.validateForm.value.search
? this.validateForm.value.search
: "",
SkipCount: String(this.SkipCount),
MaxResultCount: String(this.MaxResultCount),
// OrganizationUnitId: this.OrganizationUnitId,
IsBindingLocal: this.listConfig.IsBindingLocal,
// IsActive:true,
// IsContainsChildren: String(this.listConfig.IsContainsChildren),
};
this.http
.get(this.getAllUrl, {
params: params,
})
.subscribe((data: any) => {
console.log("中台用户列表", data);
this.listConfig.usersLIst = data.result.items;
this.listConfig.totalCount = data.result.totalCount;
this.listConfig.loading = false;
});
}
SkipCount: number = 0; //0 16 32 48
MaxResultCount: number = 16;
pageChange($event) {
this.SkipCount = ($event - 1) * this.MaxResultCount;
this.getAllUsers();
}
getAllUrl = "/api/services/app/User/GetSinochemUsers";
//搜索框提交
submitForm(): void {
for (const i in this.validateForm.controls) {
this.validateForm.controls[i].markAsDirty();
this.validateForm.controls[i].updateValueAndValidity();
}
this.getAllUsers();
}
binding(data) {
// const modal = this.modal.create({
// nzTitle: "绑定本地用户",
// nzContent: BindingComponent,
// nzViewContainerRef: this.viewContainerRef,
// nzWidth: 1500,
// nzFooter: null,
// nzMaskClosable: false,
// nzComponentParams: {
// data: JSON.parse(JSON.stringify(data)),
// },
// });
// const instance = modal.getContentComponent();
// modal.afterClose.subscribe((result) => this.getAllUsers());
}
}

2
src/app/system-management/organization/organization.component.ts

@ -43,7 +43,7 @@ export class OrganizationComponent implements OnInit {
level: number; //当前登录账号的组织机构等级
ngOnInit(): void {
let userdata = JSON.parse(sessionStorage.getItem("userdata"));
if (userdata.userName == "admin") {
if (userdata.userName == "admin" || userdata.userName == "superadmin") {
//是superadmin,是内部制作账号
this.isAdmin = true;
} else {

2
src/app/system-management/system-management-routing.module.ts

@ -12,6 +12,7 @@ import { FileOfLicenseComponent } from "./file-of-license/file-of-license.compon
import { MenuComponent } from "./menu/menu.component";
import { AlgorithmConfigComponent } from "./algorithm-config/algorithm-config.component";
import { UserBindingComponent } from "./user-binding/user-binding.component";
import { OrBindingComponent } from "./or-binding/or-binding.component";
const routes: Routes = [
{ path: "organization", component: OrganizationComponent },
{ path: "user", component: UserComponent },
@ -23,6 +24,7 @@ const routes: Routes = [
{ path: "menu", component: MenuComponent },
{ path: "algorithm", component: AlgorithmConfigComponent },
{ path: "userbinding", component: UserBindingComponent },
{ path: "orbinding", component: OrBindingComponent },
];
@NgModule({

4
src/app/system-management/system-management.module.ts

@ -53,6 +53,8 @@ import { NzToolTipModule } from "ng-zorro-antd/tooltip";
import { AlgorithmConfigComponent } from "./algorithm-config/algorithm-config.component";
import { UserBindingComponent } from "./user-binding/user-binding.component";
import { BindingComponent } from "./user-binding/binding/binding.component";
import { OrBindingComponent } from './or-binding/or-binding.component';
import { OrBindingModelComponent } from './or-binding/or-binding-model/or-binding-model.component';
@NgModule({
declarations: [
OrganizationComponent,
@ -86,6 +88,8 @@ import { BindingComponent } from "./user-binding/binding/binding.component";
AlgorithmConfigComponent,
UserBindingComponent,
BindingComponent,
OrBindingComponent,
OrBindingModelComponent,
],
imports: [
CommonModule,

2
src/app/system-management/user-binding/user-binding.component.scss

@ -134,7 +134,7 @@
.righttop {
display: flex;
// align-items: center;
.isBinding{
.isBinding {
margin-top: 6px;
}
button {

2
src/app/system-management/user/edituser/edituser.component.ts

@ -48,7 +48,7 @@ export class EdituserComponent implements OnInit {
});
let userdata = JSON.parse(sessionStorage.getItem("userdata"));
if (userdata.userName == "admin") {
if (userdata.userName == "admin" || userdata.userName == "superadmin") {
//是superadmin,是内部制作账号
this.isAdmin = true;
} else {

2
src/app/system-management/user/user.component.ts

@ -50,7 +50,7 @@ export class UserComponent implements OnInit {
ngOnInit(): void {
let userdata = JSON.parse(sessionStorage.getItem("userdata"));
if (userdata.userName == "admin") {
if (userdata.userName == "admin" || userdata.userName == "superadmin") {
//是superadmin,是内部制作账号
this.isAdmin = true;
} else {

Loading…
Cancel
Save