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: [
......
......@@ -65,7 +65,7 @@
columns: recommendColumns,
useSearchForm: false,
actionColumn: {
width: 150,
width: 60,
title: '操作',
dataIndex: 'action',
},
......
......@@ -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