修复bug

This commit is contained in:
yannqing 2024-01-24 00:21:48 +08:00
parent b46c317b3c
commit 6a5cfa8e68

View File

@ -28,11 +28,13 @@
</div> </div>
<!-- 表格内容--> <!-- 表格内容-->
<div style="width: 87vw; height: 78vh; margin: 0; padding: 0"> <div style="width: 87vw; height: 78vh; margin: 0; padding: 0">
<Table border :loading="loadingTable" ref="selection" :columns="columns" :data="states.data" style="height: 72vh ;text-align: center;" :row-class-name="setRowClassName" > <Table border :loading="loadingTable" ref="selection" :columns="columns" :data="stateInfo.data" style="height: 72vh ;text-align: center;" :row-class-name="setRowClassName" >
<template #image="{ row, index }">
<Image :src="row.image" style="width: 10px; height: 10px"></Image>
</template>
<template #isActive="{ row, index }">
<template #status="{ row, index }"> <Switch size="large" v-model="row.isActive" :before-change="handleBeforeSwitchChange">
<Switch size="large" v-model="states.data[index].accountNoLocked" :before-change="handleBeforeSwitchChange">
<template #open> <template #open>
<span>开启</span> <span>开启</span>
</template> </template>
@ -50,7 +52,7 @@
</Table> </Table>
<div style="height: 6vh ;text-align: left;padding-top: 20px"> <div style="height: 6vh ;text-align: left;padding-top: 20px">
<Page :total="states.data.length" size="small" show-elevator show-sizer /> <Page :total="30" size="small" show-elevator show-sizer />
</div> </div>
@ -139,7 +141,7 @@
</template> </template>
<script setup> <script setup>
import {Page, Radio, RadioGroup, Space, Switch} from "view-ui-plus"; import {Image, Page, Radio, RadioGroup, Space, Switch} from "view-ui-plus";
import requests from "../../public/request.js" import requests from "../../public/request.js"
import {reactive, ref} from "vue"; import {reactive, ref} from "vue";
import message from "view-ui-plus/src/components/message/index.js"; import message from "view-ui-plus/src/components/message/index.js";
@ -166,7 +168,7 @@ const columns = reactive( [
}, },
{ {
title: "图片", title: "图片",
key: "image", slot: "image",
align: "center" align: "center"
}, },
{ {
@ -189,11 +191,11 @@ const columns = reactive( [
}, },
{ {
title: "描述", title: "描述",
key: "description", key: "descriptionx",
align: "center" align: "center"
}, { }, {
title: "排序", title: "排序",
key: "description", key: "displayOrder",
align: "center" align: "center"
}, },
{ {
@ -270,10 +272,16 @@ onMounted(() => {
* 方法函数 * 方法函数
*/ */
const stateInfo = reactive({
data: []
})
function getAll() { function getAll() {
requests.infoGetHeaderImage(null,token).then((res)=>{ requests.infoGetHeaderImage(null,token).then((res)=>{
console.log(res) console.log(res)
stateInfo.data = res.data.data.data
console.log(stateInfo.data)
// states.data = res.data.data // states.data = res.data.data
// console.log(res.data.data) // console.log(res.data.data)
loadingTable.value = false loadingTable.value = false