管理界面完善4.

This commit is contained in:
妖姐 2024-01-24 01:02:05 +08:00
parent 6a5cfa8e68
commit 7b57e4cb68

View File

@ -28,13 +28,11 @@
</div>
<!-- 表格内容-->
<div style="width: 87vw; height: 78vh; margin: 0; padding: 0">
<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>
<Table border :loading="loadingTable" ref="selection" :columns="columns" :data="states.data" style="height: 72vh ;text-align: center;" :row-class-name="setRowClassName" >
<template #isActive="{ 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>
<span>开启</span>
</template>
@ -48,11 +46,13 @@
<Button type="primary" size="small" style="margin-right: 5px" @click="showEditDialog(index, row)">详情</Button>
<Button type="error" size="small" @click="showDeleteDialog(index, row)">删除</Button>
</template>
<template #image="{row,index}">
<img :src="row.image" alt="" style="width: 50px;height: 50px;text-align: center">
</template>
</Table>
<div style="height: 6vh ;text-align: left;padding-top: 20px">
<Page :total="30" size="small" show-elevator show-sizer />
<Page :total="10" size="small" show-elevator show-sizer />
</div>
@ -141,7 +141,7 @@
</template>
<script setup>
import {Image, Page, Radio, RadioGroup, Space, Switch} from "view-ui-plus";
import {Page, Radio, RadioGroup, Space, Switch} from "view-ui-plus";
import requests from "../../public/request.js"
import {reactive, ref} from "vue";
import message from "view-ui-plus/src/components/message/index.js";
@ -169,33 +169,36 @@ const columns = reactive( [
{
title: "图片",
slot: "image",
width: 80,
align: "center"
},
{
title: "作者",
key: "author",
width: 150,
align: "center"
},
{
title: "标题",
width: 200,
key: "title",
width: 150,
align: "center"
},
{
title: "有效时间",
key: "imageAddress",
width: 150,
title: "创建时间",
key: "createdAt",
align: "center"
},
{
title: "图片地址",
key: "imageAddress",
width: 150,
key: "image",
align: "center"
},
{
title: "描述",
key: "descriptionx",
align: "center"
}, {
title: "排序",
key: "displayOrder",
width: 80,
align: "center"
},
{
@ -272,23 +275,17 @@ onMounted(() => {
* 方法函数
*/
const stateInfo = reactive({
data: []
})
function getAll() {
requests.infoGetHeaderImage(null,token).then((res)=>{
console.log(res)
stateInfo.data = res.data.data.data
console.log(stateInfo.data)
// states.data = res.data.data
states.data = res.data.data.data
// console.log(res.data.data)
loadingTable.value = false
// for (let i = 0; i < res.data.data.length; i++) {
// states.data[i] = res.data.data[i].user
// for (let i = 0; i < res.data.data.data.length; i++) {
// states.data[i] = res.data.data.data[i].user
// }
// console.log("getAll:",states.data)
// // console.log("getAll:",states.data)
})
}