This commit is contained in:
2025-07-02 10:58:46 +08:00
12 changed files with 121 additions and 196 deletions

View File

@ -9,7 +9,7 @@ VITE_APP_BASE_API = 'http://192.168.110.119:8899'
# 无人机接口地址
VITE_APP_BASE_DRONE_API = 'http://192.168.110.8:9136'
VITE_APP_BASE_DRONE_API = 'http://192.168.110.119:9136'
# 应用访问路径 例如使用前缀 /admin/
VITE_APP_CONTEXT_PATH = '/'

View File

@ -210,7 +210,7 @@
</div>
</div>
<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/utils/reconnecting-websocket.js"></script>
<script type="module" src="/src/main.ts"></script>

View File

@ -500,18 +500,8 @@ const initGeoTiff = async () => {
};
let map: any = null;
const layerData = reactive<any>({});
const centerPosition = ref(fromLonLat([107.12932403398425, 23.805564054229908]));
const initOLMap = () => {
console.log(111);
// const scoure = new TileLayer({
// // 设置图层的数据源为XYZ类型。XYZ是一个通用的瓦片图层源它允许你通过URL模板来获取瓦片
// source: new XYZ({
// url: 'http://192.168.110.2:8000/api/projects/3/tasks/c2e3227f-343f-48b1-88c0-1432d6eab33f/orthophoto/tiles/{z}/{x}/{y}'
// })
// });
// console.log(scoure);
map = new Map({
// 设置地图容器的ID
target: 'olMap',
@ -519,16 +509,17 @@ const initOLMap = () => {
layers: [
// 高德地图
// TileLayer表示一个瓦片图层它由一系列瓦片通常是图片组成用于在地图上显示地理数据。
new TileLayer({
// 设置图层的数据源为XYZ类型。XYZ是一个通用的瓦片图层源它允许你通过URL模板来获取瓦片
source: new XYZ({
url: 'https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}'
url: 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',
maxZoom: 18
})
}),
new TileLayer({
// 设置图层的数据源为XYZ类型。XYZ是一个通用的瓦片图层源它允许你通过URL模板来获取瓦片
source: new XYZ({
url: 'http://webst02.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scale=1&style=8'
url: 'http://192.168.110.2:8000/api/projects/3/tasks/c2e3227f-343f-48b1-88c0-1432d6eab33f/orthophoto/tiles/{z}/{x}/{y}'
})
})
// imageLayer.value
@ -541,7 +532,7 @@ const initOLMap = () => {
center: centerPosition.value, //地图中心点
zoom: 15, // 缩放级别
minZoom: 0, // 最小缩放级别
// maxZoom: 18, // 最大缩放级别
// maxZoom: 19, // 最大缩放级别
constrainResolution: true // 因为存在非整数的缩放级别所以设置该参数为true来让每次缩放结束后自动缩放到距离最近的一个整数级别这个必须要设置当缩放在非整数级别时地图会糊
// projection: 'EPSG:4326' // 投影坐标系默认是3857
}),
@ -848,8 +839,6 @@ const toggleFeatureHighlight = (feature: Feature, addIfNotExist = true) => {
onMounted(async () => {
// 地图初始化
// geoTiffLoading.value = true;
await initGeoTiff();
initOLMap();
// geoTiffLoading.value = false;
map.addLayer(sharedLayer);

View File

@ -22,6 +22,10 @@
</el-card>
</div>
</transition>
<<<<<<< HEAD
=======
>>>>>>> 64b04286e36ef42ab8a27f17406454b185d48e80
<el-card shadow="never">
<template #header>
<el-row :gutter="10" class="mb8">

View File

@ -29,6 +29,7 @@
<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" min-width="100px" />
<el-table-column label="文件路径" align="center" min-width="100px">
<template #default="scope">
<span>{{ filterfilenPath(scope.row.filePath) }}</span>
@ -45,7 +46,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>
@ -57,30 +58,15 @@ import { ref, reactive, getCurrentInstance, nextTick } from 'vue';
import { listKnowledgeDocument, getProfileDetail } from '@/api/quality/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 +90,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 +98,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) => {

View File

@ -93,13 +93,14 @@
<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="createdAt"> </el-table-column>
<el-table-column label="操作" align="center">
<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"
v-auth="'/zm/api/v1/system/documentData/get'"
v-if="state.acceptType.includes(scope.row.suffix)"
v-if="acceptType.includes(scope.row.fileSuffix)"
link
@click="handleView(scope.row)"
><el-icon><View /></el-icon>查看</el-button
@ -107,7 +108,7 @@
<el-button
type="primary"
v-auth="'/zm/api/v1/system/documentData/complaintBoxAdd'"
v-if="state.acceptType.includes(scope.row.suffix)"
v-if="state.wordType.includes(scope.row.fileSuffix)"
link
@click="updataView(scope.row)"
><el-icon><EditPen /></el-icon>修改文件</el-button
@ -132,9 +133,9 @@
/>
</div>
</div>
<!-- <documentDetail ref="documentDetailRef" v-if="state.showDocumentDetail" @onClose="onClose"></documentDetail>
<documentsEdit ref="documentDataEditRef" v-if="state.showdocumentDataEdit" @onClose="onCloseEdit"></documentsEdit>
<uploadFileder
<documentsDeailsVue ref="documentDetailRef" v-if="state.showDocumentDetail" @onClose="onClose"></documentsDeailsVue>
<documentsEdit ref="documentDataEditRef" v-if="state.showdocumentDataEdit" @onClose="onCloseEdit"></documentsEdit>
<!-- <uploadFileder
ref="uploadFilederRef"
v-if="state.showUploadFileder"
@onCloseFile="state.showUploadFileder = false"
@ -142,7 +143,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" @onExport="onExport" @onBook="handleView"></bookFile>
<el-dialog title="上传文件" v-model="uploadFileder" width="30%">
<file-upload v-model="state.paramsQuery.file"></file-upload>
<template #footer>
@ -158,6 +159,15 @@
<RecyclingStation ref="recylingRef"></RecyclingStation>
</el-tab-pane>
</el-tabs>
<el-image-viewer
ref="imageRef"
style="width: 100%; height: 100%"
:url-list="[imgUrl]"
v-if="imgUrl"
show-progress
fit="cover"
@close="imgUrl = ''"
/>
</template>
<script setup name="KnowledgeDocument" lang="ts">
@ -179,12 +189,8 @@ type KnowledgeDocumentOption = {
fileName: string;
children?: KnowledgeDocumentOption[];
};
// import documentDetail from '/@/views/OnlineEngineering/comm/documentsDetail/index.vue';
// import documentsEdit from '/@/views/OnlineEngineering/comm/documentsEdit/index.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 DocumentsEdit from '@/views/safety/knowledgeDocument/component/documentsEdit.vue';
import documentsDeailsVue from '@/views/safety/knowledgeDocument/component/documentsDeails.vue';
import RecyclingStation from './component/recyclingStation.vue';
import { useUserStoreHook } from '@/store/modules/user';
@ -205,6 +211,8 @@ const uploadParams = computed(() => {
};
});
const imgUrl = ref<string>('');
const filterText = ref('');
const treeRef = ref();
const documentDetailRef = ref();
@ -245,11 +253,15 @@ const state = reactive({
parentName: '',
selectedNodeId: null,
projectId: currentProject.value?.id || '',
acceptType: ['.pdf', '.doc', '.docx', '.xls', '.xlsx', '.ppt', '.pptx'],
imgType: ['jpg', 'png', 'jpeg', 'gif', 'svg'],
wordType: ['pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx'],
browserViewableType: ['html', 'htm', 'txt', 'log', 'md', 'json', 'xml', 'css', 'js'],
draggableCheck: true,
activeName: ''
});
const acceptType = computed(() => [...state.imgType, ...state.wordType, ...state.browserViewableType]);
watch(filterText, (val: any) => {
treeRef.value!.filter(val);
});
@ -418,15 +430,17 @@ const updateName = (row) => {
editName(row, '请输入文件名称', 1);
};
const handleView = (row) => {
// getProfileDetail(row.id).then((res: any) => {
// if (res.code == 200) {
// // 查看文档
// state.showDocumentDetail = true;
// nextTick(() => {
// documentDetailRef.value.openDialog(res.data);
// });
// }
// });
if (state.imgType.includes(row.fileSuffix)) {
imgUrl.value = row.fileUrl;
return;
} else if (state.wordType.includes(row.fileSuffix)) {
state.showDocumentDetail = true;
nextTick(() => {
documentDetailRef.value.openDialog(row);
});
} else {
window.open(row.fileUrl);
}
};
// 关闭在线编辑弹框
const onClose = () => {
@ -440,7 +454,7 @@ const updataView = (row) => {
// 修改文档
state.showdocumentDataEdit = true;
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-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) => {

View File

@ -13,6 +13,8 @@
</template>
<script lang="ts">
import { setMove } from '@/utils/moveDiv';
declare const CXO_API: any;
export default defineComponent({
name: 'index',
setup(props, { emit }) {
@ -68,10 +70,6 @@ export default defineComponent({
};
const init = (obj) => {
let documentKey = obj.id.toString() + new Date().getTime();
let baseURL = import.meta.env.VITE_APP_BASE_API + '/';
console.log(baseURL);
let url = baseURL + obj.filePath.replaceAll('+', ' ');
console.log('🚀 ~ init ~ url:', obj.fileUrl);
let type = obj.fileSuffix;
if (obj.fileSuffix.includes('.')) {
@ -83,8 +81,6 @@ export default defineComponent({
} else if (type == 'ppt' || type == 'pptx') {
documentType = 'slide'; //演示文档文件
}
console.log(documentType, obj.fileSuffix);
new CXO_API.CXEditor('box_app', {
document: {
fileType: type,
@ -130,7 +126,7 @@ export default defineComponent({
}
});
</script>
<style lang="scss">
<style lang="scss" scoped>
.document_detail {
position: fixed;
top: 50%;

View File

@ -16,6 +16,10 @@ import { toRefs, reactive, onMounted, ref, defineComponent, watch, getCurrentIns
import { setMove } from '@/utils/moveDiv';
import { useUserStoreHook } from '@/store/modules/user';
// Ensure CXO_API is available globally or import it if it's a module
// Example for global usage (e.g., included via script tag in index.html):
declare const CXO_API: any;
export default defineComponent({
name: 'index',
setup(props, { emit }) {
@ -88,7 +92,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 +101,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,
@ -133,7 +138,7 @@ export default defineComponent({
}
});
</script>
<style lang="scss">
<style lang="scss" scoped>
.document_detail_eidt {
position: fixed;
top: 50%;

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"
:params="uploadParams"
:on-upload-success="uploadFile"
:fileType="[]"
>
<el-button type="primary" style="float: left" :disabled="!state.parentPid">
<el-icon size="small"><Plus /></el-icon>上传文件
@ -77,29 +78,26 @@
>
</el-form-item>
</el-col>
<!-- <el-col :span="4">
<el-button type="primary" v-auth="'/zm/api/v1/system/documentData/add'" :disabled="!parentPid" @click="uploadFile(2)"
><el-icon><Plus /></el-icon>导入本地文件</el-button
>
</el-col> -->
<!-- <el-col :span="4">
<el-button type="primary" @click="onMoveFile"
><el-icon><Plus /></el-icon>移动</el-button
>
</el-col> -->
</el-row>
</el-form>
</div>
<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="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.wordType.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)"
@ -124,15 +122,7 @@
</div>
<documentsDeailsVue ref="documentDetailRef" v-if="state.showDocumentDetail" @onClose="onClose"></documentsDeailsVue>
<documentsEdit ref="documentDataEditRef" v-if="state.showdocumentDataEdit" @onClose="onCloseEdit"></documentsEdit>
<!--<uploadFileder
ref="uploadFilederRef"
v-if="state.showUploadFileder"
@onCloseFile="state.showUploadFileder = false"
@getDocumentListFileType="getdocumentDataListFileType"
></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>
@ -148,32 +138,28 @@
<RecyclingStation ref="recylingRef"></RecyclingStation>
</el-tab-pane>
</el-tabs>
<el-image-viewer
ref="imageRef"
style="width: 100%; height: 100%"
:url-list="[imgUrl]"
v-if="imgUrl"
show-progress
fit="cover"
@close="imgUrl = ''"
/>
</template>
<script setup name="KnowledgeDocument" lang="ts">
import {
listKnowledgeDocument,
getKnowledgeDocument,
delKnowledgeDocument,
addKnowledgeDocument,
getUniFolderDownloadList,
treeStructureData,
documentDataEdit,
getProfileDetail,
updateKnowledgeDocument
documentDataEdit
} from '@/api/safety/knowledgeDocument';
import { KnowledgeDocumentVO, KnowledgeDocumentQuery, KnowledgeDocumentForm } from '@/api/quality/knowledgeDocument/types';
type KnowledgeDocumentOption = {
id: number;
fileName: string;
children?: KnowledgeDocumentOption[];
};
import documentsEdit from './component/documentsEdit.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 documentsDeailsVue from './component/documentsDeails.vue';
import RecyclingStation from './component/recyclingStation.vue';
@ -195,16 +181,15 @@ const uploadParams = computed(() => {
};
});
const imgUrl = ref<string>('');
const filterText = ref('');
const treeRef = ref();
const documentDetailRef = ref();
const documentDataEditRef = ref();
const uploadFileder = ref(false);
const fileOnlineRef = ref();
const moveFileRef = ref();
const imageRef = ref();
const recylingRef = ref();
const bookFileRef = ref();
const baseURL: string | undefined | boolean = import.meta.env.VITE_API_URL;
const state = reactive({
treeList: [] as any,
arrayList: [] as any,
@ -235,46 +220,20 @@ const state = reactive({
parentName: '',
selectedNodeId: null,
projectId: currentProject.value?.id || '',
acceptType: ['.pdf', '.doc', '.docx', '.xls', '.xlsx', '.ppt', '.pptx'],
imgType: ['jpg', 'png', 'jpeg', 'gif', 'svg'],
wordType: ['pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx'],
browserViewableType: ['html', 'htm', 'txt', 'log', 'md', 'json', 'xml', 'css', 'js'],
draggableCheck: true,
activeName: ''
});
const acceptType = computed(() => [...state.imgType, ...state.wordType, ...state.browserViewableType]);
watch(filterText, (val: any) => {
treeRef.value!.filter(val);
});
// 新建文件夹
// const addFile = () => {
// let tip = '在根目录下新建文件夹';
// if (state.parentPid) {
// tip = '在“' + state.parentName + '文件夹”下新建文件夹';
// }
// ElMessageBox.prompt('请输入文件夹名称', tip, {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// inputErrorMessage: '请输入文件夹名称',
// inputValue: ''
// })
// .then(({ value }) => {
// documentDataNewFolder({ fileName: value, pid: state.parentPid, fileType: 3, projectId: state.projectId }).then((res: any) => {
// if (res.code == 0) {
// ElMessage({
// type: 'success',
// message: '添加成功'
// });
// gettreeStructureData();
// } else {
// ElMessage({
// type: 'error',
// message: res.message
// });
// }
// });
// })
// .catch(() => {});
// };
// 上传文件
const uploadFile = (files: any[]) => {
proxy.$modal.success('上传成功');
@ -289,7 +248,6 @@ const subMitUpload = () => {
ElMessage.warning('请选择文件!');
return;
}
addKnowledgeDocument(state.paramsQuery, { projectId: state.projectId, pid: state.parentPid }).then((res: any) => {
if (res.code == 200) {
ElMessage.success('上传成功');
@ -409,10 +367,17 @@ const updateName = (row) => {
editName(row, '请输入文件名称', 1);
};
const handleView = (row) => {
state.showDocumentDetail = true;
nextTick(() => {
documentDetailRef.value.openDialog(row);
});
if (state.imgType.includes(row.fileSuffix)) {
imgUrl.value = row.fileUrl;
return;
} else if (state.wordType.includes(row.fileSuffix)) {
state.showDocumentDetail = true;
nextTick(() => {
documentDetailRef.value.openDialog(row);
});
} else {
window.open(row.fileUrl);
}
};
// 关闭在线编辑弹框
const onClose = () => {
@ -426,7 +391,7 @@ const updataView = (row) => {
// 修改文档
state.showdocumentDataEdit = true;
nextTick(() => {
documentDataEditRef.value.openDialog(row, '/changxie/callback');
documentDataEditRef.value.openDialog(row, '/safety/knowledgeDocument/changxie/callback/');
});
};
// 删除文件及文件夹
@ -484,15 +449,6 @@ const onExport = () => {
}
});
};
// 在线模板文件导入
const uploadOnlineFile = (node, data) => {
state.paramsQuery.folderId = data.folderId;
fileOnlineRef.value.openDialog(data.id);
};
const onMoveFile = () => {
// 移动文件
// moveFileRef.value.openDialog();
};
// 查看所有资料
const onBook = () => {