Commit f2102ca5 authored by chenjiahao's avatar chenjiahao

Shell开发-修改已知问题

parent eff0cfa8
<template>
<div class="h-full">
<div>
<CodeMirrorEditor
:value="getValue"
@change="handleValueChange"
......
<template >
<PageWrapper dense contentFullHeight fixedHeight contentClass="flex" >
<PageWrapper dense contentFullHeight fixedHeight contentClass="flex flex-col" class="toolbar" style="width: 910px; ">
<div class="toolbar" style="background: white;" >
<div class="tools" >
<a-button type="primary" style="float: right; margin: 10px 15px 10px 0" @click="preservation">保存</a-button>
<template>
<PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
<PageWrapper
dense
contentFullHeight
fixedHeight
contentClass="flex flex-col"
class="toolbar"
style="width: 910px"
>
<div class="toolbar" style="background: white">
<div class="tools">
<a-button
type="primary"
style="float: right; margin: 10px 15px 10px 0"
@click="preservation"
>保存</a-button
>
</div>
</div>
<BasicForm
style="background: white; height: 686px;"
size="middle"
:bordered="false"
:column="2"
:model="info"
@register="registerGuideModeForm"
style="background: white; height: 686px"
size="middle"
:bordered="false"
:column="2"
:model="info"
@register="registerGuideModeForm"
>
<template #fileSlot>
<div style="display: flex; width: 342px">
<a-button type="primary">文件选择</a-button>
<p style="margin: 5px">仅允许导入单个.jar文件</p>
</div>
<div style="margin-top: 10px;">
<div style="margin-top: 10px">
<a-input style="width: 342px; margin-right: auto" allowClear />
</div>
</template>
</BasicForm>
<SaveSettingsModal @register="saveSettings" />
</PageWrapper>
......@@ -35,71 +43,61 @@
</template>
<script lang="ts" setup>
import { PageWrapper } from '@/components/Page';
import { tableList } from './mock';
import { personSchema } from './mainBody.data';
import { BasicForm, useForm } from '@/components/Form';
import SaveSettingsModal from './saveSettingsModal.vue';
import { useModal } from '@/components/Modal';
import { computed, onMounted } from 'vue';
const [saveSettings, { openModal: openModal }] = useModal(); // 新建质量主体弹窗
const pros = defineProps({
deptId: {
type: Number,
default: 0,
},
});
import {PageWrapper} from "@/components/Page";
import {tableList} from "./mock";
import {personSchema} from "./mainBody.data";
import {BasicForm, useForm} from "@/components/Form";
import SaveSettingsModal from "./saveSettingsModal.vue";
import {useModal} from "@/components/Modal";
import {computed, onMounted} from "vue";
const [saveSettings, { openModal: openModal }] =
useModal(); // 新建质量主体弹窗
// 初始化 info 为一个响应式对象
const info = computed(() => {
const list = tableList;
const index = list.findIndex((item) => {
return item.selectedDeptId === pros.deptId; // 添加 return 关键字
});
console.log('list', list);
console.log('index', index);
console.log('deptId', pros.deptId);
if (index !== -1) {
return list[index];
}
return {};
});
const pros = defineProps({
deptId: {
type: Number,
default: 0,
function palyStart() {
setFieldsValue(info.value);
}
})
// 初始化 info 为一个响应式对象
const info = computed(() => {
const list = tableList;
const index = list.findIndex((item) => {
return item.selectedDeptId === pros.deptId; // 添加 return 关键字
onMounted(() => {
console.log('tableList', tableList);
palyStart();
});
console.log('list', list);
console.log('index', index);
console.log('deptId', pros.deptId);
if (index !== -1) {
return list[index];
}
return {};
});
function palyStart() {
setFieldsValue(info.value);
}
onMounted(() => {
console.log('tableList', tableList)
palyStart();
});
function preservation() {
openModal(true, {
isUpdate: false,
});
}
function preservation() {
openModal(true, {
isUpdate: false,
const [registerGuideModeForm, { setFieldsValue }] = useForm({
labelWidth: 100,
schemas: personSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
}
const [registerGuideModeForm,{setFieldsValue}] = useForm({
labelWidth: 100,
schemas: personSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
</script>
<style scoped>
</style>
<style scoped></style>
......@@ -8,26 +8,32 @@
:deptId="selectedDeptId"
/>
<div class="m-4 mr-0 w-3/4 xl:w-4/5" v-else>
<div style="display: flex; align-items: center; background-color: white">
<Icon icon="majesticons:table-plus-line" :size="40" :color="'#e9a064'" />
<div style="margin-left: 10px">
<span class="title">test</span>
<div>
<span class="path">函数/test</span>
<div
style="
padding: 15px;
display: flex;
justify-content: space-between;
align-items: center;
background-color: white;
"
>
<div style="display: flex">
<Icon icon="majesticons:table-plus-line" :size="40" :color="'#e9a064'" />
<div style="margin-left: 10px">
<span class="title">test</span>
<div>
<span class="path">函数/test</span>
</div>
</div>
</div>
<a-button style="margin-left: 700px" type="primary" @click="handleDeleteIds">删除</a-button>
<a-button style="margin-left: 10px" type="primary" @click="handleMove(1)">移动</a-button>
<a-button style="margin-left: 10px" type="primary" @click="handleExport('文件')"
>导出</a-button
>
<a-button style="margin-left: 10px" type="primary" @click="handleImport">导入</a-button>
<a-button style="margin-left: 10px" type="primary" @click="handleNewFolder"
>新建文件夹</a-button
>
<a-button style="margin-left: 10px" type="primary" @click="handleNewFile"
>新建文件</a-button
>
<div style="display: flex; gap: 10px">
<a-button type="primary" @click="handleDeleteIds">删除</a-button>
<a-button type="primary" @click="handleMove(1)">移动</a-button>
<a-button type="primary" @click="handleExport('文件')">导出</a-button>
<a-button type="primary" @click="handleImport">导入</a-button>
<a-button type="primary" @click="handleNewFolder">新建文件夹</a-button>
<a-button type="primary" @click="handleNewFile">新建文件</a-button>
</div>
</div>
<BasicTable @register="registerTable" :searchInfo="searchInfo">
<template #bodyCell="{ column, record }">
......@@ -45,7 +51,7 @@
onClick: handleMove.bind(null, 1),
},
{
icon: 'material-symbols-light:delete-outline',
icon: 'material-symbols:delete-outline',
tooltip: '删除',
popConfirm: {
title: '是否确认删除',
......@@ -199,12 +205,12 @@
};
</script>
<style scoped>
.title {
font-size: 16px;
font-weight: 500;
}
.path {
font-size: 14px;
color: gray;
}
.title {
font-size: 20px;
font-weight: 500;
}
.path {
font-size: 14px;
color: gray;
}
</style>
<template>
<div class="m-5 mr-0 overflow-hidden bg-white">
<div class="mr-0 overflow-hidden bg-white p-5">
<BasicTree
title=""
ref="treeRef"
search
treeWrapperClassName="h-[calc(100%-35px)] overflow-auto"
:defaultExpandAll="true"
:treeData="treeData"
:fieldNames="{ key: 'businessId', title: 'workSpaceName' }"
@select="handleSelect"
:actionList="actionList"
/>
>
<template #headerTitle>
<span></span>
</template>
</BasicTree>
</div>
</template>
<script lang="ts" setup>
......
......@@ -8,11 +8,20 @@
>
<BasicForm @register="registerForm">
<template #fileMethods="{ model, field }">
<div style="display: flex">
<div>
<a-button>下载模板</a-button>
<a-button type="primary" style="margin-left: 5px">选择文件</a-button>
</div>
<div style="display: flex; gap: 10px">
<a-button @click="handleExport">下载模板</a-button>
<BasicUpload
:maxSize="20"
:maxNumber="10"
@change="handleChange"
:api="uploadApi"
:accept="['image/*']"
>
<template #uploadBtnName>
<span>选择文件</span>
</template>
</BasicUpload>
<!-- <a-button type="primary" style="margin-left: 5px">选择文件</a-button>-->
</div>
</template>
</BasicForm>
......@@ -23,6 +32,9 @@
import { BasicModal, useModalInner } from '@/components/Modal';
import { BasicForm, useForm } from '@/components/Form';
import { importFormSchema } from './tempalte.data';
import { exportRoleList } from '@/api/system/role/role';
import { downloadByData } from '@/utils/file/download';
import { BasicUpload } from '@/components/Upload';
const emit = defineEmits(['success', 'register']);
const isUpdate = ref(true);
......@@ -56,6 +68,13 @@
});
// onMounted(){}
/** 导出按钮*/
async function handleExport() {
console.log('导出----');
const params = Object.assign({}, {});
const data = await exportRoleList(params);
downloadByData(data, '导入模板' + '.xlsx');
}
// const getTitle = computed(() => '新建文件');
const getTitle = '导入文件选择';
......
export const importFormSchema: any[] = [
import { Schema } from 'tinymce';
import { FormSchema } from '@/components/Form';
export const importFormSchema: FormSchema[] = [
{
field: 'deptId',
label: '导入至',
......@@ -11,26 +14,54 @@ export const importFormSchema: any[] = [
},
treeData: [
{
deptName: '个人工作组',
businessId: '1',
deptName: 'SHELL文件',
businessId: '100',
children: [
{
deptName: '个人工作区',
businessId: '11',
deptName: 'admin-个人工作区',
businessId: '101',
children: [
{
deptName: '图标验收',
businessId: '111',
deptName: '文件夹1',
businessId: '201',
children: [
{
deptName: 'SQL1',
businessId: '301',
},
],
},
],
},
{
deptName: '共享工作区',
businessId: '12',
businessId: '102',
children: [
{
deptName: '学生成绩',
businessId: '122',
deptName: '文件夹2',
businessId: '202',
children: [
{
deptName: 'SQL2',
businessId: '302',
},
],
},
],
},
{
deptName: '高级工作区',
businessId: '103',
children: [
{
deptName: '文件夹3',
businessId: '203',
children: [
{
deptName: 'SQL3',
businessId: '303',
},
],
},
],
},
......@@ -51,6 +82,7 @@ export const importFormSchema: any[] = [
label: '文件重名',
component: 'RadioGroup',
required: true,
defaultValue: '全部放弃',
colProps: { lg: 24, md: 24 },
componentProps: {
options: [
......
......@@ -4,61 +4,80 @@
<DataTree @select="handleSelect" style="height: 100%" />
<!-- <GroupTree @select="handleGroupSelect" style="height: 50%" /> -->
</div>
<BasicTable @register="registerTable" class="w-3/4 xl:w-4/5" :searchInfo="searchInfo">
<template #toolbar>
<Tooltip title="复制" placement="top">
<a-button
:disabled="getRowSelection().selectedRowKeys <= 0"
type="primary"
@click="handleMove(0, getRowSelection().selectedRowKeys)"
>
<Icon icon="majesticons:duplicate-line" :size="20" />
</a-button>
</Tooltip>
<Tooltip title="移动" placement="top">
<a-button
:disabled="getRowSelection().selectedRowKeys <= 0"
type="primary"
@click="handleMove(1, getRowSelection().selectedRowKeys)"
>
<Icon icon="majesticons:arrow-right" :size="20" />
</a-button>
</Tooltip>
<Tooltip title="删除" placement="top">
<a-button
:disabled="getRowSelection().selectedRowKeys <= 0"
type="primary"
@click="deleteButton"
>
<Icon icon="majesticons:trash-line" :size="20" />
</a-button>
</Tooltip>
<Tooltip title="导入" placement="top">
<a-button type="primary" @click="handleImport">
<Icon icon="majesticons:cloud-upload-line" :size="20" />
</a-button>
</Tooltip>
<Tooltip title="导出" placement="top">
<a-button
:disabled="getRowSelection().selectedRowKeys <= 0"
type="primary"
@click="handleExport"
>
<Icon icon="majesticons:cloud-download-line" :size="20" />
</a-button>
</Tooltip>
<Tooltip title="新建文件夹" placement="top">
<a-button type="primary" style="margin-right: 10px" @click="handleAddFolder">
<Icon icon="majesticons:folder-add-line" :size="20" />
</a-button>
</Tooltip>
<Tooltip title="新建文件" placement="top">
<a-button type="primary" @click="handleAddTemplate">
<Icon icon="majesticons:file-add-line" :size="20" />
</a-button>
</Tooltip>
<BasicTable title=" " @register="registerTable" class="w-3/4 xl:w-4/5" :searchInfo="searchInfo">
<template #headerTop>
<div style="display: flex; justify-content: space-between; align-items: center">
<div style="display: flex; gap: 5px">
<Icon size="35" icon="mdi:powershell" :color="'#fda861'" />
<div style="display: flex; flex-direction: column">
<span style="font-weight: bold; font-size: 18px">Shell开发</span>
<!-- <span style="color: grey; font-size: 12px">{{ searchInfo.res.workSpaceName }}</span>-->
</div>
</div>
<div style="display: flex; gap: 10px">
<Tooltip title="复制" placement="top">
<a-button
:disabled="getRowSelection().selectedRowKeys <= 0"
type="primary"
@click="handleMove(0, getRowSelection().selectedRowKeys)"
>
复制
<!--<Icon icon="majesticons:duplicate-line" :size="20" />-->
</a-button>
</Tooltip>
<Tooltip title="移动" placement="top">
<a-button
:disabled="getRowSelection().selectedRowKeys <= 0"
type="primary"
@click="handleMove(1, getRowSelection().selectedRowKeys)"
>
移动
<!--<Icon icon="majesticons:arrow-right" :size="20" />-->
</a-button>
</Tooltip>
<Tooltip title="删除" placement="top">
<a-button
:disabled="getRowSelection().selectedRowKeys <= 0"
type="primary"
@click="deleteButton"
>
删除
<!--<Icon icon="majesticons:trash-line" :size="20" />-->
</a-button>
</Tooltip>
<Tooltip title="导入" placement="top">
<a-button type="primary" @click="handleImport">
导入
<!--<Icon icon="majesticons:cloud-upload-line" :size="20" />-->
</a-button>
</Tooltip>
<Tooltip title="导出" placement="top">
<a-button
:disabled="getRowSelection().selectedRowKeys <= 0"
type="primary"
@click="handleExport"
>
导出
<!--<Icon icon="majesticons:cloud-download-line" :size="20" />-->
</a-button>
</Tooltip>
<Tooltip title="新建文件夹" placement="top">
<a-button type="primary" @click="handleAddFolder">
新建文件夹
<!--<Icon icon="majesticons:folder-add-line" :size="20" />-->
</a-button>
</Tooltip>
<Tooltip title="新建文件" placement="top">
<a-button type="primary" @click="handleAddTemplate">
新建文件
<!--<Icon icon="majesticons:file-add-line" :size="20" />-->
</a-button>
</Tooltip>
</div>
</div>
</template>
<template #tableTitle>
<a-input-search allow-clear style="width: 220px" @search="onSearch" />
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
......@@ -90,7 +109,7 @@
</template>
</BasicTable>
<MoveFile @register="registerMoveFile" @success="handleMoveSuccess" />
<importModal @register="registerImport" @success="handleImportSuccess" />
<ImportModal @register="registerImport" @success="handleImportSuccess" />
<AddFolder @register="register" />
<TemplateModal @register="registerTemplate" />
<Rename @register="registerRename" />
......@@ -98,7 +117,7 @@
</template>
<script lang="ts" setup>
import { Tooltip } from 'ant-design-vue';
import { reactive, onMounted } from 'vue';
import { reactive, ref, onMounted } from 'vue';
import { BasicTable, useTable, TableAction } from '@/components/Table';
import { getRoleListByPage, deleteById, exportRoleList } from '@/api/system/role/role';
import { PageWrapper } from '@/components/Page';
......@@ -112,15 +131,18 @@
import AddFolder from './addFolder/addFolder.vue';
import TemplateModal from './addFile/templateModal.vue';
import MoveFile from './handleMove/moveFile.vue';
import importModal from './importModal/importModal.vue';
import ImportModal from './importModal/importModal.vue';
import Rename from './renameModal.vue';
import { useMessage } from '@/hooks/web/useMessage';
import { downloadByData } from '@/utils/file/download';
import { tooltipProps } from 'ant-design-vue/es/tooltip';
import { getMetadataTableList } from '@/views/dataIntegration/dataLakePunctual/mock';
defineOptions({ name: 'AccountManagement' });
let DataTreeDataList = ref(DataTreeData);
const searchInfo = reactive<Recordable>({});
const { createMessage, createConfirm } = useMessage();
const [registerImport, { openModal: openImportModal }] = useModal();
......@@ -128,47 +150,34 @@
const [registerTemplate, { openModal: openTemplateModal }] = useModal();
const [registerRename, { openModal: openRenameModal }] = useModal();
const [register, { openModal: openAddFolder }] = useModal();
const [
registerTable,
{ reload, updateTableDataRecord, getSearchInfo, getForm, getRowSelection },
] = useTable({
title: 'SHELL文件',
const [registerTable, { reload, updateTableDataRecord, getForm, getRowSelection }] = useTable({
// title: 'SHELL文件',
api: async (params) => {
const response = {
pageNu: '1',
pageSize: '10',
pages: '1',
total: DataTreeData.length,
total: DataTreeDataList.value.length,
code: '',
message: '',
data: [],
};
let data = DataTreeData.filter((item) => item.parentId !== 0);
if (params.res !== undefined) {
if (params.res.parentId !== undefined) {
data = DataTreeData.filter((item) => item.parentId === params.res.businessId);
} else {
data = DataTreeData.filter((item) => item.parentId === 100);
}
} else {
data = DataTreeData.filter((item) => item.parentId === 100);
}
return { ...response, data: data };
return { ...response, data: DataTreeDataList.value };
},
rowKey: 'businessId',
rowSelection: true,
columns,
showIndexColumn: false,
formConfig: {
labelWidth: 10,
schemas: searchFormSchema,
autoSubmitOnEnter: true,
resetFunc: () => {
searchInfo.res = '';
},
},
useSearchForm: true,
// formConfig: {
// labelWidth: 10,
// schemas: searchFormSchema,
// autoSubmitOnEnter: true,
// resetFunc: () => {
// searchInfo.res = '';
// },
// },
// useSearchForm: true,
showTableSetting: false,
bordered: true,
handleSearchInfoFn(info) {
......@@ -269,10 +278,27 @@
reload();
}
function handleGroupSelect() {
function onSearch(searchValue) {
console.log(searchValue);
DataTreeDataList.value = DataTreeData.filter(
(item) =>
item.workSpaceName.includes(searchValue) &&
![0, 100, 101, 102, 103].includes(item.parentId),
);
reload();
}
function handleGroupSelect(record) {
router.push({
path: '/scriptDevelopment/shellDevelopment/shellExecute/shellExecute',
query: {
id: record.businessId,
},
});
}
onMounted(() => {});
onMounted(() => {
DataTreeDataList.value = DataTreeData.filter(
(item) => ![0, 100, 101, 102, 103].includes(item.parentId),
);
});
</script>
......@@ -65,7 +65,7 @@
columns: recommendColumns,
useSearchForm: false,
actionColumn: {
width: 150,
width: 60,
title: '操作',
dataIndex: 'action',
},
......
<template>
<PageWrapper
title="shell执行"
dense
contentFullHeight
fixedHeight
contentClass="flex"
@back="goBack"
>
<PageWrapper title=" " dense contentFullHeight fixedHeight contentClass="flex">
<!-- <GroupTree @select="handleSelect" class="w-1/4 xl:w-1/5" /> -->
<div class="w-full xl:w-full" style="padding-top: 20px">
<BasicForm @register="registerForm">
<template #formFooter>
<div style="display: flex; justify-content: space-between; margin-left: 500px">
<!-- 新窗口运行-->
<!-- <Tooltip placement="top" title="新窗口运行">
<a-button
type="primary"
style="margin-right: 10px; margin-left: 500px"
@click="handleExecute"
>
<Icon icon="si:play-forward-duotone" :size="20" />
</a-button>
</Tooltip> -->
<template #headerContent>
<div style="width: 100%; display: flex; align-items: center; justify-content: space-between">
<div style="display: flex; align-items: center">
<Icon
@click="goBack"
class="backBtn"
icon="eva:arrow-ios-back-fill"
:size="25"
color="grey"
/>
<span style="color: grey; margin-left: 10px"> {{ path }}</span>
</div>
<div style="display: flex; margin-left: 500px">
<!-- 新窗口运行-->
<!-- <Tooltip placement="top" title="新窗口运行">
<a-button
type="primary"
style="margin-right: 10px; margin-left: 500px"
@click="handleExecute"
>
<Icon icon="si:play-forward-duotone" :size="20" />
</a-button>
</Tooltip> -->
<!-- 运行-->
<!-- <Tooltip placement="top" title="运行">
<a-button type="primary" style="margin-right: 10px" @click="handleExecute">
<Icon icon="si:play-line" :size="20" />
</a-button>
</Tooltip> -->
<!-- 运行-->
<!-- <Tooltip placement="top" title="运行">
<a-button type="primary" style="margin-right: 10px" @click="handleExecute">
<Icon icon="si:play-line" :size="20" />
</a-button>
</Tooltip> -->
<!-- 执行记录-->
<!-- <Tooltip placement="top" title="执行记录">
<a-button type="primary" style="margin-right: 10px" @click="handleRecord">
<Icon icon="si:clock-alt-line" :size="20" />
</a-button>
</Tooltip> -->
<!-- 执行记录-->
<!-- <Tooltip placement="top" title="执行记录">
<a-button type="primary" style="margin-right: 10px" @click="handleRecord">
<Icon icon="si:clock-alt-line" :size="20" />
</a-button>
</Tooltip> -->
<!-- 提交版本-->
<Tooltip placement="top" title="提交版本">
<a-button type="primary" style="margin-right: 10px" @click="handleSubmit">
<Icon icon="majesticons:cloud-upload-line" :size="20" />
</a-button>
</Tooltip>
<!-- 提交版本-->
<Tooltip placement="top" title="提交版本">
<a-button type="primary" style="margin-right: 10px" @click="handleSubmit">
提交版本
<!-- <Icon icon="majesticons:cloud-upload-line" :size="20" />-->
</a-button>
</Tooltip>
<!-- 版本管理-->
<Tooltip placement="top" title="版本管理">
<a-button type="primary" style="margin-right: 10px" @click="handleVersion">
<Icon icon="majesticons:file-search-line" :size="20" />
</a-button>
</Tooltip>
<!-- 版本管理-->
<Tooltip placement="top" title="版本管理">
<a-button type="primary" style="margin-right: 10px" @click="handleVersion">
版本管理
<!-- <Icon icon="majesticons:file-search-line" :size="20" />-->
</a-button>
</Tooltip>
<!-- 参数配置-->
<Tooltip placement="top" title="参数配置">
<a-button type="primary" style="margin-right: 10px" @click="handleOptions">
<Icon icon="majesticons:link-circle-line" :size="20" />
</a-button>
</Tooltip>
<!-- 参数配置-->
<Tooltip placement="top" title="参数配置">
<a-button type="primary" style="margin-right: 10px" @click="handleOptions">
参数配置
<!-- <Icon icon="majesticons:link-circle-line" :size="20" />-->
</a-button>
</Tooltip>
<!-- 格式化-->
<Tooltip placement="top" title="格式化">
<a-button type="primary" style="margin-right: 10px" @click="handleChange">
<Icon icon="gg:align-left" :size="20" />
</a-button>
</Tooltip>
<!-- 格式化-->
<!-- <Tooltip placement="top" title="格式化">-->
<!-- <a-button type="primary" style="margin-right: 10px" @click="handleChange">-->
<!-- 格式化-->
<!-- &lt;!&ndash; <Icon icon="gg:align-left" :size="20" />&ndash;&gt;-->
<!-- </a-button>-->
<!-- </Tooltip>-->
<!-- 保存-->
<!-- <Tooltip placement="top" title="保存">
<a-button type="primary" style="margin-right: 10px" @click="handleSave">
<Icon icon="majesticons:save-line" :size="20" />
</a-button>
</Tooltip>
<Tooltip placement="top" :title="layout === 'single' ? '版本对比' : '结束对比'">
<a-button type="primary" style="margin-right: 10px" @click="toggleLayout">
<Icon
:icon="layout === 'single' ? 'majesticons:user-line' : 'majesticons:users-line'"
:size="20"
/>
</a-button>
</Tooltip> -->
</div>
</template>
</BasicForm>
<!-- 保存-->
<Tooltip placement="top" title="保存">
<a-button type="primary" style="margin-right: 10px" @click="handleSave">
保存
<!-- <Icon icon="majesticons:save-line" :size="20" />-->
</a-button>
</Tooltip>
<!--
<Tooltip placement="top" :title="layout === 'single' ? '版本对比' : '结束对比'">
<a-button type="primary" style="margin-right: 10px" @click="toggleLayout">
<Icon
:icon="layout === 'single' ? 'majesticons:user-line' : 'majesticons:users-line'"
:size="20"
/>
</a-button>
</Tooltip> -->
</div>
</div>
</template>
<div class="w-full xl:w-full" style="background-color: white">
<div style="width: 100%; margin-top: 20px">
<div v-if="layout === 'single'">
<CodeEditor v-model:value="jsonData" :mode="MODE.JSON" />
<div class="codeEditorH" style="padding: 0 15px" v-if="layout === 'single'">
<CodeEditor v-model:value="jsonData" :mode="MODE.SHELL" />
</div>
<div v-else class="editor-container">
<div class="editor-wrapper" style="height: 600px">
......@@ -108,12 +117,12 @@
</div>
</div>
</div>
<optionsModal @register="registerModal" />
<resultModal @register="registerResultModal" />
<OptionsModal @register="registerModal" />
<ResultModal @register="registerResultModal" />
<PreviewModal @register="registerPreviewModal" />
<RecordModal @register="registerRecordModal" />
<SubmitModal @register="registerSubmitModal" />
<versionManagementModal @register="registerVersionManagementModal" />
<VersionManagementModal @register="registerVersionManagementModal" />
</PageWrapper>
</template>
<script lang="ts" setup>
......@@ -121,26 +130,30 @@
import { onMounted, ref, nextTick, watch } from 'vue';
import { PageWrapper } from '@/components/Page';
import GroupTree from '../GroupTree.vue';
import { jsonData } from '../sqlDevelopmentData';
import { jsonData, DataTreeData } from '../sqlDevelopmentData';
import { formSchema } from '../data';
import { useGo } from '@/hooks/web/usePage';
import { CodeEditor, MODE } from '@/components/CodeEditor';
import { BasicForm, useForm } from '@/components/Form';
import optionsModal from './optionsModal.vue';
import OptionsModal from './optionsModal.vue';
import { useModal } from '@/components/Modal';
import resultModal from './resultModal.vue';
import ResultModal from './resultModal.vue';
import PreviewModal from './dataPreviewModal.vue';
import { useMessage } from '@/hooks/web/useMessage';
import Icon from '@/components/Icon/Icon.vue';
import RecordModal from './executeRecordModal.vue';
import SubmitModal from './handleSubmit/submitModal.vue';
import { schema } from '@/views/dataIntegration/taskOM/taskOM.data';
import versionManagementModal from './versionManagementModal.vue';
import VersionManagementModal from './versionManagementModal.vue';
import { useRoute } from 'vue-router';
import { router } from '@/router';
defineOptions({ name: 'AccountManagement' });
const { createMessage } = useMessage();
const go = useGo();
const route = useRoute();
const path = ref('');
const layout = ref('single');
const jsonDataLeft = jsonData;
const jsonDataRight = jsonData;
......@@ -203,10 +216,27 @@
createMessage.success('保存成功');
}
// 根据id获取文件路径
function getPathById(id) {
console.log(id);
const node = DataTreeData.find((item) => '' + item.businessId === id);
console.log(node);
if (!node) return ''; // 如果找不到节点,则返回空字符串
// 如果是根节点,直接返回其名称
if (node.parentId === 0) {
return node.workSpaceName;
}
// 递归获取父节点路径,并拼接当前节点名称
const parentPath = getPathById('' + node.parentId);
console.log('parentPath', parentPath);
return `${parentPath} / ${node.workSpaceName}`;
}
// 页面左侧点击返回链接时的操作
function goBack() {
// 本例的效果时点击返回始终跳转到账号列表页,实际应用时可返回上一页
go('/scriptDevelopment/shellDevelopment/index');
// // 本例的效果时点击返回始终跳转到账号列表页,实际应用时可返回上一页
// go('/scriptDevelopment/shellDevelopment/index');
router.back();
}
//同步滚动
const handleScroll = () => {
......@@ -229,6 +259,8 @@
}
});
onMounted(async () => {
console.log(111111111111);
path.value = getPathById(route.query.id);
await nextTick(() => {
if (editorLeft.value && editorRight.value) {
editorLeft.value.addEventListener('scroll', handleScroll);
......@@ -264,4 +296,11 @@
flex: 1;
overflow: hidden;
}
:deep(.CodeMirror) {
height: 700px !important;
}
:deep(.ant-page-header) {
padding: 5px !important;
}
</style>
......@@ -115,7 +115,7 @@ export const DataTreeData: any[] = [
delFlag: '0',
flag: '1',
businessId: 302,
workSpaceName: 'SQL1',
workSpaceName: 'SQL2',
parentId: 202,
code: '003',
ancestors: '0,100',
......@@ -129,7 +129,7 @@ export const DataTreeData: any[] = [
delFlag: '0',
flag: '0',
businessId: 303,
workSpaceName: 'SQL1',
workSpaceName: 'SQL3',
parentId: 203,
code: '010',
ancestors: '0,100,107',
......@@ -368,8 +368,8 @@ export const previewData: any[] = [
},
];
export const jsonData = `
#!/bin/bash
# 自动化任务伪代码示例:文件备份、日志清理和服务状态检查
#!/bin/bash
# 自动化任务伪代码示例:文件备份、日志清理和服务状态检查
# 定义变量
BACKUP_DIR="/backup" # 备份目录
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment