fix: contentDetailWrap 暗黑模式
parent
005a3e6ab0
commit
26fd35e31d
|
@ -24,12 +24,12 @@ onMounted(() => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div :class="[`${prefixCls}-container`, 'relative bg-[#fff]']" ref="contentDetailWrap">
|
<div :class="[`${prefixCls}-container`]" ref="contentDetailWrap">
|
||||||
<Sticky :offset="offset">
|
<Sticky :offset="offset">
|
||||||
<div
|
<div
|
||||||
:class="[
|
:class="[
|
||||||
`${prefixCls}-header`,
|
`${prefixCls}-header`,
|
||||||
'flex border-bottom-1 h-50px items-center text-center bg-white pr-10px'
|
'flex border-bottom-1 h-50px items-center text-center pr-10px'
|
||||||
]"
|
]"
|
||||||
>
|
>
|
||||||
<div :class="[`${prefixCls}-header__back`, 'flex pl-10px pr-10px ']">
|
<div :class="[`${prefixCls}-header__back`, 'flex pl-10px pr-10px ']">
|
||||||
|
@ -50,9 +50,7 @@ onMounted(() => {
|
||||||
</Sticky>
|
</Sticky>
|
||||||
<div style="padding: var(--app-content-padding)">
|
<div style="padding: var(--app-content-padding)">
|
||||||
<ElCard :class="[`${prefixCls}-body`, 'mb-20px']" shadow="never">
|
<ElCard :class="[`${prefixCls}-body`, 'mb-20px']" shadow="never">
|
||||||
<div>
|
<div> <slot></slot> </div>
|
||||||
<slot></slot>
|
|
||||||
</div>
|
|
||||||
</ElCard>
|
</ElCard>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -185,10 +185,10 @@ const filterTableSchema = (crudSchema: VxeCrudSchema): VxeGridPropTypes.Columns
|
||||||
const tableSchema: VxeGridPropTypes.Columns = []
|
const tableSchema: VxeGridPropTypes.Columns = []
|
||||||
// 主键ID
|
// 主键ID
|
||||||
if (crudSchema.primaryKey && crudSchema.primaryType) {
|
if (crudSchema.primaryKey && crudSchema.primaryType) {
|
||||||
const primaryWidth =
|
const primaryTitle = crudSchema.primaryTitle ? crudSchema.primaryTitle : t('common.index')
|
||||||
(crudSchema.primaryTitle ? crudSchema.primaryTitle : t('common.index')).length * 20 + 'px'
|
const primaryWidth = primaryTitle.length * 30 + 'px'
|
||||||
const tableSchemaItem = {
|
const tableSchemaItem = {
|
||||||
title: crudSchema.primaryTitle ? crudSchema.primaryTitle : t('common.index'),
|
title: primaryTitle,
|
||||||
field: crudSchema.primaryKey,
|
field: crudSchema.primaryKey,
|
||||||
type: crudSchema.primaryType ? crudSchema.primaryType : null,
|
type: crudSchema.primaryType ? crudSchema.primaryType : null,
|
||||||
width: primaryWidth
|
width: primaryWidth
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<ContentDetailWrap title="代码生成" @back="push('/infra/codegen')">
|
<ContentDetailWrap :title="title" @back="push('/infra/codegen')">
|
||||||
<el-tabs v-model="activeName">
|
<el-tabs v-model="activeName">
|
||||||
<el-tab-pane label="基本信息" name="basicInfo">
|
<el-tab-pane label="基本信息" name="basicInfo">
|
||||||
<BasicInfoForm ref="basicInfoRef" :basicInfo="tableCurrentRow" />
|
<BasicInfoForm ref="basicInfoRef" :basicInfo="tableCurrentRow" />
|
||||||
|
@ -31,22 +31,25 @@ const { t } = useI18n() // 国际化
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
const { push } = useRouter()
|
const { push } = useRouter()
|
||||||
const { query } = useRoute()
|
const { query } = useRoute()
|
||||||
|
const loading = ref(false)
|
||||||
|
const title = ref('代码生成')
|
||||||
|
const activeName = ref('cloum')
|
||||||
|
const cloumInfoRef = ref(null)
|
||||||
const tableCurrentRow = ref<CodegenTableVO>()
|
const tableCurrentRow = ref<CodegenTableVO>()
|
||||||
const cloumCurrentRow = ref<CodegenColumnVO[]>([])
|
const cloumCurrentRow = ref<CodegenColumnVO[]>([])
|
||||||
|
const basicInfoRef = ref<ComponentRef<typeof BasicInfoForm>>()
|
||||||
|
const genInfoRef = ref<ComponentRef<typeof GenInfoForm>>()
|
||||||
|
|
||||||
const getList = async () => {
|
const getList = async () => {
|
||||||
const id = query.id as unknown as number
|
const id = query.id as unknown as number
|
||||||
if (id) {
|
if (id) {
|
||||||
// 获取表详细信息
|
// 获取表详细信息
|
||||||
const res = await getCodegenTableApi(id)
|
const res = await getCodegenTableApi(id)
|
||||||
tableCurrentRow.value = res.table
|
tableCurrentRow.value = res.table
|
||||||
|
title.value = '修改[ ' + res.table.tableName + ' ]生成配置'
|
||||||
cloumCurrentRow.value = res.columns
|
cloumCurrentRow.value = res.columns
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const loading = ref(false)
|
|
||||||
const activeName = ref('cloum')
|
|
||||||
const basicInfoRef = ref<ComponentRef<typeof BasicInfoForm>>()
|
|
||||||
const genInfoRef = ref<ComponentRef<typeof GenInfoForm>>()
|
|
||||||
const cloumInfoRef = ref(null)
|
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
const basicInfo = unref(basicInfoRef)
|
const basicInfo = unref(basicInfoRef)
|
||||||
const genInfo = unref(genInfoRef)
|
const genInfo = unref(genInfoRef)
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
<template>
|
<template>
|
||||||
<vxe-table ref="dragTable" :data="info" stripe :column-config="{ resizable: true }">
|
<vxe-table
|
||||||
|
ref="dragTable"
|
||||||
|
:data="info"
|
||||||
|
max-height="600"
|
||||||
|
stripe
|
||||||
|
:column-config="{ resizable: true }"
|
||||||
|
>
|
||||||
<vxe-column title="字段列名" field="columnName" fixed="left" width="80" />
|
<vxe-column title="字段列名" field="columnName" fixed="left" width="80" />
|
||||||
<vxe-column title="字段描述" field="columnComment">
|
<vxe-column title="字段描述" field="columnComment">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
|
|
|
@ -71,7 +71,7 @@ import { ImportTable, Preview } from './components'
|
||||||
|
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
const { push } = useRouter()
|
const { push } = useRouter() // 路由跳转
|
||||||
// 列表相关的变量
|
// 列表相关的变量
|
||||||
const xGrid = ref<VxeGridInstance>() // 列表 Grid Ref
|
const xGrid = ref<VxeGridInstance>() // 列表 Grid Ref
|
||||||
const { gridOptions, getList, deleteData } = useVxeGrid<CodegenTableVO>({
|
const { gridOptions, getList, deleteData } = useVxeGrid<CodegenTableVO>({
|
||||||
|
@ -92,8 +92,6 @@ const handlePreview = (row: CodegenTableVO) => {
|
||||||
}
|
}
|
||||||
// 编辑操作
|
// 编辑操作
|
||||||
const handleUpdate = (rowId: number) => {
|
const handleUpdate = (rowId: number) => {
|
||||||
// TODO 星语:修改某个的时候,tab 要展示名字。例如说:"修改[" + tableName + "]生成配置"
|
|
||||||
// TODO 星语:【暗黑模式】编辑界面,周边有白色的边框,不太好看
|
|
||||||
push('/codegen/edit?id=' + rowId)
|
push('/codegen/edit?id=' + rowId)
|
||||||
}
|
}
|
||||||
// 同步操作
|
// 同步操作
|
||||||
|
|
|
@ -359,7 +359,6 @@ const handleCreate = async () => {
|
||||||
deptId.value = null
|
deptId.value = null
|
||||||
postIds.value = []
|
postIds.value = []
|
||||||
await nextTick()
|
await nextTick()
|
||||||
// TODO 星语:要不要这个放到新增里?这样和 handleUpdate 统一一点
|
|
||||||
if (allSchemas.formSchema[0].field !== 'username') {
|
if (allSchemas.formSchema[0].field !== 'username') {
|
||||||
unref(formRef)?.addSchema(
|
unref(formRef)?.addSchema(
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue