邵佳豪 4 years ago
parent
commit
b596452e71
  1. 3
      src/app/examiner/create-test-score/create-test-score.component.html
  2. 89
      src/app/examiner/create-test-score/create-test-score.component.ts
  3. 32
      src/app/examiner/create-test-score/finishDialog.html
  4. 44
      src/app/examiner/create-test-score/finishDialog.scss
  5. 2
      src/app/examiner/examiner-index/examiner-index.component.scss
  6. 4
      src/app/examiner/examiner-new-one/examiner-new-one.component.html
  7. 13
      src/app/examiner/examiner-new-one/examiner-new-one.component.ts
  8. 7
      src/app/examiner/examiner.module.ts
  9. 2
      src/app/navigation/navigation.component.ts
  10. 9
      src/app/tabbar/tabbar.component.ts
  11. 2008
      src/assets/css/time.scss
  12. 1
      src/styles.scss

3
src/app/examiner/create-test-score/create-test-score.component.html

@ -296,7 +296,8 @@
<div class="btn" (click)="goBack()">
上一步
</div>
<div class="btn" (click)="save()">
<div class="btn" (click)="finishClick()">
<!-- <div class="btn" (click)="save()"> -->
完成
</div>
</div>

89
src/app/examiner/create-test-score/create-test-score.component.ts

