|
@@ -8237,6 +8237,7 @@
|
|
|
></EnglishVoice>
|
|
|
<appDialog ref="appDialog" @success="selectAppSuccess"></appDialog>
|
|
|
<CodeEditor ref="CodeEditorRef" @success="addHtmlSuccess"></CodeEditor>
|
|
|
+ <selectHtmlPageDialog ref="selectHtmlPageDialogRef"/>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -8265,6 +8266,7 @@ let converter = OpenCC.Converter({
|
|
|
to: "cn"
|
|
|
});
|
|
|
import JSZip from 'jszip'
|
|
|
+import selectHtmlPageDialog from '../dialog/selectHtmlPageDialog.vue'
|
|
|
|
|
|
export default {
|
|
|
mixins: [ myMixin,uploadFileMixin],
|
|
@@ -8280,7 +8282,8 @@ export default {
|
|
|
interVideo,
|
|
|
englishRight,
|
|
|
EnglishVoice,
|
|
|
- appDialog
|
|
|
+ appDialog,
|
|
|
+ selectHtmlPageDialog
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -14108,48 +14111,49 @@ export default {
|
|
|
},
|
|
|
// zip压缩文件上传
|
|
|
uploadZIPFile(i){
|
|
|
- this.lineCount = i;
|
|
|
- // 只支持上传zip文件
|
|
|
- let input = document.createElement('input');
|
|
|
- input.type = 'file';
|
|
|
- input.accept = '.zip';
|
|
|
- input.style.display = 'none';
|
|
|
- // 只允许上传一个文件
|
|
|
- input.multiple = false;
|
|
|
- input.onchange = async (e) => {
|
|
|
- let file = e.target.files[0];
|
|
|
- if (!file) return;
|
|
|
- if (file.type !== 'application/zip' && !file.name.endsWith('.zip')) {
|
|
|
- this.$message.error('只支持上传zip文件');
|
|
|
- return;
|
|
|
- }
|
|
|
- // this.awsupload({file:file,path:"zip/"+file.name}).then(res=>{
|
|
|
- // console.log('uploadZIPFile', res);
|
|
|
- // // 转成正常的网址
|
|
|
- // let url = res && res.Location ? decodeURIComponent(res.Location) : "";
|
|
|
- // console.log('正常网址:', url);
|
|
|
-
|
|
|
- // })
|
|
|
- // 这里可以根据实际需求进行上传处理
|
|
|
- try{
|
|
|
- const zip = new JSZip();
|
|
|
- const content = await zip.loadAsync(file);
|
|
|
- let _fileStructure = this.buildFileStructure(file,content);
|
|
|
- let _time = new Date().getTime();
|
|
|
- let _resultList = await this.uploadZipFileFn(_fileStructure.files,`${_time}_${_fileStructure.folderName}`);
|
|
|
- console.log("_resultList",_resultList)
|
|
|
-
|
|
|
- }catch(e){
|
|
|
- console.log(e)
|
|
|
- this.$message.error("解析zip文件失败")
|
|
|
- }
|
|
|
+ this.$refs.selectHtmlPageDialogRef.open("测试");
|
|
|
+ // this.lineCount = i;
|
|
|
+ // // 只支持上传zip文件
|
|
|
+ // let input = document.createElement('input');
|
|
|
+ // input.type = 'file';
|
|
|
+ // input.accept = '.zip';
|
|
|
+ // input.style.display = 'none';
|
|
|
+ // // 只允许上传一个文件
|
|
|
+ // input.multiple = false;
|
|
|
+ // input.onchange = async (e) => {
|
|
|
+ // let file = e.target.files[0];
|
|
|
+ // if (!file) return;
|
|
|
+ // if (file.type !== 'application/zip' && !file.name.endsWith('.zip')) {
|
|
|
+ // this.$message.error('只支持上传zip文件');
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // // this.awsupload({file:file,path:"zip/"+file.name}).then(res=>{
|
|
|
+ // // console.log('uploadZIPFile', res);
|
|
|
+ // // // 转成正常的网址
|
|
|
+ // // let url = res && res.Location ? decodeURIComponent(res.Location) : "";
|
|
|
+ // // console.log('正常网址:', url);
|
|
|
+
|
|
|
+ // // })
|
|
|
+ // // 这里可以根据实际需求进行上传处理
|
|
|
+ // try{
|
|
|
+ // const zip = new JSZip();
|
|
|
+ // const content = await zip.loadAsync(file);
|
|
|
+ // let _fileStructure = this.buildFileStructure(file,content);
|
|
|
+ // let _time = new Date().getTime();
|
|
|
+ // let _resultList = await this.uploadZipFileFn(_fileStructure.files,`${_time}_${_fileStructure.folderName}`);
|
|
|
+ // console.log("_resultList",_resultList)
|
|
|
+
|
|
|
+ // }catch(e){
|
|
|
+ // console.log(e)
|
|
|
+ // this.$message.error("解析zip文件失败")
|
|
|
+ // }
|
|
|
|
|
|
- };
|
|
|
- document.body.appendChild(input);
|
|
|
- input.click();
|
|
|
- setTimeout(() => {
|
|
|
- document.body.removeChild(input);
|
|
|
- }, 1000);
|
|
|
+ // };
|
|
|
+ // document.body.appendChild(input);
|
|
|
+ // input.click();
|
|
|
+ // setTimeout(() => {
|
|
|
+ // document.body.removeChild(input);
|
|
|
+ // }, 1000);
|
|
|
},
|
|
|
// 构建文件结构树
|
|
|
buildFileStructure(file,zip) {
|