355 lines
9.9 KiB
Vue
355 lines
9.9 KiB
Vue
<!--<template>-->
|
|
<!-- <a-table-->
|
|
<!-- :row-selection="rowSelection"-->
|
|
<!-- :scroll="{ y: 400 }"-->
|
|
<!-- :columns="columns"-->
|
|
<!-- :row-key="record => record.login.uuid"-->
|
|
<!-- :data-source="states.data"-->
|
|
<!-- :pagination="pagination"-->
|
|
<!-- :loading="loading"-->
|
|
<!-- @change="handleTableChange"-->
|
|
<!-- >-->
|
|
<!-- <template #bodyCell="{ column, record }">-->
|
|
|
|
<!-- <template v-if="column.key === 'isActive'">-->
|
|
<!-- <a-tag :bordered="false" color="success" v-if="record.isActive === true">展示</a-tag>-->
|
|
<!-- <a-tag :bordered="false" color="error" v-if="record.isActive === false">未展示</a-tag>-->
|
|
<!-- </template>-->
|
|
|
|
<!-- <template v-else-if="column.key === 'action'">-->
|
|
<!-- <span style="margin-left: 10px">-->
|
|
<!-- <a-button class="button2" type="text" @click="showModal(record)" size="small"><EditOutlined />修改</a-button>-->
|
|
<!-- <a-button class="button1" type="text" @click="showDeleteConfirm" size="small"><DeleteOutlined />删除</a-button>-->
|
|
<!-- </span>-->
|
|
<!-- </template>-->
|
|
|
|
<!-- <template v-else-if="column.key === 'photo'">-->
|
|
<!-- <img :src="record.image" alt="" style="width: 50px;height: 50px;text-align: center">-->
|
|
<!-- </template>-->
|
|
<!-- </template>-->
|
|
|
|
<!-- </a-table>-->
|
|
<!--</template>-->
|
|
<!--<script setup>-->
|
|
<!--import { computed } from 'vue';-->
|
|
<!--import { usePagination } from 'vue-request';-->
|
|
<!--import axios from 'axios';-->
|
|
|
|
|
|
<!--const queryData = params => {-->
|
|
<!-- return axios.get('https://randomuser.me/api?noinfo', {-->
|
|
<!-- params,-->
|
|
<!-- });-->
|
|
<!--};-->
|
|
<!--const {-->
|
|
<!-- data: dataSource,-->
|
|
<!-- run,-->
|
|
<!-- loading,-->
|
|
<!-- current,-->
|
|
<!-- pageSize,-->
|
|
<!--} = usePagination(queryData, {-->
|
|
<!-- formatResult: res => res.data.results,-->
|
|
<!-- pagination: {-->
|
|
<!-- currentKey: 'page',-->
|
|
<!-- pageSizeKey: 'results',-->
|
|
<!-- },-->
|
|
<!--});-->
|
|
<!--const pagination = computed(() => ({-->
|
|
<!-- total: 200,-->
|
|
<!-- current: current.value,-->
|
|
<!-- pageSize: pageSize.value,-->
|
|
<!--}));-->
|
|
<!--const handleTableChange = (pag, filters, sorter) => {-->
|
|
<!-- run({-->
|
|
<!-- results: pag.pageSize,-->
|
|
<!-- page: pag?.current,-->
|
|
<!-- sortField: sorter.field,-->
|
|
<!-- sortOrder: sorter.order,-->
|
|
<!-- ...filters,-->
|
|
<!-- });-->
|
|
<!--};-->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- import {createVNode, onMounted, reactive, ref} from 'vue';-->
|
|
<!-- import {-->
|
|
<!-- DeleteOutlined,-->
|
|
<!-- EditOutlined,-->
|
|
<!-- ExclamationCircleOutlined,-->
|
|
<!-- PlusOutlined,-->
|
|
<!-- SearchOutlined-->
|
|
<!--} from '@ant-design/icons-vue';-->
|
|
<!-- import {Form, message, Modal} from 'ant-design-vue';-->
|
|
<!-- import requests from "../../public/request.js";-->
|
|
|
|
|
|
<!-- const current1 = ref(1);-->
|
|
<!-- const current2 = ref(2);-->
|
|
<!-- const onChange = pageNumber => {-->
|
|
<!-- console.log('Page: ', pageNumber);-->
|
|
<!--};-->
|
|
<!-- const open = ref(false);-->
|
|
<!-- const addopen = ref(false);-->
|
|
|
|
<!-- const showAddModal = () => {-->
|
|
<!-- addopen.value = true;-->
|
|
<!--};-->
|
|
|
|
<!-- // // 翻页-->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- const showModal = (record) => {-->
|
|
<!-- // formState.author = record.author;-->
|
|
<!-- updateId.value = record.id-->
|
|
<!-- formState.description = record.description-->
|
|
<!-- formState.photo = record.photo;-->
|
|
<!-- formState.title=record.title;-->
|
|
<!-- // formState.createdAt =record.createdAt;-->
|
|
<!-- formState.image = record.image;-->
|
|
<!-- formState.displayOrder = record.displayOrder;-->
|
|
<!-- formState.isActive = record.isActive;-->
|
|
|
|
<!-- open.value = true;-->
|
|
<!--};-->
|
|
<!-- const addOk = e => {-->
|
|
<!-- console.log(e);-->
|
|
<!-- addopen.value = false;-->
|
|
<!--};-->
|
|
<!-- const states = reactive({-->
|
|
<!-- data:[{-->
|
|
<!-- dataSource,-->
|
|
<!-- run,-->
|
|
<!-- loading,-->
|
|
<!-- current,-->
|
|
<!-- pageSize,-->
|
|
<!-- } = usePagination(queryData, {-->
|
|
<!-- formatResult: res => res.data.results,-->
|
|
<!-- pagination: {-->
|
|
<!-- currentKey: 'page',-->
|
|
<!-- pageSizeKey: 'results',-->
|
|
|
|
<!-- }})-->
|
|
<!-- ],-->
|
|
|
|
<!--})-->
|
|
|
|
<!-- //删除-->
|
|
|
|
<!-- const showDeleteConfirm = () => {-->
|
|
<!-- console.log("delete Dialog")-->
|
|
<!-- Modal.confirm({-->
|
|
<!-- title: 'Confirm',-->
|
|
<!-- icon: createVNode(ExclamationCircleOutlined),-->
|
|
<!-- content: '确认删除这条数据吗',-->
|
|
<!-- okText: '确认',-->
|
|
<!-- cancelText: '取消',-->
|
|
<!--});-->
|
|
|
|
<!--};-->
|
|
<!-- // 新增-->
|
|
|
|
<!-- const useForm = Form.useForm;-->
|
|
<!-- const value2 = ref('mysite');-->
|
|
<!-- const modelRef = reactive({-->
|
|
<!-- name: '',-->
|
|
<!-- sub: {-->
|
|
<!-- name: '',-->
|
|
<!--},-->
|
|
<!--});-->
|
|
<!-- const { validateInfos } = useForm(-->
|
|
<!-- modelRef,-->
|
|
<!-- reactive({-->
|
|
<!-- name: [-->
|
|
<!--{-->
|
|
<!-- required: true,-->
|
|
<!-- message: 'Please input name',-->
|
|
<!--},-->
|
|
<!-- ],-->
|
|
<!-- 'sub.name': [-->
|
|
<!--{-->
|
|
<!-- required: true,-->
|
|
<!-- message: 'Please input sub name',-->
|
|
<!--},-->
|
|
<!-- ],-->
|
|
<!--}),-->
|
|
<!-- );-->
|
|
<!-- const fileList = ref([]);-->
|
|
<!-- // const loading = ref(false);-->
|
|
<!-- const imageUrl = ref('');-->
|
|
|
|
|
|
<!-- function getBase64(img, callback) {-->
|
|
<!-- const reader = new FileReader();-->
|
|
<!-- reader.addEventListener('load', () => callback(reader.result));-->
|
|
<!-- reader.readAsDataURL(img);-->
|
|
<!--}-->
|
|
|
|
<!-- const handleChange = info => {-->
|
|
<!-- if (info.file.status === 'uploading') {-->
|
|
<!-- loading.value = true;-->
|
|
<!-- return;-->
|
|
<!--}-->
|
|
<!-- if (info.file.status === 'done') {-->
|
|
<!-- // Get this url from response in real world.-->
|
|
<!-- getBase64(info.file.originFileObj, base64Url => {-->
|
|
<!-- imageUrl.value = base64Url;-->
|
|
<!-- loading.value = false;-->
|
|
<!--});-->
|
|
<!--}-->
|
|
<!-- if (info.file.status === 'error') {-->
|
|
<!-- loading.value = false;-->
|
|
<!-- message.error('upload error');-->
|
|
<!--}-->
|
|
<!--};-->
|
|
<!-- const beforeUpload = file => {-->
|
|
<!-- const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';-->
|
|
<!-- if (!isJpgOrPng) {-->
|
|
<!-- message.error('You can only upload JPG file!');-->
|
|
<!--}-->
|
|
<!-- const isLt2M = file.size / 1024 / 1024 < 2;-->
|
|
<!-- if (!isLt2M) {-->
|
|
<!-- message.error('Image must smaller than 2MB!');-->
|
|
<!--}-->
|
|
<!-- return isJpgOrPng && isLt2M;-->
|
|
<!--};-->
|
|
|
|
<!-- // 状态-->
|
|
<!-- const updateId = ref(-1);-->
|
|
<!-- const formState = reactive({-->
|
|
<!-- // author:'',-->
|
|
<!-- description: '',-->
|
|
<!-- photo:'',-->
|
|
<!-- title:'',-->
|
|
<!-- // createdAt:'',-->
|
|
<!-- image:'',-->
|
|
<!-- displayOrder:'',-->
|
|
<!-- isActive: false,-->
|
|
<!--});-->
|
|
|
|
|
|
|
|
<!-- const columns = [-->
|
|
|
|
<!-- {-->
|
|
<!-- title: '作者',-->
|
|
<!-- dataIndex: 'author',-->
|
|
<!-- key: 'author',-->
|
|
<!-- resizable: true,-->
|
|
<!-- width: 100,-->
|
|
<!-- minWidth: 100,-->
|
|
<!-- maxWidth: 200,-->
|
|
<!-- },-->
|
|
<!-- {-->
|
|
<!-- title:'图片',-->
|
|
<!-- key: 'photo',-->
|
|
<!-- dataIndex: 'photo',-->
|
|
<!-- resizable: true,-->
|
|
<!-- width: 150,-->
|
|
|
|
<!-- },-->
|
|
<!-- {-->
|
|
<!-- title: '标题',-->
|
|
<!-- dataIndex: 'title',-->
|
|
<!-- key: 'title',-->
|
|
<!-- width:150,-->
|
|
<!-- },-->
|
|
<!-- {-->
|
|
<!-- title: '创建时间',-->
|
|
<!-- dataIndex: 'createdAt',-->
|
|
<!-- key: 'createdAt',-->
|
|
<!-- width:200,-->
|
|
<!-- },-->
|
|
<!-- {-->
|
|
<!-- title: '图片地址',-->
|
|
<!-- dataIndex: 'image',-->
|
|
<!-- key: 'image',-->
|
|
<!-- width:250,-->
|
|
<!-- },-->
|
|
<!-- {-->
|
|
<!-- title: '排序',-->
|
|
<!-- dataIndex: 'displayOrder',-->
|
|
<!-- key: 'displayOrder',-->
|
|
<!-- width:80,-->
|
|
<!-- },-->
|
|
<!-- {-->
|
|
<!-- title: '状态',-->
|
|
<!-- key: 'isActive',-->
|
|
<!-- dataIndex: 'isActive',-->
|
|
<!-- },-->
|
|
<!-- {-->
|
|
<!-- title: '操作',-->
|
|
<!-- key: 'action',-->
|
|
<!-- },-->
|
|
<!-- ]-->
|
|
<!-- // function handleResizeColumn(w, col) {-->
|
|
<!--// col.width = w;-->
|
|
<!--// }-->
|
|
|
|
|
|
<!-- const rowSelection = {-->
|
|
<!-- onChange: (selectedRowKeys, selectedRows) => {-->
|
|
<!-- console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);-->
|
|
<!--},-->
|
|
<!-- getCheckboxProps: record => ({-->
|
|
<!-- disabled: record.name === 'Disabled User',-->
|
|
<!-- // Column configuration not to be checked-->
|
|
<!-- name: record.name,-->
|
|
<!--}),-->
|
|
<!--};-->
|
|
|
|
|
|
<!-- const token = ref("eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMyIsImV4cCI6MTcwNjU1MzIxNn0.KW3tSyK1nbSW4V-js1gJCmo1L3CuU1eI2Y8jX7-IqXY");-->
|
|
|
|
|
|
<!--// 接口-->
|
|
<!-- onMounted(() => {-->
|
|
<!-- getAll()-->
|
|
<!--})-->
|
|
<!--// 获取所有数据-->
|
|
<!-- function getAll() {-->
|
|
|
|
<!-- requests.infoGetHeaderImage(null,token).then((res)=>{-->
|
|
<!-- console.log(res)-->
|
|
<!-- states.data = res.data.data.data-->
|
|
<!-- // // console.log(res.data.data)-->
|
|
<!-- // loadingTable.value = false-->
|
|
<!-- // 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)-->
|
|
<!--})-->
|
|
<!--}-->
|
|
|
|
<!--// const hideModal = () => {-->
|
|
<!--// };-->
|
|
<!--// 编辑-->
|
|
<!-- function hideModal(){-->
|
|
<!-- open.value = false;-->
|
|
<!-- requests.infoEditHeaderImage(updateId,formState,token.value).then((res)=>{-->
|
|
<!-- console.log("editResult:",res)-->
|
|
<!-- // console.log("updateData:",updateData)-->
|
|
<!-- // if (res.data.code === 200) {-->
|
|
<!-- // getAll()-->
|
|
<!-- // message.success('修改成功')-->
|
|
<!-- // }-->
|
|
<!-- // else {-->
|
|
<!-- // loadingTable.value = false-->
|
|
<!-- // message.error('修改失败')-->
|
|
<!-- //-->
|
|
<!-- // }-->
|
|
<!--})-->
|
|
|
|
<!--}-->
|
|
<!--</script>-->
|
|
<template>
|
|
团队信息
|
|
</template> |