接入畅写

This commit is contained in:
Teo
2025-06-30 19:51:55 +08:00
parent 9d303186ba
commit 1f1a82aae0
8 changed files with 54 additions and 91 deletions

View File

@ -210,7 +210,7 @@
</div> </div>
</div> </div>
<script type="text/javascript" <script type="text/javascript"
src="http://zmkg.cqet.top:8899/changxieoffice/web-apps/apps/api/documents/api.js"></script> src="http://58.17.134.85:7363/changxieoffice/web-apps/apps/api/documents/api.js"></script>
<script src="./src/assets/sdk/YJEarth.min.js"></script> <script src="./src/assets/sdk/YJEarth.min.js"></script>
<script src="./src/utils/reconnecting-websocket.js"></script> <script src="./src/utils/reconnecting-websocket.js"></script>
<script type="module" src="/src/main.ts"></script> <script type="module" src="/src/main.ts"></script>

View File

@ -29,6 +29,7 @@
<el-table v-loading="loading" :data="tableData" border height="63vh" :empty-text="emptyText"> <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" type="index" width="80px" />
<el-table-column label="文件名称" align="center" prop="fileName" min-width="100px" /> <el-table-column label="文件名称" align="center" prop="fileName" min-width="100px" />
<el-table-column label="文件类型" align="center" prop="fileSuffix" min-width="100px" />
<el-table-column label="文件路径" align="center" min-width="100px"> <el-table-column label="文件路径" align="center" min-width="100px">
<template #default="scope"> <template #default="scope">
<span>{{ filterfilenPath(scope.row.filePath) }}</span> <span>{{ filterfilenPath(scope.row.filePath) }}</span>
@ -45,7 +46,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </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>
</div> </div>
</el-dialog> </el-dialog>
@ -57,30 +58,15 @@ import { ref, reactive, getCurrentInstance, nextTick } from 'vue';
import { listKnowledgeDocument, getProfileDetail } from '@/api/quality/knowledgeDocument'; import { listKnowledgeDocument, getProfileDetail } from '@/api/quality/knowledgeDocument';
import { useUserStoreHook } from '@/store/modules/user'; import { useUserStoreHook } from '@/store/modules/user';
const emit = defineEmits(['onExport', 'onExportView']); const emit = defineEmits(['onExport', 'onExportView', 'onBook']);
const stores = useUserStoreHook(); 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 loading = ref(false);
const tableData = ref<any[]>([]); const tableData = ref<any[]>([]);
const isShowDialog = ref(false); const isShowDialog = ref(false);
const formData = reactive({ fileName: '', projectId: stores.selectedProject.id }); const formData = reactive({ fileName: '', projectId: stores.selectedProject.id, pageNum: 1, pageSize: 10 });
const projectList = ref<any[]>([]);
const projectQuery = reactive({ name: '' });
const pageNum = ref(1);
const pageSize = ref(10);
const total = ref(0); const total = ref(0);
const showDocumentDetail = ref(false);
const emptyText = ref('暂无数据'); const emptyText = ref('暂无数据');
const treeList = ref<any[]>([]); const treeList = ref<any[]>([]);
const arrayList = ref<any[]>([]);
const infoMap = ref(new Map());
const infoList = ref<any[]>([]);
const paramsQuery = reactive({ idStr: '', project: '' });
const openDialog = () => { const openDialog = () => {
isShowDialog.value = true; isShowDialog.value = true;
@ -104,7 +90,7 @@ const getDataFileQuery = () => {
tableData.value = []; tableData.value = [];
if (res.code == 200 && res.rows?.length) { if (res.code == 200 && res.rows?.length) {
tableData.value = res.rows; tableData.value = res.rows;
total.value = res.rows.length; total.value = res.total;
} else { } else {
emptyText.value = '没有查询到数据,请重新输入搜索'; emptyText.value = '没有查询到数据,请重新输入搜索';
} }
@ -112,15 +98,7 @@ const getDataFileQuery = () => {
}; };
const onBook = (row: any) => { const onBook = (row: any) => {
return; emit('onBook', row);
getProfileDetail(row.id).then((res: any) => {
if (res.code == 200) {
showDocumentDetail.value = true;
nextTick(() => {
documentDetailRef.value.openDialog(res.data);
});
}
});
}; };
const onExport = (row: any) => { const onExport = (row: any) => {

View File

@ -93,13 +93,14 @@
<el-table v-loading="state.loading" :data="state.infoList" height="67vh" border> <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" type="index" min-width="50px" />
<el-table-column label="文件名称" align="center" prop="fileName"></el-table-column> <el-table-column label="文件名称" align="center" prop="fileName"></el-table-column>
<el-table-column label="上传时间" align="center" prop="createdAt"> </el-table-column> <el-table-column label="文件类型" align="center" prop="fileSuffix" width="100px" />
<el-table-column label="操作" align="center"> <el-table-column label="上传时间" align="center" prop="createTime"> </el-table-column>
<el-table-column label="操作" align="center" width="300">
<template #default="scope"> <template #default="scope">
<el-button <el-button
type="primary" type="primary"
v-auth="'/zm/api/v1/system/documentData/get'" v-auth="'/zm/api/v1/system/documentData/get'"
v-if="state.acceptType.includes(scope.row.suffix)" v-if="state.acceptType.includes(scope.row.fileSuffix)"
link link
@click="handleView(scope.row)" @click="handleView(scope.row)"
><el-icon><View /></el-icon>查看</el-button ><el-icon><View /></el-icon>查看</el-button
@ -107,7 +108,7 @@
<el-button <el-button
type="primary" type="primary"
v-auth="'/zm/api/v1/system/documentData/complaintBoxAdd'" v-auth="'/zm/api/v1/system/documentData/complaintBoxAdd'"
v-if="state.acceptType.includes(scope.row.suffix)" v-if="state.acceptType.includes(scope.row.fileSuffix)"
link link
@click="updataView(scope.row)" @click="updataView(scope.row)"
><el-icon><EditPen /></el-icon>修改文件</el-button ><el-icon><EditPen /></el-icon>修改文件</el-button
@ -132,9 +133,9 @@
/> />
</div> </div>
</div> </div>
<!-- <documentDetail ref="documentDetailRef" v-if="state.showDocumentDetail" @onClose="onClose"></documentDetail> <documentsDeailsVue ref="documentDetailRef" v-if="state.showDocumentDetail" @onClose="onClose"></documentsDeailsVue>
<documentsEdit ref="documentDataEditRef" v-if="state.showdocumentDataEdit" @onClose="onCloseEdit"></documentsEdit> <documentsEdit ref="documentDataEditRef" v-if="state.showdocumentDataEdit" @onClose="onCloseEdit"></documentsEdit>
<uploadFileder <!-- <uploadFileder
ref="uploadFilederRef" ref="uploadFilederRef"
v-if="state.showUploadFileder" v-if="state.showUploadFileder"
@onCloseFile="state.showUploadFileder = false" @onCloseFile="state.showUploadFileder = false"
@ -142,7 +143,7 @@
></uploadFileder> ></uploadFileder>
<fileOnline ref="fileOnlineRef" @getfileOnlineType="getfileOnlineType"></fileOnline> <fileOnline ref="fileOnlineRef" @getfileOnlineType="getfileOnlineType"></fileOnline>
<moveFile ref="moveFileRef"></moveFile> --> <moveFile ref="moveFileRef"></moveFile> -->
<bookFile ref="bookFileRef" @onExportView="onExportView" @onExport="onExport"></bookFile> <bookFile ref="bookFileRef" @onExportView="onExportView" @onExport="onExport" @onBook="handleView"></bookFile>
<el-dialog title="上传文件" v-model="uploadFileder" width="30%"> <el-dialog title="上传文件" v-model="uploadFileder" width="30%">
<file-upload v-model="state.paramsQuery.file"></file-upload> <file-upload v-model="state.paramsQuery.file"></file-upload>
<template #footer> <template #footer>
@ -179,16 +180,13 @@ type KnowledgeDocumentOption = {
fileName: string; fileName: string;
children?: KnowledgeDocumentOption[]; children?: KnowledgeDocumentOption[];
}; };
// import documentDetail from '/@/views/OnlineEngineering/comm/documentsDetail/index.vue'; import DocumentsEdit from '@/views/safety/knowledgeDocument/component/documentsEdit.vue';
// import documentsEdit from '/@/views/OnlineEngineering/comm/documentsEdit/index.vue'; import documentsDeailsVue from '@/views/safety/knowledgeDocument/component/documentsDeails.vue';
// import profileData from '/@/views/OnlineEngineering/profileData/index.vue';
// import uploadFileder from '/@/views/OnlineEngineering/comm/uploadFileder/index.vue';
// import fileOnline from '/@/views/OnlineEngineering/profileEngineering/fileOnline/index.vue';
// import moveFile from '/@/views/OnlineEngineering/profileEngineering/moveFile/index.vue';
import RecyclingStation from './component/recyclingStation.vue'; import RecyclingStation from './component/recyclingStation.vue';
import { useUserStoreHook } from '@/store/modules/user'; import { useUserStoreHook } from '@/store/modules/user';
import bookFile from './component/bookFile.vue'; import bookFile from './component/bookFile.vue';
const activeName = ref('first'); const activeName = ref('first');
const { proxy } = getCurrentInstance() as any; const { proxy } = getCurrentInstance() as any;
// 获取用户 store // 获取用户 store
@ -245,7 +243,7 @@ const state = reactive({
parentName: '', parentName: '',
selectedNodeId: null, selectedNodeId: null,
projectId: currentProject.value?.id || '', projectId: currentProject.value?.id || '',
acceptType: ['.pdf', '.doc', '.docx', '.xls', '.xlsx', '.ppt', '.pptx'], acceptType: ['pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx'],
draggableCheck: true, draggableCheck: true,
activeName: '' activeName: ''
}); });
@ -418,15 +416,10 @@ const updateName = (row) => {
editName(row, '请输入文件名称', 1); editName(row, '请输入文件名称', 1);
}; };
const handleView = (row) => { const handleView = (row) => {
// getProfileDetail(row.id).then((res: any) => { state.showDocumentDetail = true;
// if (res.code == 200) { nextTick(() => {
// // 查看文档 documentDetailRef.value.openDialog(row);
// state.showDocumentDetail = true; });
// nextTick(() => {
// documentDetailRef.value.openDialog(res.data);
// });
// }
// });
}; };
// 关闭在线编辑弹框 // 关闭在线编辑弹框
const onClose = () => { const onClose = () => {
@ -440,7 +433,7 @@ const updataView = (row) => {
// 修改文档 // 修改文档
state.showdocumentDataEdit = true; state.showdocumentDataEdit = true;
nextTick(() => { nextTick(() => {
documentDataEditRef.value.openDialog(row, '/zm/api/v1/system/busConstructionUser/complaintBoxAddTwo'); documentDataEditRef.value.openDialog(row, '/quality/knowledgeDocument/changxie/callback/');
}); });
}; };
// 删除文件及文件夹 // 删除文件及文件夹

View File

@ -29,6 +29,8 @@
<el-table v-loading="loading" :data="tableData" border height="63vh" :empty-text="emptyText"> <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" type="index" width="80px" />
<el-table-column label="文件名称" align="center" prop="fileName" min-width="100px" /> <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"> <el-table-column label="文件路径" align="center" min-width="100px">
<template #default="scope"> <template #default="scope">
<span>{{ filterfilenPath(scope.row.filePath) }}</span> <span>{{ filterfilenPath(scope.row.filePath) }}</span>
@ -45,7 +47,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </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>
</div> </div>
</el-dialog> </el-dialog>
@ -53,34 +55,23 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, reactive, getCurrentInstance, nextTick } from 'vue'; import { listKnowledgeDocument } from '@/api/safety/knowledgeDocument';
import { listKnowledgeDocument, getProfileDetail } from '@/api/safety/knowledgeDocument';
import { useUserStoreHook } from '@/store/modules/user'; import { useUserStoreHook } from '@/store/modules/user';
const emit = defineEmits(['onExport', 'onExportView']); const emit = defineEmits(['onExport', 'onExportView', 'onBook']);
const stores = useUserStoreHook(); 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 loading = ref(false);
const tableData = ref<any[]>([]); const tableData = ref<any[]>([]);
const isShowDialog = ref(false); const isShowDialog = ref(false);
const formData = reactive({ fileName: '', projectId: stores.selectedProject.id }); const formData = reactive({
const projectList = ref<any[]>([]); fileName: '',
const projectQuery = reactive({ name: '' }); projectId: stores.selectedProject.id,
const pageNum = ref(1); pageNum: 1,
const pageSize = ref(10); pageSize: 10
});
const total = ref(0); const total = ref(0);
const showDocumentDetail = ref(false);
const emptyText = ref('暂无数据'); const emptyText = ref('暂无数据');
const treeList = ref<any[]>([]); const treeList = ref<any[]>([]);
const arrayList = ref<any[]>([]);
const infoMap = ref(new Map());
const infoList = ref<any[]>([]);
const paramsQuery = reactive({ idStr: '', project: '' });
const openDialog = () => { const openDialog = () => {
isShowDialog.value = true; isShowDialog.value = true;
@ -104,7 +95,7 @@ const getDataFileQuery = () => {
tableData.value = []; tableData.value = [];
if (res.code == 200 && res.rows?.length) { if (res.code == 200 && res.rows?.length) {
tableData.value = res.rows; tableData.value = res.rows;
total.value = res.rows.length; total.value = res.total;
} else { } else {
emptyText.value = '没有查询到数据,请重新输入搜索'; emptyText.value = '没有查询到数据,请重新输入搜索';
} }
@ -112,15 +103,7 @@ const getDataFileQuery = () => {
}; };
const onBook = (row: any) => { const onBook = (row: any) => {
return; emit('onBook', row);
getProfileDetail(row.id).then((res: any) => {
if (res.code == 200) {
showDocumentDetail.value = true;
nextTick(() => {
documentDetailRef.value.openDialog(res.data);
});
}
});
}; };
const onExport = (row: any) => { const onExport = (row: any) => {

View File

@ -88,7 +88,7 @@ export default defineComponent({
} else if (type == 'ppt' || type == 'pptx') { } else if (type == 'ppt' || type == 'pptx') {
documentType = 'slide'; //演示文档文件 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', { new CXO_API.CXEditor('box_app_edit', {
document: { document: {
fileType: obj.fileSuffix, fileType: obj.fileSuffix,
@ -97,8 +97,9 @@ export default defineComponent({
url: obj.fileUrl url: obj.fileUrl
}, },
documentType, documentType,
token: stores.token,
editorConfig: { editorConfig: {
callbackUrl: baseURL + state.postUrl + '?path=' + obj.filePath callbackUrl: baseURL + state.postUrl + obj.id + '?path=' + obj.filePath
}, },
events: { events: {
onDocumentReady: onDocumentReady, onDocumentReady: onDocumentReady,

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -12,6 +12,7 @@
:uploadUrl="uploadUrl" :uploadUrl="uploadUrl"
:params="uploadParams" :params="uploadParams"
:on-upload-success="uploadFile" :on-upload-success="uploadFile"
:fileType="[]"
> >
<el-button type="primary" style="float: left" :disabled="!state.parentPid"> <el-button type="primary" style="float: left" :disabled="!state.parentPid">
<el-icon size="small"><Plus /></el-icon>上传文件 <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 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" type="index" min-width="50px" />
<el-table-column label="文件名称" align="center" prop="fileName"></el-table-column> <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" prop="createTime"> </el-table-column>
<el-table-column label="操作" align="center" width="300"> <el-table-column label="操作" align="center" width="300">
<template #default="scope"> <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-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-icon><EditPen /></el-icon>修改文件</el-button
> >
<el-button type="primary" v-auth="'/zm/api/v1/system/documentData/uniFolderDownload'" link @click="onExportView(scope.row)" <el-button type="primary" v-auth="'/zm/api/v1/system/documentData/uniFolderDownload'" link @click="onExportView(scope.row)"
@ -132,7 +140,7 @@
></uploadFileder> ></uploadFileder>
<fileOnline ref="fileOnlineRef" @getfileOnlineType="getfileOnlineType"></fileOnline> <fileOnline ref="fileOnlineRef" @getfileOnlineType="getfileOnlineType"></fileOnline>
<moveFile ref="moveFileRef"></moveFile> --> <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%"> <el-dialog title="上传文件" v-model="uploadFileder" width="30%">
<file-upload v-model="state.paramsQuery.file"></file-upload> <file-upload v-model="state.paramsQuery.file"></file-upload>
<template #footer> <template #footer>
@ -235,7 +243,7 @@ const state = reactive({
parentName: '', parentName: '',
selectedNodeId: null, selectedNodeId: null,
projectId: currentProject.value?.id || '', projectId: currentProject.value?.id || '',
acceptType: ['.pdf', '.doc', '.docx', '.xls', '.xlsx', '.ppt', '.pptx'], acceptType: ['pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx'],
draggableCheck: true, draggableCheck: true,
activeName: '' activeName: ''
}); });
@ -426,7 +434,7 @@ const updataView = (row) => {
// 修改文档 // 修改文档
state.showdocumentDataEdit = true; state.showdocumentDataEdit = true;
nextTick(() => { nextTick(() => {
documentDataEditRef.value.openDialog(row, '/changxie/callback'); documentDataEditRef.value.openDialog(row, '/safety/knowledgeDocument/changxie/callback/');
}); });
}; };
// 删除文件及文件夹 // 删除文件及文件夹