update:文件对比页面新增弹窗,bug修复
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
:tableName="checkTableName"
|
||||
hidePagination
|
||||
>
|
||||
<template v-for="item in tableColumns" :key="item.key" #[item.key]="{ row }">
|
||||
<template v-for="item in tableColumns" :key="item.key" #[item.key]="{ row }">
|
||||
<div v-if="row.attributes != '操作'">
|
||||
<img
|
||||
v-if="row.attributes === '文件名称'"
|
||||
@@ -21,12 +21,13 @@
|
||||
<div v-else>
|
||||
<el-button type="primary" link @click="reviewFun(item)">预览</el-button>
|
||||
<el-button type="primary" link @click="downLoadFun(item)">下载</el-button>
|
||||
<el-button type="primary" link @click="compareFun(item)">对比</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</BaseTable>
|
||||
<FilePreview v-model="previewVisible" :fileId="fileId"></FilePreview>
|
||||
|
||||
</BaseTable>
|
||||
<FilePreview v-model="previewVisible" :fileId="fileId"></FilePreview>
|
||||
<compareTextFile v-if="compareVisible" @close="compareVisible = false"></compareTextFile>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -36,6 +37,7 @@ import BaseTable from '@/components/common/table/baseTable.vue';
|
||||
import { objectTypeArrayRemovesDuplicates } from '@/utils/common';
|
||||
import FilePreview from '@/components/common/filePreview/index.vue';
|
||||
import { downloadFileByStream, fileUploadAllocationIconFun } from '@/utils/file';
|
||||
import compareTextFile from './compareTextFile.vue';
|
||||
|
||||
const props = defineProps({
|
||||
checkTaskInfo: {
|
||||
@@ -57,8 +59,8 @@ const showTableContent = ref(false);
|
||||
const tableColumns = ref<any>([]);
|
||||
|
||||
const tableData = ref<any>([]);
|
||||
const previewVisible = ref(false);
|
||||
const fileId = ref<any>('');
|
||||
const previewVisible = ref(false);
|
||||
const fileId = ref<any>('');
|
||||
const modelAttribute = ref<any>([
|
||||
{
|
||||
name: '文件名称',
|
||||
@@ -193,6 +195,14 @@ const downLoadFun = (column: any) => {
|
||||
downloadFileByStream(fileId.value);
|
||||
};
|
||||
|
||||
const compareVisible = ref(false);
|
||||
const compareFile = ref<any>({});
|
||||
// 对比文件
|
||||
const compareFun = (data: any) => {
|
||||
compareFile.value = data;
|
||||
compareVisible.value = true;
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.checkTaskInfo,
|
||||
(newVal) => {
|
||||
|
||||
24
src/views/data/analysis/components/compareTextFile.vue
Normal file
24
src/views/data/analysis/components/compareTextFile.vue
Normal file
@@ -0,0 +1,24 @@
|
||||
<template>
|
||||
<Dialog
|
||||
v-model="diaVisible"
|
||||
diaTitle="文件对比"
|
||||
width="70%"
|
||||
height="90%"
|
||||
@close="closeFun"
|
||||
:showFooter="false"
|
||||
></Dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import Dialog from '@/components/common/dialog/index.vue';
|
||||
|
||||
const emits = defineEmits(['close']);
|
||||
const diaVisible = ref(true);
|
||||
|
||||
const closeFun = () => {
|
||||
emits('close');
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -21,11 +21,13 @@
|
||||
<div v-else>
|
||||
<el-button type="primary" link @click="reviewFun(item)">预览</el-button>
|
||||
<el-button type="primary" link @click="downLoadFun(item)">下载</el-button>
|
||||
<el-button type="primary" link @click="compareFun(item)">对比</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</BaseTable>
|
||||
<FilePreview v-model="previewVisible" :fileId="fileId"></FilePreview>
|
||||
<compareTextFile v-if="compareVisible" @close="compareVisible = false"></compareTextFile>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -35,6 +37,7 @@ import BaseTable from '@/components/common/table/baseTable.vue';
|
||||
import { objectTypeArrayRemovesDuplicates } from '@/utils/common';
|
||||
import FilePreview from '@/components/common/filePreview/index.vue';
|
||||
import { downloadFileByStream, fileUploadAllocationIconFun } from '@/utils/file';
|
||||
import compareTextFile from './compareTextFile.vue';
|
||||
|
||||
const props = defineProps({
|
||||
checkTaskInfo: {
|
||||
@@ -192,6 +195,14 @@ const downLoadFun = (column: any) => {
|
||||
downloadFileByStream(fileId.value);
|
||||
};
|
||||
|
||||
const compareVisible = ref(false);
|
||||
const compareFile = ref<any>({});
|
||||
// 对比文件
|
||||
const compareFun = (data: any) => {
|
||||
compareFile.value = data;
|
||||
compareVisible.value = true;
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.checkTaskInfo,
|
||||
(newVal) => {
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<el-tree
|
||||
ref="taskTreeRef"
|
||||
:data="dataSource"
|
||||
node-key="id"
|
||||
node-key="uuid"
|
||||
highlight-current
|
||||
:expand-on-click-node="false"
|
||||
:default-expanded-keys="defaultExpandKeys"
|
||||
@@ -255,24 +255,24 @@ const changeExpendTypeFun = (data: any) => {
|
||||
const setExpandElementFun = (list: any, flag: any = 'all') => {
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
if (flag === 'all') {
|
||||
defaultExpandKeys.value.push(list[i].id);
|
||||
defaultExpandKeys.value.push(list[i].uuid);
|
||||
}
|
||||
|
||||
if (flag === 'node') {
|
||||
if (list[i].nodeType === 'workspace') {
|
||||
defaultExpandKeys.value.push(list[i].id);
|
||||
defaultExpandKeys.value.push(list[i].uuid);
|
||||
}
|
||||
}
|
||||
|
||||
if (flag === 'task') {
|
||||
if (list[i].nodeType === NODE_TYPE.TASK) {
|
||||
defaultExpandKeys.value.push(list[i].id);
|
||||
defaultExpandKeys.value.push(list[i].uuid);
|
||||
}
|
||||
}
|
||||
|
||||
if (flag === 'run') {
|
||||
if (list[i].nodeType === NODE_TYPE.RUN) {
|
||||
defaultExpandKeys.value.push(list[i].id);
|
||||
defaultExpandKeys.value.push(list[i].uuid);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -391,7 +391,7 @@ const nodeChangeClickFun = (data: any, node: any) => {
|
||||
}
|
||||
localStorage.setItem('CURRENT_TASK_RUN_INFO', JSON.stringify(data));
|
||||
|
||||
defaultExpandKeys.value = [data.id];
|
||||
defaultExpandKeys.value = [data.uuid];
|
||||
emits('nodeClickFn', { node: currentNodeInfo.value });
|
||||
};
|
||||
|
||||
@@ -598,8 +598,8 @@ const createRunFun = async (data: any) => {
|
||||
taskTreeRef.value.append(runInfo, rightClickNode.value);
|
||||
}
|
||||
currentNodeInfo.value = runInfo;
|
||||
defaultExpandKeys.value = [runInfo.id];
|
||||
taskTreeRef.value.setCurrentKey(runInfo.id);
|
||||
defaultExpandKeys.value = [runInfo.uuid];
|
||||
taskTreeRef.value.setCurrentKey(runInfo.uuid);
|
||||
emits('nodeClickFn', { node: currentNodeInfo.value });
|
||||
}
|
||||
} else {
|
||||
@@ -662,16 +662,16 @@ const restoreSelectionFun = () => {
|
||||
: '';
|
||||
if (resetData) {
|
||||
currentNodeInfo.value = resetData;
|
||||
defaultExpandKeys.value = [resetData.id];
|
||||
defaultExpandKeys.value = [resetData.uuid];
|
||||
|
||||
// 修复 861bug 手动触发 nodeChangeClickFun,等待树节点加载
|
||||
const unwatch = watch(
|
||||
() => taskTreeRef.value?.store?.nodesMap,
|
||||
(nodesMap) => {
|
||||
if (nodesMap && nodesMap[resetData.id]) {
|
||||
if (nodesMap && nodesMap[resetData.uuid]) {
|
||||
unwatch();
|
||||
taskTreeRef.value.setCurrentKey(resetData.id);
|
||||
const node = taskTreeRef.value.getNode(resetData.id);
|
||||
taskTreeRef.value.setCurrentKey(resetData.uuid);
|
||||
const node = taskTreeRef.value.getNode(resetData.uuid);
|
||||
if (node) {
|
||||
nodeChangeClickFun(resetData, node);
|
||||
}
|
||||
|
||||
@@ -487,16 +487,19 @@ const skipRunFun = async (data: any) => {
|
||||
const obj = {
|
||||
ProjectType: projectType,
|
||||
projectName: props.currentTaskInfo.newTag1,
|
||||
projectCodeName: '',
|
||||
projectCodeName: props.currentTaskInfo.tag1Code,
|
||||
projectCode: props.currentTaskInfo.tag1Code,
|
||||
phaseName: props.currentTaskInfo.newTag2,
|
||||
phaseCodeName: '',
|
||||
phaseCodeName: props.currentTaskInfo.tag2Code,
|
||||
discipline: 'discipline',
|
||||
attribution: 'personal',
|
||||
taskType: 'all',
|
||||
expendType: 'all',
|
||||
};
|
||||
localStorage.setItem('CURRENT_FILTER_RUN_TASK_TREE_PARAM', JSON.stringify(obj));
|
||||
localStorage.setItem('CURRENT_TASK_RUN_INFO', JSON.stringify({ ...data, nodeType: 'task' }));
|
||||
|
||||
const runInfo = { ...data, nodeType: 'task' };
|
||||
localStorage.setItem('CURRENT_TASK_RUN_INFO', JSON.stringify(runInfo));
|
||||
closeFun();
|
||||
jumpPage({ path: '/task/execution' });
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user