|
1 | 1 | <template>
|
2 |
| - <content-wrap> |
3 |
| - <!-- 搜索工作栏 --> |
4 |
| - <el-form :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px"> |
| 2 | + <!-- 搜索工作栏 --> |
| 3 | + <ContentWrap> |
| 4 | + <el-form |
| 5 | + class="-mb-15px" |
| 6 | + :model="queryParams" |
| 7 | + ref="queryFormRef" |
| 8 | + :inline="true" |
| 9 | + label-width="68px" |
| 10 | + > |
5 | 11 | <el-form-item label="名称" prop="name">
|
6 | 12 | <el-input
|
7 | 13 | v-model="queryParams.name"
|
8 | 14 | placeholder="请输入名称"
|
9 | 15 | clearable
|
10 | 16 | @keyup.enter="handleQuery"
|
| 17 | + class="!w-240px" |
11 | 18 | />
|
12 | 19 | </el-form-item>
|
13 | 20 | <el-form-item label="创建时间" prop="createTime">
|
14 | 21 | <el-date-picker
|
15 | 22 | v-model="queryParams.createTime"
|
16 | 23 | value-format="YYYY-MM-DD HH:mm:ss"
|
17 | 24 | type="daterange"
|
18 |
| - range-separator="-" |
19 | 25 | start-placeholder="开始日期"
|
20 | 26 | end-placeholder="结束日期"
|
21 | 27 | :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
| 28 | + class="!w-240px" |
22 | 29 | />
|
23 | 30 | </el-form-item>
|
24 | 31 | <el-form-item>
|
25 | 32 | <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
26 | 33 | <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
27 |
| - <el-button type="primary" @click="openModal('create')" v-hasPermi="['infra:config:create']"> |
| 34 | + <el-button |
| 35 | + plain |
| 36 | + type="primary" |
| 37 | + @click="openForm('create')" |
| 38 | + v-hasPermi="['product:property:create']" |
| 39 | + > |
28 | 40 | <Icon icon="ep:plus" class="mr-5px" /> 新增
|
29 | 41 | </el-button>
|
30 | 42 | </el-form-item>
|
31 | 43 | </el-form>
|
| 44 | + </ContentWrap> |
32 | 45 |
|
33 |
| - <!-- 列表 --> |
34 |
| - <el-table v-loading="loading" :data="list" align="center"> |
| 46 | + <!-- 列表 --> |
| 47 | + <ContentWrap> |
| 48 | + <el-table v-loading="loading" :data="list"> |
35 | 49 | <el-table-column label="编号" align="center" prop="id" />
|
36 |
| - <el-table-column label="名称" align="center" :show-overflow-tooltip="true"> |
37 |
| - <template #default="scope"> |
38 |
| - <router-link :to="'/property/value/' + scope.row.id" class="link-type"> |
39 |
| - <span>{{ scope.row.name }}</span> |
40 |
| - </router-link> |
41 |
| - </template> |
42 |
| - </el-table-column> |
| 50 | + <el-table-column label="名称" align="center" /> |
43 | 51 | <el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
|
44 | 52 | <el-table-column
|
45 | 53 | label="创建时间"
|
|
53 | 61 | <el-button
|
54 | 62 | link
|
55 | 63 | type="primary"
|
56 |
| - @click="openModal('update', scope.row.id)" |
57 |
| - v-hasPermi="['infra:config:update']" |
| 64 | + @click="openForm('update', scope.row.id)" |
| 65 | + v-hasPermi="['product:property:update']" |
58 | 66 | >
|
59 | 67 | 编辑
|
60 | 68 | </el-button>
|
| 69 | + <el-button link type="primary"> |
| 70 | + <router-link :to="'/property/value/' + scope.row.id">属性值</router-link> |
| 71 | + </el-button> |
61 | 72 | <el-button
|
62 | 73 | link
|
63 | 74 | type="danger"
|
64 | 75 | @click="handleDelete(scope.row.id)"
|
65 |
| - v-hasPermi="['infra:config:delete']" |
| 76 | + v-hasPermi="['product:property:delete']" |
66 | 77 | >
|
67 | 78 | 删除
|
68 | 79 | </el-button>
|
|
76 | 87 | v-model:limit="queryParams.pageSize"
|
77 | 88 | @pagination="getList"
|
78 | 89 | />
|
79 |
| - </content-wrap> |
| 90 | + </ContentWrap> |
80 | 91 |
|
81 | 92 | <!-- 表单弹窗:添加/修改 -->
|
82 |
| - <property-form ref="modalRef" @success="getList" /> |
| 93 | + <PropertyForm ref="formRef" @success="getList" /> |
83 | 94 | </template>
|
84 | 95 | <script setup lang="ts" name="Config">
|
85 | 96 | import { dateFormatter } from '@/utils/formatTime'
|
86 | 97 | import * as PropertyApi from '@/api/mall/product/property'
|
87 |
| -import PropertyForm from './form.vue' |
| 98 | +import PropertyForm from './PropertyForm.vue' |
88 | 99 | const message = useMessage() // 消息弹窗
|
89 | 100 | const { t } = useI18n() // 国际化
|
90 | 101 |
|
@@ -124,9 +135,9 @@ const resetQuery = () => {
|
124 | 135 | }
|
125 | 136 |
|
126 | 137 | /** 添加/修改操作 */
|
127 |
| -const modalRef = ref() |
128 |
| -const openModal = (type: string, id?: number) => { |
129 |
| - modalRef.value.openModal(type, id) |
| 138 | +const formRef = ref() |
| 139 | +const openForm = (type: string, id?: number) => { |
| 140 | + formRef.value.open(type, id) |
130 | 141 | }
|
131 | 142 |
|
132 | 143 | /** 删除按钮操作 */
|
|
0 commit comments