Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
poc-fe
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
poc
poc-fe
Commits
4e94e0c3
Commit
4e94e0c3
authored
Nov 12, 2024
by
shirlyn.guo
👌🏻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 应用创建模块应用上架,下架,应用发布应用市场配置
parent
87b65028
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
375 additions
and
223 deletions
+375
-223
agent-application.ts
src/apis/agent-application.ts
+8
-0
en.yaml
src/locales/langs/en.yaml
+6
-0
zh-cn.yaml
src/locales/langs/zh-cn.yaml
+6
-0
zh-hk.yaml
src/locales/langs/zh-hk.yaml
+6
-0
personal-app-config.ts
src/store/modules/personal-app-config.ts
+3
-0
personal-app-config.ts
src/store/types/personal-app-config.ts
+2
-0
columns.ts
src/views/personal-space/personal-app-setting/columns.ts
+0
-196
app-publish.vue
...nal-space/personal-app-setting/components/app-publish.vue
+300
-16
sale-applications-configuration-modal.vue
...ce/personal-app/sale-applications-configuration-modal.vue
+38
-11
locales.d.ts
types/locales.d.ts
+6
-0
No files found.
src/apis/agent-application.ts
View file @
4e94e0c3
...
...
@@ -162,3 +162,11 @@ export function fetchSalePublishApplication<T>(payload: object) {
export
function
fetchRemoveSalePublishApplication
<
T
>
(
agentPublishId
:
number
)
{
return
request
.
post
<
T
>
(
`/bizAgentApplicationMallRest/unSaleAgentInMall.json?agentPublishId=
${
agentPublishId
}
`
)
}
/**
* * @param agentPublishId 发布应用表的id
* @returns 已上架应用信息
*/
export
function
fetchGetApplicationMallInfo
<
T
>
(
agentId
:
string
)
{
return
request
.
post
<
T
>
(
`/bizAgentApplicationMallRest/getMallInfoByAgentId.json?agentId=
${
agentId
}
`
)
}
src/locales/langs/en.yaml
View file @
4e94e0c3
...
...
@@ -315,6 +315,12 @@ personal_space_module:
access_page
:
'
Immediate
access'
share_link
:
'
Share
link'
copy_share_url_success_message
:
'
Link
copy
success,
quick
to
share
with
your
friends!'
application_square_desc
:
'
The
application
will
be
displayed
in
the
application
square,
and
all
users
will
be
able
to
access
and
use
the
application
you
have
created.'
modify_setting_btn
:
'
Modify
Settings'
not_configured_btn
:
'
Not
configured'
removal_prompt_title
:
'
Are
you
sure
you
want
to
remove
the
app
from
the
app
plaza'
removal_prompt_content
:
'
After
removal,
platform
users
will
not
be
able
to
experience
this
application
through
the
app
plaza.
If
you
need
to
relist
it,
please
reconfigure
it'
successfully_configured_published
:
'
Configuration
successful,
published
to
App
Store'
agent_sale_module
:
application_square_release_setting
:
'
The
application
plaza
publishes
the
configuration'
...
...
src/locales/langs/zh-cn.yaml
View file @
4e94e0c3
...
...
@@ -313,6 +313,12 @@ personal_space_module:
access_page
:
'
立即访问'
share_link
:
'
分享链接'
copy_share_url_success_message
:
'
链接复制成功,快分享给你的好友吧!'
application_square_desc
:
'
应用将在应用广场展示,所有用户将可以访问和使用你创建的应用'
modify_setting_btn
:
'
修改设置'
not_configured_btn
:
'
未配置'
removal_prompt_title
:
'
确定要下架在应用广场的应用?'
removal_prompt_content
:
'
下架后,平台用户将无法通过应用广场体验本应用,如需再次上架请重新配置。'
successfully_configured_published
:
'
配置成功,已发布至应用广场'
agent_sale_module
:
application_square_release_setting
:
'
应用广场发布配置'
...
...
src/locales/langs/zh-hk.yaml
View file @
4e94e0c3
...
...
@@ -313,6 +313,12 @@ personal_space_module:
access_page
:
'
立即訪問'
share_link
:
'
分享鏈接'
copy_share_url_success_message
:
'
鏈接複製成功,快分享給你的好友吧!'
application_square_desc
:
'
應用將在應用廣場展示,所有用戶將可以訪問和使用你創建的應用'
modify_setting_btn
:
'
修改設置'
not_configured_btn
:
'
未配置'
removal_prompt_title
:
'
確定要下架在應用廣場的應用?'
removal_prompt_content
:
'
下架後,平臺用戶將無法通過應用廣場體驗本應用,如需再次上架請重新配置。'
successfully_configured_published
:
'
配置成功,已發布至應用廣場'
agent_sale_module
:
application_square_release_setting
:
'
應用廣場發佈配寘'
...
...
src/store/modules/personal-app-config.ts
View file @
4e94e0c3
...
...
@@ -10,6 +10,8 @@ export function defaultPersonalAppConfigState(): PersonalAppConfigState {
agentDesc
:
''
,
agentSystem
:
''
,
agentPublishStatus
:
'draft'
,
memberId
:
0
,
publishTime
:
''
,
},
commConfig
:
{
preamble
:
''
,
...
...
@@ -30,6 +32,7 @@ export function defaultPersonalAppConfigState(): PersonalAppConfigState {
temperature
:
0.5
,
},
modifiedTime
:
new
Date
(),
createdTime
:
''
,
isCollect
:
''
,
isSale
:
''
,
agentPublishId
:
1
,
...
...
src/store/types/personal-app-config.ts
View file @
4e94e0c3
...
...
@@ -13,6 +13,7 @@ export interface PersonalAppConfigState {
agentSystem
:
string
//角色指令
agentPublishStatus
:
'draft'
|
'publish'
//发布状态 draft-草稿 publish-发布
memberId
:
number
publishTime
:
string
}
clickNumber
?:
number
collectNumber
?:
number
...
...
@@ -36,6 +37,7 @@ export interface PersonalAppConfigState {
}
popularity
?:
number
modifiedTime
:
Date
createdTime
:
string
id
?:
number
isCollect
:
string
isSale
:
string
...
...
src/views/personal-space/personal-app-setting/columns.ts
deleted
100644 → 0
View file @
87b65028
import
{
h
}
from
'vue'
import
CustomIcon
from
'@/components/custom-icon/custom-icon.vue'
import
{
formatDateTime
}
from
'@/utils/date-formatter'
import
i18n
from
'@/locales'
const
t
=
i18n
.
global
.
t
export
function
createChannelPublishColumn
(
handleChannelPublishTableAction
:
(
actionType
:
string
)
=>
void
)
{
return
[
{
title
:
()
=>
h
(
'span'
,
{},
t
(
'personal_space_module.agent_module.agent_setting_module.agent_publish_module.channel'
)),
key
:
'channel'
,
align
:
'left'
,
width
:
540
,
render
()
{
return
h
(
'div'
,
{
style
:
{
display
:
'flex'
,
justifyContent
:
'flex-start'
,
alignItems
:
'center'
,
},
},
{
default
:
()
=>
[
h
(
CustomIcon
,
{
width
:
'24px'
,
icon
:
'icon-park-solid:computer'
,
color
:
'#000DFF'
,
}),
h
(
'div'
,
{
style
:
{
display
:
'flex'
,
flexDirection
:
'column'
,
justifyContent
:
'center'
,
alignItems
:
'flex-start'
,
fontSize
:
'14px'
,
marginLeft
:
'12px'
,
},
},
{
default
:
()
=>
[
h
(
'span'
,
{},
t
(
'personal_space_module.agent_module.agent_setting_module.agent_publish_module.web_channel_name'
,
),
),
h
(
'span'
,
{
style
:
{
color
:
'#84868c'
,
},
},
t
(
'personal_space_module.agent_module.agent_setting_module.agent_publish_module.web_channel_desc'
,
),
),
],
},
),
],
},
)
},
},
{
title
:
()
=>
h
(
'span'
,
{},
t
(
'common_module.status'
)),
key
:
'agentPublishStatus'
,
align
:
'left'
,
width
:
220
,
render
()
{
return
h
(
'div'
,
{
style
:
{
display
:
'flex'
,
flexDirection
:
'column'
,
justifyContent
:
'center'
,
alignItems
:
'flex-start'
,
},
},
{
default
:
()
=>
[
h
(
'div'
,
{
style
:
{
background
:
'#34a853'
,
borderRadius
:
'4px'
,
padding
:
'2px 14px'
,
color
:
'#fff'
,
marginBottom
:
'4px'
,
},
},
t
(
'common_module.published'
),
),
h
(
'span'
,
{
style
:
{
color
:
'#84868c'
,
},
},
{
default
:
()
=>
formatDateTime
(
new
Date
())
+
t
(
'common_module.publish'
),
},
),
],
},
)
},
},
{
title
:
()
=>
h
(
'span'
,
{},
t
(
'common_module.data_table_module.action'
)),
key
:
'action'
,
align
:
'left'
,
width
:
'460'
,
render
()
{
return
h
(
'div'
,
{
style
:
{
display
:
'flex'
,
justifyContent
:
'flex-start'
,
alignItems
:
'center'
,
},
},
{
default
:
()
=>
[
h
(
'div'
,
{
style
:
{
display
:
'flex'
,
justifyContent
:
'flex-start'
,
alignItems
:
'center'
,
fontSize
:
'14px'
,
padding
:
'4px 12px'
,
background
:
'#f7f7f9'
,
borderColor
:
'#000DFF'
,
color
:
'#000DFF'
,
},
className
:
'cursor-pointer rounded-md border hover:opacity-80'
,
onClick
:
()
=>
handleChannelPublishTableAction
(
'accessPage'
),
},
{
default
:
()
=>
[
h
(
CustomIcon
,
{
icon
:
'lets-icons:view'
,
style
:
{
marginRight
:
'6px'
,
fontSize
:
'16px'
}
}),
h
(
'span'
,
{},
t
(
'personal_space_module.agent_module.agent_setting_module.agent_publish_module.access_page'
),
),
],
},
),
h
(
'div'
,
{
style
:
{
display
:
'flex'
,
justifyContent
:
'flex-start'
,
alignItems
:
'center'
,
fontSize
:
'14px'
,
marginLeft
:
'16px'
,
padding
:
'4px 12px'
,
background
:
'#f7f7f9'
,
},
className
:
'cursor-pointer hover:text-theme-color rounded-md border hover:border-theme-color'
,
onClick
:
()
=>
handleChannelPublishTableAction
(
'copyLink'
),
},
{
default
:
()
=>
[
h
(
CustomIcon
,
{
icon
:
'pepicons-pop:share-android-circle'
,
style
:
{
marginRight
:
'6px'
}
}),
h
(
'span'
,
{},
t
(
'personal_space_module.agent_module.agent_setting_module.agent_publish_module.share_link'
),
),
],
},
),
],
},
)
},
},
]
}
src/views/personal-space/personal-app-setting/components/app-publish.vue
View file @
4e94e0c3
<
script
lang=
"ts"
setup
>
import
{
reactive
}
from
'vue'
import
{
useRouter
}
from
'vue-router'
import
{
useI18n
}
from
'vue-i18n'
import
{
createChannelPublishColumn
}
from
'../columns'
import
{
Computer
,
PreviewOpen
,
AllApplication
,
SettingOne
}
from
'@icon-park/vue-next'
import
useTableScrollY
from
'@/composables/useTableScrollY'
import
{
copyToClip
}
from
'@/utils/copy'
import
{
formatDateTime
}
from
'@/utils/date-formatter'
import
{
ref
,
watch
}
from
'vue'
import
{
PersonalAppConfigState
}
from
'@/store/types/personal-app-config'
import
SaleApplicationsConfigurationModal
from
'../../personal-app/sale-applications-configuration-modal.vue'
import
{
fetchGetApplicationInfo
,
fetchGetApplicationMallInfo
,
fetchRemoveSalePublishApplication
,
}
from
'@/apis/agent-application'
import
{
defaultPersonalAppConfigState
,
usePersonalAppConfigStore
}
from
'@/store/modules/personal-app-config'
interface
ApplicationMallInfo
{
agentId
:
string
agentPublishId
:
number
categoryId
:
number
isCopy
:
string
isSale
:
string
launchTime
:
string
}
const
{
t
}
=
useI18n
()
const
{
pageContentWrapRef
,
tableContentY
}
=
useTableScrollY
()
const
router
=
useRouter
()
const
channelPublishList
=
reactive
([
{
type
:
'web'
,
const
isShowSaleApplicationsConfigurationModal
=
ref
(
false
)
const
saleApplicationsInfo
=
ref
<
PersonalAppConfigState
>
(
defaultPersonalAppConfigState
())
const
personalAppConfigStore
=
usePersonalAppConfigStore
()
const
applicationMallInfo
=
ref
<
ApplicationMallInfo
>
({
agentId
:
''
,
agentPublishId
:
1
,
categoryId
:
1
,
isCopy
:
''
,
isSale
:
''
,
launchTime
:
''
,
})
watch
(
()
=>
saleApplicationsInfo
.
value
,
(
newValue
)
=>
{
saleApplicationsInfo
.
value
=
newValue
},
]
)
)
const
columns
=
createChannelPublishColumn
(
handleClickChannelPublishTableAction
)
watch
(
()
=>
personalAppConfigStore
.
baseInfo
,
(
newValue
)
=>
{
personalAppConfigStore
.
baseInfo
=
newValue
if
(
personalAppConfigStore
.
baseInfo
.
agentId
!==
''
)
{
handleGetApplicationMallInfo
()
handleGetApplicationInfo
()
}
},
)
;(
function
()
{
if
(
personalAppConfigStore
.
baseInfo
.
agentId
!==
''
)
{
handleGetApplicationMallInfo
()
handleGetApplicationInfo
()
}
})()
function
handleClickChannelPublishTableAction
(
actionType
:
string
)
{
switch
(
actionType
)
{
...
...
@@ -28,6 +77,15 @@ function handleClickChannelPublishTableAction(actionType: string) {
case
'copyLink'
:
handleCopyShareLink
()
break
case
'configuration'
:
handleConfigurationApplication
(
saleApplicationsInfo
.
value
)
break
case
'modifySetting'
:
handleConfigurationApplication
(
saleApplicationsInfo
.
value
,
true
)
break
case
'unSaleApplication'
:
handleUnSaleApplication
()
break
}
}
...
...
@@ -43,18 +101,244 @@ function handleCopyShareLink() {
t
(
'personal_space_module.agent_module.agent_setting_module.agent_publish_module.copy_share_url_success_message'
),
)
}
function
handleConfigurationApplication
(
saleApplications
:
PersonalAppConfigState
,
isSale
=
false
)
{
if
(
isSale
)
{
saleApplicationsInfo
.
value
.
isCopy
=
applicationMallInfo
.
value
.
isCopy
saleApplicationsInfo
.
value
.
isSale
=
'Y'
saleApplicationsInfo
.
value
.
agentPublishId
=
saleApplications
.
agentPublishId
handleGetApplicationMallInfo
()
}
else
{
saleApplicationsInfo
.
value
.
isCopy
=
'N'
saleApplicationsInfo
.
value
.
isSale
=
'N'
saleApplicationsInfo
.
value
.
agentPublishId
=
saleApplications
.
agentPublishId
}
isShowSaleApplicationsConfigurationModal
.
value
=
true
}
function
handleUnSaleApplication
()
{
window
.
$message
.
ctWarning
(
t
(
'personal_space_module.agent_module.agent_setting_module.agent_publish_module.removal_prompt_content'
),
t
(
'personal_space_module.agent_module.agent_setting_module.agent_publish_module.removal_prompt_title'
),
)
.
then
(()
=>
{
fetchRemoveSalePublishApplication
(
applicationMallInfo
.
value
.
agentPublishId
)
.
then
(()
=>
{
applicationMallInfo
.
value
.
isSale
=
'N'
window
.
$message
.
success
(
t
(
'common_module.removal_successfully'
))
})
.
catch
(()
=>
{
window
.
$message
.
error
(
t
(
'common_module.removal_failed'
))
})
})
}
function
handleGetApplicationMallInfo
()
{
fetchGetApplicationMallInfo
(
personalAppConfigStore
.
baseInfo
.
agentId
).
then
((
res
)
=>
{
applicationMallInfo
.
value
=
res
.
data
as
ApplicationMallInfo
saleApplicationsInfo
.
value
.
agentPublishId
=
applicationMallInfo
.
value
.
agentPublishId
saleApplicationsInfo
.
value
.
isCopy
=
applicationMallInfo
.
value
.
isCopy
})
}
function
handleGetApplicationInfo
()
{
fetchGetApplicationInfo
(
personalAppConfigStore
.
baseInfo
.
agentId
).
then
((
res
)
=>
{
saleApplicationsInfo
.
value
=
res
.
data
as
PersonalAppConfigState
})
}
function
handleToApplicationSquare
()
{
router
.
push
({
name
:
'ApplicationsSquare'
})
}
</
script
>
<
template
>
<div
ref=
"pageContentWrapRef"
class=
"h-full overflow-hidden p-5"
>
<NDataTable
:bordered=
"true"
:bottom-bordered=
"true"
:single-line=
"false"
:data=
"channelPublishList"
:columns=
"columns"
:max-height=
"tableContentY"
:scroll-x=
"1220"
<div
ref=
"pageContentWrapRef"
class=
"h-full w-full overflow-hidden p-5"
>
<table
class=
"w-full text-left"
:max-height=
"tableContentY"
>
<thead>
<tr>
<th
class=
"w-[45%] border-[1px] border-[#efeff5] bg-[#f7f7fa] p-[12px] text-[14px] font-medium"
>
<span>
{{
t
(
'personal_space_module.agent_module.agent_setting_module.agent_publish_module.channel'
)
}}
</span>
</th>
<th
class=
"w-[17%] border-[1px] border-[#efeff5] bg-[#f7f7fa] p-[12px] text-[14px] font-medium"
>
<span>
{{
t
(
'common_module.status'
)
}}
</span>
</th>
<th
class=
"w-[38%] rounded-tr-[5px] border-[1px] border-[#efeff5] bg-[#f7f7fa] p-[12px] text-[14px] font-medium"
>
<span>
{{
t
(
'common_module.data_table_module.action'
)
}}
</span>
</th>
</tr>
</thead>
<tbody>
<tr>
<td
class=
"border-[1px] border-[#efeff5]"
>
<div
class=
"flex items-center justify-start p-[12px]"
>
<Computer
theme=
"multi-color"
size=
"24"
:fill=
"['#000dff', '#000dff', '#FFF', '#43CCF8']"
:stroke-width=
"3"
/>
<div
class=
"ml-[12px]"
>
<div>
{{
t
(
'personal_space_module.agent_module.agent_setting_module.agent_publish_module.web_channel_name'
)
}}
</div>
<div
class=
"text-[#84868c]"
>
{{
t
(
'personal_space_module.agent_module.agent_setting_module.agent_publish_module.web_channel_desc'
)
}}
</div>
</div>
</div>
</td>
<td
class=
"border-[1px] border-[#efeff5] p-[12px]"
>
<div
class=
"flex flex-col items-start justify-center"
>
<div
class=
"mb-[4px] rounded-[4px] bg-[#34a853] px-[14px] py-[3px] text-[#fff]"
>
{{
t
(
'common_module.published'
)
}}
</div>
<div
class=
"text-[#84868c]"
>
{{
formatDateTime
(
saleApplicationsInfo
.
baseInfo
.
publishTime
)
+
t
(
'common_module.publish'
)
}}
</div>
</div>
</td>
<td
class=
"border-[1px] border-[#efeff5] p-[12px]"
>
<div
class=
"flex"
>
<div
class=
"flex cursor-pointer items-center justify-start rounded-[5px] border-[1px] border-[#000DFF] bg-[#f7f7f9] px-[12px] py-[4px] text-[14px] text-[#000DFF] hover:opacity-80"
@
click=
"handleClickChannelPublishTableAction('accessPage')"
>
<PreviewOpen
theme=
"outline"
size=
"16"
fill=
"#000DFF"
:stroke-width=
"4"
class=
"mr-[6px]"
/>
<span>
{{
t
(
'personal_space_module.agent_module.agent_setting_module.agent_publish_module.access_page'
)
}}
</span>
</div>
<div
class=
"hover:text-theme-color hover:border-theme-color ml-[16px] flex cursor-pointer items-center justify-start rounded-md border bg-[#f7f7f9] px-[12px] py-[4px] text-[14px]"
@
click=
"handleClickChannelPublishTableAction('copyLink')"
>
<CustomIcon
icon=
"pepicons-pop:share-android-circle"
class=
"mr-[6px]"
/>
<span>
{{
t
(
'personal_space_module.agent_module.agent_setting_module.agent_publish_module.share_link'
)
}}
</span>
</div>
</div>
</td>
</tr>
<tr>
<td
class=
"border-[1px] border-[#efeff5]"
>
<div
class=
"flex items-center justify-start p-[12px]"
>
<AllApplication
theme=
"filled"
size=
"24"
fill=
"#000dff"
:stroke-width=
"3"
/>
<div
class=
"ml-[12px]"
>
<div
class=
"hover:text-theme-color flex cursor-pointer items-center"
@
click=
"handleToApplicationSquare"
>
<div
class=
"mr-[2px]"
>
{{
t
(
'router_title_module.application_square'
)
}}
</div>
<CustomIcon
icon=
"ep:top-right"
/>
</div>
<div
class=
"text-[#84868c]"
>
{{
t
(
'personal_space_module.agent_module.agent_setting_module.agent_publish_module.application_square_desc'
,
)
}}
</div>
</div>
</div>
</td>
<td
class=
"border-[1px] border-[#efeff5] p-[12px]"
>
<div
v-show=
"applicationMallInfo?.isSale === null || applicationMallInfo?.isSale === 'N'"
class=
"flex flex-col items-start justify-center"
>
<div
class=
"rounded-[4px] bg-[#BBB] px-[14px] py-[3px] text-[#fff]"
>
{{
t
(
'personal_space_module.agent_module.agent_setting_module.agent_publish_module.not_configured_btn'
)
}}
</div>
</div>
<div
v-show=
"applicationMallInfo?.isSale === 'Y'"
class=
"flex flex-col items-start justify-center"
>
<div
class=
"mb-[4px] rounded-[4px] bg-[#34a853] px-[14px] py-[3px] text-[#fff]"
>
{{
t
(
'common_module.published'
)
}}
</div>
<div
class=
"text-[#84868c]"
>
{{
applicationMallInfo
?.
launchTime
?
formatDateTime
(
applicationMallInfo
.
launchTime
)
+
t
(
'common_module.publish'
)
:
''
}}
</div>
</div>
</td>
<td
class=
"border-[1px] border-[#efeff5] p-[12px]"
>
<div
v-show=
"applicationMallInfo?.isSale === null || applicationMallInfo?.isSale === 'N'"
class=
"flex"
>
<div
class=
"flex cursor-pointer items-center justify-start rounded-[5px] border-[1px] border-[#000DFF] bg-[#f7f7f9] px-[12px] py-[4px] text-[14px] text-[#000DFF] hover:opacity-80"
@
click=
"handleClickChannelPublishTableAction('configuration')"
>
<SettingOne
theme=
"outline"
size=
"16"
fill=
"#000dff"
:stroke-width=
"3"
class=
"mr-[3px]"
/>
<span>
{{
t
(
'common_module.config'
)
}}
</span>
</div>
</div>
<div
v-show=
"applicationMallInfo?.isSale === 'Y'"
class=
"flex"
>
<!--
<div
class=
"flex cursor-pointer items-center justify-start rounded-[5px] border-[1px] border-[#000DFF] bg-[#f7f7f9] px-[12px] py-[4px] text-[14px] text-[#000DFF] hover:opacity-80"
@
click=
"handleClickChannelPublishTableAction('accessPage')"
>
<PreviewOpen
theme=
"outline"
size=
"16"
fill=
"#000DFF"
:stroke-width=
"4"
class=
"mr-[6px]"
/>
<span>
{{
t
(
'personal_space_module.agent_module.agent_setting_module.agent_publish_module.access_page'
)
}}
</span>
</div>
<div
class=
"hover:text-theme-color hover:border-theme-color ml-[16px] flex cursor-pointer items-center justify-start rounded-md border bg-[#f7f7f9] px-[12px] py-[4px] text-[14px]"
@
click=
"handleClickChannelPublishTableAction('copyLink')"
>
<CustomIcon
icon=
"pepicons-pop:share-android-circle"
class=
"mr-[6px]"
/>
<span>
{{
t
(
'personal_space_module.agent_module.agent_setting_module.agent_publish_module.share_link'
)
}}
</span>
</div>
-->
<div
class=
"hover:text-theme-color hover:border-theme-color flex cursor-pointer items-center justify-start rounded-md border bg-[#f7f7f9] px-[12px] py-[4px] text-[14px]"
@
click=
"handleClickChannelPublishTableAction('modifySetting')"
>
<CustomIcon
icon=
"ep:edit"
class=
"mr-[6px]"
/>
<span>
{{
t
(
'personal_space_module.agent_module.agent_setting_module.agent_publish_module.modify_setting_btn'
)
}}
</span>
</div>
<div
class=
"hover:text-theme-color hover:border-theme-color ml-[16px] flex cursor-pointer items-center justify-start rounded-md border bg-[#f7f7f9] px-[12px] py-[4px] text-[14px]"
@
click=
"handleClickChannelPublishTableAction('unSaleApplication')"
>
<CustomIcon
icon=
"nonicons:not-found-16"
class=
"mr-[6px]"
/>
<span>
{{
t
(
'common_module.data_table_module.remove_applications'
)
}}
</span>
</div>
</div>
</td>
</tr>
</tbody>
</table>
<SaleApplicationsConfigurationModal
v-model=
"isShowSaleApplicationsConfigurationModal"
:data=
"saleApplicationsInfo"
:category-id=
"applicationMallInfo.categoryId"
@
update=
"(newValue: string) => (applicationMallInfo.isSale = newValue)"
/>
</div>
</
template
>
src/views/personal-space/personal-app/sale-applications-configuration-modal.vue
View file @
4e94e0c3
...
...
@@ -15,18 +15,17 @@ const isShowSaleApplicationsConfigurationModal = defineModel<boolean>()
const
props
=
defineProps
<
{
data
:
PersonalAppConfigState
categoryId
?:
number
}
>
()
const
emit
=
defineEmits
<
{
update
:
[
value
:
string
]
}
>
()
const
{
t
}
=
useI18n
()
const
checkedClassifyValue
=
ref
<
number
|
null
>
(
null
)
const
isCopy
=
ref
(
'N
'
)
const
checkedClassifyValue
=
ref
<
number
|
null
>
(
props
.
categoryId
!
)
const
isCopy
=
ref
(
props
.
data
.
isCopy
===
'Y
'
)
const
saleApplicationsId
=
ref
(
props
.
data
.
agentPublishId
)
const
isClassifyError
=
ref
(
false
)
const
applicationsClassify
=
ref
<
MallCategory
[]
>
([])
...
...
@@ -42,16 +41,25 @@ watch(
},
)
watch
(
()
=>
props
.
categoryId
,
(
newValue
)
=>
{
checkedClassifyValue
.
value
=
newValue
!
},
)
watch
(
()
=>
props
.
data
,
(
newVal
)
=>
{
saleApplicationsId
.
value
=
newVal
.
agentPublishId
isCopy
.
value
=
newVal
.
isCopy
===
'Y'
},
)
function
handleApplicationsSaleSettingModalClose
()
{
isShowSaleApplicationsConfigurationModal
.
value
=
false
checkedClassifyValue
.
value
=
null
isCopy
.
value
=
false
}
function
handleApplicationReleaseBtn
()
{
...
...
@@ -59,17 +67,23 @@ function handleApplicationReleaseBtn() {
isClassifyError
.
value
=
true
return
}
const
payload
=
{
agentPublishId
:
saleApplicationsId
.
value
,
agentPublishId
:
props
.
data
.
agentPublishId
,
categoryId
:
checkedClassifyValue
.
value
,
isCopy
:
isCopy
.
value
,
isCopy
:
isCopy
.
value
?
'Y'
:
'N'
,
isSale
:
'Y'
,
}
fetchSalePublishApplication
(
payload
)
.
then
(()
=>
{
emit
(
'update'
,
'Y'
)
handleApplicationsSaleSettingModalClose
()
window
.
$message
.
success
(
t
(
'common_module.listing_successfully'
))
window
.
$message
.
success
(
t
(
'personal_space_module.agent_module.agent_setting_module.agent_publish_module.successfully_configured_published'
,
),
)
isClassifyError
.
value
=
false
})
.
catch
(()
=>
{
...
...
@@ -77,7 +91,7 @@ function handleApplicationReleaseBtn() {
})
}
function
handleIsCopySwitchUpdateValue
(
value
:
string
)
{
function
handleIsCopySwitchUpdateValue
(
value
:
boolean
)
{
isCopy
.
value
=
value
}
...
...
@@ -87,10 +101,23 @@ function handleGetMallCategoryList() {
applicationsClassify
.
value
=
res
.
data
as
MallCategory
[]
})
}
function
handleModalOpenAfter
()
{
if
(
props
.
data
.
isCopy
)
isCopy
.
value
=
props
.
data
.
isCopy
===
'Y'
if
(
props
.
data
.
isSale
===
'Y'
)
{
checkedClassifyValue
.
value
=
props
.
categoryId
!
}
else
{
checkedClassifyValue
.
value
=
0
}
}
</
script
>
<
template
>
<n-modal
v-model:show=
"isShowSaleApplicationsConfigurationModal"
class=
"h-auto max-h-[720px]"
:mask-closable=
"false"
>
<n-modal
v-model:show=
"isShowSaleApplicationsConfigurationModal"
:on-after-enter=
"handleModalOpenAfter"
class=
"h-auto max-h-[720px]"
:mask-closable=
"false"
>
<div
class=
"flex flex-col items-center justify-center"
>
<div
class=
"max-h-[720px] w-[720px] rounded-lg bg-white p-[24px]"
>
<div
class=
"mb-[24px] flex items-center justify-between text-[20px] font-medium"
>
...
...
@@ -162,7 +189,7 @@ function handleGetMallCategoryList() {
</div>
</n-popover>
</div>
<n-switch
size=
"small"
checked-value=
"Y"
unchecked-value=
"N
"
@
update:value=
"handleIsCopySwitchUpdateValue"
<n-switch
v-model:value=
"isCopy"
size=
"small
"
@
update:value=
"handleIsCopySwitchUpdateValue"
><
template
#
checked
>
{{
t
(
'personal_space_module.agent_module.agent_setting_module.agent_sale_module.yes'
)
}}
</
template
>
...
...
@@ -182,7 +209,7 @@ function handleGetMallCategoryList() {
{{ t('common_module.cancel_btn_text') }}
</button>
<button
class=
"bg-theme-color !box-content !h-[38px]
!w-[74px]
cursor-pointer rounded-[6px] border-[1px] border-solid border-[#dde3f0] bg-[te] px-[10px] text-[#ffffff] transition-all duration-300 hover:bg-[#528EFF]"
class=
"bg-theme-color !box-content !h-[38px] cursor-pointer rounded-[6px] border-[1px] border-solid border-[#dde3f0] bg-[te] px-[10px] text-[#ffffff] transition-all duration-300 hover:bg-[#528EFF]"
@
click=
"handleApplicationReleaseBtn()"
>
{{ t('personal_space_module.agent_module.agent_setting_module.agent_sale_module.confirm_release') }}
...
...
types/locales.d.ts
View file @
4e94e0c3
...
...
@@ -318,6 +318,12 @@ declare namespace I18n {
access_page
:
string
share_link
:
string
copy_share_url_success_message
:
string
application_square_desc
:
string
modify_setting_btn
:
string
not_configured_btn
:
string
removal_prompt_title
:
string
removal_prompt_content
:
string
successfully_configured_published
:
string
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment