|
@@ -10,15 +10,15 @@
|
|
|
<el-form-item label="价格" prop="productPrice">
|
|
<el-form-item label="价格" prop="productPrice">
|
|
|
<el-input v-model="queryParams.productPrice" placeholder="请输入价格" clearable @keyup.enter="handleQuery" />
|
|
<el-input v-model="queryParams.productPrice" placeholder="请输入价格" clearable @keyup.enter="handleQuery" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="说明" prop="description">
|
|
|
|
|
|
|
+<!-- <el-form-item label="说明" prop="description">
|
|
|
<el-input v-model="queryParams.description" placeholder="请输入说明" clearable @keyup.enter="handleQuery" />
|
|
<el-input v-model="queryParams.description" placeholder="请输入说明" clearable @keyup.enter="handleQuery" />
|
|
|
- </el-form-item>
|
|
|
|
|
|
|
+ </el-form-item>-->
|
|
|
<!-- <el-form-item label="关联道具" prop="relatedItemId">
|
|
<!-- <el-form-item label="关联道具" prop="relatedItemId">
|
|
|
<el-input v-model="queryParams.relatedItemId" placeholder="请输入关联道具" clearable @keyup.enter="handleQuery" />
|
|
<el-input v-model="queryParams.relatedItemId" placeholder="请输入关联道具" clearable @keyup.enter="handleQuery" />
|
|
|
</el-form-item>-->
|
|
</el-form-item>-->
|
|
|
- <el-form-item label="道具值" prop="quantity">
|
|
|
|
|
|
|
+<!-- <el-form-item label="道具值" prop="quantity">
|
|
|
<el-input v-model="queryParams.quantity" placeholder="请输入道具值" clearable @keyup.enter="handleQuery" />
|
|
<el-input v-model="queryParams.quantity" placeholder="请输入道具值" clearable @keyup.enter="handleQuery" />
|
|
|
- </el-form-item>
|
|
|
|
|
|
|
+ </el-form-item>-->
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
|
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
|
@@ -32,7 +32,13 @@
|
|
|
<template #header>
|
|
<template #header>
|
|
|
<el-row :gutter="10" class="mb8">
|
|
<el-row :gutter="10" class="mb8">
|
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
|
- <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['business:products:add']">新增充值项目</el-button>
|
|
|
|
|
|
|
+ <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['business:products:add']">新增品项</el-button>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="1.5">
|
|
|
|
|
+ <el-button type="primary" plain icon="Picture" @click="handleAdd">上传图片</el-button>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="1.5">
|
|
|
|
|
+ <el-button type="primary" plain icon="VideoCamera" @click="handleAdd">上传视频</el-button>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<!-- <el-col :span="1.5">
|
|
<!-- <el-col :span="1.5">
|
|
|
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['system:products:edit']"
|
|
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['system:products:edit']"
|
|
@@ -45,21 +51,21 @@
|
|
|
>
|
|
>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
-->
|
|
-->
|
|
|
- <el-col :span="1.5">
|
|
|
|
|
|
|
+<!-- <el-col :span="1.5">
|
|
|
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['business:products:export']">导出</el-button>
|
|
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['business:products:export']">导出</el-button>
|
|
|
- </el-col>
|
|
|
|
|
|
|
+ </el-col>-->
|
|
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<el-table v-loading="loading" border :data="productsList" @selection-change="handleSelectionChange">
|
|
<el-table v-loading="loading" border :data="productsList" @selection-change="handleSelectionChange">
|
|
|
- <el-table-column type="selection" width="55" align="center" />
|
|
|
|
|
- <el-table-column label="主键ID" align="center" prop="id" v-if="false" />
|
|
|
|
|
- <el-table-column label="充值商品名" align="center" prop="productName" />
|
|
|
|
|
- <el-table-column label="价格" align="center" prop="productPrice" />
|
|
|
|
|
- <el-table-column label="说明" align="center" prop="description" />
|
|
|
|
|
- <el-table-column label="关联道具" align="center" prop="itemsName" />
|
|
|
|
|
- <el-table-column label="道具值" align="center" prop="quantity" />
|
|
|
|
|
|
|
+<!-- <el-table-column type="selection" width="55" align="center" />-->
|
|
|
|
|
+ <el-table-column label="编号" align="center" prop="id" />
|
|
|
|
|
+ <el-table-column label="商品名" align="center" prop="productName" />
|
|
|
|
|
+ <el-table-column label="价格(元)" align="center" prop="productPrice" />
|
|
|
|
|
+ <el-table-column label="视频点" align="center" prop="videoPoints" />
|
|
|
|
|
+ <el-table-column label="参赛积分" align="center" prop="competitionPoints" />
|
|
|
|
|
+ <el-table-column label="排序" align="center" prop="sortOrder" />
|
|
|
<el-table-column label="创建时间" align="center" prop="createdAt" width="180">
|
|
<el-table-column label="创建时间" align="center" prop="createdAt" width="180">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
<span>{{ parseTime(scope.row.createdAt, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
|
<span>{{ parseTime(scope.row.createdAt, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
|
@@ -87,22 +93,20 @@
|
|
|
<!-- 添加或修改充值商品对话框 -->
|
|
<!-- 添加或修改充值商品对话框 -->
|
|
|
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
|
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
|
|
<el-form ref="productsFormRef" :model="form" :rules="rules" label-width="80px">
|
|
<el-form ref="productsFormRef" :model="form" :rules="rules" label-width="80px">
|
|
|
- <el-form-item label="商品名称" prop="productName">
|
|
|
|
|
|
|
+ <el-form-item label="商品名" prop="productName">
|
|
|
<el-input v-model="form.productName" placeholder="请输入商品名称" />
|
|
<el-input v-model="form.productName" placeholder="请输入商品名称" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="商品价格" prop="productPrice">
|
|
|
|
|
- <el-input v-model="form.productPrice" placeholder="请输入商品价格" />
|
|
|
|
|
|
|
+ <el-form-item label="排序" prop="sortOrder">
|
|
|
|
|
+ <el-input v-model="form.sortOrder" placeholder="请输入排序" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="商品说明" prop="description">
|
|
|
|
|
- <el-input v-model="form.description" type="textarea" placeholder="请输入内容" />
|
|
|
|
|
|
|
+ <el-form-item label="价格(元)" prop="productPrice">
|
|
|
|
|
+ <el-input v-model="form.productPrice" placeholder="请输入价格(元)" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="关联道具" prop="relatedItemId">
|
|
|
|
|
- <el-select v-model="form.relatedItemId" placeholder="请选择关联道具" style="width: 100%">
|
|
|
|
|
- <el-option v-for="item in itemOptions" :key="item.id" :label="item.label" :value="item.id" />
|
|
|
|
|
- </el-select>
|
|
|
|
|
|
|
+ <el-form-item label="视频点" prop="videoPoints">
|
|
|
|
|
+ <el-input v-model="form.videoPoints" placeholder="请输入视频点" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="道具值" prop="quantity">
|
|
|
|
|
- <el-input v-model="form.quantity" placeholder="请输入道具值" />
|
|
|
|
|
|
|
+ <el-form-item label="参赛积分" prop="competitionPoints">
|
|
|
|
|
+ <el-input v-model="form.competitionPoints" placeholder="请输入参赛积分" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
<template #footer>
|
|
<template #footer>
|
|
@@ -167,7 +171,10 @@ const data = reactive<PageData<ProductsForm, ProductsQuery>>({
|
|
|
id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }],
|
|
id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }],
|
|
|
productName: [{ required: true, message: '充值商品名不能为空', trigger: 'blur' }],
|
|
productName: [{ required: true, message: '充值商品名不能为空', trigger: 'blur' }],
|
|
|
productPrice: [{ required: true, message: '价格不能为空', trigger: 'blur' }],
|
|
productPrice: [{ required: true, message: '价格不能为空', trigger: 'blur' }],
|
|
|
- quantity: [{ required: true, message: '道具值不能为空', trigger: 'blur' }]
|
|
|
|
|
|
|
+ quantity: [{ required: true, message: '道具值不能为空', trigger: 'blur' }],
|
|
|
|
|
+ sortOrder: [{ required: true, message: '排序不能为空', trigger: 'blur' }],
|
|
|
|
|
+ videoPoints: [{ required: true, message: '视频点不能为空', trigger: 'blur' }],
|
|
|
|
|
+ competitionPoints: [{ required: true, message: '参赛积分不能为空', trigger: 'blur' }]
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -217,7 +224,7 @@ const handleSelectionChange = (selection: ProductsVO[]) => {
|
|
|
const handleAdd = () => {
|
|
const handleAdd = () => {
|
|
|
reset();
|
|
reset();
|
|
|
dialog.visible = true;
|
|
dialog.visible = true;
|
|
|
- dialog.title = '添加充值商品';
|
|
|
|
|
|
|
+ dialog.title = '添加品项';
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
/** 修改按钮操作 */
|
|
/** 修改按钮操作 */
|
|
@@ -229,7 +236,7 @@ const handleUpdate = async (row?: ProductsVO) => {
|
|
|
Object.assign(form.value, res.data);
|
|
Object.assign(form.value, res.data);
|
|
|
form.value.relatedItemId = relatedItemId; // 确保赋值正确
|
|
form.value.relatedItemId = relatedItemId; // 确保赋值正确
|
|
|
dialog.visible = true;
|
|
dialog.visible = true;
|
|
|
- dialog.title = '修改充值商品';
|
|
|
|
|
|
|
+ dialog.title = '修改品项';
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
/** 提交按钮 */
|
|
/** 提交按钮 */
|
|
@@ -252,7 +259,7 @@ const submitForm = () => {
|
|
|
/** 删除按钮操作 */
|
|
/** 删除按钮操作 */
|
|
|
const handleDelete = async (row?: ProductsVO) => {
|
|
const handleDelete = async (row?: ProductsVO) => {
|
|
|
const _ids = row?.id || ids.value;
|
|
const _ids = row?.id || ids.value;
|
|
|
- await proxy?.$modal.confirm('是否确认删除充值商品编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
|
|
|
|
|
|
+ await proxy?.$modal.confirm('是否确认删除充编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
|
|
await delProducts(_ids);
|
|
await delProducts(_ids);
|
|
|
proxy?.$modal.msgSuccess('删除成功');
|
|
proxy?.$modal.msgSuccess('删除成功');
|
|
|
await getList();
|
|
await getList();
|