Browse Source

[完善]中台油站用户登录完善

test-assets
邵佳豪 3 months ago
parent
commit
eca559d138
  1. 4
      proxy.config.json
  2. 16
      src/app/pages/home/home.component.ts
  3. 20
      src/app/pages/plan-admin/plan-admin.component.ts
  4. 6
      src/app/pages/records/records-nav/records-nav.component.ts
  5. 36
      src/app/pages/singlelogin/singlelogin.component.ts
  6. 2
      src/app/pages/today-warning-admin/today-warning-admin.component.ts
  7. 7
      src/app/service/tree.service.ts
  8. 7
      src/app/system-management/or-binding/or-binding.component.html

4
proxy.config.json

@ -1,6 +1,6 @@
{
"/api": {
"target": "http://121.36.37.70:8906/",
"target": "http://10.156.134.54:8906/",
"测试1": "http://121.36.37.70:8906/",
"测试2": "https://znaq.sinochemoilmarketing.com/",
"测试3": "https://gas.anxincloud.cn/",
@ -15,7 +15,7 @@
"logLevel": "debug"
},
"/sagframe-portal": {
"target": "https://test-uomsp.sinochemoilmarketing.com/",
"target": "https://uat-uomsp.sinochemoilmarketing.com/",
"secure": false,
"changeOrigin": true
}

16
src/app/pages/home/home.component.ts

@ -99,8 +99,13 @@ export class HomeComponent implements OnInit {
menuList1 = [];
menuList2 = [];
selectedItem;
isZT = sessionStorage.getItem("isZT") || "false";
routerChange(item) {
if (JSON.parse(sessionStorage.getItem("isGasStation"))) {
if (
JSON.parse(sessionStorage.getItem("isGasStation")) &&
this.isZT !== "true"
) {
let a = JSON.parse(sessionStorage.getItem("3dSceneData"));
if (!a.hasBuildingInfo && item.url == "/plan/petrolStation") {
this.message.info("当前油站未开通!");
@ -117,6 +122,15 @@ export class HomeComponent implements OnInit {
}
isProd: boolean;
ngOnInit(): void {
if (this.isZT == "true") {
this.menu2 = [
{ name: "数字油站", url: "/plan" },
{ name: "今日预警", url: "/todaywarning" },
{ name: "预警记录", url: "/records_nav" },
{ name: "证照管理", url: "/audit" },
];
}
this.isProd = this.patternService.isProd;
this.initSelectedItem(this.router);

20
src/app/pages/plan-admin/plan-admin.component.ts

@ -79,10 +79,7 @@ export class PlanAdminComponent implements OnInit {
organization: any;
getAllOrganization() {
this.orSpin = true;
let OrganizationUnitId = JSON.parse(sessionStorage.getItem("userdata"))
.organization.id;
let params = {
// OrganizationUnitId: OrganizationUnitId,
IsContainsChildren: "true",
};
this.http
@ -90,9 +87,6 @@ export class PlanAdminComponent implements OnInit {
params: params,
})
.subscribe((data: any) => {
data.result.items = data.result.items.filter((item, i) => {
return !item.isGasStation;
});
this.organization = data.result.items;
this.getStationsNum(data.result.items);
});
@ -100,7 +94,8 @@ export class PlanAdminComponent implements OnInit {
//获得组织机构下有多少油站
stationsList;
getStationsNum(e) {
getStationsNum(currentOrList) {
console.log("e", currentOrList);
let OrganizationUnitId = JSON.parse(sessionStorage.getItem("userdata"))
.organization.id;
let OrganizationUnitIds = JSON.parse(
@ -112,7 +107,7 @@ export class PlanAdminComponent implements OnInit {
)
.subscribe((data: any) => {
this.stationsList = data.result;
const arrs = e.map((item) => {
const arrs = currentOrList.map((item) => {
const data = this.stationsList.find(
(i) => item.id == i.organizationId
);
@ -121,6 +116,7 @@ export class PlanAdminComponent implements OnInit {
products: data ? data : false,
};
});
for (let index = 0; index < arrs.length; index++) {
if (OrganizationUnitIds && OrganizationUnitIds.length !== 0) {
if (OrganizationUnitIds.includes(arrs[index].id)) {
@ -136,11 +132,9 @@ export class PlanAdminComponent implements OnInit {
}
this.orSpin = false;
this.nodes = [...this.toTree.toTree(arrs)];
console.log("树形结构", this.nodes);
this.nzExpandedKeys = [OrganizationUnitId];
this.nzSelectedKeys = [OrganizationUnitId];
sessionStorage.setItem("planAdminOrid", OrganizationUnitId);
this.nzExpandedKeys = [this.nodes[0].id];
this.nzSelectedKeys = [this.nodes[0].id];
sessionStorage.setItem("planAdminOrid", this.nodes[0].id);
this.oilStationListComponent.onChildMethod();
});
}

6
src/app/pages/records/records-nav/records-nav.component.ts

@ -59,11 +59,13 @@ export class RecordsNavComponent implements OnInit {
}
routerChange() {
if (sessionStorage.getItem("isGasStation") == "false") {
if (
sessionStorage.getItem("isGasStation") == "false" ||
sessionStorage.getItem("isZT") == "true"
) {
if (this.selectedMenu == "预警类型统计") {
this.router.navigate(["/records_nav/all"]);
} else if (this.selectedMenu == "卸油统计") {
console.log(888888888888888888888888);
this.router.navigate(["/records_nav/oliunloadinglist"]);
} else if (this.selectedMenu == "证照预警统计") {
this.router.navigate(["/records_nav/warningstatisticslist"]);

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

@ -266,6 +266,7 @@ export class SingleloginComponent implements OnInit {
"userdataOfgasstation",
JSON.stringify(data.result.user)
);
sessionStorage.setItem("isZT", "true");
if (data.result.user.menus.length == 0) {
alert("当前用户未分配菜单");
return;
@ -276,17 +277,17 @@ export class SingleloginComponent implements OnInit {
}
if (data.result.user.organization.isGasStation) {
await this.getGasStationBaseInfo();
if (
data.result.user.menus[0].name == "数字油站" &&
data.result.user.menus.length == 1 &&
!this.init3D
) {
this.message.create(
"error",
`当前用户油站未开通3D且仅分配油站菜单`
);
return;
}
// if (
// data.result.user.menus[0].name == "数字油站" &&
// data.result.user.menus.length == 1 &&
// !this.init3D
// ) {
// this.message.create(
// "error",
// `当前用户油站未开通3D且仅分配油站菜单`
// );
// return;
// }
}
//跳转页面
@ -306,10 +307,10 @@ export class SingleloginComponent implements OnInit {
{ name: "证照管理", url: "/audit" },
];
menu2 = [
{ name: "数字油站", url: "/plan/petrolStation" },
{ name: "今日预警", url: "/todaywarning/petrolStation" },
{ name: "预警记录", url: "/records_nav/petrolStation" },
{ name: "证照管理", url: "/license/petrolStation" },
{ name: "数字油站", url: "/plan" },
{ name: "今日预警", url: "/todaywarning" },
{ name: "预警记录", url: "/records_nav" },
{ name: "证照管理", url: "/audit" },
];
init3D;
async getGasStationBaseInfo() {
@ -338,11 +339,8 @@ export class SingleloginComponent implements OnInit {
return item.name == "今日预警";
});
if (isTrue) {
this.router.navigate(["/todaywarning/petrolStation"]);
this.router.navigate(["/todaywarning"]);
sessionStorage.setItem("selectedMenu", "今日预警");
} else if (data.result.user.menus[0].name == "数字油站" && !this.init3D) {
this.router.navigate([menuList[1].url]);
sessionStorage.setItem("selectedMenu", menuList[1].name);
} else if (menuList.length == 0) {
return this.message.create("warning", `当前用户未分配菜单`);
} else {

2
src/app/pages/today-warning-admin/today-warning-admin.component.ts

@ -80,7 +80,7 @@ export class TodayWarningAdminComponent implements OnInit {
}
if (
loginUserInfo.permissions.find((item) => {
loginUserInfo?.permissions?.find((item) => {
return item.name == "Data.Violation.Positive.Censor";
})
) {

7
src/app/service/tree.service.ts

@ -18,10 +18,11 @@ export class TreeService {
}
parentNode.children.push(item);
} else {
if (!item.parentId) {
//如果parentId为null
newdata.push(item);
// 如果parentId找不到对应的id,则将parentId设置为null,并添加到newdata的顶层
if (item.parentId !== null && item.parentId !== undefined) {
item.parentId = null; // 将parentId设置为null
}
newdata.push(item);
}
});
return newdata;

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

@ -12,15 +12,14 @@
<label class="isBinding" nz-checkbox [(ngModel)]="listConfig.IsBindingLocal"
(ngModelChange)="submitForm()">是否绑定本地机构</label>
<form nz-form [formGroup]="validateForm" (ngSubmit)="submitForm()">
<!-- <nz-form-item>
<nz-form-item>
<nz-form-control>
<nz-input-group nzPrefixIcon="search">
<input type="text" nz-input placeholder="请输入用户名" formControlName="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> -->
</nz-form-item>
</form>
</div>
</div>

Loading…
Cancel
Save