Commit 318f623d by cwq0219

商品管理

1 parent 3275500c
......@@ -11,9 +11,10 @@
:stripe="true"
@sort-change="sortChange"
@selection-change="handleSelect"
:tree-props="{children: 'updateGoodsList'}"
>
<el-table-column
v-if="tableParams.mutiSelectUniqueKey"
v-if="tableParams.mutiSelectUniqueKey && tableParams.mutiSelectName"
type="selection"
width="55"
:reserve-selection="true"
......@@ -62,7 +63,8 @@
<span v-text="item.formatter(scope.row)"></span>
</template>
<template v-else-if="getListApi">
<span v-text="data[scope.$index][item.prop]"></span>
<!-- <span>{{data[scope.$index][item.prop]}}</span> -->
<span>{{scope.row[item.prop]}}</span>
</template>
<template v-else>
<span v-text="tableData[scope.$index][item.prop]"></span>
......@@ -108,7 +110,6 @@ export default {
data() {
return {
loading: false,
oldValue: {},
data: [],
// 页码
page: {
......
......@@ -56,25 +56,32 @@
</d2-table-header>
<d2-table
ref="commodityTable"
:hasNum="false"
:searchForm="searchForm"
:tableParams="tableParams"
:getListApi="getListApi"
:beforeSearchFn="beforeSearchFn"
>
<span
<img
slot="img"
slot-scope="scope"
>
<img
class="pro-img"
:src="scope.scope.img"
/>
</span>
class="pro-img"
:src="scope.scope.img"
/>
<auth-button
v-if="Object.keys(scope.scope).includes('updateGoodsList')"
slot="auth-button"
slot-scope="scope"
:data="scope.scope"
></auth-button>
<el-button
v-else
slot="auth-button"
slot-scope="scope"
:data="scope.scope"
type="text"
@click="handleUpOrDown"
>{{scope.scope.state ? '上架' : '下架'}}</el-button>
</d2-table>
</d2-container>
</template>
......@@ -96,6 +103,7 @@ export default {
getListApi: getList,
// 表格参数
tableParams: {
mutiSelectUniqueKey: 'id',
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: true,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!