|
|
@@ -162,7 +162,21 @@
|
|
|
</el-icon>
|
|
|
</div>
|
|
|
<div style="margin-left: 5px;" @click="thisFolder.dirType ? createNewMenu(2) : null">
|
|
|
- <span style="font-size: 14px;" class="shouzhi">新建文档</span>
|
|
|
+ <el-dropdown :disabled="!thisFolder.dirType" size="large" @command="handleAddFileCommand">
|
|
|
+ <span style="font-size: 14px;line-height: 48px;color:#000;" class="shouzhi">新建文档</span>
|
|
|
+ <template #dropdown>
|
|
|
+ <el-dropdown-menu>
|
|
|
+ <el-dropdown-item disabled style="font-size:16px;font-weight: 500;">空白文档</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="nullW"><img style="margin-right:5px;" src="@/assets/images/addFile/nullW.png" alt="">文字</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="nullE"><img style="margin-right:5px;" src="@/assets/images/addFile/nullE.png" alt="">表格</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="nullP"><img style="margin-right:5px;" src="@/assets/images/addFile/nullP.png" alt="">演示</el-dropdown-item>
|
|
|
+ <el-dropdown-item disabled style="font-size:16px;font-weight: 500;">文档模板</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="tW"><img style="margin-right:5px;" src="@/assets/images/addFile/tW.png" alt="">文字</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="tE"><img style="margin-right:5px;" src="@/assets/images/addFile/tE.png" alt="">表格</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="tP"><img style="margin-right:5px;" src="@/assets/images/addFile/tP.png" alt="">演示</el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </template>
|
|
|
+ </el-dropdown>
|
|
|
</div>
|
|
|
</div>
|
|
|
<template v-for="(item, index) in useMenu" :key="index">
|
|
|
@@ -499,7 +513,7 @@
|
|
|
:showInputPassword="showInputPassword"></inputPassword>
|
|
|
<div v-loading.fullscreen="loadingPreview" v-if="loadingPreview" class="lodingBox"></div>
|
|
|
<!-- 新增文档 -->
|
|
|
- <AddFile v-if="newAdd" :newAdd="newAdd" @closeAddFile="closeAddFile" @threeBe="threeBe" :clickFileData="clickFileData"></AddFile>
|
|
|
+ <!-- <AddFile v-if="newAdd" :newAdd="newAdd" @closeAddFile="closeAddFile" @threeBe="threeBe" :clickFileData="clickFileData"></AddFile> -->
|
|
|
<!-- 扫描文档 -->
|
|
|
<ScanFile v-if="openScan" :openScan="openScan" :scannerFiles="scannerFiles" @saveScanFile="saveScanFile" @closeOpen="closeOpen"></ScanFile>
|
|
|
<!-- 可用扫描仪信息 -->
|
|
|
@@ -531,8 +545,20 @@
|
|
|
<iframe :key="nowTime" :src="hisIfarmeData.src" :name="nowTime" id="iframeHis" frameborder="0" width="1200px"
|
|
|
height="800px" class="iframeBox" ></iframe>
|
|
|
</el-dialog>
|
|
|
- <!-- 文件文件下拉框 -->
|
|
|
- <addFileDrop></addFileDrop>
|
|
|
+ <!-- 查看模板的iframe -->
|
|
|
+ <el-dialog
|
|
|
+ v-model="showTemp"
|
|
|
+ title="模板预览"
|
|
|
+ width="1250px"
|
|
|
+ :close-delay='200'
|
|
|
+ :before-close="closeHis"
|
|
|
+ >
|
|
|
+ <iframe :key="nowTime" :src="tempIfarmeData.src" :name="nowTime" id="iframeHis" frameborder="0" width="1200px"
|
|
|
+ height="800px" class="iframeBox" ></iframe>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 给新建的文件命名 -->
|
|
|
+ <addFileDrop v-if="newAdd" :newAdd="newAdd" :addTempId="addTempId" :addFileType="addFileType" @closeAddFile="closeAddFile" @threeBe="threeBe" :clickFileData="clickFileData"></addFileDrop>
|
|
|
+ <addFileTempList v-if="showTempList" @getAddTempId='getAddTempId' @getTempPreview="getTempPreview" @closeTempList="closeTempList" :showTempList="showTempList" :addFileType="addFileType" @closeAddFile="closeAddFile"></addFileTempList>
|
|
|
<!-- <iframe v-if="hisIfarmeData?.src" :src="hisIfarmeData.src" id="iframeHis" frameborder="1" width="1200px"
|
|
|
height="800px" class="iframeBox" ></iframe> -->
|
|
|
</template>
|
|
|
@@ -592,6 +618,7 @@ import { listInfo,selectInfo ,getFileByScanerId} from '@/api/scanner/info.js';
|
|
|
import { getConfigKey } from "@/api/system/config.js"
|
|
|
import TreeMenu from '@/components/TreeMenu/TreeMenu.vue'
|
|
|
import addFileDrop from '@/components/addFileDrop/addFileDrop.vue'
|
|
|
+import addFileTempList from '@/components/addFileTempList/addFileTempList.vue'
|
|
|
|
|
|
export default {
|
|
|
directives: {
|
|
|
@@ -810,6 +837,11 @@ export default {
|
|
|
const nowTime = ref(new Date().getTime())
|
|
|
const showHis = ref(false)
|
|
|
const collectId = ref()
|
|
|
+ const addFileType = ref()
|
|
|
+ const showTempList = ref(false)
|
|
|
+ const addTempId = ref()
|
|
|
+ const tempIfarmeData = ref({})
|
|
|
+ const showTemp = ref(false)
|
|
|
const hisIfarmeData = ref({
|
|
|
// src: `${window.location.origin}/fileEdit?clickRowId=7567&canEdit=0&canCopy=0&history=0&fileId=0`,
|
|
|
})
|
|
|
@@ -1421,7 +1453,7 @@ export default {
|
|
|
leftNewFile.value = false
|
|
|
}
|
|
|
if (num == 2) {
|
|
|
- newAdd.value = true
|
|
|
+ // newAdd.value = true
|
|
|
} else {
|
|
|
oneOrTwo.value = num
|
|
|
folderCase.value = true
|
|
|
@@ -2546,6 +2578,46 @@ export default {
|
|
|
})
|
|
|
|
|
|
}
|
|
|
+ // 点击新建文件下拉框选项
|
|
|
+ const handleAddFileCommand = (command)=>{
|
|
|
+ // console.log('command',command);
|
|
|
+ const getType = (data)=>{
|
|
|
+ if(data.includes('W')){
|
|
|
+ return 'word'
|
|
|
+ }else if(data.includes('E')){
|
|
|
+ return 'excel'
|
|
|
+ }else{
|
|
|
+ return 'ppt'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ addFileType.value = getType(command)
|
|
|
+ if(command.includes('null')){ //空白文档
|
|
|
+ // console.log('addFileType',addFileType.value);
|
|
|
+ newAdd.value = true
|
|
|
+ }else{ // 模板文件
|
|
|
+ showTempList.value = true
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ const closeTempList = ()=>{
|
|
|
+ showTempList.value = false
|
|
|
+ }
|
|
|
+ const getAddTempId = (id)=>{
|
|
|
+ addTempId.value = id
|
|
|
+ closeTempList()
|
|
|
+ newAdd.value = true
|
|
|
+ }
|
|
|
+ // 获取预览的模板地址
|
|
|
+ const getTempPreview = (fileId)=>{
|
|
|
+ tempIfarmeData.value = {
|
|
|
+ src:`${window.location.origin}${import.meta.env.VITE_APP_BASE_API}/api/view/${fileId}`
|
|
|
+ // src:`${window.location.origin}${import.meta.env.VITE_APP_BASE_API}/only-office/tmpl/callback/${
|
|
|
+ // fileId
|
|
|
+ // }?name=${useUserStore().uname}`
|
|
|
+ }
|
|
|
+ showTemp.value = true
|
|
|
+ console.log('getTempPreview',tempIfarmeData.value);
|
|
|
+ }
|
|
|
watch(() => folder.value, async(newValue, oldValue) => {
|
|
|
// console.log('iFrameData 发生改变了', newValue, oldValue);
|
|
|
console.log('files',newValue);
|
|
|
@@ -2943,7 +3015,16 @@ export default {
|
|
|
closeHis,
|
|
|
nowTime,
|
|
|
showHis,
|
|
|
- collectId
|
|
|
+ collectId,
|
|
|
+ handleAddFileCommand,
|
|
|
+ addFileType,
|
|
|
+ showTempList,
|
|
|
+ closeTempList,
|
|
|
+ tempIfarmeData,
|
|
|
+ getTempPreview,
|
|
|
+ showTemp,
|
|
|
+ addTempId,
|
|
|
+ getAddTempId
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -2968,7 +3049,9 @@ export default {
|
|
|
MoveTo,
|
|
|
LeftList,
|
|
|
ListShow,
|
|
|
- TreeMenu
|
|
|
+ TreeMenu,
|
|
|
+ addFileDrop,
|
|
|
+ addFileTempList
|
|
|
},
|
|
|
}
|
|
|
|