Commit e6f0776b by 胡悦

提交新增公告

1 parent e5f90751
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: huyue * @Author: huyue
* @Date: 2022-10-10 10:54:14 * @Date: 2022-10-10 10:54:14
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2024-07-24 17:22:14 * @LastEditTime: 2024-07-25 17:29:46
*/ */
const staticRoutes = Object.freeze([ const staticRoutes = Object.freeze([
...@@ -21,12 +21,17 @@ const staticRoutes = Object.freeze([ ...@@ -21,12 +21,17 @@ const staticRoutes = Object.freeze([
component: () => import('views/layout/index.vue'), component: () => import('views/layout/index.vue'),
children: [ children: [
{ {
name: 'investorRelated', name: '投资者相关',
path: '/layout/investorRelated', path: '/layout/investorRelated',
component: () => import('views/investorRelated/index.vue'), component: () => import('views/investorRelated/index.vue')
}, },
{ {
name: 'news', name: '新增公告',
path: '/layout/addInvnotice',
component: () => import('views/investorRelated/addInvnotice.vue'),
},
{
name: '新闻',
path: '/layout/news', path: '/layout/news',
component: () => import('views/news/index.vue'), component: () => import('views/news/index.vue'),
} }
......
export interface DataInfo {
[property: string]: any;
}
\ No newline at end of file \ No newline at end of file
<script lang="ts" setup>
import { useRouter } from "vue-router";
import { reactive, onMounted } from 'vue'
import { DataInfo } from "./addInterface";
import AddForm from "./components/AddForm.vue";
const router = useRouter();
const form = reactive<Partial<DataInfo>>({
name: ''
})
const back = () => {
router.go(-1)
}
/** 提交表单 */
const handleSubmit = () => {
console.log(form)
}
</script>
<template>
<a-breadcrumb>
<a-breadcrumb-item class="back" @click="back">投资者相关</a-breadcrumb-item>
<a-breadcrumb-item>新增公告</a-breadcrumb-item>
</a-breadcrumb>
<div class="add-box">
<a-page-header :style="{ background: 'var(--color-bg-2)' }" title="新增公告" :show-back="false"></a-page-header>
<div class="form">
<AddForm></AddForm>
</div>
</div>
</template>
<style lang="scss" scoped>
.add-box {
margin-top: 12px;
background-color: #fff;
.form {
border-top: 1px solid #E6E8EB;
padding: 24px;
}
}
</style>
<style lang="scss">
.back {
&:hover {
cursor: pointer;
color: #195FFE;
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -3,15 +3,17 @@ ...@@ -3,15 +3,17 @@
* @Author: huyue * @Author: huyue
* @Date: 2024-07-23 16:43:07 * @Date: 2024-07-23 16:43:07
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2024-07-25 17:22:06 * @LastEditTime: 2024-07-25 17:50:13
--> -->
<script lang="ts" setup> <script lang="ts" setup>
import { h, ref, reactive } from "vue"; import { h, reactive } from "vue";
import { useRouter } from "vue-router";
import { DataInfo, TableItem, BasicItem } from "./interface"; import { DataInfo, TableItem, BasicItem } from "./interface";
import { req } from "../../utils/request"; import { req } from "../../utils/request";
import { getImageUrl } from "@/utils/common" import { getImageUrl } from "@/utils/common"
const router = useRouter();
const data = reactive<Partial<DataInfo>>({ const data = reactive<Partial<DataInfo>>({
menuList: [], tabList: [],
tableData: [], tableData: [],
currentId: '0', currentId: '0',
total: 0, total: 0,
...@@ -108,6 +110,12 @@ const expandable = reactive({ ...@@ -108,6 +110,12 @@ const expandable = reactive({
return vnode(record); return vnode(record);
}, },
}); });
/** 新增公告 */
const addInvnotice = () => {
router.push({
path: "/layout/addInvnotice",
});
}
/** 切换公告,参数类型 id */ /** 切换公告,参数类型 id */
const changeMenu = (key: string | number) => { const changeMenu = (key: string | number) => {
data.currentId = key data.currentId = key
...@@ -130,7 +138,7 @@ const getList = async () => { ...@@ -130,7 +138,7 @@ const getList = async () => {
gwInvnoticeTypeId: '0', gwInvnoticeTypeId: '0',
description: "全部公告" description: "全部公告"
}) })
data.menuList = res data.tabList = res
} }
const getTableData = async () => { const getTableData = async () => {
let { currentId, page } = data let { currentId, page } = data
...@@ -152,9 +160,9 @@ getTableData() ...@@ -152,9 +160,9 @@ getTableData()
<div class="page-content"> <div class="page-content">
<a-tabs default-active-key="0" size="'large'" @tab-click="changeMenu"> <a-tabs default-active-key="0" size="'large'" @tab-click="changeMenu">
<template #extra> <template #extra>
<a-button type="primary">新增公告</a-button> <a-button type="primary" @click="addInvnotice">新增公告</a-button>
</template> </template>
<a-tab-pane v-for="item in data.menuList" :key="item.gwInvnoticeTypeId" :title="item.description"> <a-tab-pane v-for="item in data.tabList" :key="item.gwInvnoticeTypeId" :title="item.description">
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
<a-table :columns="columns" :data="data.tableData" row-key="id" :expandable="expandable" :pagination="false" :bordered="false"> <a-table :columns="columns" :data="data.tableData" row-key="id" :expandable="expandable" :pagination="false" :bordered="false">
......
export interface MenuItem { export interface TabItem {
gwInvnoticeTypeId: String; gwInvnoticeTypeId: String;
description: String; description: String;
} }
...@@ -14,7 +14,7 @@ export interface BasicItem { ...@@ -14,7 +14,7 @@ export interface BasicItem {
} }
export interface DataInfo { export interface DataInfo {
menuList: MenuItem[]; tabList: TabItem[];
tableData: TableItem[]; // 表格数据 tableData: TableItem[]; // 表格数据
currentId?: Number | String; currentId?: Number | String;
total: Number; total: Number;
...@@ -30,4 +30,4 @@ export interface TableItem { ...@@ -30,4 +30,4 @@ export interface TableItem {
invnoticeProductTranslationsList: Partial<BasicItem>[], invnoticeProductTranslationsList: Partial<BasicItem>[],
externalReleaseDate: String; externalReleaseDate: String;
zhTag: String; zhTag: String;
}
\ No newline at end of file \ No newline at end of file
}
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: huyue * @Author: huyue
* @Date: 2024-07-23 16:28:15 * @Date: 2024-07-23 16:28:15
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2024-07-24 17:50:21 * @LastEditTime: 2024-07-26 10:25:00
--> -->
<script lang="ts" setup> <script lang="ts" setup>
import {ref, reactive} from 'vue' import {ref, reactive} from 'vue'
...@@ -46,9 +46,6 @@ const handleLogin = ({values, errors}: { ...@@ -46,9 +46,6 @@ const handleLogin = ({values, errors}: {
} }
} }
}; };
// const getImageUrl = (name: any) => {
// return new URL(`../../assets/images/` + name + ".png", import.meta.url).href;
// };
</script> </script>
<template> <template>
<div class="root"> <div class="root">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!