Commit 318f623d by cwq0219

商品管理

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