Browse Source

[新增]ng-zorro时间插件

master
邵佳豪 4 years ago
parent
commit
129c1aa3a6
  1. 73
      package-lock.json
  2. 2
      package.json
  3. 8
      src/app/ui/create-exam/create-exam.component.ts
  4. 7
      src/app/ui/eharts-statistics/eharts-statistics.component.html
  5. 4
      src/app/ui/learning-record-details/learning-record-details.component.html
  6. 7
      src/app/ui/ui.module.ts
  7. 2
      src/styles.scss

73
package-lock.json generated

@ -463,6 +463,30 @@
"resolved": "https://registry.npm.taobao.org/@angular/router/download/@angular/router-9.0.0.tgz", "resolved": "https://registry.npm.taobao.org/@angular/router/download/@angular/router-9.0.0.tgz",
"integrity": "sha1-EXhPyM6cszFMfsEIP/m+fGERgcI=" "integrity": "sha1-EXhPyM6cszFMfsEIP/m+fGERgcI="
}, },
"@ant-design/colors": {
"version": "3.2.2",
"resolved": "https://registry.npm.taobao.org/@ant-design/colors/download/@ant-design/colors-3.2.2.tgz?cache=0&sync_timestamp=1596611396536&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40ant-design%2Fcolors%2Fdownload%2F%40ant-design%2Fcolors-3.2.2.tgz",
"integrity": "sha1-WtQ9YZ6RHzSI66wwPWBuZqhCOQM=",
"requires": {
"tinycolor2": "^1.4.1"
}
},
"@ant-design/icons-angular": {
"version": "10.0.1",
"resolved": "https://registry.npm.taobao.org/@ant-design/icons-angular/download/@ant-design/icons-angular-10.0.1.tgz?cache=0&sync_timestamp=1601105390624&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40ant-design%2Ficons-angular%2Fdownload%2F%40ant-design%2Ficons-angular-10.0.1.tgz",
"integrity": "sha1-0Rc/YpU1wegqBSiP2VuOBbwnLWE=",
"requires": {
"@ant-design/colors": "^3.1.0",
"tslib": "^2.0.0"
},
"dependencies": {
"tslib": {
"version": "2.0.2",
"resolved": "https://registry.npm.taobao.org/tslib/download/tslib-2.0.2.tgz?cache=0&sync_timestamp=1601998793819&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftslib%2Fdownload%2Ftslib-2.0.2.tgz",
"integrity": "sha1-RiKVYxGF20SyGx6jYVtjzRwDgkI="
}
}
},
"@babel/code-frame": { "@babel/code-frame": {
"version": "7.5.5", "version": "7.5.5",
"resolved": "https://registry.npm.taobao.org/@babel/code-frame/download/@babel/code-frame-7.5.5.tgz", "resolved": "https://registry.npm.taobao.org/@babel/code-frame/download/@babel/code-frame-7.5.5.tgz",
@ -6531,11 +6555,6 @@
"assert-plus": "^1.0.0" "assert-plus": "^1.0.0"
} }
}, },
"date-fns": {
"version": "2.9.0",
"resolved": "https://registry.npm.taobao.org/date-fns/download/date-fns-2.9.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdate-fns%2Fdownload%2Fdate-fns-2.9.0.tgz",
"integrity": "sha1-0LF1pcN+1fF7l+InK7wfpa7Gd9I="
},
"date-format": { "date-format": {
"version": "2.1.0", "version": "2.1.0",
"resolved": "https://registry.npm.taobao.org/date-format/download/date-format-2.1.0.tgz?cache=0&sync_timestamp=1572559173297&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdate-format%2Fdownload%2Fdate-format-2.1.0.tgz", "resolved": "https://registry.npm.taobao.org/date-format/download/date-format-2.1.0.tgz?cache=0&sync_timestamp=1572559173297&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdate-format%2Fdownload%2Fdate-format-2.1.0.tgz",
@ -11395,6 +11414,45 @@
"integrity": "sha1-rCetpmFn+ohJpq3dg39rGJrSCBw=", "integrity": "sha1-rCetpmFn+ohJpq3dg39rGJrSCBw=",
"dev": true "dev": true
}, },
"ng-zorro-antd": {
"version": "10.0.0",
"resolved": "https://registry.npm.taobao.org/ng-zorro-antd/download/ng-zorro-antd-10.0.0.tgz?cache=0&sync_timestamp=1601298489342&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fng-zorro-antd%2Fdownload%2Fng-zorro-antd-10.0.0.tgz",
"integrity": "sha1-tLw3rZwAqcWbFvN6ccf+cadXOA4=",
"requires": {
"@angular/cdk": "^10.0.0",
"@ant-design/icons-angular": "^10.0.0",
"date-fns": "^2.10.0",
"resize-observer-polyfill": "^1.5.1",
"tslib": "^2.0.0"
},
"dependencies": {
"@angular/cdk": {
"version": "10.2.4",
"resolved": "https://registry.npm.taobao.org/@angular/cdk/download/@angular/cdk-10.2.4.tgz?cache=0&sync_timestamp=1601937314503&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40angular%2Fcdk%2Fdownload%2F%40angular%2Fcdk-10.2.4.tgz",
"integrity": "sha1-ZWCVZIrwBef6AsTMaIZb5L9Z/BA=",
"requires": {
"parse5": "^5.0.0",
"tslib": "^2.0.0"
}
},
"date-fns": {
"version": "2.16.1",
"resolved": "https://registry.npm.taobao.org/date-fns/download/date-fns-2.16.1.tgz?cache=0&sync_timestamp=1598884189690&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdate-fns%2Fdownload%2Fdate-fns-2.16.1.tgz",
"integrity": "sha1-BXdXksPzMx2oEq8lPhqTWFHTg0s="
},
"parse5": {
"version": "5.1.1",
"resolved": "https://registry.npm.taobao.org/parse5/download/parse5-5.1.1.tgz",
"integrity": "sha1-9o5OW6GFKsLK3AD0VV//bCq7YXg=",
"optional": true
},
"tslib": {
"version": "2.0.2",
"resolved": "https://registry.npm.taobao.org/tslib/download/tslib-2.0.2.tgz?cache=0&sync_timestamp=1601998793819&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftslib%2Fdownload%2Ftslib-2.0.2.tgz",
"integrity": "sha1-RiKVYxGF20SyGx6jYVtjzRwDgkI="
}
}
},
"ng2-file-upload": { "ng2-file-upload": {
"version": "1.4.0", "version": "1.4.0",
"resolved": "https://registry.npm.taobao.org/ng2-file-upload/download/ng2-file-upload-1.4.0.tgz", "resolved": "https://registry.npm.taobao.org/ng2-file-upload/download/ng2-file-upload-1.4.0.tgz",
@ -15213,6 +15271,11 @@
"integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=", "integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=",
"dev": true "dev": true
}, },
"tinycolor2": {
"version": "1.4.2",
"resolved": "https://registry.npm.taobao.org/tinycolor2/download/tinycolor2-1.4.2.tgz?cache=0&sync_timestamp=1601056446986&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftinycolor2%2Fdownload%2Ftinycolor2-1.4.2.tgz",
"integrity": "sha1-P2pNEHGtB2dtf6Ry4frECnGdiAM="
},
"tinyqueue": { "tinyqueue": {
"version": "1.2.3", "version": "1.2.3",
"resolved": "https://registry.npm.taobao.org/tinyqueue/download/tinyqueue-1.2.3.tgz", "resolved": "https://registry.npm.taobao.org/tinyqueue/download/tinyqueue-1.2.3.tgz",

2
package.json

@ -25,10 +25,10 @@
"@types/cesium": "^1.59.5", "@types/cesium": "^1.59.5",
"angular-calendar": "^0.28.2", "angular-calendar": "^0.28.2",
"cesium": "^1.64.0", "cesium": "^1.64.0",
"date-fns": "^2.9.0",
"e-ngx-cesium": "^6.3.2", "e-ngx-cesium": "^6.3.2",
"echarts": "^4.6.0", "echarts": "^4.6.0",
"firebase": "^7.6.2", "firebase": "^7.6.2",
"ng-zorro-antd": "^10.0.0",
"ng2-file-upload": "^1.4.0", "ng2-file-upload": "^1.4.0",
"ngx-echarts": "^4.2.2", "ngx-echarts": "^4.2.2",
"ngx-perfect-scrollbar": "^8.0.0", "ngx-perfect-scrollbar": "^8.0.0",

8
src/app/ui/create-exam/create-exam.component.ts

@ -41,7 +41,7 @@ export class CreateExamComponent implements OnInit {
} }
} }
import getISOWeek from 'date-fns/getISOWeek'; // import getISOWeek from 'date-fns/getISOWeek';
//创建组织 //创建组织
@Component({ @Component({
selector: 'CreateDialog', selector: 'CreateDialog',
@ -66,9 +66,9 @@ export class CreateDialog {
onChange(result: Date[]): void { onChange(result: Date[]): void {
console.log('onChange: ', result); console.log('onChange: ', result);
} }
getWeek(result: Date[]): void { // getWeek(result: Date[]): void {
console.log('week: ', result.map(getISOWeek)); // console.log('week: ', result.map(getISOWeek));
} // }
} }

7
src/app/ui/eharts-statistics/eharts-statistics.component.html

@ -9,7 +9,7 @@
<button type="button" mat-raised-button color="primary" (click)='queryAll()'>查看全部详情</button> <button type="button" mat-raised-button color="primary" (click)='queryAll()'>查看全部详情</button>
</div> </div>
<div class="queryField"> <!-- <div class="queryField">
<label style="margin-right: 10px;">开始时间:</label> <label style="margin-right: 10px;">开始时间:</label>
<input matInput [matDatepicker]="start" placeholder="请选择开始时间" readonly (dateChange)="startEvent($event)" [formControl]='startTime'> <input matInput [matDatepicker]="start" placeholder="请选择开始时间" readonly (dateChange)="startEvent($event)" [formControl]='startTime'>
<mat-datepicker-toggle matSuffix [for]="start"></mat-datepicker-toggle> <mat-datepicker-toggle matSuffix [for]="start"></mat-datepicker-toggle>
@ -21,14 +21,15 @@
<input matInput [matDatepicker]="end" placeholder="请选择结束时间" readonly (dateChange)="endEvent($event)" [formControl]='endTime'> <input matInput [matDatepicker]="end" placeholder="请选择结束时间" readonly (dateChange)="endEvent($event)" [formControl]='endTime'>
<mat-datepicker-toggle matSuffix [for]="end"></mat-datepicker-toggle> <mat-datepicker-toggle matSuffix [for]="end"></mat-datepicker-toggle>
<mat-datepicker #end></mat-datepicker> <mat-datepicker #end></mat-datepicker>
</div> </div> -->
<div class="btnbox" style="margin-left: 90px;"> <div class="btnbox" style="margin-left: 90px;">
<button mat-raised-button color="primary" (click)='query()'>查询</button> <button mat-raised-button color="primary" (click)='query()'>查询</button>
<button mat-raised-button style="margin-left: 10px;" type="button" (click)='getList()'>重置</button> <button mat-raised-button style="margin-left: 10px;" type="button" (click)='getList()'>重置</button>
</div> </div>
</div> </div>
</form> </form>
</div> </div>

4
src/app/ui/learning-record-details/learning-record-details.component.html

@ -5,7 +5,7 @@
<button type="button" mat-raised-button color="primary" (click)="backtop()"><mat-icon style="vertical-align: middle;font-size: 20px;">reply</mat-icon>返回</button> <button type="button" mat-raised-button color="primary" (click)="backtop()"><mat-icon style="vertical-align: middle;font-size: 20px;">reply</mat-icon>返回</button>
</div> </div>
<div class="datasearch"> <div class="datasearch">
<div class="starttime"> <!-- <div class="starttime">
<span>开始时间 :</span> <span>开始时间 :</span>
<input style="width: 220px; height:21px;line-height: 21px;font-size: 15px;" matInput [matDatepicker]="dp" readonly [formControl]="startdate"> <input style="width: 220px; height:21px;line-height: 21px;font-size: 15px;" matInput [matDatepicker]="dp" readonly [formControl]="startdate">
<mat-datepicker-toggle matSuffix [for]="dp"></mat-datepicker-toggle> <mat-datepicker-toggle matSuffix [for]="dp"></mat-datepicker-toggle>
@ -17,7 +17,7 @@
<input style="width: 220px; height:21px;line-height: 21px;font-size: 15px;" matInput [matDatepicker]="dp2" readonly [formControl]="enddate"> <input style="width: 220px; height:21px;line-height: 21px;font-size: 15px;" matInput [matDatepicker]="dp2" readonly [formControl]="enddate">
<mat-datepicker-toggle matSuffix [for]="dp2"></mat-datepicker-toggle> <mat-datepicker-toggle matSuffix [for]="dp2"></mat-datepicker-toggle>
<mat-datepicker #dp2 disabled="false"></mat-datepicker> <mat-datepicker #dp2 disabled="false"></mat-datepicker>
</div> </div> -->
</div> </div>
<div class="btnbox"> <div class="btnbox">
<button type="button" mat-raised-button color="primary" (click)="onSubmit()">查询</button> <button type="button" mat-raised-button color="primary" (click)="onSubmit()">查询</button>

7
src/app/ui/ui.module.ts

@ -17,7 +17,7 @@ import {MatCardModule} from '@angular/material/card';
import {MatCheckboxModule} from '@angular/material/checkbox'; import {MatCheckboxModule} from '@angular/material/checkbox';
import {MatChipsModule} from '@angular/material/chips'; import {MatChipsModule} from '@angular/material/chips';
import {MatStepperModule} from '@angular/material/stepper'; import {MatStepperModule} from '@angular/material/stepper';
import {MatDatepickerModule} from '@angular/material/datepicker'; // import {MatDatepickerModule} from '@angular/material/datepicker';
import {MatDialogModule} from '@angular/material/dialog'; import {MatDialogModule} from '@angular/material/dialog';
import {MatDividerModule} from '@angular/material/divider'; import {MatDividerModule} from '@angular/material/divider';
import {MatExpansionModule} from '@angular/material/expansion'; import {MatExpansionModule} from '@angular/material/expansion';
@ -67,11 +67,12 @@ import { LookOverTestComponent } from './look-over-test/look-over-test.component
import { StatisticAnalysisComponent } from './statistic-analysis/statistic-analysis.component'; import { StatisticAnalysisComponent } from './statistic-analysis/statistic-analysis.component';
import { JoinExamComponent } from './join-exam/join-exam.component'; import { JoinExamComponent } from './join-exam/join-exam.component';
import { TestRecordsComponent } from './test-records/test-records.component' import { TestRecordsComponent } from './test-records/test-records.component'
import { NzDatePickerModule } from 'ng-zorro-antd/date-picker';
@NgModule({ @NgModule({
declarations: [FolderDialog,ViewDetails,PersonaldataComponent, ChangepasswordComponent,SizePipe,NamePipe,NamePipe2,NamePipe3,ConfirmpswDirective, AllFileComponent, ChangeuserdataComponent, LoginComponent, UploadFilesComponent,AddEnterpriserUser,EnterpriseuserComponent,editenterpriseuser,seeenterpriseuser,TeacherManagementComponent,editTeacher,AddTeacher,seeTeacher, LearningRecordDetailsComponent, EhartsStatisticsComponent, CreateExamComponent, LookOverTestComponent, StatisticAnalysisComponent, JoinExamComponent, TestRecordsComponent,testState,CreateDialog], declarations: [FolderDialog,ViewDetails,PersonaldataComponent, ChangepasswordComponent,SizePipe,NamePipe,NamePipe2,NamePipe3,ConfirmpswDirective, AllFileComponent, ChangeuserdataComponent, LoginComponent, UploadFilesComponent,AddEnterpriserUser,EnterpriseuserComponent,editenterpriseuser,seeenterpriseuser,TeacherManagementComponent,editTeacher,AddTeacher,seeTeacher, LearningRecordDetailsComponent, EhartsStatisticsComponent, CreateExamComponent, LookOverTestComponent, StatisticAnalysisComponent, JoinExamComponent, TestRecordsComponent,testState,CreateDialog],
imports: [ imports: [
NzDatePickerModule,
CommonModule, CommonModule,
UiRoutingModule, UiRoutingModule,
A11yModule, A11yModule,
@ -88,7 +89,7 @@ import { TestRecordsComponent } from './test-records/test-records.component'
MatCheckboxModule, MatCheckboxModule,
MatChipsModule, MatChipsModule,
MatStepperModule, MatStepperModule,
MatDatepickerModule, // MatDatepickerModule,
MatDialogModule, MatDialogModule,
MatDividerModule, MatDividerModule,
MatExpansionModule, MatExpansionModule,

2
src/styles.scss

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

Loading…
Cancel
Save