revert: remove aotu components

This commit is contained in:
xingyu4j 2022-11-17 17:18:48 +08:00
parent ed3170e837
commit 91113eac18
6 changed files with 33 additions and 49 deletions

View File

@ -1,11 +1,3 @@
<!--
* @Descripttion: cron规则生成器
* @version: 1.0
* @Author: sakuya
* @Date: 2021年12月29日15:23:54
* @LastEditors:
* @LastEditTime:
-->
<script setup lang="ts">
import {
ElInput,
@ -520,7 +512,12 @@ const submit = () => {
<template>
<el-input v-model="defaultValue" v-bind="$attrs">
<template #append>
<el-dropdown split-button trigger="click" @command="handleShortcuts">
<el-dropdown
split-button
type="text"
@command="handleShortcuts"
style="width: 35px; margin-left: 5px; margin-right: 2px"
>
生成器
<template #dropdown>
<el-dropdown-menu>

View File

@ -206,6 +206,7 @@ service.interceptors.response.use(
)
const refreshToken = async () => {
axios.defaults.headers.common['tenant-id'] = getTenantId()
return await axios.post(base_url + '/system/auth/refresh-token?refreshToken=' + getRefreshToken())
}
const handleAuthorized = () => {

View File

@ -7,10 +7,14 @@ import { DescriptionsSchema } from '@/types/descriptions'
import { ComponentOptions } from '@/types/components'
export type CrudSchema = Omit<TableColumn, 'children'> & {
search?: CrudSearchParams
table?: CrudTableParams
form?: CrudFormParams
detail?: CrudDescriptionsParams
isSearch?: boolean // 是否在查询显示
search?: CrudSearchParams // 查询的详细配置
isTable?: boolean // 是否在列表显示
table?: CrudTableParams // 列表的详细配置
isForm?: boolean // 是否在表单显示
form?: CrudFormParams // 表单的详细配置
isDetail?: boolean // 是否在详情显示
detail?: CrudDescriptionsParams // 详情的详细配置
children?: CrudSchema[]
dictType?: string // 字典类型
dictData?: 'string' | 'number' | 'boolean' // 字典数据类型 string | number | boolean
@ -80,7 +84,7 @@ const filterSearchSchema = (crudSchema: CrudSchema[]): FormSchema[] => {
eachTree(crudSchema, (schemaItem: CrudSchema) => {
// 判断是否显示
if (schemaItem?.search?.show) {
if (schemaItem?.isSearch || schemaItem.search?.show) {
let component = schemaItem?.search?.component || 'Input'
const options: ComponentOptions[] = []
let comonentProps = {}
@ -93,7 +97,7 @@ const filterSearchSchema = (crudSchema: CrudSchema[]): FormSchema[] => {
comonentProps = {
options: options
}
if (!schemaItem.search.component) component = 'Select'
if (!schemaItem.search?.component) component = 'Select'
}
const searchSchemaItem = {
// 默认为 input
@ -116,7 +120,7 @@ const filterSearchSchema = (crudSchema: CrudSchema[]): FormSchema[] => {
const filterTableSchema = (crudSchema: CrudSchema[]): TableColumn[] => {
const tableColumns = treeMap<CrudSchema>(crudSchema, {
conversion: (schema: CrudSchema) => {
if (schema?.table?.show !== false) {
if (schema?.isTable !== false || schema?.table?.show !== false) {
return {
...schema.table,
...schema
@ -140,7 +144,7 @@ const filterFormSchema = (crudSchema: CrudSchema[]): FormSchema[] => {
eachTree(crudSchema, (schemaItem: CrudSchema) => {
// 判断是否显示
if (schemaItem?.form?.show !== false) {
if (schemaItem?.isForm !== false || schemaItem?.form?.show == true) {
let component = schemaItem?.form?.component || 'Input'
let defaultValue: any = ''
if (schemaItem.form?.value) {
@ -197,7 +201,7 @@ const filterDescriptionsSchema = (crudSchema: CrudSchema[]): DescriptionsSchema[
eachTree(crudSchema, (schemaItem: CrudSchema) => {
// 判断是否显示
if (schemaItem?.detail?.show !== false) {
if (schemaItem?.isDetail !== false || schemaItem.detail?.show !== false) {
const descriptionsSchemaItem = {
...schemaItem.detail,
field: schemaItem.field,

View File

@ -181,7 +181,7 @@ const filterTableSchema = (crudSchema: VxeCrudSchema): VxeGridPropTypes.Columns
}
eachTree(crudSchema.columns, (schemaItem: VxeCrudColumns) => {
// 判断是否显示
if (schemaItem?.isTable !== false) {
if (schemaItem?.isTable !== false && schemaItem?.table?.show !== false) {
const tableSchemaItem = {
...schemaItem.table,
field: schemaItem.field,
@ -278,7 +278,7 @@ const filterDescriptionsSchema = (crudSchema: VxeCrudSchema): DescriptionsSchema
eachTree(crudSchema.columns, (schemaItem: VxeCrudColumns) => {
// 判断是否显示
if (schemaItem?.isDetail !== false) {
if (schemaItem?.isDetail !== false || schemaItem.detail?.show !== false) {
const descriptionsSchemaItem = {
...schemaItem.detail,
field: schemaItem.field,

View File

@ -17,40 +17,28 @@ const crudSchemas = reactive<CrudSchema[]>([
label: t('common.index'),
field: 'id',
type: 'index',
form: {
show: false
},
detail: {
show: false
}
isForm: false,
isDetail: false
},
{
label: '表名称',
field: 'tableName',
search: {
show: true
}
isSearch: true
},
{
label: '表描述',
field: 'tableComment',
search: {
show: true
}
isSearch: true
},
{
label: '实体',
field: 'className',
search: {
show: true
}
isSearch: true
},
{
label: t('common.createTime'),
field: 'createTime',
form: {
show: false
},
isForm: false,
search: {
show: true,
component: 'DatePicker',
@ -64,20 +52,14 @@ const crudSchemas = reactive<CrudSchema[]>([
{
label: t('common.updateTime'),
field: 'updateTime',
form: {
show: false
}
isForm: false
},
{
label: t('table.action'),
field: 'action',
width: '500px',
form: {
show: false
},
detail: {
show: false
}
width: '350px',
isForm: false,
isDetail: false
}
])
export const { allSchemas } = useCrudSchemas(crudSchemas)

View File

@ -33,7 +33,7 @@
:data="dbTableList"
v-loading="dbLoading"
:checkbox-config="{ highlight: true, range: true }"
height="350px"
height="260px"
class="xtable-scrollbar"
>
<vxe-column type="checkbox" width="60" />