fix: 字典页面排版

This commit is contained in:
TsMask
2024-01-10 15:39:47 +08:00
parent 3d8b2d35d7
commit 8b2317545d
2 changed files with 91 additions and 73 deletions

View File

@@ -148,32 +148,38 @@ let tableColumns: ColumnsType = [
title: t('views.system.dictData.dictCode'), title: t('views.system.dictData.dictCode'),
dataIndex: 'dictCode', dataIndex: 'dictCode',
align: 'left', align: 'left',
width: 100,
}, },
{ {
title: t('views.system.dictData.dictLabel'), title: t('views.system.dictData.dictLabel'),
dataIndex: 'dictLabel', dataIndex: 'dictLabel',
align: 'left', align: 'left',
width: 200,
}, },
{ {
title: t('views.system.dictData.dictValue'), title: t('views.system.dictData.dictValue'),
dataIndex: 'dictValue', dataIndex: 'dictValue',
align: 'left', align: 'left',
width: 200,
}, },
{ {
title: t('views.system.dictData.dictSort'), title: t('views.system.dictData.dictSort'),
dataIndex: 'dictSort', dataIndex: 'dictSort',
align: 'left', align: 'left',
width: 100,
}, },
{ {
title: t('views.system.dictData.status'), title: t('views.system.dictData.status'),
dataIndex: 'status', dataIndex: 'status',
key: 'status', key: 'status',
align: 'left', align: 'left',
width: 100,
}, },
{ {
title: t('views.system.dictData.createTime'), title: t('views.system.dictData.createTime'),
dataIndex: 'createTime', dataIndex: 'createTime',
align: 'left', align: 'left',
width: 150,
customRender(opt) { customRender(opt) {
if (+opt.value <= 0) return ''; if (+opt.value <= 0) return '';
return parseDateToStr(+opt.value); return parseDateToStr(+opt.value);
@@ -182,7 +188,7 @@ let tableColumns: ColumnsType = [
{ {
title: t('common.operate'), title: t('common.operate'),
key: 'dictCode', key: 'dictCode',
align: 'center', align: 'left',
}, },
]; ];
@@ -513,14 +519,13 @@ onMounted(() => {
<!-- 表格搜索栏 --> <!-- 表格搜索栏 -->
<a-form :model="queryParams" name="queryParams" layout="horizontal"> <a-form :model="queryParams" name="queryParams" layout="horizontal">
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :lg="6" :md="12" :xs="24"> <a-col :lg="6" :md="12" :xs="24" v-if="dictId !== '0'">
<a-form-item <a-form-item
:label="t('views.system.dictData.dictType')" :label="t('views.system.dictData.dictType')"
name="dictType" name="dictType"
> >
<a-select <a-select
v-model:value="queryParams.dictType" v-model:value="queryParams.dictType"
:allow-clear="dictId === '0'"
:disabled="dictId !== '0'" :disabled="dictId !== '0'"
:placeholder="t('common.selectPlease')" :placeholder="t('common.selectPlease')"
:options="dict.sysDictType" :options="dict.sysDictType"
@@ -672,7 +677,7 @@ onMounted(() => {
:data-source="tableState.data" :data-source="tableState.data"
:size="tableState.size" :size="tableState.size"
:row-class-name="fnTableStriped" :row-class-name="fnTableStriped"
:scroll="{ x: true }" :scroll="{ x: tableColumns.length * 120 }"
:pagination="tablePagination" :pagination="tablePagination"
:row-selection="{ :row-selection="{
type: 'checkbox', type: 'checkbox',
@@ -729,7 +734,7 @@ onMounted(() => {
:title="modalState.title" :title="modalState.title"
@cancel="fnModalCancel" @cancel="fnModalCancel"
> >
<a-form layout="horizontal"> <a-form layout="horizontal" :label-col="{ span: 6 }" :label-wrap="true">
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item <a-form-item
@@ -835,8 +840,17 @@ onMounted(() => {
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
<a-form-item :label="t('views.system.dictData.remark')" name="remark"> <a-form-item
{{ modalState.from.remark }} :label="t('views.system.dictData.remark')"
name="remark"
:label-col="{ span: 3 }"
:label-wrap="true"
>
<a-textarea
v-model:value="modalState.from.remark"
:auto-size="{ minRows: 2, maxRows: 6 }"
:disabled="true"
/>
</a-form-item> </a-form-item>
</a-form> </a-form>
<template #footer> <template #footer>
@@ -857,7 +871,12 @@ onMounted(() => {
@ok="fnModalOk" @ok="fnModalOk"
@cancel="fnModalCancel" @cancel="fnModalCancel"
> >
<a-form name="modalStateFrom" layout="horizontal"> <a-form
name="modalStateFrom"
layout="horizontal"
:label-col="{ span: 6 }"
:label-wrap="true"
>
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item <a-form-item
@@ -934,6 +953,7 @@ onMounted(() => {
type="color" type="color"
allow-clear allow-clear
:placeholder="t('common.inputPlease')" :placeholder="t('common.inputPlease')"
size="small"
></a-input> ></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
@@ -979,7 +999,12 @@ onMounted(() => {
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
<a-form-item :label="t('views.system.dictData.remark')" name="remark"> <a-form-item
:label="t('views.system.dictData.remark')"
name="remark"
:label-col="{ span: 3 }"
:label-wrap="true"
>
<a-textarea <a-textarea
v-model:value="modalState.from.remark" v-model:value="modalState.from.remark"
:auto-size="{ minRows: 4, maxRows: 6 }" :auto-size="{ minRows: 4, maxRows: 6 }"

View File

@@ -104,28 +104,32 @@ let tableColumns: ColumnsType = [
{ {
title: t('views.system.dict.dictId'), title: t('views.system.dict.dictId'),
dataIndex: 'dictId', dataIndex: 'dictId',
align: 'center', align: 'left',
}, },
{ {
title: t('views.system.dict.dictName'), title: t('views.system.dict.dictName'),
dataIndex: 'dictName', dataIndex: 'dictName',
align: 'left', align: 'left',
width: 200,
}, },
{ {
title: t('views.system.dict.dictType'), title: t('views.system.dict.dictType'),
dataIndex: 'dictType', dataIndex: 'dictType',
align: 'left', align: 'left',
width: 200,
}, },
{ {
title: t('views.system.dict.dictSatus'), title: t('views.system.dict.dictSatus'),
dataIndex: 'status', dataIndex: 'status',
key: 'status', key: 'status',
align: 'center', align: 'center',
width: 100,
}, },
{ {
title: t('views.system.dict.createTime'), title: t('views.system.dict.createTime'),
dataIndex: 'createTime', dataIndex: 'createTime',
align: 'center', align: 'center',
width: 150,
customRender(opt) { customRender(opt) {
if (+opt.value <= 0) return ''; if (+opt.value <= 0) return '';
return parseDateToStr(+opt.value); return parseDateToStr(+opt.value);
@@ -134,7 +138,7 @@ let tableColumns: ColumnsType = [
{ {
title: t('common.operate'), title: t('common.operate'),
key: 'dictId', key: 'dictId',
align: 'center', align: 'left',
}, },
]; ];
@@ -347,7 +351,7 @@ function fnRecordDelete(dictId: string = '0') {
} }
Modal.confirm({ Modal.confirm({
title: t('common.tipTitle'), title: t('common.tipTitle'),
content: t('views.system.dict.dictType', { dictId }), content: t('views.system.dict.delSure', { dictId }),
onOk() { onOk() {
const key = 'delType'; const key = 'delType';
message.loading({ content: t('common.loading'), key }); message.loading({ content: t('common.loading'), key });
@@ -663,7 +667,7 @@ onMounted(() => {
:size="tableState.size" :size="tableState.size"
:row-class-name="fnTableStriped" :row-class-name="fnTableStriped"
:pagination="tablePagination" :pagination="tablePagination"
:scroll="{ x: true }" :scroll="{ x: tableColumns.length * 120 }"
:row-selection="{ :row-selection="{
type: 'checkbox', type: 'checkbox',
selectedRowKeys: tableState.selectedRowKeys, selectedRowKeys: tableState.selectedRowKeys,
@@ -731,33 +735,28 @@ onMounted(() => {
:title="modalState.title" :title="modalState.title"
@cancel="fnModalCancel" @cancel="fnModalCancel"
> >
<a-form layout="horizontal"> <a-form layout="horizontal" :label-col="{ span: 3 }" :label-wrap="true">
<a-row :gutter="16"> <a-form-item :label="t('views.system.dict.dictId')" name="dictId">
<a-col :lg="12" :md="12" :xs="24"> {{ modalState.from.dictId }}
<a-form-item :label="t('views.system.dict.dictId')" name="dictId"> </a-form-item>
{{ modalState.from.dictId }}
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
:label="t('views.system.dict.dictSatus')"
name="status"
>
<DictTag
:options="dict.sysNormalDisable"
:value="modalState.from.status"
/>
</a-form-item>
</a-col>
</a-row>
<a-form-item :label="t('views.system.dict.dictName')" name="dictName"> <a-form-item :label="t('views.system.dict.dictName')" name="dictName">
{{ modalState.from.dictName }} {{ modalState.from.dictName }}
</a-form-item> </a-form-item>
<a-form-item :label="t('views.system.dict.dictType')" name="dictType"> <a-form-item :label="t('views.system.dict.dictType')" name="dictType">
{{ modalState.from.dictType }} {{ modalState.from.dictType }}
</a-form-item> </a-form-item>
<a-form-item :label="t('views.system.dict.dictSatus')" name="status">
<DictTag
:options="dict.sysNormalDisable"
:value="modalState.from.status"
/>
</a-form-item>
<a-form-item :label="t('views.system.dict.mark')" name="remark"> <a-form-item :label="t('views.system.dict.mark')" name="remark">
{{ modalState.from.remark }} <a-textarea
v-model:value="modalState.from.remark"
:auto-size="{ minRows: 2, maxRows: 6 }"
:disabled="true"
/>
</a-form-item> </a-form-item>
</a-form> </a-form>
<template #footer> <template #footer>
@@ -778,46 +777,40 @@ onMounted(() => {
@ok="fnModalOk" @ok="fnModalOk"
@cancel="fnModalCancel" @cancel="fnModalCancel"
> >
<a-form name="modalStateFrom" layout="horizontal"> <a-form
<a-row :gutter="16"> name="modalStateFrom"
<a-col :lg="18" :md="18" :xs="24"> layout="horizontal"
<a-form-item :label-col="{ span: 3 }"
:label="t('views.system.dict.dictName')" :label-wrap="true"
name="dictName" >
v-bind="modalStateFrom.validateInfos.dictName" <a-form-item
> :label="t('views.system.dict.dictName')"
<a-input name="dictName"
v-model:value="modalState.from.dictName" v-bind="modalStateFrom.validateInfos.dictName"
allow-clear >
></a-input> <a-input
</a-form-item> v-model:value="modalState.from.dictName"
</a-col> allow-clear
<a-col :lg="6" :md="6" :xs="24"> ></a-input>
<a-form-item </a-form-item>
:label="t('views.system.dict.dictSatus')" <a-form-item
name="status" :label="t('views.system.dict.dictType')"
> name="dictType"
<a-select v-bind="modalStateFrom.validateInfos.dictType"
v-model:value="modalState.from.status" >
default-value="0" <a-input
:options="dict.sysNormalDisable" v-model:value="modalState.from.dictType"
> allow-clear
</a-select> ></a-input>
</a-form-item> </a-form-item>
</a-col> <a-form-item :label="t('views.system.dict.dictSatus')" name="status">
<a-col :lg="18" :md="18" :xs="24"> <a-select
<a-form-item v-model:value="modalState.from.status"
:label="t('views.system.dict.dictType')" default-value="0"
name="dictType" :options="dict.sysNormalDisable"
v-bind="modalStateFrom.validateInfos.dictType" >
> </a-select>
<a-input </a-form-item>
v-model:value="modalState.from.dictType"
allow-clear
></a-input>
</a-form-item>
</a-col>
</a-row>
<a-form-item :label="t('views.system.dict.mark')" name="remark"> <a-form-item :label="t('views.system.dict.mark')" name="remark">
<a-textarea <a-textarea