Browse Source

[完善]修改bug

master
邵佳豪 3 years ago
parent
commit
484e09c49d
  1. 4
      src/app/examiner/create-test-score/create-test-score.component.html
  2. 4
      src/app/examiner/examiner-new-one/examiner-new-one.component.html
  3. 147
      src/app/student/student-index/student-index.component.ts
  4. 2
      src/app/ui/collection-tools-examinee/collection-tools.component.html
  5. 4
      src/app/ui/collection-tools-read/collection-tools.component.html

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

@ -281,14 +281,14 @@
<tr *ngFor="let item of unitId[selectedUnitIndex].planList">
<td>{{item.title}}</td>
<td>{{item.creatorName}}</td>
<td>{{item.modifiedTime | date:'yyyy-MM-dd'}}</td>
<td>{{item.modifiedTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
<td>{{item.isPublic ? '已公开' : '未公开'}}</td>
<td>{{item.planLevel | planlevel}}</td>
<td>
<input onchange="if(!value)value=0" (input)="planItemScore()" type="number" [(ngModel)]="item.score">
</td>
<td *ngIf="!(pattern=='look')">
<span style="color: #07CDCF;" (click)="edit(item)" >编辑</span>
<!-- <span style="color: #07CDCF;" (click)="edit(item)" >编辑</span> -->
<span style="color: #FF8678;" (click)="deletePlan(item)">删除</span>
</td>
</tr>

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

@ -20,7 +20,7 @@
<div><input type="text" name="shehui" [(ngModel)]="shehui" autocomplete="off" placeholder="请填写"></div>
</div>
<div class="queryField ordiv">
<div><label style="margin-right: 10px;position: relative;top: 5px;" >辖区中队:</label></div>
<div><label style="margin-right: 10px;position: relative;top: 5px;" >消防救援站:</label></div>
<div>
<input (click)="stopclose($event)" readonly autocomplete="off" [(ngModel)]="js" name="js" (focus)="openorganizationbox()" placeholder="请填写">
<mat-checkbox color="primary" style="margin-left: 6px;" [(ngModel)]="jscheck" name="jscheck">包含下级</mat-checkbox>
@ -67,7 +67,7 @@
<td mat-cell *matCellDef="let element">{{element.name}}</td>
</ng-container>
<ng-container matColumnDef="jurisdictionsquadron">
<th mat-header-cell *matHeaderCellDef>辖区中队</th>
<th mat-header-cell *matHeaderCellDef>消防救援站</th>
<td mat-cell *matCellDef="let element">{{element.organizationName}}</td>
</ng-container>

147
src/app/student/student-index/student-index.component.ts

@ -6,15 +6,15 @@
* @LastEditors: sueRimn
* @LastEditTime: 2020-12-24 10:49:54
*/
import { Component, OnInit, ViewChild, Inject,Input } from '@angular/core';
import {HttpClient} from '@angular/common/http'
import { Component, OnInit, ViewChild, Inject, Input } from '@angular/core';
import { HttpClient } from '@angular/common/http'
import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatPaginator } from '@angular/material/paginator';
import { MatTableDataSource } from '@angular/material/table';
import { PageEvent } from '@angular/material/paginator';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import {FormControl} from '@angular/forms';
import { Router,ActivatedRoute } from '@angular/router';
import { FormControl } from '@angular/forms';
import { Router, ActivatedRoute } from '@angular/router';
import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree';
import { FlatTreeControl } from '@angular/cdk/tree';
import { TreeService } from '../../http-interceptors/tree.service'
@ -26,16 +26,16 @@ import { TreeService } from '../../http-interceptors/tree.service'
})
export class StudentIndexComponent implements OnInit {
constructor(private router: Router,private activatedRoute: ActivatedRoute,public http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,private tree: TreeService) { }
constructor(private router: Router, private activatedRoute: ActivatedRoute, public http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, private tree: TreeService) { }
ngOnInit(): void {
this.getAlltabledate()
this.tableInterval=setInterval(()=>this.getAlltabledate(),60000)
this.tableInterval = setInterval(() => this.getAlltabledate(), 60000)
//this.gettime("2020-12-22T18:40:00+08:00","2020-12-22T18:39:00+08:00")
//this.idtime=setInterval(()=>this.newjsq(),1000)
//this.newjsq()
}
ngOnDestroy (){
ngOnDestroy() {
clearInterval(this.idtime)
clearInterval(this.tableInterval)
}
@ -44,59 +44,59 @@ export class StudentIndexComponent implements OnInit {
tableInterval
//分页
@ViewChild(MatPaginator, {static: true})
@ViewChild(MatPaginator, { static: true })
pageEvent: PageEvent;
paginator: MatPaginator;
length:any; //共多少条数据
pageSize:any; //每页条数
length: any; //共多少条数据
pageSize: any; //每页条数
pageSizeOptions: number[] = [10] //设置每页条数
PageNumber:any //第几页
startTime:[]
endTime:[]
PageNumber: any //第几页
startTime: []
endTime: []
tabledataSource//表格数据
timecha
//分页事件
chagePage(e){
this.PageNumber = e.pageIndex+1
chagePage(e) {
this.PageNumber = e.pageIndex + 1
this.getAlltabledate()
}
//获取表格信息
getAlltabledate(){
let paramsdata:any = {
getAlltabledate() {
let paramsdata: any = {
PageNumber: this.PageNumber || '1',
PageSize: this.pageSizeOptions[0],
PageSize: this.pageSizeOptions[0],
Sort: null,
SortType: null,
Status:1
Status: 1
}
this.http.get("/api/Papers",{params:paramsdata}).subscribe((data:any)=>{
this.tabledataSource=data.items
this.length=data.totalCount
this.http.get("/api/Papers", { params: paramsdata }).subscribe((data: any) => {
this.tabledataSource = data.items
this.length = data.totalCount
//console.log(this.tabledataSource)
})
}
//计时器
jishi(startTime,endTime){
jishi(startTime, endTime) {
//startTime=new Date
var nowtime = new Date(startTime), //获取开始时间
endtime = new Date(endTime); //定义结束时间
var jieshu=nowtime.getTime()
setInterval(()=>{jieshu--})
//console.log(endtime.getSeconds()-1)
var lefttime = jieshu - nowtime.getTime(), //距离结束时间的毫秒数
leftd = Math.floor(lefttime/(1000*60*60*24)), //计算天数
lefth = Math.floor(lefttime/(1000*60*60)), //计算小时数
leftm = Math.floor(lefttime/(1000*60)%60), //计算分钟数
lefts = Math.floor(lefttime/1000%60); //计算秒数
this.timecha=lefth+":"+leftm+":"+lefts
if(this.timecha=='0:0:0'){
this.timecha="已结束"
clearInterval(this.idtime)
}
console.log(this.timecha)
endtime = new Date(endTime); //定义结束时间
var jieshu = nowtime.getTime()
setInterval(() => { jieshu-- })
//console.log(endtime.getSeconds()-1)
var lefttime = jieshu - nowtime.getTime(), //距离结束时间的毫秒数
leftd = Math.floor(lefttime / (1000 * 60 * 60 * 24)), //计算天数
lefth = Math.floor(lefttime / (1000 * 60 * 60)), //计算小时数
leftm = Math.floor(lefttime / (1000 * 60) % 60), //计算分钟数
lefts = Math.floor(lefttime / 1000 % 60); //计算秒数
this.timecha = lefth + ":" + leftm + ":" + lefts
if (this.timecha == '0:0:0') {
this.timecha = "已结束"
clearInterval(this.idtime)
}
console.log(this.timecha)
}
@ -106,56 +106,61 @@ export class StudentIndexComponent implements OnInit {
time_end
//time_now_server=new Date("2020-12-22T18:30:00+08:00").getTime();//开始的时间
time_now_server
time_now_client=new Date().getTime();
time_now_client = new Date().getTime();
//time_server_client=this.time_now_server-this.time_now_client;
time_server_client
str_time=""
str_time = ""
gettime(endtime,stearttime){
this.time_end=new Date(endtime).getTime()
this.time_now_server=new Date(stearttime).getTime()
this.time_server_client=this.time_now_server-this.time_now_client
this.idtime=setInterval(()=>this.newtimer(),1000)
gettime(endtime, stearttime) {
this.time_end = new Date(endtime).getTime()
this.time_now_server = new Date(stearttime).getTime()
this.time_server_client = this.time_now_server - this.time_now_client
this.idtime = setInterval(() => this.newtimer(), 1000)
}
//新计时器
newtimer(){
newtimer() {
var time_distance;
var int_day,int_hour,int_minute,int_second;
var time_now=new Date().getTime();
time_now=time_now+this.time_server_client;
time_distance=this.time_end-time_now;
if(time_distance>0){
int_day=Math.floor(time_distance/86400000)
time_distance-=int_day*86400000;
int_hour=Math.floor(time_distance/3600000)
time_distance-=int_hour*3600000;
int_minute=Math.floor(time_distance/60000)
time_distance-=int_minute*60000;
int_second=Math.floor(time_distance/1000)
if(int_hour<10)
int_hour="0"+int_hour;
if(int_minute<10)
int_minute="0"+int_minute;
if(int_second<10)
int_second="0"+int_second;
this.str_time=int_hour+":"+int_minute+":"+int_second;
if(this.str_time=="00:00:00")
{this.str_time="已结束"}
var int_day, int_hour, int_minute, int_second;
var time_now = new Date().getTime();
time_now = time_now + this.time_server_client;
time_distance = this.time_end - time_now;
if (time_distance > 0) {
int_day = Math.floor(time_distance / 86400000)
time_distance -= int_day * 86400000;
int_hour = Math.floor(time_distance / 3600000)
time_distance -= int_hour * 3600000;
int_minute = Math.floor(time_distance / 60000)
time_distance -= int_minute * 60000;
int_second = Math.floor(time_distance / 1000)
if (int_hour < 10)
int_hour = "0" + int_hour;
if (int_minute < 10)
int_minute = "0" + int_minute;
if (int_second < 10)
int_second = "0" + int_second;
this.str_time = int_hour + ":" + int_minute + ":" + int_second;
if (this.str_time == "00:00:00") { this.str_time = "已结束" }
//console.log(this.str_time)
}else{
} else {
//timer=timer;
clearTimeout(this.timerID)
}
}
//参加考试
takeTest (e) {
takeTest(e) {
console.log(e)
let body = {
name: e.title,
paperId: e.id,
}
this.http.post('/api/Examinations',body).subscribe((data:any)=>{
this.http.post('/api/Examinations', body).subscribe((data: any) => {
window.open(`/examinationDetails?paperId=${e.id}&examId=${data.id}`)
}, err => {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open(err, '确定', config);
})
}
}

2
src/app/ui/collection-tools-examinee/collection-tools.component.html

@ -62,7 +62,7 @@
<p style="font-size: 15px;">考试题目</p>
<nz-tree *ngIf="questionstreeData.length != 0" nzExpandAll #nzTreeComponent [nzData]="questionstreeData" nzBlockNode [nzTreeTemplate]="nzTreeTemplate"></nz-tree>
<ng-template #nzTreeTemplate let-node let-origin="origin">
<div id="terrNodePublic" [ngClass]="{'selectanelPoint': selectDisposalNode==node.origin.id}">
<div id="terrNodePublic" (click)='selectanelPoint(node.origin,0)' [ngClass]="{'selectanelPoint': selectDisposalNode==node.origin.id}">
<label title="{{node.title}}" class="overflowText textNode">{{node.title}}</label>
</div>
</ng-template>

4
src/app/ui/collection-tools-read/collection-tools.component.html

@ -8,9 +8,9 @@
</div>
</div>
<div class="headerRight" *ngIf="paperType == 0">
<!-- <button style="border: 1px solid #07CDCF; border-radius: 5px; margin: 0 15px;" (click)='lookAnswerDiv()'><mat-icon>visibility</mat-icon>
<button style="border: 1px solid #07CDCF; border-radius: 5px; margin: 0 15px;" (click)='lookAnswerDiv()'><mat-icon>visibility</mat-icon>
查看答案
</button> -->
</button>
<button (click)="score()"><mat-icon>description</mat-icon>评分</button>
<button (click)="submitScore()"><mat-icon>open_in_browser</mat-icon>提交</button>
</div>

Loading…
Cancel
Save