Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-business
/
website-middleground
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit cfc5f479
authored
Jul 30, 2024
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
add
1 parent
5e660d86
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
42 deletions
src/views/investorRelated/components/AddForm.vue
src/views/investorRelated/components/AddForm.vue
View file @
cfc5f47
...
@@ -14,9 +14,9 @@ import { getImageUrl } from "@/utils/common";
...
@@ -14,9 +14,9 @@ import { getImageUrl } from "@/utils/common";
import
{
Message
}
from
"@arco-design/web-vue"
;
import
{
Message
}
from
"@arco-design/web-vue"
;
import
{
useRoute
,
useRouter
}
from
"vue-router"
;
import
{
useRoute
,
useRouter
}
from
"vue-router"
;
import
*
as
dayjs
from
"dayjs"
;
import
*
as
dayjs
from
"dayjs"
;
let
route
=
useRoute
()
let
route
=
useRoute
()
;
const
router
=
useRouter
()
const
router
=
useRouter
()
;
let
{
query
}
=
toRefs
(
route
)
let
{
query
}
=
toRefs
(
route
)
;
let
form
=
reactive
<
Partial
<
DataInfo
>>
({
let
form
=
reactive
<
Partial
<
DataInfo
>>
({
name
:
""
,
name
:
""
,
gwInvnoticeTypeId
:
""
,
gwInvnoticeTypeId
:
""
,
...
@@ -83,11 +83,11 @@ const handleSubmit = async () => {
...
@@ -83,11 +83,11 @@ const handleSubmit = async () => {
const
invnoticeProductList
=
getParams
();
const
invnoticeProductList
=
getParams
();
if
(
query
.
value
.
id
)
{
if
(
query
.
value
.
id
)
{
const
res
=
await
req
(
"gw.api.invnotice.updateInvnoticeProduct"
,
{
const
res
=
await
req
(
"gw.api.invnotice.updateInvnoticeProduct"
,
{
invnoticeProduct
:
invnoticeProductList
[
0
]
invnoticeProduct
:
invnoticeProductList
[
0
]
,
})
})
;
if
(
res
)
{
if
(
res
)
{
Message
.
success
(
"修改成功"
);
Message
.
success
(
"修改成功"
);
router
.
back
()
router
.
back
()
;
}
}
}
else
{
}
else
{
const
res
=
await
req
(
"gw.api.invnotice.addInvnoticeProduct"
,
{
const
res
=
await
req
(
"gw.api.invnotice.addInvnoticeProduct"
,
{
...
@@ -126,12 +126,12 @@ const getParams = () => {
...
@@ -126,12 +126,12 @@ const getParams = () => {
invnoticeProductTranslationsList
:
[],
// 新增公告list
invnoticeProductTranslationsList
:
[],
// 新增公告list
gwInvnoticeTypeId
,
// 公告类型
gwInvnoticeTypeId
,
// 公告类型
sendType
,
// 发布类型
sendType
,
// 发布类型
}
as
DataInfo
}
as
DataInfo
;
if
(
query
.
value
.
id
)
{
if
(
query
.
value
.
id
)
{
invnoticeTemplate
.
id
=
+
query
.
value
.
id
invnoticeTemplate
.
id
=
+
query
.
value
.
id
;
invnoticeTemplate
.
modifiedBy
=
'admin'
invnoticeTemplate
.
modifiedBy
=
"admin"
;
}
else
{
}
else
{
invnoticeTemplate
.
createdBy
=
'admin'
invnoticeTemplate
.
createdBy
=
"admin"
;
}
}
// const invnoticeProductList = new Array(len).fill(invnotice);
// const invnoticeProductList = new Array(len).fill(invnotice);
const
invnoticeProductList
=
new
Array
(
len
).
fill
(
null
).
map
(()
=>
({
const
invnoticeProductList
=
new
Array
(
len
).
fill
(
null
).
map
(()
=>
({
...
@@ -140,11 +140,12 @@ const getParams = () => {
...
@@ -140,11 +140,12 @@ const getParams = () => {
}));
}));
Object
.
keys
(
language
).
forEach
((
l
,
index
)
=>
{
Object
.
keys
(
language
).
forEach
((
l
,
index
)
=>
{
for
(
var
i
=
0
;
i
<
len
;
i
++
)
{
for
(
var
i
=
0
;
i
<
len
;
i
++
)
{
invnoticeProductList
[
i
].
invnoticeProductTranslationsList
[
index
].
title
=
form
[
`
${
l
}
_title
${
i
+
1
}
`
];
invnoticeProductList
[
i
].
invnoticeProductTranslationsList
[
index
]
=
{
invnoticeProductList
[
i
].
invnoticeProductTranslationsList
[
index
].
tags
=
form
[
`
${
l
}
_tags
${
i
+
1
}
`
];
title
:
form
[
`
${
l
}
_title
${
i
+
1
}
`
],
invnoticeProductList
[
i
].
invnoticeProductTranslationsList
[
index
].
filePath
=
form
[
`
${
l
}
_filePath
${
i
+
1
}
`
];
tags
:
form
[
`
${
l
}
_tags
${
i
+
1
}
`
],
invnoticeProductList
[
i
].
invnoticeProductTranslationsList
[
index
].
languageCode
=
language
[
l
];
filePath
:
form
[
`
${
l
}
_filePath
${
i
+
1
}
`
],
console
.
log
(
i
,
l
)
languageCode
:
language
[
l
],
};
}
}
});
});
...
@@ -179,8 +180,8 @@ const addInvnotice = () => {
...
@@ -179,8 +180,8 @@ const addInvnotice = () => {
data
.
childPass
.
push
(
false
);
data
.
childPass
.
push
(
false
);
};
};
onBeforeMount
(()
=>
{
onBeforeMount
(()
=>
{
if
(
query
.
value
.
id
)
findById
()
if
(
query
.
value
.
id
)
findById
()
;
})
})
;
/** 接口调用 */
/** 接口调用 */
/** 获取公告 */
/** 获取公告 */
const
getList
=
async
()
=>
{
const
getList
=
async
()
=>
{
...
@@ -188,39 +189,39 @@ const getList = async () => {
...
@@ -188,39 +189,39 @@ const getList = async () => {
data
.
sectionList
=
res
;
data
.
sectionList
=
res
;
};
};
const
findById
=
async
()
=>
{
const
findById
=
async
()
=>
{
const
id
=
query
.
value
.
id
const
id
=
query
.
value
.
id
;
const
res
=
await
req
(
"gw.api.invnotice.findById"
,
{
id
});
const
res
=
await
req
(
"gw.api.invnotice.findById"
,
{
id
});
console
.
log
(
res
)
console
.
log
(
res
)
;
const
languageMap
=
{
const
languageMap
=
{
'zh-TW'
:
'e'
,
"zh-TW"
:
"e"
,
'en-US'
:
'u'
,
"en-US"
:
"u"
,
'zh-CN'
:
'c'
"zh-CN"
:
"c"
,
};
};
res
.
invnoticeProductTranslationsList
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
res
.
invnoticeProductTranslationsList
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
const
langPrefix
=
languageMap
[
item
.
languageCode
];
const
langPrefix
=
languageMap
[
item
.
languageCode
];
form
[
`
${
langPrefix
}
_title1`
]
=
item
.
title
form
[
`
${
langPrefix
}
_title1`
]
=
item
.
title
;
form
[
`
${
langPrefix
}
_tags1`
]
=
item
.
tags
form
[
`
${
langPrefix
}
_tags1`
]
=
item
.
tags
;
form
[
`
${
langPrefix
}
_filePath1`
]
=
item
.
filePath
form
[
`
${
langPrefix
}
_filePath1`
]
=
item
.
filePath
;
})
})
;
// form = reactive(Object.assign({}, _form))
// form = reactive(Object.assign({}, _form))
form
.
sendType
=
res
.
sendType
.
toString
()
form
.
sendType
=
res
.
sendType
.
toString
()
;
form
.
gwInvnoticeTypeId
=
res
.
gwInvnoticeTypeId
form
.
gwInvnoticeTypeId
=
res
.
gwInvnoticeTypeId
;
form
.
externalReleaseDate
=
res
.
externalReleaseDate
form
.
externalReleaseDate
=
res
.
externalReleaseDate
;
form
.
systemPublishTime
=
res
.
systemPublishTime
form
.
systemPublishTime
=
res
.
systemPublishTime
;
const
fileList
=
[
const
fileList
=
[
{
{
url
:
res
.
oaScreenshotUrl
url
:
res
.
oaScreenshotUrl
,
}
}
,
]
]
;
form
.
oaFile
=
fileList
form
.
oaFile
=
fileList
;
// form.oaFile = 'https://wx.glsx.com.cn/upload/biz/fd433878-9963-4dce-ab5e-ecbf4aea5857.png'
// form.oaFile = 'https://wx.glsx.com.cn/upload/biz/fd433878-9963-4dce-ab5e-ecbf4aea5857.png'
console
.
log
(
form
)
console
.
log
(
form
)
;
// form = res;
// form = res;
// data.childPass = res.childPass;
// data.childPass = res.childPass;
// form = res;
// form = res;
// data.childPass = res.childPass;
// data.childPass = res.childPass;
}
}
;
// if (query.value.id) findById()
// if (query.value.id) findById()
getList
();
getList
();
/** 自定义上传 */
/** 自定义上传 */
...
@@ -235,8 +236,8 @@ const customRequest = (option: RequestOption) => {
...
@@ -235,8 +236,8 @@ const customRequest = (option: RequestOption) => {
console
.
log
(
res
);
console
.
log
(
res
);
form
.
oaFile
=
[
form
.
oaFile
=
[
{
{
url
:
res
url
:
res
,
}
}
,
];
];
data
.
isLoading
=
false
;
data
.
isLoading
=
false
;
onSuccess
(
res
);
onSuccess
(
res
);
...
@@ -274,9 +275,9 @@ const translateBase64 = (file: any, fileType: string) => {
...
@@ -274,9 +275,9 @@ const translateBase64 = (file: any, fileType: string) => {
file
?.
name
.
split
(
"."
)[
file
.
name
.
split
(
"."
).
length
-
1
]
+
file
?.
name
.
split
(
"."
)[
file
.
name
.
split
(
"."
).
length
-
1
]
+
"@"
+
"@"
+
imgFile
.
split
(
","
)[
1
];
imgFile
.
split
(
","
)[
1
];
const
res
=
await
uploadFile
(
"glsx.accounts.biz.common.pictureUpload"
,
{
const
res
=
await
uploadFile
(
"glsx.accounts.biz.common.pictureUpload"
,
{
file
:
base64
,
file
:
base64
,
});
});
// setTimeout(() => {
// setTimeout(() => {
// if (fileType == 'image') {
// if (fileType == 'image') {
// const path = 'https://scrm.test.glsx.com.cn/group1/M00/06/DD/wKgD3makkXeABsmzAAXeTH5DprU876.png'
// const path = 'https://scrm.test.glsx.com.cn/group1/M00/06/DD/wKgD3makkXeABsmzAAXeTH5DprU876.png'
...
@@ -286,7 +287,7 @@ const translateBase64 = (file: any, fileType: string) => {
...
@@ -286,7 +287,7 @@ const translateBase64 = (file: any, fileType: string) => {
// resolve(filePath)
// resolve(filePath)
// }
// }
// }, 1000);
// }, 1000);
resolve
(
res
)
resolve
(
res
)
;
};
};
reader
.
onerror
=
(
error
)
=>
reject
(
error
);
reader
.
onerror
=
(
error
)
=>
reject
(
error
);
});
});
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment