Skip to content

Commit 1a56509

Browse files
committed
chore: update
1 parent c896201 commit 1a56509

File tree

5 files changed

+100
-94
lines changed

5 files changed

+100
-94
lines changed

locales/en.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,4 @@ menus:
7575
hsAntAnchor: Imitate Antdv Anchor
7676
hsAntTreeSelect: Imitate Antdv TreeSelector
7777
list: List Page
78-
listCard: Card List page
78+
listCard: Card List Page

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"dayjs": "^1.11.0",
4242
"driver.js": "^0.9.8",
4343
"echarts": "^5.3.2",
44-
"element-plus": "^2.1.8",
44+
"element-plus": "^2.1.9",
4545
"element-resize-detector": "^1.2.3",
4646
"js-cookie": "^3.0.1",
4747
"lodash": "^4.17.21",

pnpm-lock.yaml

+30-24
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/views/list/card/components/DialogForm.vue

+2
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ const rules = {
8282
v-model="formVisible"
8383
title="新建产品"
8484
:width="680"
85+
draggable
8586
:before-close="closeDialog"
8687
>
8788
<!-- 表单内容 -->
@@ -115,6 +116,7 @@ const rules = {
115116
<el-select
116117
v-model="formData.type"
117118
clearable
119+
:teleported="false"
118120
:style="{ width: '480px' }"
119121
>
120122
<el-option

src/views/list/card/index.vue

+66-68
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import ReCard from "/@/components/ReCard";
1010
import { ref, onMounted, nextTick } from "vue";
1111
import DialogForm from "./components/DialogForm.vue";
1212
import { ElMessage, ElMessageBox } from "element-plus";
13+
import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
1314
1415
const svg = `
1516
<path class="path" d="
@@ -94,86 +95,83 @@ const handleManageProduct = product => {
9495
</script>
9596

9697
<template>
97-
<div>
98-
<div class="list-card-operation">
99-
<el-button @click="formDialogVisible = true"> 新建产品 </el-button>
100-
<div class="search-input">
101-
<el-input
102-
v-model="searchValue"
103-
placeholder="请输入你需要搜索的内容"
104-
clearable
105-
>
106-
<template #suffix>
107-
<el-icon class="el-input__icon">
108-
<IconifyIconOffline v-if="searchValue === ''" icon="search" />
109-
</el-icon>
110-
</template>
111-
</el-input>
112-
</div>
98+
<div class="main">
99+
<div class="w-full flex justify-between mb-4">
100+
<el-button :icon="useRenderIcon('add')" @click="formDialogVisible = true"
101+
>新建产品</el-button
102+
>
103+
<el-input
104+
style="width: 300px"
105+
v-model="searchValue"
106+
placeholder="请输入产品名称"
107+
clearable
108+
>
109+
<template #suffix>
110+
<el-icon class="el-input__icon">
111+
<IconifyIconOffline
112+
v-show="searchValue.length === 0"
113+
icon="search"
114+
/>
115+
</el-icon>
116+
</template>
117+
</el-input>
113118
</div>
114119
<div
115120
v-loading="dataLoading"
116121
:element-loading-svg="svg"
117122
element-loading-svg-view-box="-10, -10, 50, 50"
118123
>
124+
<el-empty
125+
description="暂无数据"
126+
v-show="
127+
productList
128+
.slice(
129+
pagination.pageSize * (pagination.current - 1),
130+
pagination.pageSize * pagination.current
131+
)
132+
.filter(v =>
133+
v.name.toLowerCase().includes(searchValue.toLowerCase())
134+
).length === 0
135+
"
136+
/>
119137
<template v-if="pagination.total > 0">
120-
<div class="list-card-items">
121-
<el-row :gutter="16">
122-
<el-col
123-
v-for="product in productList.slice(
138+
<el-row :gutter="16">
139+
<el-col
140+
v-for="(product, index) in productList
141+
.slice(
124142
pagination.pageSize * (pagination.current - 1),
125143
pagination.pageSize * pagination.current
144+
)
145+
.filter(v =>
146+
v.name.toLowerCase().includes(searchValue.toLowerCase())
126147
)"
127-
:key="product.index"
128-
:xs="24"
129-
:sm="12"
130-
:md="8"
131-
:lg="6"
132-
:xl="4"
133-
>
134-
<ReCard
135-
class="list-card-item"
136-
:product="product"
137-
@delete-item="handleDeleteItem"
138-
@manage-product="handleManageProduct"
139-
/>
140-
</el-col>
141-
</el-row>
142-
</div>
143-
<div class="list-card-pagination">
144-
<el-pagination
145-
v-model:currentPage="pagination.current"
146-
:page-size="pagination.pageSize"
147-
:total="pagination.total"
148-
:page-sizes="[12, 24, 36]"
149-
layout="total, sizes, prev, pager, next"
150-
@size-change="onPageSizeChange"
151-
@current-change="onCurrentChange"
152-
/>
153-
</div>
148+
:key="index"
149+
:xs="24"
150+
:sm="12"
151+
:md="8"
152+
:lg="6"
153+
:xl="4"
154+
>
155+
<ReCard
156+
:product="product"
157+
@delete-item="handleDeleteItem"
158+
@manage-product="handleManageProduct"
159+
/>
160+
</el-col>
161+
</el-row>
162+
<el-pagination
163+
class="float-right"
164+
v-model:currentPage="pagination.current"
165+
:page-size="pagination.pageSize"
166+
:total="pagination.total"
167+
:page-sizes="[12, 24, 36]"
168+
:background="true"
169+
layout="total, sizes, prev, pager, next, jumper"
170+
@size-change="onPageSizeChange"
171+
@current-change="onCurrentChange"
172+
/>
154173
</template>
155174
</div>
156175
<DialogForm v-model:visible="formDialogVisible" :data="formData" />
157176
</div>
158177
</template>
159-
160-
<style scoped lang="scss">
161-
.list-card {
162-
&-operation {
163-
display: flex;
164-
justify-content: space-between;
165-
166-
.search-input {
167-
width: 360px;
168-
}
169-
}
170-
171-
&-items {
172-
margin: 14px 0 24px 0;
173-
}
174-
175-
&-pagination {
176-
padding: 16px;
177-
}
178-
}
179-
</style>

0 commit comments

Comments
 (0)