提交 8afba627 authored 作者: 王鹏飞's avatar 王鹏飞

chore update

上级 1bf888af
...@@ -138,8 +138,7 @@ defineExpose({ refetch, tableRef }) ...@@ -138,8 +138,7 @@ defineExpose({ refetch, tableRef })
clearable clearable
@change="search" @change="search"
style="width: 200px" style="width: 200px"
v-if="item.type === 'input'" v-if="item.type === 'input'" />
/>
<!-- select --> <!-- select -->
<el-select <el-select
v-model="params[item.prop]" v-model="params[item.prop]"
...@@ -147,14 +146,12 @@ defineExpose({ refetch, tableRef }) ...@@ -147,14 +146,12 @@ defineExpose({ refetch, tableRef })
filterable filterable
clearable clearable
@change="search" @change="search"
v-if="item.type === 'select'" v-if="item.type === 'select'">
>
<el-option <el-option
:label="option[item.labelKey] || option.label" :label="option[item.labelKey] || option.label"
:value="option[item.valueKey] || option.value" :value="option[item.valueKey] || option.value"
v-for="(option, index) in item.options" v-for="(option, index) in item.options"
:key="index" :key="index" />
/>
</el-select> </el-select>
</template> </template>
</el-form-item> </el-form-item>
...@@ -178,8 +175,7 @@ defineExpose({ refetch, tableRef }) ...@@ -178,8 +175,7 @@ defineExpose({ refetch, tableRef })
:data="dataList" :data="dataList"
v-loading="loading" v-loading="loading"
v-bind="$attrs" v-bind="$attrs"
ref="tableRef" ref="tableRef">
>
<el-table-column align="center" v-bind="item || {}" v-for="item in columns" :key="item.prop"> <el-table-column align="center" v-bind="item || {}" v-for="item in columns" :key="item.prop">
<template #default="scope" v-if="item.slots || item.computed"> <template #default="scope" v-if="item.slots || item.computed">
<slot :name="item.slots" v-bind="scope" v-if="item.slots"></slot> <slot :name="item.slots" v-bind="scope" v-if="item.slots"></slot>
...@@ -205,21 +201,13 @@ defineExpose({ refetch, tableRef }) ...@@ -205,21 +201,13 @@ defineExpose({ refetch, tableRef })
@size-change="pageSizeChange" @size-change="pageSizeChange"
@current-change="fetchList()" @current-change="fetchList()"
:hide-on-single-page="true" :hide-on-single-page="true"
v-if="hasPagination" v-if="hasPagination">
>
</el-pagination> </el-pagination>
</div> </div>
</div> </div>
</template> </template>
<style lang="scss"> <style lang="scss">
// .table-list {
// height: 100%;
// display: flex;
// flex-direction: column;
// box-sizing: border-box;
// }
.table-list-hd { .table-list-hd {
display: flex; display: flex;
margin-bottom: 20px; margin-bottom: 20px;
...@@ -229,9 +217,6 @@ defineExpose({ refetch, tableRef }) ...@@ -229,9 +217,6 @@ defineExpose({ refetch, tableRef })
} }
.table-list-filter { .table-list-filter {
flex: 1; flex: 1;
// padding: 30px 30px 10px;
// background: #f8f8f8;
// border-radius: 12px;
} }
.table-list-buttons { .table-list-buttons {
margin-bottom: 20px; margin-bottom: 20px;
...@@ -239,9 +224,7 @@ defineExpose({ refetch, tableRef }) ...@@ -239,9 +224,7 @@ defineExpose({ refetch, tableRef })
display: none; display: none;
} }
} }
// .table-list-bd {
// flex: 1;
// }
.table-list-ft { .table-list-ft {
padding: 10px 0; padding: 10px 0;
display: flex; display: flex;
...@@ -254,8 +237,21 @@ defineExpose({ refetch, tableRef }) ...@@ -254,8 +237,21 @@ defineExpose({ refetch, tableRef })
.el-table-column--selection .cell { .el-table-column--selection .cell {
padding: 0 14px !important; padding: 0 14px !important;
} }
.el-button a { .table-list {
.el-button {
a {
margin: -8px -15px; margin: -8px -15px;
padding: 8px 15px; padding: 8px 15px;
}
&.is-text {
padding: 8px;
}
&.is-text + .is-text {
margin-left: 0;
}
&.is-plain {
--el-button-border-color: var(--el-button-bg-color);
}
}
} }
</style> </style>
...@@ -19,10 +19,17 @@ const currentSubmenu = computed(() => { ...@@ -19,10 +19,17 @@ const currentSubmenu = computed(() => {
function findMenu(path: string, menus: IMenuItem[]) { function findMenu(path: string, menus: IMenuItem[]) {
return menus.find(item => { return menus.find(item => {
if (item.children && item.children.find(item => item.path === path)) { if (
item.children &&
item.children.find(item => {
const regExp = new RegExp(`^${item.path}`)
return regExp.test(path)
})
) {
return item return item
} }
return item.path === path const regExp = new RegExp(`^${item.path}`)
return regExp.test(path)
}) })
} }
</script> </script>
......
...@@ -30,15 +30,12 @@ withDefaults(defineProps<Props>(), { ...@@ -30,15 +30,12 @@ withDefaults(defineProps<Props>(), {
<style lang="scss"> <style lang="scss">
.app-layout { .app-layout {
min-width: 1000px;
min-height: 100vh; min-height: 100vh;
margin: 0 auto;
background-color: #ecf2f7; background-color: #ecf2f7;
display: flex; display: flex;
} }
.app-layout-container { .app-layout-container {
// min-height: calc(100vh - 66px);
flex: 1; flex: 1;
display: flex; overflow: hidden;
} }
</style> </style>
...@@ -4,26 +4,13 @@ export default { name: 'AppMain' } ...@@ -4,26 +4,13 @@ export default { name: 'AppMain' }
<template> <template>
<section class="app-main"> <section class="app-main">
<div class="app-main-inner">
<router-view></router-view> <router-view></router-view>
</div>
</section> </section>
</template> </template>
<style> <style>
.app-main { .app-main {
position: relative;
flex: 1;
padding: 10px; padding: 10px;
overflow: hidden; overflow: hidden;
} }
.app-main-inner {
height: 100%;
margin: 0 auto;
}
.app-main-container::after {
content: '';
display: table;
clear: both;
}
</style> </style>
<script setup lang="ts">
// 列表配置
const listOptions = computed(() => {
return {
filters: [
{ type: 'input', prop: 'name', placeholder: '请输入事件名称' },
{
type: 'select',
prop: 'type',
placeholder: '请选择事件所属连接'
}
],
columns: [
{ label: '序号', type: 'index', width: 60 },
{ label: '事件ID', prop: 'id' },
{ label: '事件名称', prop: 'name' },
{ label: '所属连接', prop: 'name' },
{ label: '属性字段数量', prop: 'name' },
{ label: '状态', prop: 'name' },
{ label: '更新人', prop: 'name' },
{ label: '更新时间', prop: 'name' },
{ label: '操作', slots: 'table-x', width: 300 }
],
data: [{}, {}]
}
})
</script>
<template> <template>
<AppCard></AppCard> <AppCard>
<AppList v-bind="listOptions">
<template #table-x>
<el-button type="primary" plain>查看</el-button>
<el-button type="primary" plain>编辑</el-button>
<el-button type="primary" plain>删除</el-button>
<el-button type="primary" plain>字段</el-button>
</template>
</AppList>
</AppCard>
</template> </template>
...@@ -18,7 +18,7 @@ const listOptions = computed(() => { ...@@ -18,7 +18,7 @@ const listOptions = computed(() => {
{ label: '状态', prop: 'name' }, { label: '状态', prop: 'name' },
{ label: '更新人', prop: 'name' }, { label: '更新人', prop: 'name' },
{ label: '更新时间', prop: 'name' }, { label: '更新时间', prop: 'name' },
{ label: '操作', slots: 'table-x' } { label: '操作', slots: 'table-x', width: 240 }
], ],
data: [{}, {}] data: [{}, {}]
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论