接入畅写
This commit is contained in:
		| @ -29,6 +29,8 @@ | ||||
|           <el-table v-loading="loading" :data="tableData" border height="63vh" :empty-text="emptyText"> | ||||
|             <el-table-column label="序号" align="center" type="index" width="80px" /> | ||||
|             <el-table-column label="文件名称" align="center" prop="fileName" min-width="100px" /> | ||||
|             <el-table-column label="文件类型" align="center" prop="fileSuffix" width="100px" /> | ||||
|  | ||||
|             <el-table-column label="文件路径" align="center" min-width="100px"> | ||||
|               <template #default="scope"> | ||||
|                 <span>{{ filterfilenPath(scope.row.filePath) }}</span> | ||||
| @ -45,7 +47,7 @@ | ||||
|               </template> | ||||
|             </el-table-column> | ||||
|           </el-table> | ||||
|           <pagination :total="tableData.length" v-model:page="pageNum" v-model:limit="pageSize" @pagination="getDataFileQuery" /> | ||||
|           <pagination :total="total" v-model:page="formData.pageNum" v-model:limit="formData.pageSize" @pagination="getDataFileQuery" /> | ||||
|         </div> | ||||
|       </div> | ||||
|     </el-dialog> | ||||
| @ -53,34 +55,23 @@ | ||||
| </template> | ||||
|  | ||||
| <script lang="ts" setup> | ||||
| import { ref, reactive, getCurrentInstance, nextTick } from 'vue'; | ||||
| import { listKnowledgeDocument, getProfileDetail } from '@/api/safety/knowledgeDocument'; | ||||
| import { listKnowledgeDocument } from '@/api/safety/knowledgeDocument'; | ||||
| import { useUserStoreHook } from '@/store/modules/user'; | ||||
|  | ||||
| const emit = defineEmits(['onExport', 'onExportView']); | ||||
| const emit = defineEmits(['onExport', 'onExportView', 'onBook']); | ||||
| const stores = useUserStoreHook(); | ||||
| const { proxy } = getCurrentInstance() as any; | ||||
|  | ||||
| const documentDetailRef = ref(); | ||||
| const allTreeRef = ref(); | ||||
| const baseURL: string | undefined | boolean = import.meta.env.VITE_API_URL; | ||||
|  | ||||
| const loading = ref(false); | ||||
| const tableData = ref<any[]>([]); | ||||
| const isShowDialog = ref(false); | ||||
| const formData = reactive({ fileName: '', projectId: stores.selectedProject.id }); | ||||
| const projectList = ref<any[]>([]); | ||||
| const projectQuery = reactive({ name: '' }); | ||||
| const pageNum = ref(1); | ||||
| const pageSize = ref(10); | ||||
| const formData = reactive({ | ||||
|   fileName: '', | ||||
|   projectId: stores.selectedProject.id, | ||||
|   pageNum: 1, | ||||
|   pageSize: 10 | ||||
| }); | ||||
| const total = ref(0); | ||||
| const showDocumentDetail = ref(false); | ||||
| const emptyText = ref('暂无数据'); | ||||
| const treeList = ref<any[]>([]); | ||||
| const arrayList = ref<any[]>([]); | ||||
| const infoMap = ref(new Map()); | ||||
| const infoList = ref<any[]>([]); | ||||
| const paramsQuery = reactive({ idStr: '', project: '' }); | ||||
|  | ||||
| const openDialog = () => { | ||||
|   isShowDialog.value = true; | ||||
| @ -104,7 +95,7 @@ const getDataFileQuery = () => { | ||||
|     tableData.value = []; | ||||
|     if (res.code == 200 && res.rows?.length) { | ||||
|       tableData.value = res.rows; | ||||
|       total.value = res.rows.length; | ||||
|       total.value = res.total; | ||||
|     } else { | ||||
|       emptyText.value = '没有查询到数据,请重新输入搜索'; | ||||
|     } | ||||
| @ -112,15 +103,7 @@ const getDataFileQuery = () => { | ||||
| }; | ||||
|  | ||||
| const onBook = (row: any) => { | ||||
|   return; | ||||
|   getProfileDetail(row.id).then((res: any) => { | ||||
|     if (res.code == 200) { | ||||
|       showDocumentDetail.value = true; | ||||
|       nextTick(() => { | ||||
|         documentDetailRef.value.openDialog(res.data); | ||||
|       }); | ||||
|     } | ||||
|   }); | ||||
|   emit('onBook', row); | ||||
| }; | ||||
|  | ||||
| const onExport = (row: any) => { | ||||
|  | ||||
| @ -88,7 +88,7 @@ export default defineComponent({ | ||||
|       } else if (type == 'ppt' || type == 'pptx') { | ||||
|         documentType = 'slide'; //演示文档文件 | ||||
|       } | ||||
|       console.log(documentType, obj.fileSuffix.substring(1), obj.fileUrl); | ||||
|       console.log(baseURL + state.postUrl + '?path=' + obj.filePath + '&id=' + obj.id); | ||||
|       new CXO_API.CXEditor('box_app_edit', { | ||||
|         document: { | ||||
|           fileType: obj.fileSuffix, | ||||
| @ -97,8 +97,9 @@ export default defineComponent({ | ||||
|           url: obj.fileUrl | ||||
|         }, | ||||
|         documentType, | ||||
|         token: stores.token, | ||||
|         editorConfig: { | ||||
|           callbackUrl: baseURL + state.postUrl + '?path=' + obj.filePath | ||||
|           callbackUrl: baseURL + state.postUrl + obj.id + '?path=' + obj.filePath | ||||
|         }, | ||||
|         events: { | ||||
|           onDocumentReady: onDocumentReady, | ||||
|  | ||||
							
								
								
									
										
											BIN
										
									
								
								src/views/safety/knowledgeDocument/icon/full.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/views/safety/knowledgeDocument/icon/full.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 2.8 KiB | 
							
								
								
									
										
											BIN
										
									
								
								src/views/safety/knowledgeDocument/icon/suo.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/views/safety/knowledgeDocument/icon/suo.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 2.4 KiB | 
| @ -12,6 +12,7 @@ | ||||
|                   :uploadUrl="uploadUrl" | ||||
|                   :params="uploadParams" | ||||
|                   :on-upload-success="uploadFile" | ||||
|                   :fileType="[]" | ||||
|                 > | ||||
|                   <el-button type="primary" style="float: left" :disabled="!state.parentPid"> | ||||
|                     <el-icon size="small"><Plus /></el-icon>上传文件 | ||||
| @ -93,13 +94,20 @@ | ||||
|             <el-table v-loading="state.loading" :data="state.infoList" height="67vh" border> | ||||
|               <el-table-column label="序号" align="center" type="index" min-width="50px" /> | ||||
|               <el-table-column label="文件名称" align="center" prop="fileName"></el-table-column> | ||||
|               <el-table-column label="文件类型" align="center" prop="fileSuffix" width="100px" /> | ||||
|  | ||||
|               <el-table-column label="上传时间" align="center" prop="createTime"> </el-table-column> | ||||
|               <el-table-column label="操作" align="center" width="300"> | ||||
|                 <template #default="scope"> | ||||
|                   <el-button type="primary" link @click="handleView(scope.row)" | ||||
|                   <el-button type="primary" link @click="handleView(scope.row)" v-if="state.acceptType.includes(scope.row.fileSuffix)" | ||||
|                     ><el-icon><View /></el-icon>查看</el-button | ||||
|                   > | ||||
|                   <el-button type="primary" v-auth="'/zm/api/v1/system/documentData/complaintBoxAdd'" link @click="updataView(scope.row)" | ||||
|                   <el-button | ||||
|                     type="primary" | ||||
|                     v-auth="'/zm/api/v1/system/documentData/complaintBoxAdd'" | ||||
|                     v-if="state.acceptType.includes(scope.row.fileSuffix)" | ||||
|                     link | ||||
|                     @click="updataView(scope.row)" | ||||
|                     ><el-icon><EditPen /></el-icon>修改文件</el-button | ||||
|                   > | ||||
|                   <el-button type="primary" v-auth="'/zm/api/v1/system/documentData/uniFolderDownload'" link @click="onExportView(scope.row)" | ||||
| @ -132,7 +140,7 @@ | ||||
|     ></uploadFileder> | ||||
|     <fileOnline ref="fileOnlineRef" @getfileOnlineType="getfileOnlineType"></fileOnline> | ||||
|     <moveFile ref="moveFileRef"></moveFile> --> | ||||
|         <bookFile ref="bookFileRef" @onExportView="onExportView" @onExport="onExport"></bookFile> | ||||
|         <bookFile ref="bookFileRef" @onExportView="onExportView" @onBook="handleView" @onExport="onExport"></bookFile> | ||||
|         <el-dialog title="上传文件" v-model="uploadFileder" width="30%"> | ||||
|           <file-upload v-model="state.paramsQuery.file"></file-upload> | ||||
|           <template #footer> | ||||
| @ -235,7 +243,7 @@ const state = reactive({ | ||||
|   parentName: '', | ||||
|   selectedNodeId: null, | ||||
|   projectId: currentProject.value?.id || '', | ||||
|   acceptType: ['.pdf', '.doc', '.docx', '.xls', '.xlsx', '.ppt', '.pptx'], | ||||
|   acceptType: ['pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx'], | ||||
|   draggableCheck: true, | ||||
|   activeName: '' | ||||
| }); | ||||
| @ -426,7 +434,7 @@ const updataView = (row) => { | ||||
|   // 修改文档 | ||||
|   state.showdocumentDataEdit = true; | ||||
|   nextTick(() => { | ||||
|     documentDataEditRef.value.openDialog(row, '/changxie/callback'); | ||||
|     documentDataEditRef.value.openDialog(row, '/safety/knowledgeDocument/changxie/callback/'); | ||||
|   }); | ||||
| }; | ||||
| // 删除文件及文件夹 | ||||
|  | ||||
		Reference in New Issue
	
	Block a user