Commit 78cc3786 by 胡悦

提交

1 parent dced7328
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2024-07-24 20:28:10
* @LastEditors: huyue
* @LastEditTime: 2024-10-17 16:09:34
* @LastEditTime: 2024-10-17 17:38:27
-->
<script lang="ts" setup>
......@@ -16,11 +16,12 @@ const route = useRoute();
let defaultSelectedKeys = ref(['']);
const menuList = ref(staticRoutes.filter(item => item.isMenu));
onBeforeMount (() => {
console.log(route.path)
console.log(route)
if (route.path == '/login') {
defaultSelectedKeys.value = ['/investorRelated']
} else {
defaultSelectedKeys.value = [route.path]
const _parentPath = staticRoutes.find(item => item.path === route.path)?.parentPath
defaultSelectedKeys.value = [_parentPath]
}
})
</script>
......
......@@ -20,12 +20,14 @@ const staticRoutes = Object.freeze([
id: '1',
name: '投资者相关',
path: '/investorRelated',
parentPath: '/investorRelated',
component: () => import('views/investorRelated/index.vue'),
isMenu: true,
icon: 'icon-user',
children: []
},
{
parentPath: '/investorRelated',
name: '新增公告',
path: '/investorRelated/addInvnotice',
component: () => import('views/investorRelated/addInvnotice.vue'),
......@@ -33,12 +35,14 @@ const staticRoutes = Object.freeze([
{
id: '2',
name: '新闻动态',
parentPath: '/news',
path: '/news',
component: () => import('views/news/index.vue'),
isMenu: true,
icon: 'icon-public'
},
{
parentPath: '/news',
name: '新增动态',
path: '/news/addNews',
component: () => import('views/news/AddNews.vue'),
......
......@@ -289,6 +289,9 @@ const findById = async () => {
};
// if (query.value.id) findById()
getList();
const back = () => {
router.go(-1)
}
/** 自定义上传 */
// 图片的
const customRequest = (option: RequestOption) => {
......@@ -695,6 +698,7 @@ const onBeforeRemove = (fileItem: FileItem, modelName: string) => {
</div>
<a-form-item>
<a-button type="primary" html-type="submit">提交</a-button>
<a-button class="back" @click="back">取消</a-button>
<!-- <a-button @click="getParams">获取参数</a-button> -->
</a-form-item>
</a-form>
......@@ -715,6 +719,10 @@ const onBeforeRemove = (fileItem: FileItem, modelName: string) => {
}
}
.back {
margin-left: 16px;
}
.add-btn {
color: #195ffe;
font-size: 14px;
......
......@@ -65,7 +65,7 @@ const handleSubmit = () => {
let api = 'gw.api.news.information.add'
if (params.id) api = 'gw.api.news.information.update'
const res = await req(api, params)
res ? Message.success('提交成功') : Message.error('提交失败')
res ? Message.success('数据保存成功') : Message.error('数据保存失败')
if (res) router.go(-1)
}
})
......@@ -75,11 +75,11 @@ const handleSubmit = () => {
const customRequest = (option: RequestOption, name: string) => {
const { onProgress, onError, onSuccess, fileItem } = option;
if (name == 'pcImg') {
const size = fileItem.file.size / 1024;
const size = fileItem.file.size / 1024 / 1024;
console.log(size)
if (size > 200) {
if (size > 1) {
form.value[name] = []
return data.value.errMeg = '文件大小不能超过200K';
return data.value.errMeg = '文件大小不能超过1M';
} else {
data.value.errMeg = '';
}
......@@ -283,7 +283,7 @@ onBeforeUnmount(() => {
正在上传
</div>
<div class="tips err-tips" v-if="data.errMeg">{{data.errMeg}}</div>
<div class="tips" v-else>图片建议尺寸368*244px,大小在200K以内</div>
<div class="tips" v-else>图片建议尺寸368*244px,大小在1M以内</div>
</div>
</a-form-item>
<a-form-item
......
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2024-07-23 16:43:07
* @LastEditors: huyue
* @LastEditTime: 2024-10-17 15:27:23
* @LastEditTime: 2024-10-17 17:47:54
-->
<script lang="ts" setup>
import { ref } from 'vue'
......@@ -43,6 +43,7 @@ const columns = [
{
title: "发布时间",
dataIndex: "publishTime",
slotName: 'publishTime',
},
{
title: "操作",
......@@ -112,6 +113,7 @@ getTableData()
</div>
<a-table class="table" :columns="columns" :data="tableData" row-key="id" :pagination="false" :bordered="false">
<template #index="{ rowIndex }"> {{ data.page.pageSize * (data.page.pageNum - 1) + rowIndex + 1 }} </template>
<template #publishTime="{ record }">{{ record.publishTime || '-' }}</template>
<template #operation="{ record }">
<a-popconfirm :content="'是否确认下架'" @ok="publishOrDown(record)">
<!-- <a-button type="text" v-if="record.systemPublishStatus === 1 || record.systemPublishStatus === 2">发布</a-button> -->
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!