Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
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 720c8ae4
authored
Nov 08, 2022
by
xinla
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
--no commit message
1 parent
d9ea537b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
327 deletions
linkwe-pc/src/views/internalCollaborate/appManage.vue
linkwe-pc/src/views/internalCollaborate/appManage/HistoryMsg.vue
linkwe-pc/src/views/internalCollaborate/appManage/list.vue
linkwe-pc/src/views/internalCollaborate/appManage.vue
deleted
100644 → 0
View file @
d9ea537
<
script
>
import
{
getList
,
update
,
add
,
remove
}
from
'@/api/internalCollaborate/appManage'
// import clipboard from "clipboard";
export
default
{
components
:
{},
props
:
{},
data
()
{
return
{
query
:
{
// pageNum: 1,
// pageSize: 10,
// name: '',
},
// dateRange: [], // 添加日期
// total: 0,
form
:
{},
list
:
[],
dialogVisible
:
false
,
disabled
:
false
,
loading
:
false
,
rules
:
Object
.
freeze
({
agentId
:
[{
required
:
true
,
message
:
'必填项'
,
trigger
:
'blur'
}],
secret
:
[{
required
:
true
,
message
:
'必填项'
,
trigger
:
'blur'
}],
name
:
[{
required
:
true
,
message
:
'必填项'
,
trigger
:
'blur'
}],
description
:
[{
required
:
true
,
message
:
'必填项'
,
trigger
:
'blur'
}],
logoUrl
:
[{
required
:
true
,
message
:
'必填项'
,
trigger
:
'change'
}],
}),
// status: ['正常', '停用'],
// dialogVisibleSelectMaterial: false,
}
},
watch
:
{},
computed
:
{},
created
()
{
this
.
getList
()
this
.
$store
.
dispatch
(
'app/setBusininessDesc'
,
`<div>企业微信自建应用管理,支持通过应用发送应用消息</div> `
,
)
},
mounted
()
{
// new clipboard(".copy-btn");
},
methods
:
{
getList
(
page
)
{
// if (this.dateRange) {
// this.query.beginTime = this.dateRange[0]
// this.query.endTime = this.dateRange[1]
// } else {
// this.query.beginTime = ''
// this.query.endTime = ''
// }
// page && (this.query.pageNum = page)
this
.
loading
=
true
getList
()
.
then
(({
data
,
total
})
=>
{
data
.
forEach
((
element
)
=>
{
element
.
allowPartyName
=
(
element
.
allowPartyName
||
''
).
split
(
','
)
element
.
allowUserinfoName
=
(
element
.
allowUserinfoName
||
''
).
split
(
','
)
})
this
.
list
=
data
})
.
finally
(()
=>
{
this
.
loading
=
false
})
},
edit
(
data
,
type
)
{
this
.
form
=
Object
.
assign
({},
data
||
{})
this
.
dialogVisible
=
true
type
||
!
data
?
(
this
.
disabled
=
false
)
:
(
this
.
disabled
=
true
)
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'form'
].
clearValidate
()
})
},
submit
()
{
this
.
$refs
[
'form'
].
validate
((
valid
)
=>
{
if
(
valid
)
{
;(
this
.
form
.
id
?
update
:
add
)(
this
.
form
)
.
then
(()
=>
{
this
.
msgSuccess
(
'操作成功'
)
this
.
dialogVisible
=
false
this
.
getList
()
// this.getList(!this.form.id && 1)
})
.
catch
(()
=>
{
this
.
dialogVisible
=
false
})
}
})
},
/** 删除按钮操作 */
remove
(
id
)
{
// const operIds = id || this.ids + ''
this
.
$confirm
(
'是否确认删除?该操作不可撤销,请谨慎操作。'
,
{
title
:
'警告'
,
type
:
'warning'
,
})
.
then
(
function
()
{
return
remove
(
id
)
})
.
then
(()
=>
{
this
.
getList
()
this
.
msgSuccess
(
'删除成功'
)
})
},
// goRoute(id, path) {
// this.$router.push({
// path: 'taskAev',
// query: { id },
// })
// },
// 选择素材确认按钮
// submitSelectMaterial(text, image, file) {
// this.form.logoMediaid = image.id
// this.form.squareLogoUrl = image.materialUrl
// this.dialogVisibleSelectMaterial = false
// },
},
}
</
script
>
<
template
>
<div>
<ul
v-loading=
"loading"
class=
"list-wrap"
>
<li
v-for=
"(item, index) of list"
:key=
"index"
class=
"list"
>
<div
class=
"flex"
>
<el-image
:src=
"item.logoUrl"
fit=
"fit"
></el-image>
<div
class=
""
>
<div
class=
"title blod toe"
>
{{
item
.
name
}}
</div>
<div
class=
"desc mt10"
>
{{
item
.
description
}}
</div>
</div>
</div>
<div
class=
"flex aic mt10"
>
<div
class=
"list-label"
>
AgentId
</div>
{{
item
.
agentId
}}
</div>
<div
class=
"flex aic mt10"
>
<div
class=
"list-label"
>
可见范围
</div>
<!--
<div
class=
"flex"
>
<div
v-for=
"(item, index) of item.allowPartys.split(',')"
:key=
"index"
>
<i
class=
"el-icon-folder-opened"
v-if=
"item"
></i>
{{
item
}}
</div>
</div>
-->
<TagEllipsis
:list=
"item.allowPartyName"
></TagEllipsis>
</div>
<div
class=
"list-action fr"
>
<!--
<el-button
type=
"text"
>
发送消息
</el-button>
<el-button
type=
"text"
>
历史消息
</el-button>
-->
<el-button
type=
"text"
@
click=
"edit(item)"
>
编辑
</el-button>
<el-button
type=
"text"
@
click=
"remove(item.id)"
>
删除
</el-button>
</div>
</li>
<li
class=
"list flex aic cp"
style=
"justify-content: center"
@
click=
"edit()"
>
<div
class=
"ac theme"
>
<i
class=
"el-icon-plus"
></i>
添加应用
</div>
</li>
</ul>
<el-dialog
:title=
"form.id ? '编辑' : '添加'"
:visible
.
sync=
"dialogVisible"
:close-on-click-modal=
"false"
width=
"580px"
>
<el-form
ref=
"form"
label-position=
"right"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<!-- 添加 -->
<template
v-if=
"!form.id"
>
<el-form-item
label=
"应用ID"
prop=
"agentId"
>
<el-input
v-model=
"form.agentId"
:disabled=
"!!form.id"
placeholder=
"请输入应用 AgentId"
></el-input>
<div
class=
"dialog-tip"
>
如何获取:企微后台->应用管理->自建应用详情->AgentId
</div>
</el-form-item>
<el-form-item
label=
"应用密钥"
prop=
"secret"
>
<el-input
v-model=
"form.secret"
placeholder=
"请输入应用 Secret"
></el-input>
<div
class=
"dialog-tip"
>
如何获取:企微后台->应用管理->自建应用详情->Secret
</div>
</el-form-item>
</
template
>
<!-- 编辑 -->
<
template
v-if=
"form.id"
>
<el-form-item
label=
"应用名称"
prop=
"name"
>
<el-input
v-model=
"form.name"
maxlength=
"16"
show-word-limit
placeholder=
"请输入应用名称"
></el-input>
</el-form-item>
<el-form-item
label=
"应用描述"
prop=
"description"
>
<el-input
type=
"textarea"
v-model=
"form.description"
maxlength=
"60"
show-word-limit
placeholder=
"请输入应用描述"
></el-input>
</el-form-item>
<el-form-item
label=
"应用头像"
prop=
"logoUrl"
>
<upload
class=
"image-uploader"
:fileUrl
.
sync=
"form.logoUrl"
type=
"0"
></upload>
</el-form-item>
</
template
>
<!-- <el-row :gutter="10">
<el-col :span="4">
<div class="avatar-wrap ac" @click="dialogVisibleSelectMaterial = true">
<img class="avatar" v-if="form.squareLogoUrl" :src="form.squareLogoUrl" />
<i v-else class="el-icon-plus avatar-uploader-icon cc"></i>
</div>
</el-col>
<el-col :span="20">
<el-form-item label="应用Id" prop="agentId">
<el-input
v-model="form.agentId"
:disabled="!!form.id"
placeholder="请输入应用Id"></el-input>
</el-form-item>
<el-form-item label="应用Secret" prop="agentSecret">
<el-input
:disabled="!!form.id"
v-model="form.agentSecret"
placeholder="请输入应用Secret"></el-input>
</el-form-item>
<el-form-item label="可见范围" v-if="form.id">
<div class="flex">
<div v-for="(item, index) of form.allowPartys.split(',')" :key="index">
<i class="el-icon-folder-opened" v-if="item"></i>{{ item }}
</div>
<div v-for="(item, index) of form.allowUserinfos.split(',')" :key="'1' + index">
<i class="el-icon-s-custom" v-if="item"></i>{{ item }}
</div>
</div>
</el-form-item>
</el-col>
</el-row> -->
</el-form>
<div
slot=
"footer"
>
<el-button
@
click=
"dialogVisible = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"submit"
>
确 定
</el-button>
</div>
</el-dialog>
<!-- 选择素材弹窗 -->
<!-- <SelectMaterial
:visible.sync="dialogVisibleSelectMaterial"
type="1"
:showArr="[1]"
@success="submitSelectMaterial"
>
</SelectMaterial> -->
</div>
</template>
<
style
lang=
"scss"
scoped
>
.theme
{
color
:
$
blue
;
}
.list-wrap
{
display
:
flex
;
flex-wrap
:
wrap
;
line-height
:
20px
;
.list
{
width
:
33%
;
height
:
218px
;
padding
:
20px
20px
10px
;
border
:
1px
solid
#eee
;
margin
:
0
20px
20px
0
;
background
:
#fff
;
border-radius
:
6px
;
.el-image
{
margin-right
:
10px
;
width
:
80px
;
height
:
80px
;
flex
:
none
;
border
:
1px
solid
#eee
;
border-radius
:
5px
;
background
:
#eee
;
}
.title
{
font-size
:
16px
;
}
.desc
{
color
:
#ddd
;
word-break
:
break-all
;
}
.list-label
{
color
:
#888
;
width
:
90px
;
}
}
}
.dialog-tip
{
color
:
#888
;
font-size
:
12px
;
}
//
.avatar-wrap
{
//
position
:
relative
;
//
width
:
120px
;
//
height
:
120px
;
//
border
:
1px
solid
#eee
;
//
border-radius
:
5px
;
//
}
//
.avatar
{
//
width
:
100%
;
//
}
//
.avatar-uploader-icon
{
//
font-size
:
28px
;
//
color
:
#ddd
;
//
}
</
style
>
linkwe-pc/src/views/internalCollaborate/appManage/HistoryMsg.vue
View file @
720c8ae
...
@@ -73,6 +73,7 @@ export default {
...
@@ -73,6 +73,7 @@ export default {
.
getList
(
this
.
query
)
.
getList
(
this
.
query
)
.
then
(({
data
,
total
})
=>
{
.
then
(({
data
,
total
})
=>
{
this
.
list
=
data
this
.
list
=
data
this
.
total
=
+
total
})
})
.
finally
(()
=>
{
.
finally
(()
=>
{
this
.
loading
=
false
this
.
loading
=
false
...
@@ -99,14 +100,14 @@ export default {
...
@@ -99,14 +100,14 @@ export default {
}
}
})
})
},
},
remov
e
(
id
)
{
remov
ke
(
id
,
action
,
tip
)
{
// const operIds = id || this.ids + ''
// const operIds = id || this.ids + ''
this
.
$confirm
(
'是否确认
删除
?该操作不可撤销,请谨慎操作。'
,
{
this
.
$confirm
(
'是否确认
'
+
tip
+
'
?该操作不可撤销,请谨慎操作。'
,
{
title
:
'警告'
,
title
:
'警告'
,
type
:
'warning'
,
type
:
'warning'
,
})
})
.
then
(
function
()
{
.
then
(
function
()
{
return
appMsg
.
remove
(
id
)
return
appMsg
[
action
]
(
id
)
})
})
.
then
(()
=>
{
.
then
(()
=>
{
this
.
getList
()
this
.
getList
()
...
@@ -120,7 +121,7 @@ export default {
...
@@ -120,7 +121,7 @@ export default {
<
template
>
<
template
>
<div>
<div>
<el-select
v-model=
"query.status"
placeholder=
""
>
<el-select
v-model=
"query.status"
placeholder=
""
>
<el-option
v-for=
"(value, key) in status"
:key=
"key"
:label=
"value"
:value=
"key"
>
</el-option>
<el-option
v-for=
"(value, key) in status"
:key=
"key"
:label=
"value"
:value=
"key"
></el-option>
</el-select>
</el-select>
<el-table
v-loading=
"loading"
:data=
"list"
>
<el-table
v-loading=
"loading"
:data=
"list"
>
<el-table-column
label=
"消息标题"
align=
"center"
prop=
"title"
/>
<el-table-column
label=
"消息标题"
align=
"center"
prop=
"title"
/>
...
@@ -133,10 +134,10 @@ export default {
...
@@ -133,10 +134,10 @@ export default {
<el-table-column
label=
"发送时间"
align=
"center"
prop=
"groupName"
/>
<el-table-column
label=
"发送时间"
align=
"center"
prop=
"groupName"
/>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"{ row }"
>
<
template
slot-scope=
"{ row }"
>
<el-button
type=
"text"
@
click=
"edit(row, 'detail')"
>
详情
</el-button>
<
!--
<
el-button
type=
"text"
@
click=
"edit(row, 'detail')"
>
详情
</el-button>
<el-button
v-if=
"[0, 1].includes(row.status)"
type=
"text"
@
click=
"edit(row, 'edit')"
>
编辑
</el-button>
<el-button
v-if=
"[0, 1].includes(row.status)"
type=
"text"
@
click=
"edit(row, 'edit')"
>
编辑
</el-button>
-->
<el-button
v-if=
"row.status == 2"
type=
"text"
@
click=
"
edit(row, 'revoke
')"
>
撤回
</el-button>
<el-button
v-if=
"row.status == 2"
type=
"text"
@
click=
"
removke(row.id, 'revoke', '撤回
')"
>
撤回
</el-button>
<el-button
v-else
@
click=
"remov
e(scope.row.groupId
)"
type=
"text"
>
删除
</el-button>
<el-button
v-else
@
click=
"remov
ke(row.id, 'remove', '删除'
)"
type=
"text"
>
删除
</el-button>
<!-- v-hasPermi="['customerManage:tag:remove']" -->
<!-- v-hasPermi="['customerManage:tag:remove']" -->
</
template
>
</
template
>
</el-table-column>
</el-table-column>
...
...
linkwe-pc/src/views/internalCollaborate/appManage/list.vue
View file @
720c8ae
...
@@ -153,8 +153,8 @@ export default {
...
@@ -153,8 +153,8 @@ export default {
</div>
-->
</div>
-->
<TagEllipsis
:list=
"item.allowPartyName"
></TagEllipsis>
<TagEllipsis
:list=
"item.allowPartyName"
></TagEllipsis>
</div>
</div>
<div
class=
"list-action f
r
"
>
<div
class=
"list-action f
xbw
"
>
<!--
<el-button
type=
"text"
>
发送消息
</el-button>
<!--
<el-button
type=
"text"
>
发送消息
</el-button>
-->
<el-button
<el-button
type=
"text"
type=
"text"
@
click=
"
@
click=
"
...
@@ -162,7 +162,7 @@ export default {
...
@@ -162,7 +162,7 @@ export default {
dialogVisibleHistoryMsg = true
dialogVisibleHistoryMsg = true
"
>
"
>
历史消息
历史消息
</el-button>
-->
</el-button>
<el-button
type=
"text"
@
click=
"edit(item)"
>
编辑
</el-button>
<el-button
type=
"text"
@
click=
"edit(item)"
>
编辑
</el-button>
<el-button
type=
"text"
@
click=
"remove(item.id)"
>
删除
</el-button>
<el-button
type=
"text"
@
click=
"remove(item.id)"
>
删除
</el-button>
</div>
</div>
...
...
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