Merge branch 'dev' into test
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -1,6 +1,25 @@
|
|||||||
<template>
|
<template>
|
||||||
<CommonPage show-footer :title="$route.title">
|
<CommonPage show-footer :title="$route.title">
|
||||||
<n-button type="primary" @click="addGood(1)">添加商品</n-button>
|
<n-grid class="mb-10" x-gap="12">
|
||||||
|
<n-gi span="12" mt-10 flex items-center>
|
||||||
|
<span w-100>筛选条件:</span>
|
||||||
|
<n-input-group>
|
||||||
|
<n-select
|
||||||
|
v-model:value="queryParams.selectKey"
|
||||||
|
:style="{ width: '20%' }"
|
||||||
|
:options="selectOptions"
|
||||||
|
placeholder="请选择"
|
||||||
|
/>
|
||||||
|
<n-input v-model:value="queryParams.word" :style="{ width: '30%' }" />
|
||||||
|
</n-input-group>
|
||||||
|
</n-gi>
|
||||||
|
<n-gi span="24" mt-10 flex items-center>
|
||||||
|
<n-button type="primary" @click="getList">查询</n-button>
|
||||||
|
<n-button ml-10 @click="clear">重置</n-button>
|
||||||
|
<n-button ml-10 type="primary" @click="addGood(1)">添加商品</n-button>
|
||||||
|
</n-gi>
|
||||||
|
</n-grid>
|
||||||
|
|
||||||
<n-data-table
|
<n-data-table
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
@@ -21,6 +40,18 @@ import { useGoodsStore } from '@/store/modules/goods'
|
|||||||
|
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
|
|
||||||
|
const selectOptions = ref([
|
||||||
|
{
|
||||||
|
label: '商品名称',
|
||||||
|
value: 0,
|
||||||
|
},
|
||||||
|
])
|
||||||
|
|
||||||
|
const queryParams = ref({
|
||||||
|
selectKey: 0,
|
||||||
|
word: '',
|
||||||
|
})
|
||||||
|
|
||||||
const columns = ref([
|
const columns = ref([
|
||||||
{
|
{
|
||||||
title: 'ID',
|
title: 'ID',
|
||||||
@@ -160,6 +191,7 @@ const getList = async () => {
|
|||||||
const res = await api.getGoods({
|
const res = await api.getGoods({
|
||||||
pageNum: pagination.value.page,
|
pageNum: pagination.value.page,
|
||||||
pageSize: pagination.value.pageSize,
|
pageSize: pagination.value.pageSize,
|
||||||
|
name: queryParams.value.word,
|
||||||
})
|
})
|
||||||
data.value = res.data.data || []
|
data.value = res.data.data || []
|
||||||
pagination.value.itemCount = res.data.total
|
pagination.value.itemCount = res.data.total
|
||||||
@@ -182,6 +214,11 @@ const toEdit = (item) => {
|
|||||||
setRow(item)
|
setRow(item)
|
||||||
addGood()
|
addGood()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const clear = () => {
|
||||||
|
queryParams.value.word = ''
|
||||||
|
getList()
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
<style lang="scss" scoped></style>
|
||||||
|
|||||||
Reference in New Issue
Block a user