|
|
|
|
@ -1,13 +1,20 @@
|
|
|
|
|
<template>
|
|
|
|
|
<content-wrap>
|
|
|
|
|
<!-- 搜索工作栏 -->
|
|
|
|
|
<el-form :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px">
|
|
|
|
|
<!-- 搜索工作栏 -->
|
|
|
|
|
<ContentWrap>
|
|
|
|
|
<el-form
|
|
|
|
|
class="-mb-15px"
|
|
|
|
|
:model="queryParams"
|
|
|
|
|
ref="queryFormRef"
|
|
|
|
|
:inline="true"
|
|
|
|
|
label-width="68px"
|
|
|
|
|
>
|
|
|
|
|
<el-form-item label="名称" prop="name">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryParams.name"
|
|
|
|
|
placeholder="请输入名称"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter="handleQuery"
|
|
|
|
|
class="!w-240px"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="创建时间" prop="createTime">
|
|
|
|
|
@ -15,31 +22,32 @@
|
|
|
|
|
v-model="queryParams.createTime"
|
|
|
|
|
value-format="YYYY-MM-DD HH:mm:ss"
|
|
|
|
|
type="daterange"
|
|
|
|
|
range-separator="-"
|
|
|
|
|
start-placeholder="开始日期"
|
|
|
|
|
end-placeholder="结束日期"
|
|
|
|
|
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
|
|
|
|
class="!w-240px"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
|
|
|
|
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
|
|
|
|
<el-button type="primary" @click="openModal('create')" v-hasPermi="['infra:config:create']">
|
|
|
|
|
<el-button
|
|
|
|
|
plain
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="openForm('create')"
|
|
|
|
|
v-hasPermi="['product:property:create']"
|
|
|
|
|
>
|
|
|
|
|
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
</ContentWrap>
|
|
|
|
|
|
|
|
|
|
<!-- 列表 -->
|
|
|
|
|
<el-table v-loading="loading" :data="list" align="center">
|
|
|
|
|
<!-- 列表 -->
|
|
|
|
|
<ContentWrap>
|
|
|
|
|
<el-table v-loading="loading" :data="list">
|
|
|
|
|
<el-table-column label="编号" align="center" prop="id" />
|
|
|
|
|
<el-table-column label="名称" align="center" :show-overflow-tooltip="true">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<router-link :to="'/property/value/' + scope.row.id" class="link-type">
|
|
|
|
|
<span>{{ scope.row.name }}</span>
|
|
|
|
|
</router-link>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="名称" align="center" />
|
|
|
|
|
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="创建时间"
|
|
|
|
|
@ -53,16 +61,19 @@
|
|
|
|
|
<el-button
|
|
|
|
|
link
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="openModal('update', scope.row.id)"
|
|
|
|
|
v-hasPermi="['infra:config:update']"
|
|
|
|
|
@click="openForm('update', scope.row.id)"
|
|
|
|
|
v-hasPermi="['product:property:update']"
|
|
|
|
|
>
|
|
|
|
|
编辑
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button link type="primary">
|
|
|
|
|
<router-link :to="'/property/value/' + scope.row.id">属性值</router-link>
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
link
|
|
|
|
|
type="danger"
|
|
|
|
|
@click="handleDelete(scope.row.id)"
|
|
|
|
|
v-hasPermi="['infra:config:delete']"
|
|
|
|
|
v-hasPermi="['product:property:delete']"
|
|
|
|
|
>
|
|
|
|
|
删除
|
|
|
|
|
</el-button>
|
|
|
|
|
@ -76,15 +87,15 @@
|
|
|
|
|
v-model:limit="queryParams.pageSize"
|
|
|
|
|
@pagination="getList"
|
|
|
|
|
/>
|
|
|
|
|
</content-wrap>
|
|
|
|
|
</ContentWrap>
|
|
|
|
|
|
|
|
|
|
<!-- 表单弹窗:添加/修改 -->
|
|
|
|
|
<property-form ref="modalRef" @success="getList" />
|
|
|
|
|
<PropertyForm ref="formRef" @success="getList" />
|
|
|
|
|
</template>
|
|
|
|
|
<script setup lang="ts" name="Config">
|
|
|
|
|
import { dateFormatter } from '@/utils/formatTime'
|
|
|
|
|
import * as PropertyApi from '@/api/mall/product/property'
|
|
|
|
|
import PropertyForm from './form.vue'
|
|
|
|
|
import PropertyForm from './PropertyForm.vue'
|
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
|
|
const { t } = useI18n() // 国际化
|
|
|
|
|
|
|
|
|
|
@ -124,9 +135,9 @@ const resetQuery = () => {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 添加/修改操作 */
|
|
|
|
|
const modalRef = ref()
|
|
|
|
|
const openModal = (type: string, id?: number) => {
|
|
|
|
|
modalRef.value.openModal(type, id)
|
|
|
|
|
const formRef = ref()
|
|
|
|
|
const openForm = (type: string, id?: number) => {
|
|
|
|
|
formRef.value.open(type, id)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
|
|