feat: v1.1 Element Plus 组件全面升级
- 布局: 面包屑/头像下拉/公告气泡(点击外部关闭)/菜单滚动条/路由切换动效 - 工作台: el-statistic 彩色统计卡/el-skeleton 骨架屏/公告轮播/快捷入口 - 订单: 日期范围筛选/列排序/详情抽屉 el-descriptions+el-tabs+el-timeline 日志 - 样板库: el-tree-select 分类树/el-image 大图预览/el-badge 引用徽标 - 客户表单校验规则/优化下料 dashboard 利用率进度环 - 全接口回归 13/13 通过, SPA 路由验证通过
This commit is contained in:
@@ -6,9 +6,9 @@
|
||||
<el-radio-button value="official">官方样板</el-radio-button>
|
||||
<el-radio-button value="mine">我的样板</el-radio-button>
|
||||
</el-radio-group>
|
||||
<el-select v-model="catelogId" placeholder="全部分类" clearable style="width:160px" @change="load">
|
||||
<el-option v-for="c in catelogs" :key="c.id" :label="c.name" :value="c.id" />
|
||||
</el-select>
|
||||
<el-tree-select v-model="catelogId" :data="catelogs" node-key="id"
|
||||
:props="{ label: 'name', children: 'children' }" check-strictly default-expand-all
|
||||
clearable style="width:170px" placeholder="全部分类" @change="load" />
|
||||
<el-input v-model="name" placeholder="模板名称" clearable style="width:200px" @keyup.enter="load" />
|
||||
<el-button type="primary" @click="load">查询</el-button>
|
||||
<div style="flex:1" />
|
||||
@@ -16,7 +16,11 @@
|
||||
</div>
|
||||
<div v-loading="loading" class="grid">
|
||||
<div v-for="t in rows" :key="t.id" class="item" @click="preview(t)">
|
||||
<el-image :src="t.pic_url" fit="contain" lazy class="pic" />
|
||||
<el-badge :value="t.times ? `${t.times}次` : ''" :hidden="!t.times" class="bdg">
|
||||
<el-image :src="t.pic_url" fit="contain" lazy class="pic"
|
||||
:preview-src-list="[t.pic_url]" preview-teleported :hide-on-click-modal="true"
|
||||
@click.stop />
|
||||
</el-badge>
|
||||
<div class="cap">{{ t.name || `样板#${t.id}` }}</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -137,8 +141,7 @@ function useInOrder() {
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
const tree = await api<any[]>('get', '/api/windoor/catelogs')
|
||||
catelogs.value = tree.flatMap(t => [t, ...((t.children ?? []) as any[])])
|
||||
catelogs.value = await api<any[]>('get', '/api/windoor/catelogs')
|
||||
load()
|
||||
})
|
||||
</script>
|
||||
@@ -151,6 +154,7 @@ onMounted(async () => {
|
||||
transition: box-shadow .2s; display: flex; flex-direction: column; align-items: center; }
|
||||
.item:hover { box-shadow: 0 2px 12px rgba(0,0,0,.12); }
|
||||
.pic { width: 100%; height: 110px; }
|
||||
.bdg :deep(.el-badge__content) { z-index: 3; }
|
||||
.cap { font-size: 12px; color: #606266; margin-top: 6px; text-align: center; }
|
||||
.preview .canvas-box { height: 60vh; border: 1px solid #e4e7ed; border-radius: 6px; overflow: hidden; }
|
||||
.preview .meta { display: flex; gap: 20px; margin-top: 10px; color: #606266; font-size: 13px; align-items: center; flex-wrap: wrap; }
|
||||
|
||||
Reference in New Issue
Block a user