|
|
@ -30,13 +30,21 @@ |
|
|
|
<a-radio-button value="2">已下架</a-radio-button> |
|
|
|
<a-radio-button value="2">已下架</a-radio-button> |
|
|
|
</a-radio-group> |
|
|
|
</a-radio-group> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<a-button v-if="$auth('/goods/create')" class="fl-l" type="primary" icon="plus" @click="handleCreate()" |
|
|
|
<a-button |
|
|
|
|
|
|
|
v-if="$auth('/goods/create')" |
|
|
|
|
|
|
|
class="fl-l" |
|
|
|
|
|
|
|
type="primary" |
|
|
|
|
|
|
|
icon="plus" |
|
|
|
|
|
|
|
@click="handleCreate()" |
|
|
|
>新增服务</a-button |
|
|
|
>新增服务</a-button |
|
|
|
> |
|
|
|
> |
|
|
|
<div v-if="selectedRowKeys.length" class="button-group"> |
|
|
|
<div v-if="selectedRowKeys.length" class="button-group"> |
|
|
|
<a-button-group class="ml-10"> |
|
|
|
<a-button-group class="ml-10"> |
|
|
|
<a-button v-action:status icon="arrow-up" @click="handleUpdateStatus(selectedRowKeys, true)">上架</a-button> |
|
|
|
<a-button v-action:status icon="arrow-up" @click="handleUpdateStatus(selectedRowKeys, true)">上架</a-button> |
|
|
|
<a-button v-action:status icon="arrow-down" @click="handleUpdateStatus(selectedRowKeys, false)" |
|
|
|
<a-button |
|
|
|
|
|
|
|
v-action:status |
|
|
|
|
|
|
|
icon="arrow-down" |
|
|
|
|
|
|
|
@click="handleUpdateStatus(selectedRowKeys, false)" |
|
|
|
>下架</a-button |
|
|
|
>下架</a-button |
|
|
|
> |
|
|
|
> |
|
|
|
<a-button v-action:delete icon="delete" @click="handleDelete(selectedRowKeys)">删除</a-button> |
|
|
|
<a-button v-action:delete icon="delete" @click="handleDelete(selectedRowKeys)">删除</a-button> |
|
|
@ -77,7 +85,7 @@ |
|
|
|
> |
|
|
|
> |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
<!-- 操作项 --> |
|
|
|
<!-- 操作项 --> |
|
|
|
<span class="actions" slot="action" slot-scope="item"> |
|
|
|
<span class="actions" slot="action" slot-scope="text, item"> |
|
|
|
<a style="margin-right: 8px" @click="handleEdit(item)">编辑</a> |
|
|
|
<a style="margin-right: 8px" @click="handleEdit(item)">编辑</a> |
|
|
|
<a @click="handleDelete([item.server_id])">删除</a> |
|
|
|
<a @click="handleDelete([item.server_id])">删除</a> |
|
|
|
</span> |
|
|
|
</span> |
|
|
@ -96,53 +104,53 @@ import Edit from './modules/Edit' |
|
|
|
const columns = [ |
|
|
|
const columns = [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: '服务ID', |
|
|
|
title: '服务ID', |
|
|
|
dataIndex: 'server_id', |
|
|
|
dataIndex: 'server_id' |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: '服务图片', |
|
|
|
title: '服务图片', |
|
|
|
dataIndex: 'server_image', |
|
|
|
dataIndex: 'server_image', |
|
|
|
scopedSlots: { customRender: 'server_image' }, |
|
|
|
scopedSlots: { customRender: 'server_image' } |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: '服务名称', |
|
|
|
title: '服务名称', |
|
|
|
dataIndex: 'server_name', |
|
|
|
dataIndex: 'server_name', |
|
|
|
scopedSlots: { customRender: 'server_name' }, |
|
|
|
scopedSlots: { customRender: 'server_name' } |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: '服务分类', |
|
|
|
title: '服务分类', |
|
|
|
dataIndex: 'server_category', |
|
|
|
dataIndex: 'server_category', |
|
|
|
scopedSlots: { customRender: 'server_category' }, |
|
|
|
scopedSlots: { customRender: 'server_category' } |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: '服务价格', |
|
|
|
title: '服务价格', |
|
|
|
dataIndex: 'server_price', |
|
|
|
dataIndex: 'server_price', |
|
|
|
scopedSlots: { customRender: 'server_price' }, |
|
|
|
scopedSlots: { customRender: 'server_price' } |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: '划线价格', |
|
|
|
title: '划线价格', |
|
|
|
dataIndex: 'line_price', |
|
|
|
dataIndex: 'line_price', |
|
|
|
scopedSlots: { customRender: 'line_price' }, |
|
|
|
scopedSlots: { customRender: 'line_price' } |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: '状态', |
|
|
|
title: '状态', |
|
|
|
dataIndex: 'status', |
|
|
|
dataIndex: 'status', |
|
|
|
scopedSlots: { customRender: 'status' }, |
|
|
|
scopedSlots: { customRender: 'status' } |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: '排序', |
|
|
|
title: '排序', |
|
|
|
dataIndex: 'sort', |
|
|
|
dataIndex: 'sort' |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: '添加时间', |
|
|
|
title: '添加时间', |
|
|
|
width: '180px', |
|
|
|
width: '180px', |
|
|
|
dataIndex: 'create_time', |
|
|
|
dataIndex: 'create_time' |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: '操作', |
|
|
|
title: '操作', |
|
|
|
dataIndex: 'action', |
|
|
|
dataIndex: 'action', |
|
|
|
width: '150px', |
|
|
|
width: '150px', |
|
|
|
scopedSlots: { customRender: 'action' }, |
|
|
|
scopedSlots: { customRender: 'action' } |
|
|
|
}, |
|
|
|
} |
|
|
|
] |
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
export default { |
|
|
@ -151,7 +159,7 @@ export default { |
|
|
|
ContentHeader, |
|
|
|
ContentHeader, |
|
|
|
STable, |
|
|
|
STable, |
|
|
|
Add, |
|
|
|
Add, |
|
|
|
Edit, |
|
|
|
Edit |
|
|
|
}, |
|
|
|
}, |
|
|
|
data () { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
return { |
|
|
@ -177,7 +185,7 @@ export default { |
|
|
|
return Api.serverList({ ...param, ...this.queryParam }).then((response) => { |
|
|
|
return Api.serverList({ ...param, ...this.queryParam }).then((response) => { |
|
|
|
return response.data.list |
|
|
|
return response.data.list |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
created () { |
|
|
|
created () { |
|
|
@ -192,9 +200,9 @@ export default { |
|
|
|
rowSelection () { |
|
|
|
rowSelection () { |
|
|
|
return { |
|
|
|
return { |
|
|
|
selectedRowKeys: this.selectedRowKeys, |
|
|
|
selectedRowKeys: this.selectedRowKeys, |
|
|
|
onChange: this.onSelectChange, |
|
|
|
onChange: this.onSelectChange |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
// 选中项发生变化时的回调 |
|
|
|
// 选中项发生变化时的回调 |
|
|
@ -255,7 +263,7 @@ export default { |
|
|
|
app.handleRefresh() |
|
|
|
app.handleRefresh() |
|
|
|
}) |
|
|
|
}) |
|
|
|
.finally((result) => modal.destroy()) |
|
|
|
.finally((result) => modal.destroy()) |
|
|
|
}, |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -275,8 +283,8 @@ export default { |
|
|
|
handleRefresh (bool = false) { |
|
|
|
handleRefresh (bool = false) { |
|
|
|
this.selectedRowKeys = [] |
|
|
|
this.selectedRowKeys = [] |
|
|
|
this.$refs.table.refresh(bool) |
|
|
|
this.$refs.table.refresh(bool) |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
<style lang="less" scoped> |
|
|
|
<style lang="less" scoped> |
|
|
|