Commit f2102ca5 authored by chenjiahao's avatar chenjiahao

Shell开发-修改已知问题

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