- 维护审核 |
- {{element.maintenanceVerifyState}} |
+
+ 审核状态 |
+
+ {{element.auditStatus | auditState}}
+ |
操作 |
diff --git a/src/app/plan-management/meet-plan/meet-plan.component.ts b/src/app/plan-management/meet-plan/meet-plan.component.ts
index c4e7dcb..cdcf45a 100644
--- a/src/app/plan-management/meet-plan/meet-plan.component.ts
+++ b/src/app/plan-management/meet-plan/meet-plan.component.ts
@@ -84,7 +84,7 @@ export class MeetPlanComponent implements OnInit {
preparelevels: any
plcheck: boolean //编制级别勾选框
IsNewData = '' //维护更新活新增
- displayedColumns: string[] = ['state', 'unitname', 'level', 'addname', 'addtime', 'plantype', 'isopen', 'projectlevel', 'passstate', 'weihustate', 'operation'];
+ displayedColumns: string[] = ['state', 'unitname', 'level', 'addname', 'addtime', 'plantype', 'isopen', 'projectlevel', 'passstate', 'auditstate', 'operation'];
tabledataSource
typePlan//新预案类型
unitname//预案名称
diff --git a/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.html b/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.html
index e120f7c..80967a0 100644
--- a/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.html
+++ b/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.html
@@ -144,12 +144,8 @@
{{element.disasterType}} |
- 新增审核 |
- {{element.newVerifyState}} |
-
-
- 维护审核 |
- {{element.maintenanceVerifyState}} |
+ 审核状态 |
+ {{element.auditStatus | auditState}} |
是否公开 |
diff --git a/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.ts b/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.ts
index 06a56c3..f79fdab 100644
--- a/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.ts
+++ b/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.ts
@@ -1,249 +1,296 @@
/*
- * @Descripttion:
- * @version:
+ * @Descripttion:
+ * @version:
* @Author: sueRimn
* @Date: 2020-12-24 14:15:10
* @LastEditors: sueRimn
* @LastEditTime: 2021-05-14 17:09:58
*/
-import { Component, OnInit, ViewChild, Inject } from '@angular/core';
-import { HttpClient } from '@angular/common/http'
-import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree';
-import { MatPaginator } from '@angular/material/paginator';
-
-import { FlatTreeControl } from '@angular/cdk/tree';
-import { FormControl } from '@angular/forms';
-import { Router, ActivatedRoute } from '@angular/router'
-import { PageEvent } from '@angular/material/paginator';
-import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog';
-import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
-import { TreeService } from '../../http-interceptors/tree.service'
-import { ConstantPool } from '@angular/compiler';
-import { MatTableDataSource } from '@angular/material/table';
-declare var CryptoJS
-
+import { Component, OnInit, ViewChild, Inject } from "@angular/core";
+import { HttpClient } from "@angular/common/http";
+import {
+ MatTreeFlatDataSource,
+ MatTreeFlattener,
+} from "@angular/material/tree";
+import { MatPaginator } from "@angular/material/paginator";
+
+import { FlatTreeControl } from "@angular/cdk/tree";
+import { FormControl } from "@angular/forms";
+import { Router, ActivatedRoute } from "@angular/router";
+import { PageEvent } from "@angular/material/paginator";
+import {
+ MatDialogRef,
+ MatDialog,
+ MAT_DIALOG_DATA,
+} from "@angular/material/dialog";
+import { MatSnackBar, MatSnackBarConfig } from "@angular/material/snack-bar";
+import { TreeService } from "../../http-interceptors/tree.service";
+import { ConstantPool } from "@angular/compiler";
+import { MatTableDataSource } from "@angular/material/table";
+declare var CryptoJS;
@Component({
- selector: 'app-onetwo-entry-plan',
- templateUrl: './onetwo-entry-plan.component.html',
- styleUrls: ['./onetwo-entry-plan.component.scss']
+ selector: "app-onetwo-entry-plan",
+ templateUrl: "./onetwo-entry-plan.component.html",
+ styleUrls: ["./onetwo-entry-plan.component.scss"],
})
export class OnetwoEntryPlanComponent implements OnInit {
-
- constructor(private http: HttpClient, private router: Router, private route: ActivatedRoute, private tree: TreeService, public dialog: MatDialog, public snackBar: MatSnackBar) { }
+ constructor(
+ private http: HttpClient,
+ private router: Router,
+ private route: ActivatedRoute,
+ private tree: TreeService,
+ public dialog: MatDialog,
+ public snackBar: MatSnackBar
+ ) {}
ngOnInit(): void {
if (window.matchMedia("(max-width: 1400px)").matches) {
- this.pcMore = false
- this.padMore = true
- this.pcfind = false
- this.padjt = true
+ this.pcMore = false;
+ this.padMore = true;
+ this.pcfind = false;
+ this.padjt = true;
} else {
- this.pcfind = true
- this.pcMore = true
- this.padMore = false
- this.padjt = false
+ this.pcfind = true;
+ this.pcMore = true;
+ this.padMore = false;
+ this.padjt = false;
}
this.levels = sessionStorage.getItem("level");
- if (this.levels == "0") {//如果是总队
+ if (this.levels == "0") {
+ //如果是总队
this.preparelevels = [
{ name: "总队", value: "1" },
{ name: "支队", value: "2" },
{ name: "大队", value: "4" },
- { name: "中队", value: "8" }
- ]
+ { name: "中队", value: "8" },
+ ];
}
- if (this.levels == "1") {//如果是支队
+ if (this.levels == "1") {
+ //如果是支队
this.preparelevels = [
{ name: "支队", value: "2" },
{ name: "大队", value: "4" },
- { name: "中队", value: "8" }
- ]
+ { name: "中队", value: "8" },
+ ];
}
- if (this.levels == "2") {//如果是大队
+ if (this.levels == "2") {
+ //如果是大队
this.preparelevels = [
{ name: "大队", value: "4" },
- { name: "中队", value: "8" }
- ]
+ { name: "中队", value: "8" },
+ ];
}
- if (this.levels == "3") {//如果是中队
- this.preparelevels = [
- { name: "中队", value: "8" }
- ]
+ if (this.levels == "3") {
+ //如果是中队
+ this.preparelevels = [{ name: "中队", value: "8" }];
}
- this.url = window.location.href.substring(window.location.href.length - 1, window.location.href.length)
- this.getAlltabledate()
+ this.url = window.location.href.substring(
+ window.location.href.length - 1,
+ window.location.href.length
+ );
+ this.getAlltabledate();
}
- pcMore//pc更多
- pcput = false//pc收起
- pcfind//pc查询
- padjt = false
- padMore = true//pad收缩控制
- padput = false//pad收起按钮
- imgsrcopen = "../../../assets/images/routdown2.png"
- imgsrcdown = "../../../assets/images/routup2.png"
+ pcMore; //pc更多
+ pcput = false; //pc收起
+ pcfind; //pc查询
+ padjt = false;
+ padMore = true; //pad收缩控制
+ padput = false; //pad收起按钮
+ imgsrcopen = "../../../assets/images/routdown2.png";
+ imgsrcdown = "../../../assets/images/routup2.png";
pcInfo() {
- this.pcMore = !this.pcMore
- this.pcput = !this.pcput
+ this.pcMore = !this.pcMore;
+ this.pcput = !this.pcput;
}
padInfo() {
- this.padMore = !this.padMore
- this.padput = !this.padput
+ this.padMore = !this.padMore;
+ this.padput = !this.padput;
}
- levels
- url
- preparelevels: any
- plcheck: boolean //编制级别勾选框
- displayedColumns: string[] = ['state', 'unitname', 'level', 'addname', 'addtime', 'plantype', 'isopen', 'projectlevel', 'passstate', 'weihustate', 'operation'];
- tabledataSource
- unitname//预案名称
- level//预案级别
- addname//添加人
- addtime//添加时间
- endtime//结束时间
- reservePlanType//预案类型
- unitstate//审核状态
- projectlevel//编制级别
- typePlan//新预案类型
+ levels;
+ url;
+ preparelevels: any;
+ plcheck: boolean; //编制级别勾选框
+ displayedColumns: string[] = [
+ "state",
+ "unitname",
+ "level",
+ "addname",
+ "addtime",
+ "plantype",
+ "isopen",
+ "projectlevel",
+ "passstate",
+ "operation",
+ ];
+ tabledataSource;
+ unitname; //预案名称
+ level; //预案级别
+ addname; //添加人
+ addtime; //添加时间
+ endtime; //结束时间
+ reservePlanType; //预案类型
+ unitstate; //审核状态
+ projectlevel; //编制级别
+ typePlan; //新预案类型
//分页
@ViewChild(MatPaginator, { static: true })
pageEvent: PageEvent;
paginator: MatPaginator;
length: any; //共多少条数据
pageSize: any; //每页条数
- pageSizeOptions: number[] = [10] //设置每页条数
+ pageSizeOptions: number[] = [10]; //设置每页条数
PageNumber: any; //第几页
- IsNewData = '' //维护更新活新增
+ IsNewData = ""; //维护更新活新增
//获取表格数据
getAlltabledate() {
- let reservePlanType
- this.reservePlanType ? reservePlanType = JSON.parse(JSON.stringify(this.reservePlanType)) : reservePlanType = ''
+ let reservePlanType;
+ this.reservePlanType
+ ? (reservePlanType = JSON.parse(JSON.stringify(this.reservePlanType)))
+ : (reservePlanType = "");
if (this.reservePlanType && this.reservePlanType.length != 0) {
- reservePlanType = eval(this.reservePlanType.join("|"))
+ reservePlanType = eval(this.reservePlanType.join("|"));
}
let paramsdata: any = {
- Name: this.unitname || '',
- planCategories: this.url == '2' ? 2 : 1,
+ Name: this.unitname || "",
+ planCategories: this.url == "2" ? 2 : 1,
//PlanType:reservePlanType||'',
- DisasterType: this.typePlan || '',
- CreatorName: this.addname || '',
- AuditStatus: this.unitstate || '',
- CreationTimeRangeStart: this.addtime || '',
- CreationTimeRangeEnd: this.endtime || '',
- PlanLevel: this.projectlevel || '',
- HasChildrenPlanLevel: this.plcheck || '',
- PageNumber: this.PageNumber || '1',
+ DisasterType: this.typePlan || "",
+ CreatorName: this.addname || "",
+ AuditStatus: this.unitstate || "",
+ CreationTimeRangeStart: this.addtime || "",
+ CreationTimeRangeEnd: this.endtime || "",
+ PlanLevel: this.projectlevel || "",
+ HasChildrenPlanLevel: this.plcheck || "",
+ PageNumber: this.PageNumber || "1",
PageSize: this.pageSizeOptions[0],
IsNewData: this.IsNewData,
- }
- this.http.get("/api/PlanComponentsMajor", { params: paramsdata }).subscribe((data: any) => {
- this.length = data.totalCount
- this.tabledataSource = data.items
- })
+ };
+ this.http
+ .get("/api/PlanComponentsMajor", { params: paramsdata })
+ .subscribe((data: any) => {
+ this.length = data.totalCount;
+ this.tabledataSource = data.items;
+ });
}
//分页事件
changePage(e) {
- this.PageNumber = e.pageIndex + 1
- this.getAlltabledate()
+ this.PageNumber = e.pageIndex + 1;
+ this.getAlltabledate();
}
//重置
reset() {
- this.IsNewData = ''
- this.typePlan = ''
- this.unitname = ''
- this.level = ''
- this.addname = ''
- this.addtime = ''
- this.endtime = ''
- this.reservePlanType = ''
- this.unitstate = ''
- this.projectlevel = ''
- this.plcheck = false
- this.getAlltabledate()
+ this.IsNewData = "";
+ this.typePlan = "";
+ this.unitname = "";
+ this.level = "";
+ this.addname = "";
+ this.addtime = "";
+ this.endtime = "";
+ this.reservePlanType = "";
+ this.unitstate = "";
+ this.projectlevel = "";
+ this.plcheck = false;
+ this.getAlltabledate();
}
//查询
onSubmit(value) {
//console.log(value)
- this.getAlltabledate()
+ this.getAlltabledate();
}
//删除预案
deletePlan(id) {
- let isTrue = confirm('您确定要删除吗')
+ let isTrue = confirm("您确定要删除吗");
if (isTrue) {
const config = new MatSnackBarConfig();
- config.verticalPosition = 'top';
- config.duration = 3000
- this.http.delete(`/api/PlanComponentsMajor/${id}`).subscribe(data => {
- this.snackBar.open('删除成功!', '确定', config);
- this.getAlltabledate()
- }, err => {
- this.snackBar.open(err, '确定', config);
- })
+ config.verticalPosition = "top";
+ config.duration = 3000;
+ this.http.delete(`/api/PlanComponentsMajor/${id}`).subscribe(
+ (data) => {
+ this.snackBar.open("删除成功!", "确定", config);
+ this.getAlltabledate();
+ },
+ (err) => {
+ this.snackBar.open(err, "确定", config);
+ }
+ );
}
-
}
//提交审核
submitAudit(element) {
const config = new MatSnackBarConfig();
- config.verticalPosition = 'top';
- config.duration = 3000
+ config.verticalPosition = "top";
+ config.duration = 3000;
if (element.auditStatus == 4 || element.auditStatus == 32) {
- this.snackBar.open('审核退回的预案需要修改后方可再次提交审核!', '确定', config);
+ this.snackBar.open(
+ "审核退回的预案需要修改后方可再次提交审核!",
+ "确定",
+ config
+ );
}
- this.http.put(`/api/PlanComponentsMajor/${element.id}/Commit`, "").subscribe(data => {
- this.getAlltabledate()
- }, err => {
- this.snackBar.open(err, '确定', config);
- })
-
-
+ this.http
+ .put(`/api/PlanComponentsMajor/${element.id}/Commit`, "")
+ .subscribe(
+ (data) => {
+ this.getAlltabledate();
+ },
+ (err) => {
+ this.snackBar.open(err, "确定", config);
+ }
+ );
}
//撤销审核
cancelAudit(element) {
const config = new MatSnackBarConfig();
- config.verticalPosition = 'top';
- config.duration = 3000
- this.http.put(`/api/PlanComponentsMajor/${element.id}/Cancel`, "").subscribe(data => {
- this.getAlltabledate()
- }, err => {
- this.snackBar.open(err, '确定', config);
- })
+ config.verticalPosition = "top";
+ config.duration = 3000;
+ this.http
+ .put(`/api/PlanComponentsMajor/${element.id}/Cancel`, "")
+ .subscribe(
+ (data) => {
+ this.getAlltabledate();
+ },
+ (err) => {
+ this.snackBar.open(err, "确定", config);
+ }
+ );
}
//查看预案
openPlan(element) {
- let fetchUrl = element.attachmentUrls[0]
- let suffix = fetchUrl.split('.')[fetchUrl.split('.').length - 1].toLowerCase()
- if (suffix == 'docx' || suffix == 'doc') {
- let arr = fetchUrl.split('.')
- arr[arr.length - 1] = 'pdf'
- window.open(`/api/Objects/PlanPlatform/` + arr.join('.'))
- } else if (suffix == 'pdf') {
- window.open(`/api/Objects/PlanPlatform/` + element.attachmentUrls[0])
+ let fetchUrl = element.attachmentUrls[0];
+ let suffix = fetchUrl
+ .split(".")
+ [fetchUrl.split(".").length - 1].toLowerCase();
+ if (suffix == "docx" || suffix == "doc") {
+ let arr = fetchUrl.split(".");
+ arr[arr.length - 1] = "pdf";
+ window.open(`/api/Objects/PlanPlatform/` + arr.join("."));
+ } else if (suffix == "pdf") {
+ window.open(`/api/Objects/PlanPlatform/` + element.attachmentUrls[0]);
} else {
let config = new MatSnackBarConfig();
- config.verticalPosition = 'top';
- config.duration = 3000
- this.snackBar.open('该文件类型暂不支持在线查看', '确定', config);
+ config.verticalPosition = "top";
+ config.duration = 3000;
+ this.snackBar.open("该文件类型暂不支持在线查看", "确定", config);
}
}
//新增预案弹窗
addunit() {
const dialogRef = this.dialog.open(newunitComponent, {
- width: '340px',
- height: '410px',
- disableClose: true
+ width: "340px",
+ height: "410px",
+ disableClose: true,
//data: paperDataInfo
});
- dialogRef.afterClosed().subscribe(result => {
- this.getAlltabledate()
- }
- );
+ dialogRef.afterClosed().subscribe((result) => {
+ this.getAlltabledate();
+ });
}
//审核结果
@@ -252,343 +299,421 @@ export class OnetwoEntryPlanComponent implements OnInit {
const dialogRef = this.dialog.open(onetwoAuditResult, {
width: "400px",
//height:"300px",
- data: { element: element }
+ data: { element: element },
});
-
}
//下载↓
selectDownloadFile: any; //选择下载的文件
download: any; //下载文件元数据
downloadisLoading: boolean = false; //进度条loading加载
- downloadProgress: number = 0; //进度条进度
- downloadFileName: any
- fileUrls: any //当前预案附件地址
- fileDatas: any = []
- selectedFileIndex: any = 0
- selectedFileData: any
-
- uploadFileLonging: any
+ downloadProgress: number = 0; //进度条进度
+ downloadFileName: any;
+ fileUrls: any; //当前预案附件地址
+ fileDatas: any = [];
+ selectedFileIndex: any = 0;
+ selectedFileData: any;
+
+ uploadFileLonging: any;
//读取下载文件信息
readFile(element) {
- this.uploadFileLonging = element
- element.attachmentUrls.forEach(item => {
- this.http.get('/api/ObjectMetadata/PlanPlatform/' + item).subscribe((data: any) => {
- data.filePige = (data.fileLength / (1024 * 1024)).toFixed(2)
- //console.log(data)
- this.download = data
- this.downloadFile()
- })
- })
-
+ this.uploadFileLonging = element;
+ element.attachmentUrls.forEach((item) => {
+ this.http
+ .get("/api/ObjectMetadata/PlanPlatform/" + item)
+ .subscribe((data: any) => {
+ data.filePige = (data.fileLength / (1024 * 1024)).toFixed(2);
+ //console.log(data)
+ this.download = data;
+ this.downloadFile();
+ });
+ });
}
//初始化下载
downloadFile() {
- this.downloadProgress = 0
- let file = this.download
- let fileSize = file.fileLength//下载文件的总大小
- let shardSize = 10 * 1024 * 1024 //文件大小是否大于10MB
-
- if (file && fileSize <= shardSize) { //<=10MB时直接下载
- this.downloadisLoading = true
+ this.downloadProgress = 0;
+ let file = this.download;
+ let fileSize = file.fileLength; //下载文件的总大小
+ let shardSize = 10 * 1024 * 1024; //文件大小是否大于10MB
+
+ if (file && fileSize <= shardSize) {
+ //<=10MB时直接下载
+ this.downloadisLoading = true;
// this.setFileLoading()
- this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`, { responseType: 'blob' },).subscribe(data => {
-
- let url = window.URL.createObjectURL(new Blob([data])); //createObjectURL创建一个下载Blob的url地址
- let link = document.createElement("a");
- link.style.display = "none";
- link.href = url;
-
- let suffix = file.objectName.substring(file.objectName.lastIndexOf(".") + 1, file.objectName.length);
- link.setAttribute("download", file.fileName + "-" + this.uploadFileLonging.name + "." + suffix);
- document.body.appendChild(link);
- link.click();
- this.downloadisLoading = false
- // this.setFileLoading()
- })
- } else if (file && fileSize > shardSize) { //>10MB时分块下载
- this.blockingDownload() //分段下载
- this.downloadisLoading = true
+ this.http
+ .get(`/api/Objects/PlanPlatform/${file.objectName}`, {
+ responseType: "blob",
+ })
+ .subscribe((data) => {
+ let url = window.URL.createObjectURL(new Blob([data])); //createObjectURL创建一个下载Blob的url地址
+ let link = document.createElement("a");
+ link.style.display = "none";
+ link.href = url;
+
+ let suffix = file.objectName.substring(
+ file.objectName.lastIndexOf(".") + 1,
+ file.objectName.length
+ );
+ link.setAttribute(
+ "download",
+ file.fileName + "-" + this.uploadFileLonging.name + "." + suffix
+ );
+ document.body.appendChild(link);
+ link.click();
+ this.downloadisLoading = false;
+ // this.setFileLoading()
+ });
+ } else if (file && fileSize > shardSize) {
+ //>10MB时分块下载
+ this.blockingDownload(); //分段下载
+ this.downloadisLoading = true;
// this.setFileLoading()
}
-
}
//分段下载并合并
async blockingDownload() {
- let file = this.download
- let fileSize = file.fileLength //下载文件的总大小
- let shardSize = 3 * 1024 * 1024 //3MB一个分片
- let allSlice = Math.ceil(fileSize / shardSize) //总文件/3MB===共分多少段
- let allFile: any = [] //所有的file分段
+ let file = this.download;
+ let fileSize = file.fileLength; //下载文件的总大小
+ let shardSize = 3 * 1024 * 1024; //3MB一个分片
+ let allSlice = Math.ceil(fileSize / shardSize); //总文件/3MB===共分多少段
+ let allFile: any = []; //所有的file分段
for (let i = 0; i < allSlice; i++) {
- let start = i * shardSize //每次下载文件开始位置
+ let start = i * shardSize; //每次下载文件开始位置
let end = Math.min(fileSize, start + shardSize - 1); //每次下载文件结束为止
let result = await new Promise((result, reject) => {
- this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`, { headers: { 'range': `bytes= ${start}-${end}` }, responseType: 'blob' }).subscribe(data => {
- result(data)
- })
- })
- allFile.push(result)
- this.downloadProgress = Number((i / allSlice).toFixed(2)) * 100
+ this.http
+ .get(`/api/Objects/PlanPlatform/${file.objectName}`, {
+ headers: { range: `bytes= ${start}-${end}` },
+ responseType: "blob",
+ })
+ .subscribe((data) => {
+ result(data);
+ });
+ });
+ allFile.push(result);
+ this.downloadProgress = Number((i / allSlice).toFixed(2)) * 100;
- if (allFile.length === allSlice) { //合并文件输出给浏览器
+ if (allFile.length === allSlice) {
+ //合并文件输出给浏览器
let url = window.URL.createObjectURL(new Blob(allFile)); //createObjectURL创建一个下载Blob的url地址
let link = document.createElement("a");
link.style.display = "none";
link.href = url;
- let suffix = file.objectName.substring(file.objectName.lastIndexOf(".") + 1, file.objectName.length);
- link.setAttribute("download", file.fileName + "-" + this.uploadFileLonging.name + "." + suffix);
+ let suffix = file.objectName.substring(
+ file.objectName.lastIndexOf(".") + 1,
+ file.objectName.length
+ );
+ link.setAttribute(
+ "download",
+ file.fileName + "-" + this.uploadFileLonging.name + "." + suffix
+ );
document.body.appendChild(link);
link.click();
// this.downloadProgress = 0
- this.downloadisLoading = false
+ this.downloadisLoading = false;
// this.setFileLoading()
}
-
} //for循环
-
}
//取消分块下载
- cancelDowload() {
- }
-
+ cancelDowload() {}
//查看预案按钮跳转
routerTo(element) {
- sessionStorage.setItem("companyName", element.unitname)
- window.open(`/planManagement/entryPlandetail?unitId=${element.company.id}&unitTypeId=${element.company.buildingTypes.length == 0 ? null : element.company.buildingTypes[0].id}&operation=true&pagetype=entryplan&unitName=${element.company.name}&orName=${element.company.organizationName}&unitType=${element.company.buildingTypes.length == 0 ? null : element.company.buildingTypes[0].name}&unitAdd=${element.company.address}`);
+ sessionStorage.setItem("companyName", element.unitname);
+ window.open(
+ `/planManagement/entryPlandetail?unitId=${
+ element.company.id
+ }&unitTypeId=${
+ element.company.buildingTypes.length == 0
+ ? null
+ : element.company.buildingTypes[0].id
+ }&operation=true&pagetype=entryplan&unitName=${
+ element.company.name
+ }&orName=${element.company.organizationName}&unitType=${
+ element.company.buildingTypes.length == 0
+ ? null
+ : element.company.buildingTypes[0].name
+ }&unitAdd=${element.company.address}`
+ );
}
-
}
//新建
@Component({
- selector: 'new-unit',
- templateUrl: './newunit.html',
- styleUrls: ['./newunit.scss']
+ selector: "new-unit",
+ templateUrl: "./newunit.html",
+ styleUrls: ["./newunit.scss"],
})
export class newunitComponent {
- constructor(private router: Router, private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data: any) { }
+ constructor(
+ private router: Router,
+ private http: HttpClient,
+ public dialog: MatDialog,
+ public snackBar: MatSnackBar,
+ public dialogRef: MatDialogRef,
+ @Inject(MAT_DIALOG_DATA) public data: any
+ ) {}
ngOnInit(): void {
- this.url = window.location.href.substring(window.location.href.length - 1, window.location.href.length)
+ this.url = window.location.href.substring(
+ window.location.href.length - 1,
+ window.location.href.length
+ );
}
- url
- unitname//预案名称
- level//预案级别
- addname//添加人
- addtime//添加时间
- reservePlanType//预案类型
- unitstate//审核状态
- projectlevel//编制级别
+ url;
+ unitname; //预案名称
+ level; //预案级别
+ addname; //添加人
+ addtime; //添加时间
+ reservePlanType; //预案类型
+ unitstate; //审核状态
+ projectlevel; //编制级别
//上传文件↓
file: any; //上传的文件
fileName: any; //上传文件name
uploadisLoading: boolean = false; //进度条loading加载
- uploadProgress: number = 0; //进度条进度
+ uploadProgress: number = 0; //进度条进度
objectName: any; //上传对象名
uploadId: any; //上传分块上传事件编号
- uploadover: any = false //上传完成之后提示
- selectedPLanType: any//所选预案类型
- selectedPLanName: any//所选预案名称
- localup: boolean = false //本地上传
- defaultisshow = '0' //默认显示上传input框
+ uploadover: any = false; //上传完成之后提示
+ selectedPLanType: any; //所选预案类型
+ selectedPLanName: any; //所选预案名称
+ localup: boolean = false; //本地上传
+ defaultisshow = "0"; //默认显示上传input框
//上传
upload() {
- document.getElementById('up').click()
+ document.getElementById("up").click();
}
//上传文件input
filechange(e) {
- this.file = e.target.files[0] || null //上传的文件
+ this.file = e.target.files[0] || null; //上传的文件
}
//上传文件
startUploading(planType) {
- let file = this.file || null //获取上传的文件
- let fileSize = file.size || null //上传文件的总大小
- let shardSize = 5 * 1024 * 1024 //5MB一个分片
-
- if (file && fileSize <= shardSize) { //上传文件<=5MB时
- let formData = new FormData()
- formData.append("file", file)
+ let file = this.file || null; //获取上传的文件
+ let fileSize = file.size || null; //上传文件的总大小
+ let shardSize = 5 * 1024 * 1024; //5MB一个分片
+
+ if (file && fileSize <= shardSize) {
+ //上传文件<=5MB时
+ let formData = new FormData();
+ formData.append("file", file);
const config = new MatSnackBarConfig();
- config.verticalPosition = 'top';
- config.duration = 3000
- this.http.post(this.url == '2' ? `/api/Objects/PlanPlatform/twoClass` : '/api/Objects/PlanPlatform/oneClass', formData).subscribe((data: any) => {
- this.objectName = data.objectName
- //this.snackBar.open('上传成功!','确定',config);
- let level = sessionStorage.getItem("level")
- // console.log(level)
- let PlanLevel
- if (level == '0') {
- PlanLevel = 1
- }
- if (level == '1') {
- PlanLevel = 2
- }
- if (level == '2') {
- PlanLevel = 4
- }
- if (level == '3') {
- PlanLevel = 8
- }
-
- let body: any = {
- Name: this.unitname || '',
- PlanCategory: this.url == '2' ? 2 : 1,
- disasterType: this.reservePlanType,
- PlanLevel: PlanLevel,
- PlanMode: 1,
- planType: 16,
- attachmentUrls: [`${this.objectName}`]
- }
- this.http.post("/api/PlanComponentsMajor", body).subscribe((data: any) => {
- this.snackBar.open('创建成功!', '确定', config);
- this.dialogRef.close();
- }, err => {
- this.snackBar.open('创建失败!', '确定', config);
- })
- }, err => {
- this.snackBar.open('上传失败!', '确定', config);
- })
- } else if (file && fileSize > shardSize) { //上传文件>5MB时,分块上传
- let data = { filename: file.name }
- this.uploadisLoading = true
- this.http.post(this.url == '2' ? `/api/NewMultipartUpload/PlanPlatform/twoClass` : '/api/NewMultipartUpload/PlanPlatform/oneClass', {}, { params: data }).subscribe((data: any) => { //初始化分段上传
- this.objectName = data.objectName
- this.uploadId = data.uploadId
- this.subsectionUploading(planType)
- })
+ config.verticalPosition = "top";
+ config.duration = 3000;
+ this.http
+ .post(
+ this.url == "2"
+ ? `/api/Objects/PlanPlatform/twoClass`
+ : "/api/Objects/PlanPlatform/oneClass",
+ formData
+ )
+ .subscribe(
+ (data: any) => {
+ this.objectName = data.objectName;
+ //this.snackBar.open('上传成功!','确定',config);
+ let level = sessionStorage.getItem("level");
+ // console.log(level)
+ let PlanLevel;
+ if (level == "0") {
+ PlanLevel = 1;
+ }
+ if (level == "1") {
+ PlanLevel = 2;
+ }
+ if (level == "2") {
+ PlanLevel = 4;
+ }
+ if (level == "3") {
+ PlanLevel = 8;
+ }
+
+ let body: any = {
+ Name: this.unitname || "",
+ PlanCategory: this.url == "2" ? 2 : 1,
+ disasterType: this.reservePlanType,
+ PlanLevel: PlanLevel,
+ PlanMode: 1,
+ planType: 16,
+ attachmentUrls: [`${this.objectName}`],
+ };
+ this.http.post("/api/PlanComponentsMajor", body).subscribe(
+ (data: any) => {
+ this.snackBar.open("创建成功!", "确定", config);
+ this.dialogRef.close();
+ },
+ (err) => {
+ this.snackBar.open("创建失败!", "确定", config);
+ }
+ );
+ },
+ (err) => {
+ this.snackBar.open("上传失败!", "确定", config);
+ }
+ );
+ } else if (file && fileSize > shardSize) {
+ //上传文件>5MB时,分块上传
+ let data = { filename: file.name };
+ this.uploadisLoading = true;
+ this.http
+ .post(
+ this.url == "2"
+ ? `/api/NewMultipartUpload/PlanPlatform/twoClass`
+ : "/api/NewMultipartUpload/PlanPlatform/oneClass",
+ {},
+ { params: data }
+ )
+ .subscribe((data: any) => {
+ //初始化分段上传
+ this.objectName = data.objectName;
+ this.uploadId = data.uploadId;
+ this.subsectionUploading(planType);
+ });
}
-
}
PartNumberETag: any = []; //每次返回需要保存的信息
//开始分段上传
async subsectionUploading(planType) {
- let file = this.file || null //获取上传的文件
- let fileSize = file.size || null //上传文件的总大小
- let shardSize = 5 * 1024 * 1024 //5MB一个分片
- let allSlice = Math.ceil(fileSize / shardSize) //总文件/5MB===共分多少段 向上取整
+ let file = this.file || null; //获取上传的文件
+ let fileSize = file.size || null; //上传文件的总大小
+ let shardSize = 5 * 1024 * 1024; //5MB一个分片
+ let allSlice = Math.ceil(fileSize / shardSize); //总文件/5MB===共分多少段 向上取整
- for (let i = 0; i < allSlice; i++) { //循环分段上传
- let start = i * shardSize //切割文件开始位置
+ for (let i = 0; i < allSlice; i++) {
+ //循环分段上传
+ let start = i * shardSize; //切割文件开始位置
let end = Math.min(fileSize, start + shardSize); //切割文件结束位置 (对比取小数)
- let formData = new FormData()
- formData.append("file", file.slice(start, end))
+ let formData = new FormData();
+ formData.append("file", file.slice(start, end));
//同步写法实现异步调用
let result = await new Promise((resolve, reject) => {
// await 需要后面返回一个 promise 对象
- this.http.post(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}&partNumber=${i + 1}`, formData).subscribe((data: any) => {
- let msg = {
- "partNumber": data.partNumber || null,
- "eTag": data.eTag || null
- }
- resolve(msg) // 调用 promise 内置方法处理成功
- })
+ this.http
+ .post(
+ `/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${
+ this.uploadId
+ }&partNumber=${i + 1}`,
+ formData
+ )
+ .subscribe((data: any) => {
+ let msg = {
+ partNumber: data.partNumber || null,
+ eTag: data.eTag || null,
+ };
+ resolve(msg); // 调用 promise 内置方法处理成功
+ });
});
- this.PartNumberETag.push(result)
- this.uploadProgress = Number((i / allSlice).toFixed(2)) * 100
+ this.PartNumberETag.push(result);
+ this.uploadProgress = Number((i / allSlice).toFixed(2)) * 100;
if (this.PartNumberETag.length === allSlice) {
- this.uploadProgress = 100
- this.endUploading(planType)
+ this.uploadProgress = 100;
+ this.endUploading(planType);
}
- }//for循环
-
+ } //for循环
}
//完成分块上传
endUploading(planType) {
- let data = this.PartNumberETag
- let paramsData = { uploadId: this.uploadId }
- this.http.post(`/api/CompleteMultipartUpload/PlanPlatform/${this.objectName}`, data, { params: paramsData }).subscribe(data => {
- const config = new MatSnackBarConfig();
- config.verticalPosition = 'top';
- config.duration = 3000
- //this.snackBar.open('上传成功!','确定',config);
- this.uploadProgress = 0;
- this.uploadisLoading = false
- this.PartNumberETag = [] //清空保存返回的信息
- this.uploadover = true
- let level = sessionStorage.getItem("level")
- // console.log(level)
- let PlanLevel
- if (level == '0') {
- PlanLevel = 1
- }
- if (level == '1') {
- PlanLevel = 2
- }
- if (level == '2') {
- PlanLevel = 4
- }
- if (level == '3') {
- PlanLevel = 8
- }
-
- let body: any = {
- Name: this.unitname || '',
- PlanCategory: this.url == '2' ? 2 : 1,
- disasterType: this.reservePlanType,
- PlanLevel: PlanLevel,
- PlanMode: 1,
- planType: 16,
- attachmentUrls: [`${this.objectName}`]
- }
+ let data = this.PartNumberETag;
+ let paramsData = { uploadId: this.uploadId };
+ this.http
+ .post(
+ `/api/CompleteMultipartUpload/PlanPlatform/${this.objectName}`,
+ data,
+ { params: paramsData }
+ )
+ .subscribe((data) => {
+ const config = new MatSnackBarConfig();
+ config.verticalPosition = "top";
+ config.duration = 3000;
+ //this.snackBar.open('上传成功!','确定',config);
+ this.uploadProgress = 0;
+ this.uploadisLoading = false;
+ this.PartNumberETag = []; //清空保存返回的信息
+ this.uploadover = true;
+ let level = sessionStorage.getItem("level");
+ // console.log(level)
+ let PlanLevel;
+ if (level == "0") {
+ PlanLevel = 1;
+ }
+ if (level == "1") {
+ PlanLevel = 2;
+ }
+ if (level == "2") {
+ PlanLevel = 4;
+ }
+ if (level == "3") {
+ PlanLevel = 8;
+ }
- this.http.post("/api/PlanComponentsMajor", body).subscribe((data: any) => {
- this.snackBar.open('创建成功!', '确定', config);
- this.dialogRef.close();
- }, err => {
- this.snackBar.open('创建失败!', '确定', config);
- })
- })
+ let body: any = {
+ Name: this.unitname || "",
+ PlanCategory: this.url == "2" ? 2 : 1,
+ disasterType: this.reservePlanType,
+ PlanLevel: PlanLevel,
+ PlanMode: 1,
+ planType: 16,
+ attachmentUrls: [`${this.objectName}`],
+ };
+
+ this.http.post("/api/PlanComponentsMajor", body).subscribe(
+ (data: any) => {
+ this.snackBar.open("创建成功!", "确定", config);
+ this.dialogRef.close();
+ },
+ (err) => {
+ this.snackBar.open("创建失败!", "确定", config);
+ }
+ );
+ });
}
//取消分块上传
cancel() {
- this.http.delete(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}`).subscribe(data => {
- this.uploadProgress = 0;
- this.uploadisLoading = false;
- (document.getElementById('up')).value = null
- this.PartNumberETag = [] //清空保存返回的信息
- const config = new MatSnackBarConfig();
- config.verticalPosition = 'top';
- config.duration = 3000
- this.snackBar.open('取消上传成功!', '确定', config);
- this.uploadover = false
- this.file = null
- })
+ this.http
+ .delete(
+ `/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}`
+ )
+ .subscribe((data) => {
+ this.uploadProgress = 0;
+ this.uploadisLoading = false;
+ (document.getElementById("up")).value = null;
+ this.PartNumberETag = []; //清空保存返回的信息
+ const config = new MatSnackBarConfig();
+ config.verticalPosition = "top";
+ config.duration = 3000;
+ this.snackBar.open("取消上传成功!", "确定", config);
+ this.uploadover = false;
+ this.file = null;
+ });
}
-
//创建预案
newplan() {
const config = new MatSnackBarConfig();
- config.verticalPosition = 'top';
- config.duration = 3000
+ config.verticalPosition = "top";
+ config.duration = 3000;
if (this.unitname == undefined || this.reservePlanType == undefined) {
- this.snackBar.open('请输入预案名称或类型!', '确定', config);
- }
- else if (this.file == undefined) {
- this.snackBar.open('请先上传文件!', '确定', config);
- }
- else {
- if (this.reservePlanType != '1') {
- this.startUploading("非二维")
+ this.snackBar.open("请输入预案名称或类型!", "确定", config);
+ } else if (this.file == undefined) {
+ this.snackBar.open("请先上传文件!", "确定", config);
+ } else {
+ if (this.reservePlanType != "1") {
+ this.startUploading("非二维");
+ } else {
+ this.startUploading("二维");
}
- else { this.startUploading("二维") }
-
-
}
-
-
}
//取消按钮
close() {
@@ -598,22 +723,26 @@ export class newunitComponent {
//查看审核结果
@Component({
- selector: 'resultonetwo',
- templateUrl: './resultPlanonetwo.html',
- styleUrls: ['./onetwo-entry-plan.component.scss']
+ selector: "resultonetwo",
+ templateUrl: "./resultPlanonetwo.html",
+ styleUrls: ["./onetwo-entry-plan.component.scss"],
})
export class onetwoAuditResult {
- constructor(private http: HttpClient, public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data, public snackBar: MatSnackBar) { }
- planName: any = this.data.element.name
- commitTime: any = this.data.element.committedTime
- commitOrganizationName: any = this.data.element.committerOrganizationName
-
- auditOrganizationName: any = this.data.element.auditorOrganizationName
- auditResult: any = this.data.element.auditStatus
- auditOpinion: any = this.data.element.auditOpinion
- ngOnInit(): void {
- }
+ constructor(
+ private http: HttpClient,
+ public dialogRef: MatDialogRef,
+ @Inject(MAT_DIALOG_DATA) public data,
+ public snackBar: MatSnackBar
+ ) {}
+ planName: any = this.data.element.name;
+ commitTime: any = this.data.element.committedTime;
+ commitOrganizationName: any = this.data.element.committerOrganizationName;
+
+ auditOrganizationName: any = this.data.element.auditorOrganizationName;
+ auditResult: any = this.data.element.auditStatus;
+ auditOpinion: any = this.data.element.auditOpinion;
+ ngOnInit(): void {}
onNoClick(): void {
this.dialogRef.close();
}
-}
\ No newline at end of file
+}
diff --git a/src/app/plan-management/open-plan/open-plan.component.html b/src/app/plan-management/open-plan/open-plan.component.html
index d9eb115..9661364 100644
--- a/src/app/plan-management/open-plan/open-plan.component.html
+++ b/src/app/plan-management/open-plan/open-plan.component.html
@@ -122,15 +122,14 @@
margin: 3px 0 0 3px;" src="../../../assets/images/custom.png" alt="">
-
- 新增审核 |
- {{element.newVerifyState}} |
-
-
- 维护审核 |
- {{element.maintenanceVerifyState}} |
-
+
+
+ 审核状态 |
+
+ {{element.auditStatus | auditState}}
+ |
+
是否公开 |
{{element.openRange}} |
diff --git a/src/app/plan-management/open-plan/open-plan.component.ts b/src/app/plan-management/open-plan/open-plan.component.ts
index a507031..d06350b 100644
--- a/src/app/plan-management/open-plan/open-plan.component.ts
+++ b/src/app/plan-management/open-plan/open-plan.component.ts
@@ -1,38 +1,63 @@
-import { Component, OnInit, ViewChild, Inject } from '@angular/core';
-import { HttpClient } from '@angular/common/http'
-import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree';
-import { MatPaginator } from '@angular/material/paginator';
-import { FlatTreeControl } from '@angular/cdk/tree';
-import { FormControl } from '@angular/forms';
-import { Router, ActivatedRoute } from '@angular/router'
-import { PageEvent } from '@angular/material/paginator';
-import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog';
-import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
-import { TreeService } from '../../http-interceptors/tree.service'
-import { Viewer } from 'photo-sphere-viewer';
-import { ImgDetails, PsViewer } from '../entry-plan-look/entry-plan-look.component';
-declare var CryptoJS
+import { Component, OnInit, ViewChild, Inject } from "@angular/core";
+import { HttpClient } from "@angular/common/http";
+import {
+ MatTreeFlatDataSource,
+ MatTreeFlattener,
+} from "@angular/material/tree";
+import { MatPaginator } from "@angular/material/paginator";
+import { FlatTreeControl } from "@angular/cdk/tree";
+import { FormControl } from "@angular/forms";
+import { Router, ActivatedRoute } from "@angular/router";
+import { PageEvent } from "@angular/material/paginator";
+import {
+ MatDialogRef,
+ MatDialog,
+ MAT_DIALOG_DATA,
+} from "@angular/material/dialog";
+import { MatSnackBar, MatSnackBarConfig } from "@angular/material/snack-bar";
+import { TreeService } from "../../http-interceptors/tree.service";
+import { Viewer } from "photo-sphere-viewer";
+import {
+ ImgDetails,
+ PsViewer,
+} from "../entry-plan-look/entry-plan-look.component";
+declare var CryptoJS;
@Component({
- selector: 'app-open-plan',
- templateUrl: './open-plan.component.html',
- styleUrls: ['./open-plan.component.scss']
+ selector: "app-open-plan",
+ templateUrl: "./open-plan.component.html",
+ styleUrls: ["./open-plan.component.scss"],
})
export class OpenPlanComponent implements OnInit {
+ constructor(
+ private http: HttpClient,
+ private router: Router,
+ private route: ActivatedRoute,
+ private tree: TreeService,
+ public dialog: MatDialog,
+ public snackBar: MatSnackBar
+ ) {}
- constructor(private http: HttpClient, private router: Router, private route: ActivatedRoute, private tree: TreeService, public dialog: MatDialog, public snackBar: MatSnackBar) { }
-
- private _transformer = (node, level: number) => { //初始化tree
+ private _transformer = (node, level: number) => {
+ //初始化tree
return {
expandable: !!node.children && node.children.length > 0,
name: node.name,
level: level,
id: node.id,
parentId: node.parentId,
- children: node.children
+ children: node.children,
};
- }
- treeControl = new FlatTreeControl(node => node.level, node => node.expandable);
- treeFlattener = new MatTreeFlattener(this._transformer, node => node.level, node => node.expandable, node => node.children);
+ };
+ treeControl = new FlatTreeControl(
+ (node) => node.level,
+ (node) => node.expandable
+ );
+ treeFlattener = new MatTreeFlattener(
+ this._transformer,
+ (node) => node.level,
+ (node) => node.expandable,
+ (node) => node.children
+ );
dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);
myControl = new FormControl();
hasChild = (_: number, node: any) => node.expandable;
@@ -42,306 +67,342 @@ export class OpenPlanComponent implements OnInit {
paginator: MatPaginator;
length: any; //共多少条数据
pageSize: any; //每页条数
- pageSizeOptions: number[] = [10] //设置每页条数
+ pageSizeOptions: number[] = [10]; //设置每页条数
PageNumber: any; //第几页
- IsNewData = '' //维护更新活新增
+ IsNewData = ""; //维护更新活新增
- displayedColumns: string[] = ['state', 'unitname', 'planname', 'addpeople', 'addtime', 'plantype', 'auditStatus', 'weihuStatus', 'openRange', 'projectlevel', 'operation'];
+ displayedColumns: string[] = [
+ "state",
+ "unitname",
+ "planname",
+ "addpeople",
+ "addtime",
+ "plantype",
+ "auditstate",
+ "openRange",
+ "projectlevel",
+ "operation",
+ ];
- allorganizations: any //所有组织机构
- allunittype: any //所有单位类型
- tabledataSource: any //表格数据
- preparelevels: any //编制级别
+ allorganizations: any; //所有组织机构
+ allunittype: any; //所有单位类型
+ tabledataSource: any; //表格数据
+ preparelevels: any; //编制级别
ngOnInit(): void {
if (window.matchMedia("(max-width: 1400px)").matches) {
- this.pcMore = false
- this.padMore = true
- this.pcfind = false
- this.padjt = true
+ this.pcMore = false;
+ this.padMore = true;
+ this.pcfind = false;
+ this.padjt = true;
} else {
- this.pcfind = true
- this.pcMore = true
- this.padMore = false
- this.padjt = false
+ this.pcfind = true;
+ this.pcMore = true;
+ this.padMore = false;
+ this.padjt = false;
}
this.getunitdata();
this.getOrganizations();
this.getUnittype();
this.getAllPlanInfo(); //得到所有单位
let level = sessionStorage.getItem("level");
- if (level == "0") {//如果是总队
+ if (level == "0") {
+ //如果是总队
this.preparelevels = [
{ name: "总队", value: "1" },
{ name: "支队", value: "2" },
{ name: "大队", value: "4" },
- { name: "中队", value: "8" }
- ]
+ { name: "中队", value: "8" },
+ ];
}
- if (level == "1") {//如果是支队
+ if (level == "1") {
+ //如果是支队
this.preparelevels = [
{ name: "支队", value: "2" },
{ name: "大队", value: "4" },
- { name: "中队", value: "8" }
- ]
+ { name: "中队", value: "8" },
+ ];
}
- if (level == "2") {//如果是大队
+ if (level == "2") {
+ //如果是大队
this.preparelevels = [
{ name: "大队", value: "4" },
- { name: "中队", value: "8" }
- ]
+ { name: "中队", value: "8" },
+ ];
}
- if (level == "3") {//如果是中队
- this.preparelevels = [
- { name: "中队", value: "8" }
- ]
+ if (level == "3") {
+ //如果是中队
+ this.preparelevels = [{ name: "中队", value: "8" }];
}
}
- pcMore//pc更多
- pcput = false//pc收起
- pcfind//pc查询
- padjt = false
- padMore = true//pad收缩控制
- padput = false//pad收起按钮
- imgsrcopen = "../../../assets/images/routdown2.png"
- imgsrcdown = "../../../assets/images/routup2.png"
+ pcMore; //pc更多
+ pcput = false; //pc收起
+ pcfind; //pc查询
+ padjt = false;
+ padMore = true; //pad收缩控制
+ padput = false; //pad收起按钮
+ imgsrcopen = "../../../assets/images/routdown2.png";
+ imgsrcdown = "../../../assets/images/routup2.png";
pcInfo() {
- this.pcMore = !this.pcMore
- this.pcput = !this.pcput
+ this.pcMore = !this.pcMore;
+ this.pcput = !this.pcput;
}
padInfo() {
- this.padMore = !this.padMore
- this.padput = !this.padput
+ this.padMore = !this.padMore;
+ this.padput = !this.padput;
}
- allPlanInfo: any //存储所有预案信息
+ allPlanInfo: any; //存储所有预案信息
//获得所有预案信息
- IsNewCompanyData = ''
- templatePlan: boolean = false//模板录入预案checkbox
- customPlan: boolean = false//自定义预案
+ IsNewCompanyData = "";
+ templatePlan: boolean = false; //模板录入预案checkbox
+ customPlan: boolean = false; //自定义预案
getAllPlanInfo() {
- let planmode = []
- this.templatePlan ? planmode.push(2) : null
- this.customPlan ? planmode.push(4) : null
+ let planmode = [];
+ this.templatePlan ? planmode.push(2) : null;
+ this.customPlan ? planmode.push(4) : null;
let paramsdata: any = {
- CompanyName: this.companyName || '',
- OrganizationId: '',
- HasChildrenOrganization: '',
- BuildingTypeId: this.unittype || '',
- PlanType: this.reservePlanType || '',
- AuditStatus: '', //审核状态
- PlanLevel: this.preparelevel || '',
- HasChildrenPlanLevel: this.plcheck || '',
- PageNumber: this.PageNumber || '1',
+ CompanyName: this.companyName || "",
+ OrganizationId: "",
+ HasChildrenOrganization: "",
+ BuildingTypeId: this.unittype || "",
+ PlanType: this.reservePlanType || "",
+ AuditStatus: "", //审核状态
+ PlanLevel: this.preparelevel || "",
+ HasChildrenPlanLevel: this.plcheck || "",
+ PageNumber: this.PageNumber || "1",
PageSize: this.pageSizeOptions[0],
- Sort: '',
+ Sort: "",
IsNewData: this.IsNewData,
IsNewCompanyData: this.IsNewCompanyData,
- PlanModes: planmode
- }
- this.http.get("/api/PublicPlans", { params: paramsdata }).subscribe((data: any) => {
- // console.log(111,data)
- this.length = data.totalCount
- this.allPlanInfo = data
- this.tabledataSource = data.items
- })
+ PlanModes: planmode,
+ };
+ this.http
+ .get("/api/PublicPlans", { params: paramsdata })
+ .subscribe((data: any) => {
+ // console.log(111,data)
+ this.length = data.totalCount;
+ this.allPlanInfo = data;
+ this.tabledataSource = data.items;
+ });
}
//得到当前单位信息
getunitdata() {
- this.http.get("/api/Account/Profiles").subscribe(
- (data: any) => {
- this.organizationName = data.organizationName
- }
- )
+ this.http.get("/api/Account/Profiles").subscribe((data: any) => {
+ this.organizationName = data.organizationName;
+ });
}
- organizationName: any //当前单位组织机构名称
- treedata: any //组织机构树型数据
- newArr: any = []
- newallorganizations: any //用于存储在原始数据基础上的每个机构增加children字段
+ organizationName: any; //当前单位组织机构名称
+ treedata: any; //组织机构树型数据
+ newArr: any = [];
+ newallorganizations: any; //用于存储在原始数据基础上的每个机构增加children字段
//得到当前单位所在组织机构的tree型数据
getpresentOrganization() {
- this.newallorganizations = this.allorganizations
- this.newallorganizations.forEach(item => {
- item.children = []
- this.newallorganizations.forEach(element => {
+ this.newallorganizations = this.allorganizations;
+ this.newallorganizations.forEach((item) => {
+ item.children = [];
+ this.newallorganizations.forEach((element) => {
if (element.parentId == item.id) {
- item.children.push(element)
+ item.children.push(element);
}
});
});
// console.log(666,this.organizationName)
if (this.organizationName) {
- this.newallorganizations.forEach(item => {
+ this.newallorganizations.forEach((item) => {
if (item.name == this.organizationName) {
- this.dataSource.data = [item]
+ this.dataSource.data = [item];
}
});
} else {
this.dataSource.data = this.tree.toTree(this.treedata);
}
-
}
//获得所有组织机构
getOrganizations() {
- this.http.get('/api/Organizations').subscribe(
- (data: any) => {
- this.allorganizations = data
- this.treedata = this.tree.toTree(data);
- this.getpresentOrganization();
- }
- )
+ this.http.get("/api/Organizations").subscribe((data: any) => {
+ this.allorganizations = data;
+ this.treedata = this.tree.toTree(data);
+ this.getpresentOrganization();
+ });
}
//获得所有单位类型
getUnittype() {
- this.http.get('/api/BuildingTypes/Simple').subscribe(
- data => {
- this.allunittype = data
- }
- )
+ this.http.get("/api/BuildingTypes/Simple").subscribe((data) => {
+ this.allunittype = data;
+ });
}
//跳转查看预案页面 公开预案
routerTo(e) {
- console.log(e)
+ console.log(e);
if (e.planType == 16 || e.planType == 4 || e.planType == 8) {
if (e.planType == 16 && e.attachmentUrls == null) {
- window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${e.companyId}&planName=${e.name}&unitName=${e.company.name}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${e.company.buildingTypes[0].id}&orName=${e.company.organizationName}&orId=${e.company.organizationId}&pattern=false`)
+ window.open(
+ `/planManagement/createplanonlinefive?navIsOpen=false&companyId=${e.companyId}&planName=${e.name}&unitName=${e.company.name}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${e.company.buildingTypes[0].id}&orName=${e.company.organizationName}&orId=${e.company.organizationId}&pattern=false`
+ );
} else {
- var index = e.attachmentUrls[0].indexOf("\/")
- if (e.attachmentUrls[0].substr(0, index) == 'psw') {
+ var index = e.attachmentUrls[0].indexOf("/");
+ if (e.attachmentUrls[0].substr(0, index) == "psw") {
const dialogRef = this.dialog.open(PsViewer, {
- width: '1500px',
- height: '800px',
- data: e.attachmentUrls[0]
+ width: "1500px",
+ height: "800px",
+ data: e.attachmentUrls[0],
});
- } else if (e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'JPG' || e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'png' || e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'jpeg' || e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'jpg') {
- let data = e
- const dialogRef = this.dialog.open(ImgDetails, {//调用open方法打开对话框并且携带参数过去
+ } else if (
+ e.attachmentUrls[0].substr(
+ e.attachmentUrls[0].length - 3,
+ e.attachmentUrls[0].length
+ ) == "JPG" ||
+ e.attachmentUrls[0].substr(
+ e.attachmentUrls[0].length - 3,
+ e.attachmentUrls[0].length
+ ) == "png" ||
+ e.attachmentUrls[0].substr(
+ e.attachmentUrls[0].length - 3,
+ e.attachmentUrls[0].length
+ ) == "jpeg" ||
+ e.attachmentUrls[0].substr(
+ e.attachmentUrls[0].length - 3,
+ e.attachmentUrls[0].length
+ ) == "jpg"
+ ) {
+ let data = e;
+ const dialogRef = this.dialog.open(ImgDetails, {
+ //调用open方法打开对话框并且携带参数过去
data: data.attachmentUrls,
});
dialogRef.afterClosed().subscribe();
} else {
- let fetchUrl = e.attachmentUrls[0]
+ let fetchUrl = e.attachmentUrls[0];
if (fetchUrl) {
- let suffix = fetchUrl.split('.')[fetchUrl.split('.').length - 1].toLowerCase()
- if (suffix == 'docx' || suffix == 'doc') {
- let arr = fetchUrl.split('.')
- arr[arr.length - 1] = 'pdf'
- window.open(`/api/Objects/PlanPlatform/` + arr.join('.'))
- } else if (suffix == 'pdf') {
- window.open(`/api/Objects/PlanPlatform/` + fetchUrl)
+ let suffix = fetchUrl
+ .split(".")
+ [fetchUrl.split(".").length - 1].toLowerCase();
+ if (suffix == "docx" || suffix == "doc") {
+ let arr = fetchUrl.split(".");
+ arr[arr.length - 1] = "pdf";
+ window.open(`/api/Objects/PlanPlatform/` + arr.join("."));
+ } else if (suffix == "pdf") {
+ window.open(`/api/Objects/PlanPlatform/` + fetchUrl);
} else {
let config = new MatSnackBarConfig();
- config.verticalPosition = 'top';
- config.duration = 3000
- this.snackBar.open('该文件类型暂不支持在线查看', '确定', config);
+ config.verticalPosition = "top";
+ config.duration = 3000;
+ this.snackBar.open("该文件类型暂不支持在线查看", "确定", config);
}
}
}
}
}
- if (e.planMode == 2 && e.planType == 1) { //如果是在线编辑
- let id = e.id
- sessionStorage.setItem("planId", id)
- sessionStorage.setItem("companyId", e.companyId)
+ if (e.planMode == 2 && e.planType == 1) {
+ //如果是在线编辑
+ let id = e.id;
+ sessionStorage.setItem("planId", id);
+ sessionStorage.setItem("companyId", e.companyId);
//sessionStorage.setItem("buildingTypeId",this.unittypeId)
- sessionStorage.setItem("editable", "0")
- sessionStorage.setItem("planName", e.name)
- let companyId = sessionStorage.getItem("companyId")
+ sessionStorage.setItem("editable", "0");
+ sessionStorage.setItem("planName", e.name);
+ let companyId = sessionStorage.getItem("companyId");
window.open(`/keyUnit/viewunitinfoplan?id=${companyId}`);
}
- if (e.planMode == 3) { //如果是跳转网页
- sessionStorage.setItem("url", e.url)
- window.open(`/planManagement/webLook`)
+ if (e.planMode == 3) {
+ //如果是跳转网页
+ sessionStorage.setItem("url", e.url);
+ window.open(`/planManagement/webLook`);
}
}
-
templatePlanChange($event, type) {
if (type == 1) {
- this.templatePlan = $event
+ this.templatePlan = $event;
} else if (type == 2) {
- this.customPlan = $event
+ this.customPlan = $event;
}
if (this.templatePlan || this.customPlan) {
- this.reservePlanType = ['16']
+ this.reservePlanType = ["16"];
} else {
- this.reservePlanType = []
+ this.reservePlanType = [];
}
}
//分页事件
chagePage(e) {
- this.PageNumber = e.pageIndex + 1
+ this.PageNumber = e.pageIndex + 1;
this.getAllPlanInfo();
}
//辖区中队div是否显示
- isorganizationbox: boolean = false
+ isorganizationbox: boolean = false;
//点击辖区中队树,将选择的辖区中队添加到变量
add(node) {
- this.isorganizationbox = false
- this.js = node.name
- this.jsId = node.id
+ this.isorganizationbox = false;
+ this.js = node.name;
+ this.jsId = node.id;
}
//关闭辖区中队隐藏框
closeorganizationbox() {
- this.isorganizationbox = false
+ this.isorganizationbox = false;
}
//打开辖区中队隐藏框
openorganizationbox() {
- this.isorganizationbox = true
+ this.isorganizationbox = true;
}
//关闭出现的组织机构div
closediv() {
- this.isorganizationbox = false
+ this.isorganizationbox = false;
}
//查询
onSubmit(e) {
- this.getAllPlanInfo()
+ this.getAllPlanInfo();
}
- companyName: any //单位名称
- js: any //所选组织机构
- jsId: any //所选组织机构的id
+ companyName: any; //单位名称
+ js: any; //所选组织机构
+ jsId: any; //所选组织机构的id
// jscheck:boolean //所选组织机构勾选框
- unittype: any //单位类型
- reservePlanType: any //预案类型
- preparelevel: any //编制级别
- plcheck: boolean //编制级别勾选框
+ unittype: any; //单位类型
+ reservePlanType: any; //预案类型
+ preparelevel: any; //编制级别
+ plcheck: boolean; //编制级别勾选框
//重置
reset() {
- this.companyName = ''
+ this.companyName = "";
// this.js = ''
// this.jsId = ''
// this.jscheck = false
- this.unittype = ''
- this.reservePlanType = ''
- this.preparelevel = ''
- this.plcheck = false
+ this.unittype = "";
+ this.reservePlanType = "";
+ this.preparelevel = "";
+ this.plcheck = false;
//重新获取初始化列表
- this.pageEvent.pageIndex = 0
- this.PageNumber = 1
- this.templatePlan = false
- this.customPlan = false
+ this.pageEvent.pageIndex = 0;
+ this.PageNumber = 1;
+ this.templatePlan = false;
+ this.customPlan = false;
this.getAllPlanInfo();
- this.IsNewCompanyData = ''
- this.IsNewData = ''
-
+ this.IsNewCompanyData = "";
+ this.IsNewData = "";
}
}
@Component({
- selector: 'PsViewer',
- templateUrl: './PsvShow.html',
- styleUrls: ['./open-plan.component.scss']
+ selector: "PsViewer",
+ templateUrl: "./PsvShow.html",
+ styleUrls: ["./open-plan.component.scss"],
})
export class GkhtmlPsViewer {
- constructor(private router: Router, private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data: any) { }
+ constructor(
+ private router: Router,
+ private http: HttpClient,
+ public dialog: MatDialog,
+ public snackBar: MatSnackBar,
+ public dialogRef: MatDialogRef,
+ @Inject(MAT_DIALOG_DATA) public data: any
+ ) {}
ngOnInit(): void {
// console.log(this.data)
const viewer = new Viewer({
- container: document.querySelector('#viewer'),
- panorama: '/api/Objects/PlanPlatform/' + this.data,
-
+ container: document.querySelector("#viewer"),
+ panorama: "/api/Objects/PlanPlatform/" + this.data,
});
}
}
diff --git a/src/app/plan-management/pass-plan/pass-plan.component.html b/src/app/plan-management/pass-plan/pass-plan.component.html
index 9d743e5..b0a9ff4 100644
--- a/src/app/plan-management/pass-plan/pass-plan.component.html
+++ b/src/app/plan-management/pass-plan/pass-plan.component.html
@@ -187,15 +187,13 @@
margin: 3px 0 0 3px;" src="../../../assets/images/custom.png" alt="">
-
- 新增审核 |
- {{element.newVerifyState}} |
-
-
- 维护审核 |
- {{element.maintenanceVerifyState}} |
-
+
+ 审核状态 |
+
+ {{element.auditStatus | auditState}}
+ |
+
是否公开 |
{{element.openRange}} |
diff --git a/src/app/plan-management/pass-plan/pass-plan.component.ts b/src/app/plan-management/pass-plan/pass-plan.component.ts
index 33b5b04..2068cd0 100644
--- a/src/app/plan-management/pass-plan/pass-plan.component.ts
+++ b/src/app/plan-management/pass-plan/pass-plan.component.ts
@@ -78,8 +78,7 @@ export class PassPlanComponent implements OnInit {
"level",
"addtime",
"plantype",
- "auditStatus",
- "weihuState",
+ "auditstate",
"openRange",
"projectlevel",
"operation",
diff --git a/src/app/plan-management/plan-management.module.ts b/src/app/plan-management/plan-management.module.ts
index 1d203f8..83b3180 100644
--- a/src/app/plan-management/plan-management.module.ts
+++ b/src/app/plan-management/plan-management.module.ts
@@ -55,7 +55,13 @@ import {
ChangeName,
ImgDetails,
} from "./entry-plan-look/entry-plan-look.component";
-import { PlanType, AuditSatus, PlanLevel, state } from "../pipes/boolean.pipe";
+import {
+ PlanType,
+ AuditSatus,
+ PlanLevel,
+ state,
+ auditState,
+} from "../pipes/boolean.pipe";
import { WebLookComponent } from "./web-look/web-look.component";
import { OnetwoEntryPlanComponent } from "./onetwo-entry-plan/onetwo-entry-plan.component";
import { newunitComponent } from "./onetwo-entry-plan/onetwo-entry-plan.component";
@@ -150,6 +156,7 @@ import { NzTreeModule } from "ng-zorro-antd/tree";
PlanDeductionComponent,
AddPlanComponent,
OpenOrComponent,
+ auditState,
],
imports: [
CommonModule,
@@ -215,6 +222,7 @@ import { NzTreeModule } from "ng-zorro-antd/tree";
PlanLevel,
state,
CreatePlanOnlineFiveComponent,
+ auditState,
],
})
export class PlanManagementModule {}
diff --git a/src/app/plan-management/reinforce-plan/reinforce-plan.component.html b/src/app/plan-management/reinforce-plan/reinforce-plan.component.html
index 1cb4035..4d53e0f 100644
--- a/src/app/plan-management/reinforce-plan/reinforce-plan.component.html
+++ b/src/app/plan-management/reinforce-plan/reinforce-plan.component.html
@@ -2,47 +2,47 @@
-
+
-
-
-
+
+
+
-
-
- 预案状态 |
-
- 新增
- 维护更新
- |
+
+
+ 预案状态 |
+
+ 新增
+ 维护更新
+ |
+
+
+ 单位名称 |
+ {{element.companyName}} |
+
+
+ 预案名称 |
+ {{element.name}} |
+
+
+ 添加人 |
+ {{element.creatorName}} |
+
+
+ 预案级别 |
+ {{element.planCategory==1?'Ⅰ级预案':element.planCategory==2?'Ⅱ级预案':
+ element.planCategory==3?'Ⅲ级预案':element.planCategory==4?'Ⅳ级预案':element.planCategory==5?'Ⅴ级预案':element.planCategory==8?'类型预案':'应急预案'}}
+ |
+
+
+ 添加时间 |
+ {{element.creationTime | date:'yyyy-MM-dd'}} |
-
- 单位名称 |
- {{element.companyName}} |
-
-
- 预案名称 |
- {{element.name}} |
-
-
- 添加人 |
- {{element.creatorName}} |
-
-
- 预案级别 |
- {{element.planCategory==1?'Ⅰ级预案':element.planCategory==2?'Ⅱ级预案':
- element.planCategory==3?'Ⅲ级预案':element.planCategory==4?'Ⅳ级预案':element.planCategory==5?'Ⅴ级预案':element.planCategory==8?'类型预案':'应急预案'}} |
-
-
- 添加时间 |
- {{element.creationTime | date:'yyyy-MM-dd'}} |
-
-
- 预案类型 |
- 二维预案 |
-
-
- 新增审核 |
- {{element.newVerifyState}} |
-
-
- 维护审核 |
- {{element.maintenanceVerifyState}} |
-
-
- 是否公开 |
- {{element.openRange}} |
-
-
- 编制级别 |
- {{element.planLevel | planlevel}} |
-
-
- 操作 |
-
- 查看预案
- |
-
-
-
-
-
-
-
+
+ 预案类型 |
+ 二维预案 |
+
+
+ 审核状态 |
+
+ {{element.auditStatus | auditState}}
+ |
+
+
+ 是否公开 |
+ {{element.openRange}} |
+
+
+ 编制级别 |
+ {{element.planLevel | planlevel}} |
+
+
+ 操作 |
+
+ 查看预案
+ |
+
+
+
+
+
+
+
-
-
+
+
\ No newline at end of file
diff --git a/src/app/plan-management/reinforce-plan/reinforce-plan.component.ts b/src/app/plan-management/reinforce-plan/reinforce-plan.component.ts
index 582c543..0e32997 100644
--- a/src/app/plan-management/reinforce-plan/reinforce-plan.component.ts
+++ b/src/app/plan-management/reinforce-plan/reinforce-plan.component.ts
@@ -74,8 +74,7 @@ export class ReinforcePlanComponent implements OnInit {
"level",
"addtime",
"plantype",
- "auditStatus",
- "weihuStatus",
+ "auditstate",
"openRange",
"projectlevel",
"operation",
diff --git a/src/app/plan-management/type-plan/type-plan.component.html b/src/app/plan-management/type-plan/type-plan.component.html
index 5c300fe..c3e7939 100644
--- a/src/app/plan-management/type-plan/type-plan.component.html
+++ b/src/app/plan-management/type-plan/type-plan.component.html
@@ -142,9 +142,12 @@
{{element.planLevel=='1'?'总队':element.planLevel=='2'?'支队':element.planLevel=='4'?'大队':'中队'}} |
-
- 维护审核 |
- {{element.maintenanceVerifyState}} |
+
+
+ 审核状态 |
+
+ {{element.auditStatus | auditState}}
+ |
操作 |
diff --git a/src/app/plan-management/type-plan/type-plan.component.ts b/src/app/plan-management/type-plan/type-plan.component.ts
index 012c2b3..3b7e007 100644
--- a/src/app/plan-management/type-plan/type-plan.component.ts
+++ b/src/app/plan-management/type-plan/type-plan.component.ts
@@ -114,7 +114,7 @@ export class TypePlanComponent implements OnInit {
"isopen",
"projectlevel",
"passstate",
- "weihustate",
+ "auditstate",
"operation",
];
tabledataSource;
diff --git a/src/index.html b/src/index.html
index d0aa01d..a6899a6 100644
--- a/src/index.html
+++ b/src/index.html
@@ -24,9 +24,9 @@
securityJsCode: 'dca2583973d0448116433fd64f97f8f8'
}
-
-
+ -->