|
@@ -3,7 +3,7 @@
|
|
|
<el-row>
|
|
|
<el-col :span="24" class="main animate__animated animate__backInRight">
|
|
|
<el-col :span="24" class="one">
|
|
|
- <data-table @query="search" :fields="fields" :opera="opera" :data="list" :total="total" @view="toView" @export="toExport">
|
|
|
+ <data-table @query="search" :fields="fields" :opera="opera" :data="list" :total="total" @view="toView" @check="toCheck">
|
|
|
<template #options="{ item }">
|
|
|
<template v-if="item.prop == 'status'">
|
|
|
<el-option v-for="item in statusList" :key="item.label" :label="item.label" :value="item.value"></el-option>
|
|
@@ -40,7 +40,7 @@ export default {
|
|
|
fields: [
|
|
|
{ label: '商品名称', prop: 'name', filter: true },
|
|
|
{ label: '商品类型', prop: 'type_name', filter: true },
|
|
|
- { label: '商品价格', prop: 'money', filter: 'select' },
|
|
|
+ { label: '商品价格', prop: 'money' },
|
|
|
{
|
|
|
label: '商品状态',
|
|
|
prop: 'status',
|
|
@@ -53,10 +53,10 @@ export default {
|
|
|
],
|
|
|
//操作项
|
|
|
opera: [
|
|
|
- { label: '详细信息', method: 'view' },
|
|
|
- { label: '上架', method: 'export', type: 'success', confirm: true, display: (i) => i.status == '0' },
|
|
|
- { label: '下架', method: 'export', type: 'success', confirm: true, display: (i) => i.status == '1' },
|
|
|
- { label: '重新上架', method: 'export', type: 'success', confirm: true, display: (i) => i.status == '2' },
|
|
|
+ { label: '详情', method: 'view' },
|
|
|
+ { label: '上架', method: 'check', type: 'success', confirm: true, display: (i) => i.status == '0' },
|
|
|
+ { label: '下架', method: 'check', type: 'success', confirm: true, display: (i) => i.status == '1' },
|
|
|
+ { label: '重新上架', method: 'check', type: 'success', confirm: true, display: (i) => i.status == '2' },
|
|
|
],
|
|
|
//表格数据
|
|
|
list: [
|
|
@@ -64,18 +64,18 @@ export default {
|
|
|
name: '喜羊羊',
|
|
|
type_name: '羊肉',
|
|
|
money: '22',
|
|
|
- status: '1',
|
|
|
+ status: '0',
|
|
|
brief: '一份',
|
|
|
img_url: [{ url: require('@a/logo.png') }, { url: require('@a/login-1.jpg') }, { url: require('@a/logo.png') }, { url: require('@a/login-1.jpg') }],
|
|
|
},
|
|
|
- { name: '喜羊羊', type_name: '羊肉', money: '22', status: '0', brief: '一份' },
|
|
|
{ name: '喜羊羊', type_name: '羊肉', money: '22', status: '1', brief: '一份' },
|
|
|
+ { name: '喜羊羊', type_name: '羊肉', money: '22', status: '2', brief: '一份' },
|
|
|
],
|
|
|
// 列表数据总数
|
|
|
total: 0,
|
|
|
//弹框
|
|
|
dialog: { title: '详细信息', show: false, type: '1' },
|
|
|
- form: { order: [], img_url: [] },
|
|
|
+ form: { img_url: [] },
|
|
|
// 状态
|
|
|
statusList: [
|
|
|
{ label: '待上架', value: '0' },
|
|
@@ -89,27 +89,27 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
//查询数据
|
|
|
- async search() {},
|
|
|
+ async search({ skip = 0, limit = 10, ...info } = {}) {},
|
|
|
//详细信息
|
|
|
async toView({ data }) {
|
|
|
this.$set(this, `form`, data);
|
|
|
this.dialog = { title: '详细信息', show: true, type: '2', widths: '40%' };
|
|
|
},
|
|
|
+ // 添加
|
|
|
+ toAdd() {
|
|
|
+ this.dialog = { title: '添加信息', show: true, type: '1', widths: '40%' };
|
|
|
+ },
|
|
|
//上架,下架,重新上架
|
|
|
- async toExport({ data }) {
|
|
|
- this.dialog = { title: '导出条件', show: true, type: '1', widths: '40%' };
|
|
|
+ async toCheck({ data }) {
|
|
|
+ console.log(data);
|
|
|
},
|
|
|
// 提交保存,创建/修改
|
|
|
async toSave({ data }) {
|
|
|
console.log(data);
|
|
|
},
|
|
|
- // 添加
|
|
|
- toAdd() {
|
|
|
- this.dialog = { title: '添加信息', show: true, type: '1', widths: '40%' };
|
|
|
- },
|
|
|
//关闭
|
|
|
toClose() {
|
|
|
- this.form = { order: [] };
|
|
|
+ this.form = { img_url: [] };
|
|
|
this.dialog = { title: '详细信息', show: false, type: '1' };
|
|
|
this.search();
|
|
|
},
|