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 9c976409
authored
Jul 30, 2024
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交
1 parent
286d6686
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
91 additions
and
23 deletions
package-lock.json
package.json
src/views/investorRelated/components/AddForm.vue
package-lock.json
View file @
9c97640
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
"axios"
:
"^0.27.2"
,
"axios"
:
"^0.27.2"
,
"dayjs"
:
"^1.11.12"
,
"dayjs"
:
"^1.11.12"
,
"echarts"
:
"^5.4.0"
,
"echarts"
:
"^5.4.0"
,
"js-md5"
:
"^0.8.3"
,
"js-sha1"
:
"^0.6.0"
,
"js-sha1"
:
"^0.6.0"
,
"md5"
:
"^2.3.0"
,
"md5"
:
"^2.3.0"
,
"pinia"
:
"^2.0.17"
,
"pinia"
:
"^2.0.17"
,
...
@@ -2000,6 +2001,11 @@
...
@@ -2000,6 +2001,11 @@
"url"
:
"https://github.com/chalk/supports-color?sponsor=1"
"url"
:
"https://github.com/chalk/supports-color?sponsor=1"
}
}
},
},
"node_modules/js-md5"
:
{
"version"
:
"0.8.3"
,
"resolved"
:
"https://registry.npmmirror.com/js-md5/-/js-md5-0.8.3.tgz"
,
"integrity"
:
"sha512-qR0HB5uP6wCuRMrWPTrkMaev7MJZwJuuw4fnwAzRgP4J4/F8RwtodOKpGp4XpqsLBFzzgqIO42efFAyz2Et6KQ=="
},
"node_modules/js-sha1"
:
{
"node_modules/js-sha1"
:
{
"version"
:
"0.6.0"
,
"version"
:
"0.6.0"
,
"resolved"
:
"https://registry.npmjs.org/js-sha1/-/js-sha1-0.6.0.tgz"
,
"resolved"
:
"https://registry.npmjs.org/js-sha1/-/js-sha1-0.6.0.tgz"
,
...
@@ -4698,6 +4704,11 @@
...
@@ -4698,6 +4704,11 @@
}
}
}
}
},
},
"js-md5"
:
{
"version"
:
"0.8.3"
,
"resolved"
:
"https://registry.npmmirror.com/js-md5/-/js-md5-0.8.3.tgz"
,
"integrity"
:
"sha512-qR0HB5uP6wCuRMrWPTrkMaev7MJZwJuuw4fnwAzRgP4J4/F8RwtodOKpGp4XpqsLBFzzgqIO42efFAyz2Et6KQ=="
},
"js-sha1"
:
{
"js-sha1"
:
{
"version"
:
"0.6.0"
,
"version"
:
"0.6.0"
,
"resolved"
:
"https://registry.npmjs.org/js-sha1/-/js-sha1-0.6.0.tgz"
,
"resolved"
:
"https://registry.npmjs.org/js-sha1/-/js-sha1-0.6.0.tgz"
,
...
...
package.json
View file @
9c97640
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
"axios"
:
"^0.27.2"
,
"axios"
:
"^0.27.2"
,
"dayjs"
:
"^1.11.12"
,
"dayjs"
:
"^1.11.12"
,
"echarts"
:
"^5.4.0"
,
"echarts"
:
"^5.4.0"
,
"js-md5"
:
"^0.8.3"
,
"js-sha1"
:
"^0.6.0"
,
"js-sha1"
:
"^0.6.0"
,
"md5"
:
"^2.3.0"
,
"md5"
:
"^2.3.0"
,
"pinia"
:
"^2.0.17"
,
"pinia"
:
"^2.0.17"
,
...
...
src/views/investorRelated/components/AddForm.vue
View file @
9c97640
...
@@ -3,24 +3,28 @@
...
@@ -3,24 +3,28 @@
* @Author: huyue
* @Author: huyue
* @Date: 2024-07-26 10:46:04
* @Date: 2024-07-26 10:46:04
* @LastEditors: huyue
* @LastEditors: huyue
* @LastEditTime: 2024-07-
29 17:20
:35
* @LastEditTime: 2024-07-
30 11:18
:35
-->
-->
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
reactive
,
ref
,
nextTick
,
toRefs
,
on
Mounted
}
from
"vue"
;
import
{
reactive
,
ref
,
nextTick
,
toRefs
,
on
BeforeMount
}
from
"vue"
;
import
{
DataInfo
}
from
"../addInterface"
;
import
{
DataInfo
}
from
"../addInterface"
;
import
{
RequestOption
,
FileItem
}
from
"@arco-design/web-vue"
;
import
{
RequestOption
,
FileItem
}
from
"@arco-design/web-vue"
;
import
{
req
,
uploadReq
,
uploadFile
}
from
"../../../utils/request"
;
import
{
req
,
uploadReq
,
uploadFile
}
from
"../../../utils/request"
;
import
{
getImageUrl
}
from
"@/utils/common"
;
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
*
as
dayjs
from
"dayjs"
;
import
*
as
dayjs
from
"dayjs"
;
const
form
=
reactive
<
Partial
<
DataInfo
>>
({
let
route
=
useRoute
()
const
router
=
useRouter
()
let
{
query
}
=
toRefs
(
route
)
let
form
=
reactive
<
Partial
<
DataInfo
>>
({
name
:
""
,
name
:
""
,
gwInvnoticeTypeId
:
""
,
gwInvnoticeTypeId
:
""
,
sendType
:
"1"
,
sendType
:
"1"
,
externalReleaseDate
:
""
,
externalReleaseDate
:
""
,
systemPublishTime
:
""
,
systemPublishTime
:
""
,
invnoticeProductList
:
[],
invnoticeProductList
:
[],
oaFile
:
""
,
oaFile
:
[]
,
c_title1
:
""
,
c_title1
:
""
,
c_tags1
:
""
,
c_tags1
:
""
,
c_filePath1
:
""
,
c_filePath1
:
""
,
...
@@ -77,11 +81,21 @@ const handleSubmit = async () => {
...
@@ -77,11 +81,21 @@ const handleSubmit = async () => {
if
(
data
.
pass
&&
data
.
childPass
.
every
((
item
:
boolean
)
=>
item
))
{
if
(
data
.
pass
&&
data
.
childPass
.
every
((
item
:
boolean
)
=>
item
))
{
console
.
log
(
"提交成功"
,
form
);
console
.
log
(
"提交成功"
,
form
);
const
invnoticeProductList
=
getParams
();
const
invnoticeProductList
=
getParams
();
if
(
query
.
value
.
id
)
{
const
res
=
await
req
(
"gw.api.invnotice.updateInvnoticeProduct"
,
{
invnoticeProduct
:
invnoticeProductList
[
0
]
})
if
(
res
)
{
Message
.
success
(
"修改成功"
);
router
.
back
()
}
}
else
{
const
res
=
await
req
(
"gw.api.invnotice.addInvnoticeProduct"
,
{
const
res
=
await
req
(
"gw.api.invnotice.addInvnoticeProduct"
,
{
invnoticeProductList
,
invnoticeProductList
,
});
});
console
.
log
(
res
);
console
.
log
(
res
);
Message
.
success
(
"新增成功"
);
if
(
res
)
Message
.
success
(
"新增成功"
);
}
}
}
});
});
formRef
.
value
.
clearValidate
(
"invnoticeProductList"
);
formRef
.
value
.
clearValidate
(
"invnoticeProductList"
);
...
@@ -105,22 +119,31 @@ const getParams = () => {
...
@@ -105,22 +119,31 @@ const getParams = () => {
{
title
:
""
,
tags
:
""
,
filePath
:
""
,
languageCode
:
language
[
"u"
]
},
{
title
:
""
,
tags
:
""
,
filePath
:
""
,
languageCode
:
language
[
"u"
]
},
{
title
:
""
,
tags
:
""
,
filePath
:
""
,
languageCode
:
language
[
"e"
]
},
{
title
:
""
,
tags
:
""
,
filePath
:
""
,
languageCode
:
language
[
"e"
]
},
];
];
const
invnoticeProductList
=
new
Array
(
len
).
fill
(
{
let
invnoticeTemplate
=
{
systemPublishTime
:
sendType
==
2
?
systemPublishTime
:
""
,
// 系统发布时间
systemPublishTime
:
sendType
==
2
?
systemPublishTime
:
""
,
// 系统发布时间
oaScreenshotUrl
:
oaFile
,
// OA截图
oaScreenshotUrl
:
oaFile
[
0
].
url
,
// OA截图
externalReleaseDate
:
externalReleaseDate
,
// 外网发布时间
externalReleaseDate
:
externalReleaseDate
,
// 外网发布时间
invnoticeProductTranslationsList
:
invnoticeProductTranslationsList
,
// 新增公告list
invnoticeProductTranslationsList
:
[]
,
// 新增公告list
gwInvnoticeTypeId
:
gwInvnoticeTypeId
.
gwInvnoticeTypeId
,
// 公告类型
gwInvnoticeTypeId
,
// 公告类型
sendType
,
// 发布类型
sendType
,
// 发布类型
});
}
as
DataInfo
if
(
query
.
value
.
id
)
{
invnoticeTemplate
.
id
=
+
query
.
value
.
id
invnoticeTemplate
.
modifiedBy
=
'admin'
}
else
{
invnoticeTemplate
.
createdBy
=
'admin'
}
// const invnoticeProductList = new Array(len).fill(invnotice);
const
invnoticeProductList
=
new
Array
(
len
).
fill
(
null
).
map
(()
=>
({
...
invnoticeTemplate
,
invnoticeProductTranslationsList
:
[...
invnoticeProductTranslationsList
],
}));
Object
.
keys
(
language
).
forEach
((
l
,
index
)
=>
{
Object
.
keys
(
language
).
forEach
((
l
,
index
)
=>
{
for
(
let
i
=
0
;
i
<
len
;
i
++
)
{
for
(
var
i
=
0
;
i
<
len
;
i
++
)
{
invnoticeProductList
[
i
].
invnoticeProductTranslationsList
[
index
].
title
=
console
.
log
(
i
,
l
)
form
[
`
${
l
}
_title
${
i
+
1
}
`
];
invnoticeProductList
[
i
].
invnoticeProductTranslationsList
[
index
].
title
=
form
[
`
${
l
}
_title
${
i
+
1
}
`
];
invnoticeProductList
[
i
].
invnoticeProductTranslationsList
[
index
].
tags
=
invnoticeProductList
[
i
].
invnoticeProductTranslationsList
[
index
].
tags
=
form
[
`
${
l
}
_tags
${
i
+
1
}
`
];
form
[
`
${
l
}
_tags
${
i
+
1
}
`
];
invnoticeProductList
[
i
].
invnoticeProductTranslationsList
[
index
].
filePath
=
form
[
`
${
l
}
_filePath
${
i
+
1
}
`
];
invnoticeProductList
[
i
].
invnoticeProductTranslationsList
[
index
].
filePath
=
form
[
`
${
l
}
_filePath
${
i
+
1
}
`
];
}
}
});
});
...
@@ -154,7 +177,9 @@ const addInvnotice = () => {
...
@@ -154,7 +177,9 @@ const addInvnotice = () => {
data
.
activeKey
.
push
(
len
);
data
.
activeKey
.
push
(
len
);
data
.
childPass
.
push
(
false
);
data
.
childPass
.
push
(
false
);
};
};
onBeforeMount
(()
=>
{
if
(
query
.
value
.
id
)
findById
()
})
/** 接口调用 */
/** 接口调用 */
/** 获取公告 */
/** 获取公告 */
const
getList
=
async
()
=>
{
const
getList
=
async
()
=>
{
...
@@ -165,10 +190,37 @@ const findById = async () => {
...
@@ -165,10 +190,37 @@ 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
=
{
'zh-TW'
:
'e'
,
'en-US'
:
'u'
,
'zh-CN'
:
'c'
};
res
.
invnoticeProductTranslationsList
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
const
langPrefix
=
languageMap
[
item
.
languageCode
];
form
[
`
${
langPrefix
}
_title1`
]
=
item
.
title
form
[
`
${
langPrefix
}
_tags1`
]
=
item
.
tags
form
[
`
${
langPrefix
}
_filePath1`
]
=
item
.
filePath
})
// form = reactive(Object.assign({}, _form))
form
.
sendType
=
res
.
sendType
.
toString
()
form
.
gwInvnoticeTypeId
=
res
.
gwInvnoticeTypeId
form
.
externalReleaseDate
=
res
.
externalReleaseDate
form
.
systemPublishTime
=
res
.
systemPublishTime
const
fileList
=
[
{
url
:
res
.
oaScreenshotUrl
}
]
form
.
oaFile
=
fileList
// form.oaFile = 'https://wx.glsx.com.cn/upload/biz/fd433878-9963-4dce-ab5e-ecbf4aea5857.png'
console
.
log
(
form
)
// form = res;
// data.childPass = res.childPass;
// form = res;
// form = res;
// data.childPass = res.childPass;
// data.childPass = res.childPass;
}
}
findById
()
// if (query.value.id)
findById()
getList
();
getList
();
/** 自定义上传 */
/** 自定义上传 */
// 图片的
// 图片的
...
@@ -180,7 +232,11 @@ const customRequest = (option: RequestOption) => {
...
@@ -180,7 +232,11 @@ const customRequest = (option: RequestOption) => {
translateBase64
(
fileItem
.
file
,
"image"
)
translateBase64
(
fileItem
.
file
,
"image"
)
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
console
.
log
(
res
);
console
.
log
(
res
);
form
.
oaFile
=
res
;
form
.
oaFile
=
[
{
url
:
res
}
];
data
.
isLoading
=
false
;
data
.
isLoading
=
false
;
onSuccess
(
res
);
onSuccess
(
res
);
})
})
...
@@ -229,7 +285,7 @@ const translateBase64 = (file: any, fileType: string) => {
...
@@ -229,7 +285,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
);
});
});
...
@@ -266,7 +322,7 @@ const onBeforeRemove = (fileItem: FileItem, modelName: string) => {
...
@@ -266,7 +322,7 @@ const onBeforeRemove = (fileItem: FileItem, modelName: string) => {
>
>
<a-option
<a-option
v-for=
"i in data.sectionList"
v-for=
"i in data.sectionList"
:value=
"i"
:value=
"i
.gwInvnoticeTypeId
"
:key=
"i.gwInvnoticeTypeId"
:key=
"i.gwInvnoticeTypeId"
:label=
"i.description"
:label=
"i.description"
></a-option>
></a-option>
...
@@ -313,7 +369,7 @@ const onBeforeRemove = (fileItem: FileItem, modelName: string) => {
...
@@ -313,7 +369,7 @@ const onBeforeRemove = (fileItem: FileItem, modelName: string) => {
image-preview
image-preview
:limit=
"1"
:limit=
"1"
:custom-request=
"customRequest"
:custom-request=
"customRequest"
v-model
=
"form.oaFile"
:file-list
=
"form.oaFile"
:list-type=
"'picture-card'"
:list-type=
"'picture-card'"
></a-upload>
></a-upload>
<!-- -->
<!-- -->
...
...
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