Browse Source

拉取代码

maotao 8 months ago
parent
commit
1c39105524

+ 5 - 3
src/app/share/wang-editor/wang-editor.component.less

@@ -1,10 +1,12 @@
1 1
 .wangeditor-box {
2
-  overflow: auto;
2
+  overflow-y: auto;
3 3
   height: 100%;
4
-
4
+	width: 100%;
5 5
   #editor{
6 6
     height: 300px;
7
-    width: auto;
7
+		// max-height: 300px;
8
+		// overflow-y: auto;
9
+    // width: 100%;
8 10
     border:1px solid #ccc;
9 11
 		border-top: none;
10 12
   }

+ 1 - 0
src/app/share/wang-editor/wang-editor.component.ts

@@ -130,6 +130,7 @@ export class wangEditorComponent implements OnInit {
130 130
 	  // 富文本编辑器内容变化触发方法
131 131
 	  editorContentChange = (html) => {
132 132
 	    console.log(html);
133
+			this.changeContent.emit(html)
133 134
 	  }
134 135
 	
135 136
 	  // 编辑器获取到焦点触发事件

+ 6 - 30
src/app/views/repository-manage-add/repository-manage-add.component.html

@@ -1,19 +1,7 @@
1 1
 <div class="detail-box">
2 2
   <div class="modalBody">
3
-    <overlay-scrollbars #osComponentRef1 class="content">
3
+    <!-- <overlay-scrollbars #osComponentRef1 class="content"> -->
4 4
      <form nz-form [formGroup]="validateForm" class="addForm">
5
-<!--     	<nz-form-item class="form-item">
6
-     	  <nz-form-label nzRequired nzFor="code">编号</nz-form-label>
7
-     	  <nz-form-control nzErrorTip="请输入编号!">
8
-     			<input nz-input formControlName="code"  placeholder="请输入编号" nzSize="default" />
9
-     	  </nz-form-control>
10
-     	</nz-form-item>
11
-			<nz-form-item class="form-item">
12
-			  <nz-form-label nzRequired nzFor="version">版本号</nz-form-label>
13
-			  <nz-form-control nzErrorTip="请输入版本号!">
14
-					<input nz-input formControlName="version"  placeholder="请输入版本号" nzSize="default" />
15
-			  </nz-form-control>
16
-			</nz-form-item> -->
17 5
 			<div class="left-form-box">
18 6
 				<nz-form-item class="form-title-box" *ngIf="!add">
19 7
 					<div class="form-title">知识库编号:{{solutionNumber}}</div>
@@ -72,12 +60,10 @@
72 60
 				<nz-form-item class="form-item" *ngIf="classItem==1">
73 61
 				  <nz-form-label nzRequired nzFor="malfunction" [nzSm]="6" [nzXs]="24">关联故障现象</nz-form-label>
74 62
 				  <nz-form-control nzErrorTip="请选择关联故障现象!" [nzSm]="16" [nzXs]="24">
75
-				    <nz-input-group>
76
-							<nz-cascader [nzOptions]="malfunctionData" 
77
-								formControlName="malfunction" 
78
-								nzPlaceHolder="请选择关联故障现象">
79
-							</nz-cascader>
80
-						</nz-input-group>
63
+						<nz-cascader [nzOptions]="malfunctionData" 
64
+							formControlName="malfunction" 
65
+							nzPlaceHolder="请选择关联故障现象">
66
+						</nz-cascader>
81 67
 				  </nz-form-control>
82 68
 				</nz-form-item>
83 69
 				
@@ -102,13 +88,10 @@
102 88
 				  <nz-form-control [nzSm]="16" [nzXs]="24">
103 89
 						<nz-upload nzFor="file"
104 90
 						  class="avatar-uploader"
105
-						  nzAction="https://jsonplaceholder.typicode.com/posts/"
106
-							[nzCustomRequest]="customReq"
107 91
 						  nzName="file"
108 92
 							[(nzFileList)]="fileData"
109 93
 							[(nzRemove)]="removeFile"
110 94
 						  [nzBeforeUpload]="beforeUpload"
111
-						  (nzChange)="handleChange($event)"
112 95
 						>
113 96
 						  <button nz-button><i nz-icon nzType="upload"></i><span>点击上传</span></button>
114 97
 							<div class="upload-sign">支持扩展名:PDF、word、ppt、excel、txt...</div>
@@ -118,7 +101,7 @@
118 101
 			</div>
119 102
 			
120 103
      </form>
121
-    </overlay-scrollbars>
104
+    <!-- </overlay-scrollbars> -->
122 105
  
123 106
   </div>
124 107
 	<div class="display_flex justify-content_flex-center form-btn">
@@ -134,12 +117,5 @@
134 117
 <!-- 操作成功/失败提示框 -->
135 118
 <app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
136 119
   [info]="promptInfo" (closeModel)="closeModel()"></app-prompt-modal>
137
-	
138
-<!-- 删除模态框 -->
139
-  <app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
140
-    (confirmDelEvent)="confirmDel()" content="您确认要删除发药科室吗?"></app-dialog-delete>
141 120
 
142
-<!-- 单发/箱发 -->
143
-  <app-dialog-delete [delModal]="delGrantModal" (hideDelModalEvent)="hideGrantModal()" [btnLoading]="btnLoading"
144
-    (confirmDelEvent)="confirmGrantDel()" [content]="content"></app-dialog-delete>
145 121
 

+ 2 - 0
src/app/views/repository-manage-add/repository-manage-add.component.less

@@ -57,6 +57,7 @@ h3{
57 57
 	justify-content: center;
58 58
 	padding: 20px;
59 59
 	position: relative;
60
+	overflow-x: hidden;
60 61
 	.modalBody{
61 62
 		height: 100%;
62 63
 		position: relative;
@@ -91,6 +92,7 @@ h3{
91 92
 		}
92 93
 	  .ant-form-item {
93 94
 	    margin-bottom: 14px;
95
+			display: flex;
94 96
 	    .ant-form-item-label {
95 97
 	      text-align: right;
96 98
 	    }

+ 31 - 73
src/app/views/repository-manage-add/repository-manage-add.component.ts

@@ -84,6 +84,7 @@ export class RepositoryManageAddComponent implements OnInit {
84 84
   pageIndex: number = 1; //页码
85 85
   listLength: number = 10; //总条数
86 86
   pageSize: number = 10; //每页条数
87
+	btnLoading: boolean = false; //确认按钮loading状态
87 88
   btnLoading1: boolean = false; //确认按钮loading状态
88 89
 	btnLoading2: boolean = false; //确认按钮loading状态
89 90
   printLoading: boolean = false; //批量打印按钮loading状态
@@ -98,7 +99,8 @@ export class RepositoryManageAddComponent implements OnInit {
98 99
 	malfunctionData: any = []; //故障现象数据
99 100
 	productData: any = []; //产品数据
100 101
 	typeDic:any = []; //知识库状态字典
101
-	fileData:any[] = []; //附件数据
102
+	fileData: UploadFile[] = [];//附件数据
103
+	fileAllData:any[] = []; //附件数据
102 104
 	building:''; //楼栋
103 105
 	deptIndex:number; //选中index
104 106
   searchParentDeptSubject = new Subject();
@@ -110,8 +112,8 @@ export class RepositoryManageAddComponent implements OnInit {
110 112
 	isDeptLoading = false;
111 113
 	delGrantModal = false;
112 114
 	showInsp = false;
113
-  changeInp(e, type) {
114
-    this.searchParentDeptSubject.next([e, type]);
115
+  changeInp(e) {
116
+    this.searchParentDeptSubject.next([e]);
115 117
   }
116 118
 
117 119
 	// 获取详情
@@ -136,7 +138,8 @@ export class RepositoryManageAddComponent implements OnInit {
136 138
 				this.detailData = data
137 139
 				this.solutionNumber = data.solutionNumber
138 140
 				this.versionNumber = data.versionNumber
139
-				this.detailContent = data.content || ''
141
+				this.detailContent = data.content || null
142
+				this.editOrData = data.content || null
140 143
 				let item = this.dicData.find(i=>i.id == this.detailData.type.id)
141 144
 				if(item){
142 145
 					this.classItem = item.value
@@ -152,7 +155,6 @@ export class RepositoryManageAddComponent implements OnInit {
152 155
 				this.isSpinning = false
153 156
 			});
154 157
 	}
155
-	fileAllData=null;
156 158
 	getFile(){
157 159
 		this.mainService
158 160
 			.getPreviewImage('solution', this.detailId)
@@ -187,8 +189,10 @@ export class RepositoryManageAddComponent implements OnInit {
187 189
 		this.mainService
188 190
 		  .getFetchDataList("data", "assetProduct", postData)
189 191
 		  .subscribe((result) => {
190
-				this.isDeptLoading = false
191
-				this.productData = result.list;
192
+				setTimeout(_=>{
193
+					this.isDeptLoading = false
194
+					this.productData = result.list;
195
+				},500)
192 196
 		  });
193 197
 	}
194 198
 	
@@ -206,6 +210,7 @@ export class RepositoryManageAddComponent implements OnInit {
206 210
 		  return;
207 211
 		};
208 212
 		let postData = {
213
+			hasThird: 'true',
209 214
 		  category: {
210 215
 		    dutyIds: this.currentHospital.type.value === '6' ? this.currentHospital.id.toString()  : undefined,
211 216
 		  },
@@ -306,7 +311,7 @@ export class RepositoryManageAddComponent implements OnInit {
306 311
 	  let data = {
307 312
 			title:this.validateForm.value.title,
308 313
 			repairVisible:this.validateForm.value.repairVisible,
309
-			content:this.editOrData,
314
+			content:this.editOrData?this.editOrData:null,
310 315
 			id:'',
311 316
 			hosId:this.hosId,
312 317
 			inspectionForm:{
@@ -375,15 +380,15 @@ export class RepositoryManageAddComponent implements OnInit {
375 380
 	// 上传图片
376 381
 	uploadFile(id){
377 382
 		let url = `/service/common/common/uploadAttachment/solution/${id}/${id}`
383
+		const formData = new FormData()
378 384
 		for(let i of this.fileData){//新上传的附件
379 385
 			let item = this.fileAllData.find(t=>t.id == i.uid) //之前的附件
380 386
 			if(!item){
381
-				const formData = new FormData();
382 387
 				if(i.originFileObj){
383 388
 					formData.append('file', i.originFileObj);
384 389
 					formData.append('filename', i.originFileObj.name);
385 390
 				}else{
386
-					formData.append('file', i);
391
+					formData.append('file', i as any);
387 392
 					formData.append('filename', i.name);
388 393
 				}
389 394
 				
@@ -427,42 +432,25 @@ export class RepositoryManageAddComponent implements OnInit {
427 432
 		});
428 433
   }
429 434
 	
430
-	avatarLoading = false;
431
-	avatarUrl: string;
432
-	avatarUrl1: string;
433
-	beforeUpload = (file: File) => {
435
+	beforeUpload = (file: UploadFile) => {
434 436
 		console.log(888,file)
435
-	  return new Observable((observer: Observer<boolean>) => {
436
-			let type = file.name.split('.')
437
-	    const isPic = (type[1] === 'xlsx' || type[1] === 'pdf' || 
438
-			type[1] === 'xls' || type[1] === 'ppt' || type[1] === 'txt');
439
-	    if (!isPic) {
440
-	      this.message.error('只能上传PDF、word、ppt、excel、txt等文件类型格式!');
441
-	      observer.complete();
442
-	      return;
443
-	    }
444
-	    const isLt4M = file.size / 1024 / 1024 < 10;
445
-	    if (!isLt4M) {
446
-	      this.message.error('图片大小不能大于10MB!');
447
-	      observer.complete();
448
-	      return;
449
-	    }
450
-	    observer.next(isPic && isLt4M);
451
-	    observer.complete();
452
-	  });
437
+		let type = file.name.split('.')
438
+		const isPic = (type[1] === 'xlsx' || type[1] === 'pdf' || 
439
+		type[1] === 'xls' || type[1] === 'ppt' || type[1] === 'txt' ||
440
+		type[1] === 'doc' || type[1] === 'docx');
441
+		if (!isPic) {
442
+			this.message.error('只能上传PDF、word、ppt、excel、txt等文件类型格式!');
443
+			return;
444
+		}
445
+		const isLt4M = file.size / 1024 / 1024 < 10;
446
+		if (!isLt4M) {
447
+			this.message.error('图片大小不能大于10MB!');
448
+			return;
449
+		} 
450
+		this.fileData = this.fileData.concat(file);
451
+		return false;
453 452
 	};
454 453
 	
455
-	// 附件上传
456
-	handleChange(info: { file: UploadFile }): void {
457
-
458
-	}
459
-	
460
-	private getBase64(img: File, callback: (img: string) => void): void {
461
-	  const reader = new FileReader();
462
-	  reader.addEventListener('load', () => callback(reader.result!.toString()));
463
-	  reader.readAsDataURL(img);
464
-	}
465
-	
466 454
 	// 删除附件
467 455
 	removeFile = (file) =>  {
468 456
 		console.log(111,file)
@@ -485,36 +473,6 @@ export class RepositoryManageAddComponent implements OnInit {
485 473
 		
486 474
 	}
487 475
 	
488
-	// 自定义上传
489
-	customReq = (item: UploadXHRArgs) => {
490
-	  const formData = new FormData();
491
-	  // tslint:disable-next-line:no-any
492
-	  formData.append('file', item.file as any);
493
-	  formData.append('filename', item.file.name);
494
-	  const req = new HttpRequest('POST', item.action!, formData, {
495
-	    reportProgress: true,
496
-	    withCredentials: true
497
-	  });
498
-	  // Always returns a `Subscription` object. nz-upload would automatically unsubscribe it at correct time.
499
-	  return this.http.request(req).subscribe(
500
-	    // tslint:disable-next-line no-any
501
-	    (event: HttpEvent<any>) => {
502
-	      if (event.type === HttpEventType.UploadProgress) {
503
-	        if (event.total! > 0) {
504
-	          // tslint:disable-next-line:no-any
505
-	          (event as any).percent = (event.loaded / event.total!) * 100;
506
-	        }
507
-	        item.onProgress!(event, item.file!);
508
-	      } else if (event instanceof HttpResponse) {
509
-	        item.onSuccess!(event.body, item.file!, event);
510
-	      }
511
-	    },
512
-	    err => {
513
-	      item.onError!(err, item.file!);
514
-	    }
515
-	  );
516
-	};
517
-	
518 476
 	closeModel(){
519 477
 		this.initForm();
520 478
 		this.back()

+ 1 - 1
src/app/views/repository-manage/repository-manage.component.html

@@ -90,7 +90,7 @@
90 90
 						 <div class="width-180" *ngIf="lookData.type.name=='日常巡检'">关联巡检:{{lookData.inspectionForm?lookData.inspectionForm.name: ''}}</div>
91 91
 						 <div>关联产品:{{lookData.assetProduct?lookData.assetProduct.name:''}}</div>
92 92
 					 </div>
93
-					 <div class="content-class" [innerHTML]="richText"></div>
93
+					 <div class="content-class" *ngIf="richText" [innerHTML]="richText"></div>
94 94
 					 <div class="file-box" *ngIf="fileData.length>0">
95 95
 						 <div>附件列表:</div>
96 96
 						 <div>

+ 12 - 2
src/app/views/repository-manage/repository-manage.component.ts

@@ -185,7 +185,12 @@ export class RepositoryManageComponent implements OnInit {
185 185
 		this.vIndex = index
186 186
 		this.lookData = data
187 187
 		this.stepLength = this.lookData.solutionLogs.length
188
-		this.richText = this.sanitizer.bypassSecurityTrustHtml(data.content);
188
+		let content = data.content
189
+		if(content){
190
+			this.richText = this.sanitizer.bypassSecurityTrustHtml(content);
191
+		}else{
192
+			this.richText = ''
193
+		}
189 194
 	}
190 195
 	
191 196
 	// 点击附件
@@ -310,7 +315,12 @@ export class RepositoryManageComponent implements OnInit {
310 315
 				this.getFile()
311 316
 				let data = res.list
312 317
 				this.detailData = data
313
-				this.richText = this.sanitizer.bypassSecurityTrustHtml(data[0].content);
318
+				let content = data[0].content
319
+				if(content){
320
+					this.richText = this.sanitizer.bypassSecurityTrustHtml(content);
321
+				}else{
322
+					this.richText = ''
323
+				}
314 324
 				for(let i of data){
315 325
 					if(i.solutionLogs.length>0){
316 326
 						for(let t of i.solutionLogs){

+ 95 - 3
src/assets/iconfont/demo_index.html

@@ -55,6 +55,30 @@
55 55
           <ul class="icon_lists dib-box">
56 56
           
57 57
             <li class="dib">
58
+              <span class="icon icon_transport">&#xe689;</span>
59
+                <div class="name">快速报修</div>
60
+                <div class="code-name">&amp;#xe689;</div>
61
+              </li>
62
+          
63
+            <li class="dib">
64
+              <span class="icon icon_transport">&#xe648;</span>
65
+                <div class="name">bg-question</div>
66
+                <div class="code-name">&amp;#xe648;</div>
67
+              </li>
68
+          
69
+            <li class="dib">
70
+              <span class="icon icon_transport">&#xe610;</span>
71
+                <div class="name">关闭</div>
72
+                <div class="code-name">&amp;#xe610;</div>
73
+              </li>
74
+          
75
+            <li class="dib">
76
+              <span class="icon icon_transport">&#xe622;</span>
77
+                <div class="name">关闭</div>
78
+                <div class="code-name">&amp;#xe622;</div>
79
+              </li>
80
+          
81
+            <li class="dib">
58 82
               <span class="icon icon_transport">&#xe611;</span>
59 83
                 <div class="name">Icon - 统计分析</div>
60 84
                 <div class="code-name">&amp;#xe611;</div>
@@ -780,9 +804,9 @@
780 804
 <pre><code class="language-css"
781 805
 >@font-face {
782 806
   font-family: 'icon_transport';
783
-  src: url('iconfont.woff2?t=1721896916365') format('woff2'),
784
-       url('iconfont.woff?t=1721896916365') format('woff'),
785
-       url('iconfont.ttf?t=1721896916365') format('truetype');
807
+  src: url('iconfont.woff2?t=1722576999612') format('woff2'),
808
+       url('iconfont.woff?t=1722576999612') format('woff'),
809
+       url('iconfont.ttf?t=1722576999612') format('truetype');
786 810
 }
787 811
 </code></pre>
788 812
           <h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
@@ -809,6 +833,42 @@
809 833
         <ul class="icon_lists dib-box">
810 834
           
811 835
           <li class="dib">
836
+            <span class="icon icon_transport transport-kuaisubaoxiu"></span>
837
+            <div class="name">
838
+              快速报修
839
+            </div>
840
+            <div class="code-name">.transport-kuaisubaoxiu
841
+            </div>
842
+          </li>
843
+          
844
+          <li class="dib">
845
+            <span class="icon icon_transport transport-bg-question"></span>
846
+            <div class="name">
847
+              bg-question
848
+            </div>
849
+            <div class="code-name">.transport-bg-question
850
+            </div>
851
+          </li>
852
+          
853
+          <li class="dib">
854
+            <span class="icon icon_transport transport-guanbi2"></span>
855
+            <div class="name">
856
+              关闭
857
+            </div>
858
+            <div class="code-name">.transport-guanbi2
859
+            </div>
860
+          </li>
861
+          
862
+          <li class="dib">
863
+            <span class="icon icon_transport transport-guanbi3"></span>
864
+            <div class="name">
865
+              关闭
866
+            </div>
867
+            <div class="code-name">.transport-guanbi3
868
+            </div>
869
+          </li>
870
+          
871
+          <li class="dib">
812 872
             <span class="icon icon_transport transport-Icon-tongjifenxi"></span>
813 873
             <div class="name">
814 874
               Icon - 统计分析
@@ -1899,6 +1959,38 @@
1899 1959
           
1900 1960
             <li class="dib">
1901 1961
                 <svg class="icon svg-icon" aria-hidden="true">
1962
+                  <use xlink:href="#transport-kuaisubaoxiu"></use>
1963
+                </svg>
1964
+                <div class="name">快速报修</div>
1965
+                <div class="code-name">#transport-kuaisubaoxiu</div>
1966
+            </li>
1967
+          
1968
+            <li class="dib">
1969
+                <svg class="icon svg-icon" aria-hidden="true">
1970
+                  <use xlink:href="#transport-bg-question"></use>
1971
+                </svg>
1972
+                <div class="name">bg-question</div>
1973
+                <div class="code-name">#transport-bg-question</div>
1974
+            </li>
1975
+          
1976
+            <li class="dib">
1977
+                <svg class="icon svg-icon" aria-hidden="true">
1978
+                  <use xlink:href="#transport-guanbi2"></use>
1979
+                </svg>
1980
+                <div class="name">关闭</div>
1981
+                <div class="code-name">#transport-guanbi2</div>
1982
+            </li>
1983
+          
1984
+            <li class="dib">
1985
+                <svg class="icon svg-icon" aria-hidden="true">
1986
+                  <use xlink:href="#transport-guanbi3"></use>
1987
+                </svg>
1988
+                <div class="name">关闭</div>
1989
+                <div class="code-name">#transport-guanbi3</div>
1990
+            </li>
1991
+          
1992
+            <li class="dib">
1993
+                <svg class="icon svg-icon" aria-hidden="true">
1902 1994
                   <use xlink:href="#transport-Icon-tongjifenxi"></use>
1903 1995
                 </svg>
1904 1996
                 <div class="name">Icon - 统计分析</div>

+ 19 - 3
src/assets/iconfont/iconfont.css

@@ -1,8 +1,8 @@
1 1
 @font-face {
2 2
   font-family: "icon_transport"; /* Project id 4543613 */
3
-  src: url('iconfont.woff2?t=1721896916365') format('woff2'),
4
-       url('iconfont.woff?t=1721896916365') format('woff'),
5
-       url('iconfont.ttf?t=1721896916365') format('truetype');
3
+  src: url('iconfont.woff2?t=1722576999612') format('woff2'),
4
+       url('iconfont.woff?t=1722576999612') format('woff'),
5
+       url('iconfont.ttf?t=1722576999612') format('truetype');
6 6
 }
7 7
 
8 8
 .icon_transport {
@@ -13,6 +13,22 @@
13 13
   -moz-osx-font-smoothing: grayscale;
14 14
 }
15 15
 
16
+.transport-kuaisubaoxiu:before {
17
+  content: "\e689";
18
+}
19
+
20
+.transport-bg-question:before {
21
+  content: "\e648";
22
+}
23
+
24
+.transport-guanbi2:before {
25
+  content: "\e610";
26
+}
27
+
28
+.transport-guanbi3:before {
29
+  content: "\e622";
30
+}
31
+
16 32
 .transport-Icon-tongjifenxi:before {
17 33
   content: "\e611";
18 34
 }

File diff suppressed because it is too large
+ 1 - 1
src/assets/iconfont/iconfont.js


+ 28 - 0
src/assets/iconfont/iconfont.json

@@ -6,6 +6,34 @@
6 6
   "description": "",
7 7
   "glyphs": [
8 8
     {
9
+      "icon_id": "18856229",
10
+      "name": "快速报修",
11
+      "font_class": "kuaisubaoxiu",
12
+      "unicode": "e689",
13
+      "unicode_decimal": 59017
14
+    },
15
+    {
16
+      "icon_id": "11882921",
17
+      "name": "bg-question",
18
+      "font_class": "bg-question",
19
+      "unicode": "e648",
20
+      "unicode_decimal": 58952
21
+    },
22
+    {
23
+      "icon_id": "4880431",
24
+      "name": "关闭",
25
+      "font_class": "guanbi2",
26
+      "unicode": "e610",
27
+      "unicode_decimal": 58896
28
+    },
29
+    {
30
+      "icon_id": "5712912",
31
+      "name": "关闭",
32
+      "font_class": "guanbi3",
33
+      "unicode": "e622",
34
+      "unicode_decimal": 58914
35
+    },
36
+    {
9 37
       "icon_id": "6334918",
10 38
       "name": "Icon - 统计分析",
11 39
       "font_class": "Icon-tongjifenxi",

BIN
src/assets/iconfont/iconfont.ttf


BIN
src/assets/iconfont/iconfont.woff


BIN
src/assets/iconfont/iconfont.woff2