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 5e601931
authored
Nov 07, 2022
by
xinla
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'develop'
2 parents
25fd8d2b
202fcf19
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
492 additions
and
38 deletions
linkwe-pc/src/api/internalCollaborate/appManage.js
linkwe-pc/src/router/index.js
linkwe-pc/src/utils/common.js
linkwe-pc/src/views/internalCollaborate/appManage.vue
linkwe-pc/src/api/internalCollaborate/appManage.js
0 → 100644
View file @
5e60193
import
request
from
'@/utils/request'
const
service
=
window
.
CONFIG
.
services
.
system
+
window
.
CONFIG
.
services
.
wecom
+
'/agent'
const
serviceMsg
=
service
+
'/msg'
// 应用管理
/**
* 列表
* @param {*} params
*/
export
function
getList
()
{
return
request
({
url
:
service
+
'/list'
,
})
}
/**
* 删除
* @param {*} params
*/
export
function
remove
(
id
)
{
return
request
({
url
:
service
+
`/delete/
${
id
}
`
,
method
:
'delete'
,
})
}
/**
* 添加应用
* @param {*} data
{
"agentId": "应用ID",
"secret": "应用密钥"
}
* @returns
*/
export
function
add
(
data
)
{
return
request
({
url
:
service
+
'/pull'
,
method
:
'post'
,
data
,
})
}
/**
* 编辑应用信息
* @param {*} data
{
description:'', // string 企业应用详情
homeUrl:'', // string 应用主页url
logoUrl:'', // string 企业应用头像
name:'', // string 企业应用名称
redirectDomain:'', // string 企业应用可信域名
}
* @returns
*/
export
function
update
(
data
)
{
return
request
({
url
:
service
+
`/update/
${
data
.
id
}
`
,
method
:
'PUT'
,
data
,
})
}
// 应用消息
export
const
appMsg
=
{
/**
* 获取历史消息列表
* @param {*} params
{
endTime:'', // string date-time 发送结束时间
startTime:'', // string date-time 发送开始时间
status:'',// integer int32状态
title:'', // string 标题
}
*/
getList
(
params
)
{
return
request
({
url
:
service
+
'/list'
,
params
,
})
},
/**
* 应用消息详情
* @param {*} id
*/
getDetail
(
id
)
{
return
request
({
url
:
service
+
`/get/
${
id
}
`
,
})
},
/**
* 撤销应用消息
* @param {*} id
*/
revoke
(
id
)
{
return
request
({
url
:
service
+
`/revoke/
${
id
}
`
,
})
},
/**
* 新增应用消息
* @param {*} data
{
agentId:'', // integer int32 应用ID
planSendTime: '', // string date-time 计划时间
scopeType:'', // integer int32 范围类型 1-全部 2-自定义
sendTime: '', // string date-time 发送时间
sendType:'', // integer int32 发送方式 1-立即发送 2-定时发送
title: '', // string 消息标题
toParty: '', // string 示例值 接收消息的部门
toTag: '', // string 示例值 接收消息的标签
toUser: '', // string 示例值 接收消息的成员
WeMessageTemplate:{
appId: '', // string 小程序appid(可以在微信公众平台上查询),必须是关联到企业的小程序应用
content: '', // string 文本内容(文本消息必传)
description: '', // string 消息的描述(视频、文本卡片、图文 必传)
linkUrl: '', // string 点击后跳转的链接。最长2048字节,请确保包含了协议头(http/https) (文本卡片、图文 必传)
mediaId: '', // string 素材id(语音、视频、文件 必传)
msgType: '', // string 消息类型 文本:text, 图片:image, 语音:voice, 视频:video, 文件:file, 文本卡片:textcard, 图文:news, 图文消息:link, 小程序:miniprogram
picUrl: '', // string 图文消息的图片链接,支持JPG、PNG格式,较好的效果为大图 1068*455,小图150*150。(文本卡片、图文 必传)
title: '', // string 消息的标题(视频、文本卡片、图文 必传)
}
}
*/
add
(
data
)
{
return
request
({
url
:
serviceMsg
+
'/add'
,
method
:
'post'
,
data
,
})
},
// 保存应用消息 data同上
save
(
data
)
{
return
request
({
url
:
serviceMsg
+
'/save'
,
method
:
'post'
,
data
,
})
},
// 修改应用消息 data同上
update
(
data
)
{
return
request
({
url
:
service
+
`/update/
${
data
.
id
}
`
,
method
:
'PUT'
,
data
,
})
},
/**
* 删除
* @param {*} id
*/
remove
(
id
)
{
return
request
({
url
:
service
+
`/delete/
${
id
}
`
,
method
:
'delete'
,
})
},
}
linkwe-pc/src/router/index.js
View file @
5e60193
...
...
@@ -32,44 +32,25 @@ import visitor from '@/layout/visitor'
// 开发路由,总后台配置完菜单务必删除或注释,只在开发环境生效
const
devRoutes
=
[
// {
// path: '/smartForms',
// component: Layout,
// hidden: true,
// meta: {
// title: '商品中心',
// },
// children: [
// {
// path: 'list',
// component: (resolve) => require(['@/views/drainageCode/smartForms/index'], resolve),
// meta: {
// title: '商品管理',
// activeMenu: '/commodityCenter/commodityManage',
// breadcrumb: true,
// },
// },
// {
// path: 'add',
// component: (resolve) => require(['@/views/drainageCode/smartForms/add'], resolve),
// meta: {
// title: '商品管理',
// activeMenu: '/commodityCenter/commodityManage',
// breadcrumb: true,
// },
// },
// {
// path: 'smartFormStatistics',
// component: (resolve) =>
// require(['@/views/drainageCode/smartForms/statistics/index'], resolve),
// meta: {
// title: '商品管理',
// activeMenu: '/commodityCenter/commodityManage',
// breadcrumb: true,
// },
// },
// ],
// },
{
path
:
'/internalCollaborate'
,
component
:
Layout
,
hidden
:
true
,
meta
:
{
title
:
'应用管理'
,
},
children
:
[
{
path
:
'list'
,
component
:
(
resolve
)
=>
require
([
'@/views/internalCollaborate/appManage'
],
resolve
),
meta
:
{
title
:
''
,
activeMenu
:
'/commodityCenter/commodityManage'
,
breadcrumb
:
true
,
},
},
],
},
{
path
:
'/commodityCenter'
,
component
:
Layout
,
...
...
linkwe-pc/src/utils/common.js
View file @
5e60193
This diff is collapsed.
Click to expand it.
linkwe-pc/src/views/internalCollaborate/appManage.vue
0 → 100644
View file @
5e60193
<
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
})
=>
{
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
)
},
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.split(',')"
></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%
;
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
>
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