Commit f069dc81 authored by 水落(YangLei)'s avatar 水落(YangLei)

feat: 优化表格样式

parent a3bf1b58
<template> <template>
<div> <div class="tw-flex tw-items-center tw-flex-1 tw-pr-3" :class="$style.container">
<label>{{ label }}</label> <label :class="$style.label">{{ label }}</label>
<slot /> <slot />
</div> </div>
</template> </template>
...@@ -12,3 +12,19 @@ export default { ...@@ -12,3 +12,19 @@ export default {
}, },
}; };
</script> </script>
<style module lang="less">
.container:last-child {
min-width: 250px;
}
.label {
color: rgba(0, 0, 0, 0.85);
width: 6em;
text-align: right;
margin-right: 1em;
&::after {
content: ':';
}
}
</style>
<template> <template>
<div> <div :style="`min-width: ${width}px`" class="tw-overflow-x-auto">
<my-card v-if="$scopedSlots.search" class="tw-mb-2.5"> <my-card v-if="$scopedSlots.search" class="tw-mb-2.5">
<a-form-model :model="queryForm" layout="inline"> <div class="tw-flex">
<slot name="search" :query="queryForm" /> <slot name="search" :query="queryForm" />
</a-form-model> </div>
<div class="tw-text-right tw-mt-2"> <div class="tw-text-right tw-mt-2">
<a-space> <a-space>
...@@ -97,6 +97,7 @@ export default { ...@@ -97,6 +97,7 @@ export default {
}, },
noPadding: Boolean, noPadding: Boolean,
scroll: Object, scroll: Object,
width: { type: Number, default: 900 },
}, },
data() { data() {
...@@ -228,20 +229,7 @@ export default { ...@@ -228,20 +229,7 @@ export default {
padding: 15px 0 0 0; padding: 15px 0 0 0;
> div { > div {
display: flex;
align-items: center;
@apply tw-mb-3; @apply tw-mb-3;
> label {
color: rgba(0, 0, 0, 0.85);
width: 6em;
text-align: right;
margin-right: 1em;
&::after {
content: ':';
}
}
} }
} }
</style> </style>
<template> <template>
<div class="page-layout"> <div class="page-layout tw-overflow-x-auto">
<page-header <page-header
ref="pageHeader" ref="pageHeader"
:style="`margin-top: ${multiPage ? 0 : -24}px`" :style="`margin-top: ${multiPage ? 0 : -24}px`"
...@@ -79,11 +79,11 @@ export default { ...@@ -79,11 +79,11 @@ export default {
...mapMutations('settingModule', ['correctPageMinHeight']), ...mapMutations('settingModule', ['correctPageMinHeight']),
getRouteBreadcrumb() { getRouteBreadcrumb() {
const path = this.$route.path; const path = this.$route.path;
const currentMenu = this.menuList.find(m => m.menuUrl === path); const currentMenu = this.menuList.find((m) => m.menuUrl === path);
let parentMenuId = currentMenu.parentMenuId; let parentMenuId = currentMenu.parentMenuId;
const breadcrumb = [currentMenu.menuName]; const breadcrumb = [currentMenu.menuName];
while (parentMenuId !== 0) { while (parentMenuId !== 0) {
const parentMenu = this.menuList.find(m => m.menuId === parentMenuId); const parentMenu = this.menuList.find((m) => m.menuId === parentMenuId);
breadcrumb.unshift(parentMenu.menuName); breadcrumb.unshift(parentMenu.menuName);
parentMenuId = parentMenu.parentMenuId; parentMenuId = parentMenu.parentMenuId;
} }
......
<template> <template>
<Wraper :hidden="hidden" noFooter> <Wraper :hidden="hidden" noFooter>
<Table :url="tableUrl" rowKey="taskId" noPadding :buttons="buttons" :scroll="scroll"> <Table :url="tableUrl" rowKey="taskId" noPadding :buttons="buttons" :scroll="scroll" :width="600">
<template #search="{ query }"> <template #search="{ query }">
<a-form-model-item label="开始时间"> <MoreItem label="开始时间">
<a-date-picker <a-date-picker
class="tw-w-full" class="tw-w-full"
show-time show-time
v-model="query.startTime" v-model="query.startTime"
valueFormat="YYYY-MM-DD HH:mm:ss" valueFormat="YYYY-MM-DD HH:mm:ss"
/> />
</a-form-model-item> </MoreItem>
<a-form-model-item label="结束时间"> <MoreItem label="结束时间">
<a-date-picker <a-date-picker
class="tw-w-full" class="tw-w-full"
show-time show-time
v-model="query.endTime" v-model="query.endTime"
valueFormat="YYYY-MM-DD HH:mm:ss" valueFormat="YYYY-MM-DD HH:mm:ss"
/> />
</a-form-model-item> </MoreItem>
</template> </template>
<template #moreSearch="{ query }"> <template #moreSearch="{ query }">
......
...@@ -9,31 +9,31 @@ ...@@ -9,31 +9,31 @@
:drawerWidth="800" :drawerWidth="800"
> >
<template #search="{ query }"> <template #search="{ query }">
<a-form-model-item label="开始时间"> <MoreItem label="开始时间">
<a-date-picker <a-date-picker
class="tw-w-full" class="tw-w-full"
show-time show-time
v-model="query.startTime" v-model="query.startTime"
valueFormat="YYYY-MM-DD HH:mm:ss" valueFormat="YYYY-MM-DD HH:mm:ss"
/> />
</a-form-model-item> </MoreItem>
<a-form-model-item label="结束时间">
<MoreItem label="结束时间">
<a-date-picker <a-date-picker
class="tw-w-full" class="tw-w-full"
show-time show-time
v-model="query.endTime" v-model="query.endTime"
valueFormat="YYYY-MM-DD HH:mm:ss" valueFormat="YYYY-MM-DD HH:mm:ss"
/> />
</a-form-model-item> </MoreItem>
<a-form-model-item label="地区"> <MoreItem label="地区">
<RequestSelect <RequestSelect
style="width: 220px"
:request="getAreaListDataApi" :request="getAreaListDataApi"
v-model="query.regionId" v-model="query.regionId"
labelFiled="regionName" labelFiled="regionName"
valueFiled="regionId" valueFiled="regionId"
/> />
</a-form-model-item> </MoreItem>
</template> </template>
<template #moreSearch="{ query }"> <template #moreSearch="{ query }">
...@@ -157,7 +157,16 @@ import Detail from './detail.vue'; ...@@ -157,7 +157,16 @@ import Detail from './detail.vue';
import MoreItem from '@/components/table/more_item.vue'; import MoreItem from '@/components/table/more_item.vue';
export default { export default {
components: { Table, Form, RequestSelect, UrlSelect, SearchSelect, Progress, Detail, MoreItem }, components: {
Table,
Form,
RequestSelect,
UrlSelect,
SearchSelect,
Progress,
Detail,
MoreItem,
},
data() { data() {
return { return {
getAreaListDataApi, getAreaListDataApi,
......
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