Commit 810ee5f5 by 前端
2 parents ed633fd3 286d6686
<script lang="ts" setup>
import { useRouter } from "vue-router";
import { reactive, onMounted } from 'vue'
import { useRouter, useRoute } from "vue-router";
import { reactive, onMounted, toRefs } from 'vue'
import { DataInfo } from "./addInterface";
import AddForm from "./components/AddForm.vue";
let route = useRoute()
let { query } = toRefs(route)
const router = useRouter();
const form = reactive<Partial<DataInfo>>({
name: ''
......@@ -19,10 +21,10 @@ const handleSubmit = () => {
<template>
<a-breadcrumb>
<a-breadcrumb-item class="back" @click="back">投资者相关</a-breadcrumb-item>
<a-breadcrumb-item>新增公告</a-breadcrumb-item>
<a-breadcrumb-item>{{query.id ? '编辑' : '新增'}}公告</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>
<a-page-header :style="{ background: 'var(--color-bg-2)' }" :title="`${query.id ? '编辑' : '新增'}公告`" :show-back="false"></a-page-header>
<div class="form">
<AddForm></AddForm>
</div>
......
......@@ -3,10 +3,10 @@
* @Author: huyue
* @Date: 2024-07-26 10:46:04
* @LastEditors: huyue
* @LastEditTime: 2024-07-29 16:13:48
* @LastEditTime: 2024-07-29 17:20:35
-->
<script lang="ts" setup>
import { reactive, ref, nextTick } from "vue";
import { reactive, ref, nextTick, toRefs, onMounted } from "vue";
import { DataInfo } from "../addInterface";
import { RequestOption, FileItem } from "@arco-design/web-vue";
import { req, uploadReq, uploadFile } from "../../../utils/request";
......@@ -161,6 +161,14 @@ const getList = async () => {
const res = await req("gw.api.invnotice.findAllTypeByLanguageCode");
data.sectionList = res;
};
const findById = async () => {
const id = query.value.id
const res = await req("gw.api.invnotice.findById", { id });
console.log(res)
// form = res;
// data.childPass = res.childPass;
}
findById()
getList();
/** 自定义上传 */
// 图片的
......
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2024-07-23 16:43:07
* @LastEditors: huyue
* @LastEditTime: 2024-07-29 16:21:16
* @LastEditTime: 2024-07-29 16:57:27
-->
<!--
* @Description:
......@@ -13,7 +13,7 @@
* @LastEditTime: 2024-07-29 15:46:54
-->
<script lang="ts" setup>
import { h, reactive } from "vue";
import { h, reactive, ref } from "vue";
import { useRouter } from "vue-router";
import { DataInfo, TableItem, BasicItem } from "./interface";
import { req } from "../../utils/request";
......@@ -28,7 +28,8 @@ const data = reactive<Partial<DataInfo>>({
pageNum: 1,
pageSize: 10
},
imgVisible: false
imgVisible: false,
imgUrl: ''
})
/** table列配置 */
const columns = [
......@@ -57,7 +58,6 @@ const columns = [
const vnode = (record: Partial<TableItem>) => {
const { invnoticeProductTranslationsList, externalReleaseDate, zhTag } = record;
const _CN = invnoticeProductTranslationsList?.find((item: Partial<BasicItem>) => item.languageCode == 'zh-CN')
console.log(_CN)
const _US = invnoticeProductTranslationsList?.find((item: Partial<BasicItem>) => item.languageCode == 'en-US')
const _TW = invnoticeProductTranslationsList?.find((item: Partial<BasicItem>) => item.languageCode == 'zh-TW')
return h('div', {}, [
......@@ -147,10 +147,16 @@ const down = (record: Partial<TableItem>) => {
}
const edit = (record: Partial<TableItem>) => {
router.push({
path: "/layout/addInvnotice",
query: {
id: record?.id
}
});
}
const previewOA = () => {
const previewOA = (record: Partial<TableItem>) => {
data.imgVisible = true
data.imgUrl = record?.oaScreenshotUrl
}
// 接口定义、调用
const getList = async () => {
......@@ -191,9 +197,9 @@ getTableData()
<a-button type="text" @click="publish(record)" v-if="record.systemPublishStatus === 1 || record.systemPublishStatus === 2">发布</a-button>
<a-button type="text" @click="down(record)" v-if="record.systemPublishStatus === 3">下架</a-button>
<a-button type="text" @click="edit(record)" v-if="record.systemPublishStatus === 1 || record.systemPublishStatus === 2">编辑</a-button>
<a-button type="text" @click="previewOA">OA截图</a-button>
<a-button type="text" @click="previewOA(record)">OA截图</a-button>
<a-image-preview
:src="record.oaScreenshotUrl"
:src="data.imgUrl"
v-model:visible="data.imgVisible"
/>
</template>
......
......@@ -20,6 +20,7 @@ export interface DataInfo {
total: Number;
page: Page;
imgVisible: Boolean;
imgUrl: String;
}
export interface TableItem {
......@@ -31,4 +32,5 @@ export interface TableItem {
invnoticeProductTranslationsList: Partial<BasicItem>[],
externalReleaseDate: String;
zhTag: String;
oaScreenshotUrl: String;
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!