|
@@ -4,7 +4,7 @@ import { onMounted, ref, reactive } from 'vue'
|
|
|
import type { BaseTableColumns } from 'tdesign-vue-next'
|
|
import type { BaseTableColumns } from 'tdesign-vue-next'
|
|
|
import type { Classify } from '@/model/classify'
|
|
import type { Classify } from '@/model/classify'
|
|
|
import ClassifyDialog from '@/pages/carousal/components/CarousalDialog.vue'
|
|
import ClassifyDialog from '@/pages/carousal/components/CarousalDialog.vue'
|
|
|
-import { createCarousal } from '@/api/carousal'
|
|
|
|
|
|
|
+import { getCarousalList } from '@/api/carousal'
|
|
|
|
|
|
|
|
const columns: BaseTableColumns = [
|
|
const columns: BaseTableColumns = [
|
|
|
{
|
|
{
|
|
@@ -19,7 +19,7 @@ const columns: BaseTableColumns = [
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title: '显示状态',
|
|
title: '显示状态',
|
|
|
- colKey: 'targetType',
|
|
|
|
|
|
|
+ colKey: 'status',
|
|
|
width: 100
|
|
width: 100
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
@@ -32,15 +32,23 @@ const loading = ref(false)
|
|
|
const data = ref([])
|
|
const data = ref([])
|
|
|
const pagination = reactive({
|
|
const pagination = reactive({
|
|
|
page: 1,
|
|
page: 1,
|
|
|
- size: 10
|
|
|
|
|
|
|
+ size: 10,
|
|
|
|
|
+ total:0
|
|
|
|
|
+})
|
|
|
|
|
+const query = reactive({
|
|
|
|
|
+ page:1,
|
|
|
|
|
+ size:10,
|
|
|
})
|
|
})
|
|
|
const classifyDialogVisible = ref(false)
|
|
const classifyDialogVisible = ref(false)
|
|
|
const isEdit = ref(false)
|
|
const isEdit = ref(false)
|
|
|
-const currentTableData = ref<Classify | {}>({})
|
|
|
|
|
-const fetchClassifyTableData = () => {
|
|
|
|
|
|
|
+const currentTableData = ref<{}>({})
|
|
|
|
|
+const fetchClassifyTableData = async () => {
|
|
|
/* TODO: 获取轮播图表格数据 */
|
|
/* TODO: 获取轮播图表格数据 */
|
|
|
- const createCarousalApi = createCarousal(pagination)
|
|
|
|
|
- console.log(createCarousalApi,'api')
|
|
|
|
|
|
|
+ query.page = pagination.page
|
|
|
|
|
+ query.size = pagination.size
|
|
|
|
|
+ const getCarousalListApi = await getCarousalList(query)
|
|
|
|
|
+ currentTableData.value = getCarousalListApi.data
|
|
|
|
|
+ pagination.total = getCarousalListApi.pagination.total
|
|
|
}
|
|
}
|
|
|
onMounted(fetchClassifyTableData)
|
|
onMounted(fetchClassifyTableData)
|
|
|
const editClick = (classify: Classify) => {
|
|
const editClick = (classify: Classify) => {
|