diff --git a/public/neDataImput/pcf_template.txt b/public/neDataImput/pcf_template.txt new file mode 100644 index 00000000..d6ee40e8 --- /dev/null +++ b/public/neDataImput/pcf_template.txt @@ -0,0 +1,2 @@ +imsi,msisdn,sess_rules,pcc_rules,hdr_enrich,rfsp,sar,qos_audio,qos_video +001012082101039,1234,internet|ims_sig,internet|ims_sig,321321,255,321312,32131,32131 \ No newline at end of file diff --git a/public/neDataImput/udm_auth_template.txt b/public/neDataImput/udm_auth_template.txt new file mode 100644 index 00000000..79c40d62 --- /dev/null +++ b/public/neDataImput/udm_auth_template.txt @@ -0,0 +1,2 @@ +001011100001157,1234567890ABCDEF1234567890ABCDEF,0,8000,11111111111111111111111111111111 +001011100001158,1234567890ABCDEF1234567890ABCDEF,0,8000,11111111111111111111111111111111 \ No newline at end of file diff --git a/public/neDataImput/udm_sub_template.txt b/public/neDataImput/udm_sub_template.txt new file mode 100644 index 00000000..0e42251e --- /dev/null +++ b/public/neDataImput/udm_sub_template.txt @@ -0,0 +1,2 @@ +001011100001157,62357000583,def_ambr,def_nssai,def_arfb,def_sar,0,3,def_snssai,1-000001&internet&ims,1,64,24,65,def_eps,1,010200000000,- +001011100001158,62357000585,def_ambr,def_nssai,def_arfb,def_sar,0,3,def_snssai,1-000001&internet&ims,1,64,24,65,def_eps,1,010200000000,- \ No newline at end of file diff --git a/src/views/neUser/auth/index.vue b/src/views/neUser/auth/index.vue index d207bfa3..dceb1192 100644 --- a/src/views/neUser/auth/index.vue +++ b/src/views/neUser/auth/index.vue @@ -721,18 +721,18 @@ function fnModalUploadImportUpload(file: File) { function fnModalDownloadImportTemplate() { const hide = message.loading(t('common.loading'), 0); - const blob = new Blob( - [ - [ - '001011100001157,1234567890ABCDEF1234567890ABCDEF,0,8000', - '001011100001158,1234567890ABCDEF1234567890ABCDEF,0,8000', - ].join('\r\n'), - ], - { - type: 'text/plain', - } + const baseUrl = import.meta.env.VITE_HISTORY_BASE_URL; + const templateUrl = `${ + baseUrl.length === 1 && baseUrl.indexOf('/') === 0 + ? '' + : baseUrl.indexOf('/') === -1 + ? '/' + baseUrl + : baseUrl + }/neDataImput`; + saveAs( + `${templateUrl}/udm_auth_template.txt`, + `import_udmauth_template_${Date.now()}.txt` ); - saveAs(blob, `import_authdata_template_${Date.now()}.txt`); hide(); } diff --git a/src/views/neUser/pcf/index.vue b/src/views/neUser/pcf/index.vue index f43cbb2c..91595441 100644 --- a/src/views/neUser/pcf/index.vue +++ b/src/views/neUser/pcf/index.vue @@ -641,18 +641,18 @@ function filterOption(value: any, option: any) { function fnModalDownloadImportTemplate() { const hide = message.loading(t('common.loading'), 0); - const blob = new Blob( - [ - [ - 'imsi,msisdn,sess_rules,pcc_rules,hdr_enrich,rfsp,sar,qos_audio,qos_video', - '001012082101039,1234,internet|ims_sig,internet|ims_sig,321321,255,321312,32131,32131', - ].join('\r\n'), - ], - { - type: 'text/plain', - } + const baseUrl = import.meta.env.VITE_HISTORY_BASE_URL; + const templateUrl = `${ + baseUrl.length === 1 && baseUrl.indexOf('/') === 0 + ? '' + : baseUrl.indexOf('/') === -1 + ? '/' + baseUrl + : baseUrl + }/neDataImput`; + saveAs( + `${templateUrl}/pcf_template.txt`, + `import_pcfrule_template_${Date.now()}.txt` ); - saveAs(blob, `import_pcfrule_template_${Date.now()}.txt`); hide(); } diff --git a/src/views/neUser/sub/index.vue b/src/views/neUser/sub/index.vue index 4972f975..0b9da26b 100644 --- a/src/views/neUser/sub/index.vue +++ b/src/views/neUser/sub/index.vue @@ -1220,21 +1220,21 @@ function delBigRow(bigIndex: any) { } /**对话框表格信息导入模板 */ -function fnModalDownloadImportTemplate() { +async function fnModalDownloadImportTemplate() { const hide = message.loading(t('common.loading'), 0); - const blob = new Blob( - [ - [ - "001016650000584,62357000583,def_ambr,def_nssai,def_arfb,def_sar,0,3,def_snssai,1-000001&internet&ims,1,64,24,65,def_eps,1,010200000000,-", - "001016650000585,62357000585,def_ambr,def_nssai,def_arfb,def_sar,0,3,def_snssai,1-000001&internet&ims,1,64,24,65,def_eps,1,010200000000,-", - ].join('\r\n'), - ], - { - type: 'text/plain', - } + const baseUrl = import.meta.env.VITE_HISTORY_BASE_URL; + const templateUrl = `${ + baseUrl.length === 1 && baseUrl.indexOf('/') === 0 + ? '' + : baseUrl.indexOf('/') === -1 + ? '/' + baseUrl + : baseUrl + }/neDataImput`; + saveAs( + `${templateUrl}/udm_sub_template.txt`, + `import_udmsub_template_${Date.now()}.txt` ); - saveAs(blob, `import_udmuser_template_${Date.now()}.txt`); hide(); }