|
@@ -5,6 +5,9 @@ import { CompUploadComponent } from '../../../../app/comp-upload/comp-upload.com
|
|
|
import { NzRadioModule } from 'ng-zorro-antd/radio';
|
|
|
import { CommonCompModule } from '../../../../services/common.modules';
|
|
|
import { NzMessageService } from 'ng-zorro-antd/message';
|
|
|
+import { textbookServer } from '../../../../services/textbook';
|
|
|
+import { ProvierOssAli } from '../../../../app/comp-upload/provider-oss-aliyun';
|
|
|
+import { NzModalService } from 'ng-zorro-antd/modal';
|
|
|
interface link {
|
|
|
url: string;
|
|
|
username?: string;
|
|
@@ -31,20 +34,28 @@ export class UploadCollectComponent implements OnInit {
|
|
|
}; //链接、账号密码
|
|
|
|
|
|
radioValue: string = '上传文件';
|
|
|
- carrierShape:string = '' //类型
|
|
|
+ carrierShape: string = ''; //类型
|
|
|
+ ossProvider: { signatureUrl: any } | undefined;
|
|
|
|
|
|
- constructor(private msg: NzMessageService) {}
|
|
|
+ constructor(
|
|
|
+ private modal: NzModalService,
|
|
|
+ public tbookSer: textbookServer,
|
|
|
+ private msg: NzMessageService
|
|
|
+ ) {
|
|
|
+ this.ossProvider = new ProvierOssAli();
|
|
|
+ }
|
|
|
|
|
|
ngOnInit() {
|
|
|
this.collectFiles = this.eduTextbookVolume?.get('collectFiles') || [];
|
|
|
- this.collectDigitFiles = this.eduTextbookVolume?.get('collectDigitFiles') || [];
|
|
|
+ this.collectDigitFiles =
|
|
|
+ this.eduTextbookVolume?.get('collectDigitFiles') || [];
|
|
|
this.collectLink = this.eduTextbookVolume?.get('collectLink') || {
|
|
|
url: '',
|
|
|
username: '',
|
|
|
password: '',
|
|
|
};
|
|
|
this.radioValue = this.eduTextbookVolume?.get('collectCheck') || '上传文件';
|
|
|
- this.carrierShape = this.eduTextbookVolume?.get('carrierShape')?.trim()
|
|
|
+ this.carrierShape = this.eduTextbookVolume?.get('carrierShape')?.trim();
|
|
|
}
|
|
|
upload(e: any, type: string) {
|
|
|
console.log('上传材料发生改变');
|
|
@@ -100,7 +111,17 @@ export class UploadCollectComponent implements OnInit {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- openUrl(url: string) {
|
|
|
+ async openUrl(url: string) {
|
|
|
+ if (
|
|
|
+ this.eduTextbookVolume?.get('editionUnit') ===
|
|
|
+ this.tbookSer.profile.user?.department?.name
|
|
|
+ ) {
|
|
|
+ url = await this.ossProvider?.signatureUrl(url);
|
|
|
+ }
|
|
|
window.open(url);
|
|
|
+ this.modal.warning({
|
|
|
+ nzTitle: '提示',
|
|
|
+ nzContent: '教材文件临时链接已打开,有效期10分钟,请勿外泄。'
|
|
|
+ });
|
|
|
}
|
|
|
}
|