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,71 +43,61 @@ ...@@ -35,71 +43,61 @@
</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';
const [saveSettings, { openModal: openModal }] = useModal(); // 新建质量主体弹窗
const pros = defineProps({
deptId: {
type: Number,
default: 0,
},
});
import {PageWrapper} from "@/components/Page"; // 初始化 info 为一个响应式对象
import {tableList} from "./mock"; const info = computed(() => {
import {personSchema} from "./mainBody.data"; const list = tableList;
import {BasicForm, useForm} from "@/components/Form"; const index = list.findIndex((item) => {
import SaveSettingsModal from "./saveSettingsModal.vue"; return item.selectedDeptId === pros.deptId; // 添加 return 关键字
import {useModal} from "@/components/Modal"; });
import {computed, onMounted} from "vue"; console.log('list', list);
console.log('index', index);
console.log('deptId', pros.deptId);
if (index !== -1) {
const [saveSettings, { openModal: openModal }] = return list[index];
useModal(); // 新建质量主体弹窗 }
return {};
});
const pros = defineProps({ function palyStart() {
deptId: { setFieldsValue(info.value);
type: Number,
default: 0,
} }
})
// 初始化 info 为一个响应式对象 onMounted(() => {
const info = computed(() => { console.log('tableList', tableList);
const list = tableList; palyStart();
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 {};
});
function palyStart() {
setFieldsValue(info.value);
}
onMounted(() => { function preservation() {
console.log('tableList', tableList) openModal(true, {
palyStart(); isUpdate: false,
}); });
}
function preservation() { const [registerGuideModeForm, { setFieldsValue }] = useForm({
openModal(true, { labelWidth: 100,
isUpdate: false, schemas: personSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
}); });
}
const [registerGuideModeForm,{setFieldsValue}] = useForm({
labelWidth: 100,
schemas: personSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
</script> </script>
<style scoped> <style scoped></style>
</style>
...@@ -8,26 +8,32 @@ ...@@ -8,26 +8,32 @@
: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
<Icon icon="majesticons:table-plus-line" :size="40" :color="'#e9a064'" /> style="
<div style="margin-left: 10px"> padding: 15px;
<span class="title">test</span> display: flex;
<div> justify-content: space-between;
<span class="path">函数/test</span> 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>
</div> </div>
<a-button style="margin-left: 700px" type="primary" @click="handleDeleteIds">删除</a-button> <div style="display: flex; gap: 10px">
<a-button style="margin-left: 10px" type="primary" @click="handleMove(1)">移动</a-button> <a-button type="primary" @click="handleDeleteIds">删除</a-button>
<a-button style="margin-left: 10px" type="primary" @click="handleExport('文件')" <a-button type="primary" @click="handleMove(1)">移动</a-button>
>导出</a-button <a-button type="primary" @click="handleExport('文件')">导出</a-button>
> <a-button type="primary" @click="handleImport">导入</a-button>
<a-button style="margin-left: 10px" type="primary" @click="handleImport">导入</a-button> <a-button type="primary" @click="handleNewFolder">新建文件夹</a-button>
<a-button style="margin-left: 10px" type="primary" @click="handleNewFolder" <a-button type="primary" @click="handleNewFile">新建文件</a-button>
>新建文件夹</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: [ children: [
{ {
deptName: '学生成绩', deptName: '文件夹2',
businessId: '122', 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[] = [ ...@@ -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: [
......
...@@ -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',
}, },
......
...@@ -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