@ -3,6 +3,11 @@ import { HttpClient } from '@angular/common/http';
import { Component, Inject, OnInit, ViewChild } from '@angular/core';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatTableDataSource } from '@angular/material/table';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { NzDatePickerModule } from 'ng-zorro-antd/date-picker';
import { DisabledTimeFn, DisabledTimePartial } from 'ng-zorro-antd/date-picker';
import getISOWeek from 'date-fns/getISOWeek';
import setHours from 'date-fns/setHours';
import { NzFormatEmitEvent, NzTreeComponent } from 'ng-zorro-antd/tree';
@Component({
selector: 'app-create-test-score',
@ -11,7 +16,7 @@ import { NzFormatEmitEvent, NzTreeComponent } from 'ng-zorro-antd/tree';
})
export class CreateTestScoreComponent implements OnInit {
constructor(public dialog: MatDialog,private http: HttpClient) { }
constructor(public dialog: MatDialog,private http: HttpClient,public snackBar: MatSnackBar) { }
selectedTab:number = 1 //选中的选项卡
selectTab(index){
this.selectedTab = index
@ -1027,6 +1032,18 @@ export class CreateTestScoreComponent implements OnInit {
goBack(){
window.history.back();
}
//完成按钮
finishClick(){
const dialogRef = this.dialog.open(FinishDialog, {
width: '700px',
height: '300px',
data: {}
});
dialogRef.afterClosed().subscribe(result => {
console.log('The dialog was closed');
});
}
}
//添加预案1
@ -1114,6 +1131,74 @@ export class AddPlanTwoDialog {
}
//完成弹窗
@Component({
selector: 'finish-dialog',
templateUrl: 'finishDialog.html',
styleUrls: ['finishDialog.scss']
})
export class FinishDialog{
constructor(public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef<AddPlanTwoDialog>,@Inject(MAT_DIALOG_DATA) public data: any) {}
ngOnInit(): void {
}
startTime:string
endTime:string
date=null
timeDefaultValue = setHours(new Date(), 0);
disabledDateTime: DisabledTimeFn = () => {
var second=[]
for(var i=1;i<60;i++){
second.push(i)
}
return {
nzDisabledHours: () => [],
nzDisabledMinutes: () => [],
nzDisabledSeconds: () => second
};
};
onNoClick(): void {
//this.dialogRef.close();
const config = new MatSnackBarConfig();
if(this.startTime!=undefined&&this.endTime!=undefined){
if(this.startTime>this.endTime){
this.snackBar.open('开始时间不能大于结束时间','确定',config);
}
else{
//截取字符串,得到日期部分"2009-12-02",用split把字符串分隔成数组
var begin1=this.startTime.substr(0,10).split("-");
var end1=this.endTime.substr(0,10).split("-");
//将拆分的数组重新组合,并实例成化新的日期对象
var date1=new Date(begin1[1] + - + begin1[2] + - + begin1[0]);
var date2=new Date(end1[1] + - + end1[2] + - + end1[0]);
//得到两个日期之间的差值m,以分钟为单位
var m=Number(Math.abs(Number(date2)-Number(date1))/1000/60);
//小时数和分钟数相加得到总的分钟数
var min1=parseInt(this.startTime.substr(11,2))*60+parseInt(this.startTime.substr(14,2));
var min2=parseInt(this.endTime.substr(11,2))*60+parseInt(this.endTime.substr(14,2));
//两个分钟数相减得到时间部分的差值,以分钟为单位
var n=min2-min1;
//将日期和时间两个部分计算出来的差值相加,即得到两个时间相减后的分钟数
var minutes=m+n;
this.dialogRef.close();
console.log(minutes)
}
}
else{
this.snackBar.open('请输入开始或结束时间','确定',config);
}
}
onChange(result: Date[]): void {
console.log('onChange: ', result);
}
getWeek(result: Date[]): void {
console.log('week: ', result.map(getISOWeek));
}
}
//查看答案
@Component({
@ -1139,4 +1224,4 @@ export class LookTreeNodeDialog {
this.dialogRef.close();
}
}
}

32
src/app/examiner/create-test-score/finishDialog.html

@ -0,0 +1,32 @@
<!--
* @Descripttion:
* @version:
* @Author: sueRimn
* @Date: 2020-12-13 10:57:48
* @LastEditors: sueRimn
* @LastEditTime: 2020-12-14 10:23:32
-->
<div class="box">
<div class="diaone">
<div><label>请填写试卷类型:</label></div>
<div><input placeholder="请填写"></div>
</div>
<div class="diatwo">
<div class="starttime">
<div><label>请选择开始时间</label></div>
<!-- <div><nz-range-picker class="datepicker" nzFormat="yyyy-MM-dd HH:mm" [nzShowTime]="{ nzHideDisabledOptions: true, nzDefaultOpenValue: timeDefaultValue }" [nzDisabledTime]="disabledDateTime" [(ngModel)]="date" (ngModelChange)="onChange($event)"></nz-range-picker>
</div> -->
<div><input type="datetime-local" name="start_time" value="" [(ngModel)]="startTime" /></div>
</div>
<div class="endtime">
<div><label>请选择结束时间</label></div>
<div><input type="datetime-local" name="end_time" value="" [(ngModel)]="endTime"/></div>
</div>
</div>
<div mat-dialog-actions style="margin-top: 20px;">
<button mat-button (click)="onNoClick()" style="background-color: #07CDCF;margin-left: 200px;">确定</button>
<button mat-button [mat-dialog-close]="data.animal" style=" background-color: #FF8678;margin-left: 25px;">取消</button>
</div>
</div>

44
src/app/examiner/create-test-score/finishDialog.scss

@ -0,0 +1,44 @@
.box{
display: flex;
flex-direction: column;
margin-left: 20px;
input{
width: 260px;
height: 40px;
line-height: 34px;
border-radius: 5px;
padding-left: 5px;
outline: none;
border: 1px solid rgb(226, 211, 211);
}
.diaone{
display: flex;
flex-direction: column;
button {
border: none;
color: white;
padding: 5px 25px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
border-radius: 8px;
outline:0 none !important;
}
}
.diatwo{
margin-top: 20px;
display: flex;
flex-direction: row;
.endtime{
margin-left: 20px;
}
.datepicker{
height: 44px;
border-radius: 5px;
}
}
}

2
src/app/examiner/examiner-index/examiner-index.component.scss

@ -64,7 +64,7 @@ table {
table{
td,th{
height: 48px;
font-size: 18px;
font-size: 16px;
}
td{
border-bottom: 1px solid #F2F5F6;

4
src/app/examiner/examiner-new-one/examiner-new-one.component.html

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2020-12-11 16:34:26
* @LastEditors: sueRimn
* @LastEditTime: 2020-12-13 09:43:19
* @LastEditTime: 2020-12-14 10:46:59
-->
<div class="content">
<div class="contentLeft">
@ -108,7 +108,7 @@
</table>
</div>
<div class="rightthree">
<button mat-raised-button style="background-color: #07CDCF;margin-left: 100px;width: 120px;" color="primary" (click)="nextClick()">下一步</button>
<button mat-raised-button style="background-color: #07CDCF;margin-left: 100px;margin-top: 20px; width: 120px;" color="primary" (click)="nextClick()">下一步</button>
</div>
</div>
</div>

13
src/app/examiner/examiner-new-one/examiner-new-one.component.ts

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2020-12-11 16:34:26
* @LastEditors: sueRimn
* @LastEditTime: 2020-12-13 10:13:54
* @LastEditTime: 2020-12-14 11:14:49
*/
import { Component, OnInit, ViewChild, Inject } from '@angular/core';
import { HttpClient } from '@angular/common/http'
@ -246,7 +246,7 @@ export class ExaminerNewOneComponent implements OnInit {
}
//得到当前单位信息
getunitdata(){
this.http.get("/api/Account/Profiles").subscribe(
this.http.get("/api/ExamAccounts/Profiles").subscribe(
(data:any)=>{
this.organizationName = data.organizationName
}
@ -268,7 +268,7 @@ export class ExaminerNewOneComponent implements OnInit {
}
});
});
this.http.get("/api/Account/Profiles").subscribe(
this.http.get("/api/ExamAccounts/Profiles").subscribe(
(data:any)=>{
this.organizationName = data.organizationName
if(this.organizationName){
@ -341,7 +341,12 @@ export class ExaminerNewOneComponent implements OnInit {
}
//下一步事件
nextClick(){
//console.log(this.selectedunitArr)
console.log(this.selectedunitArr)
/* var workDate=[]
for(var i=0;i<this.selectedunitArr.length;i++){
workDate.push(this.selectedunitArr[i].buildingTypes)
}
console.log(workDate) */
localStorage.setItem("checkedWork",JSON.stringify(this.selectedunitArr) )
this.router.navigateByUrl("/examiner/create-test-score")
}

7
src/app/examiner/examiner.module.ts

@ -46,15 +46,15 @@ import { ReactiveFormsModule, FormsModule } from '@angular/forms';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatPaginatorIntl } from '@angular/material/paginator';
import { myPaginator } from '../ui/my-paginator';
import { AddPlanDialog, AddPlanTwoDialog, CreateTestScoreComponent, LookTreeNodeDialog } from './create-test-score/create-test-score.component';
import { AddPlanDialog, AddPlanTwoDialog, CreateTestScoreComponent,FinishDialog,LookTreeNodeDialog } from './create-test-score/create-test-score.component';
import { NavigationModule } from '../navigation/navigation.module';
import { NzTreeModule } from 'ng-zorro-antd/tree';
import { ExaminerIndexComponent } from './examiner-index/examiner-index.component';
import { ExaminerNewOneComponent } from './examiner-new-one/examiner-new-one.component';
import { NzDatePickerModule } from 'ng-zorro-antd/date-picker';
@NgModule({
declarations: [CreateTestScoreComponent,AddPlanDialog,AddPlanTwoDialog,LookTreeNodeDialog,ExaminerIndexComponent, ExaminerNewOneComponent],
declarations: [CreateTestScoreComponent,AddPlanDialog,AddPlanTwoDialog,LookTreeNodeDialog,ExaminerIndexComponent, ExaminerNewOneComponent,FinishDialog],
imports: [
CommonModule,
examinerRoutingModule,
@ -104,6 +104,7 @@ import { ExaminerNewOneComponent } from './examiner-new-one/examiner-new-one.com
FormsModule,
NavigationModule,
NzTreeModule,
NzDatePickerModule,
],
providers: [ { provide: MatPaginatorIntl, useValue: myPaginator() } ]
})

2
src/app/navigation/navigation.component.ts

@ -23,7 +23,7 @@ export class NavigationComponent implements OnInit {
selectedDataBank:any //当前选中的资料库
hoverDataBank:any//当前鼠标移入的资料库
isOneClick:boolean //是否第一次进入网页
leftMenuname=""
leftMenuname="found"
//左侧菜单点击事件
clickLeftmenu(name){

9
src/app/tabbar/tabbar.component.ts

@ -1,3 +1,11 @@
/*
* @Descripttion:
* @version:
* @Author: sueRimn
* @Date: 2020-12-13 10:18:14
* @LastEditors: sueRimn
* @LastEditTime: 2020-12-14 10:29:32
*/
import { Component, OnInit,Output,EventEmitter } from '@angular/core';
import { HttpClient } from '@angular/common/http'
import { Router,ActivatedRoute } from '@angular/router'
@ -49,6 +57,7 @@ export class TabbarComponent implements OnInit {
config.duration = 3000
this.snackBar.open('退出成功','确定',config);
})
localStorage.removeItem("checkedWork")
} //if
}

2008
src/assets/css/time.scss

File diff suppressed because it is too large Load Diff

1
src/styles.scss

@ -2,6 +2,7 @@
@import './app/theme.scss';
// @import "~ng-zorro-antd/date-picker/style/index.min.css"; /* 引入组件样式 */
@import "./assets/css/ngZorroTree.css"; /* 引入组件样式 */
@import "./assets/css/time.scss";
html,body{
width: 100%;
height: 100%;

Loading…
Cancel
Save