Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-3
Overview
Overview
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
office
haoban-3
Commits
4397d279
Commit
4397d279
authored
Mar 10, 2022
by
crushh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: dist
parent
acdd2845
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
175 additions
and
90 deletions
+175
-90
index.html
index.html
+2
-2
main.js
src/main.js
+1
-1
salutatory.vue
src/views/enterprise/salutatory.vue
+42
-37
salutatorySet.vue
src/views/enterprise/salutatorySet.vue
+130
-50
No files found.
index.html
View file @
4397d279
...
...
@@ -14,8 +14,8 @@
<link
rel=
"shortcut icon"
href=
"./favicon.ico"
/>
<title>
好办管理平台
</title>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"//web-1251519181.file.myqcloud.com/custom-element/custom-element.1.0.69.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"//at.alicdn.com/t/font_1628375_
kcme8v8q3t
.css"
/>
<!--好办后台3.0-->
<script
src=
"//at.alicdn.com/t/font_1628375_
kcme8v8q3t
.js"
></script>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"//at.alicdn.com/t/font_1628375_
5ghlvsafe8j
.css"
/>
<!--好办后台3.0-->
<script
src=
"//at.alicdn.com/t/font_1628375_
5ghlvsafe8j
.js"
></script>
</head>
<body
style=
"min-width: 1400px;"
class=
"damolish"
>
...
...
src/main.js
View file @
4397d279
...
...
@@ -39,7 +39,7 @@ VueAMap.initAMapApiLoader({
plugin
:
[
'Autocomplete'
,
'PlaceSearch'
,
'Scale'
,
'OverView'
,
'Geocoder'
,
'ToolBar'
,
'MapType'
,
'PolyEditor'
,
'AMap.CircleEditor'
],
v
:
'1.4.4'
});
window
.
ELEMENT
.
Dialog
.
props
.
closeOnClickModal
.
default
=
false
;
// 全局设置点击蒙层不关闭
Vue
.
use
(
htmlToPdf
);
Vue
.
use
(
vueGicImgPreview
);
Vue
.
use
(
vueOfficeUploadImage
);
...
...
src/views/enterprise/salutatory.vue
View file @
4397d279
<
template
>
<div>
<div
class=
"warp"
>
<
!--
<
div
class=
"warp"
>
<h2>
加好友配置
</h2>
<span
class=
"echoData"
v-show=
"friendSettingType"
>
{{
echoFriendData
}}
</span>
<el-button
type=
"text"
style=
"margin-left: 20px;"
@
click=
"openDialog"
>
去配置
</el-button>
</div>
</div>
-->
<div
class=
"daily-set-wrap"
>
<div
class=
"daily-set-content border-box"
>
<div
class=
"admin-tip-body"
>
...
...
@@ -26,7 +26,7 @@
<el-input
placeholder=
"请输入标题"
maxlength=
"50"
v-model=
"title"
class=
"w-264"
style=
"width: 264px;"
@
keyup
.
native=
"value => toInput(value, searchInput)"
clearable
@
clear=
"clearSearch"
>
<i
slot=
"prefix"
class=
"el-input__icon el-icon-search"
></i>
</el-input>
<el-button
type=
"primary"
@
click=
"changeRoute"
>
新建欢迎语
</el-button>
</div>
<el-table
ref=
"multipleTable"
:data=
"tableData"
tooltip-effect=
"dark"
:style=
"
{ width: '100%' }">
<el-table
ref=
"multipleTable"
:data=
"tableData"
tooltip-effect=
"dark"
:style=
"
{ width: '100%' }"
v-loading="loading"
>
<el-table-column
prop=
"title"
label=
"标题"
width=
"200"
show-overflow-tooltip
>
<template
slot-scope=
"
{ row }">
{{
row
.
title
}}
</
template
>
</el-table-column>
...
...
@@ -70,13 +70,13 @@
<el-table-column
label=
"操作"
width=
"180"
>
<
template
slot-scope=
"{ row }"
>
<el-button
type=
"text"
@
click=
"changeRoute(row)"
>
编辑
</el-button>
<el-button
type=
"text"
@
click=
"remove(row)"
v-if=
"row.defaultWelcomeFlag != 1"
>
删除
</el-button>
<el-button
type=
"text"
@
click=
"remove(row)"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
</div>
</div>
<el-dialog
title=
"加好友配置"
:visible
.
sync=
"dialogVisible"
width=
"590px"
:before-close=
"handleClose"
>
<
!-- <
el-dialog title="加好友配置" :visible.sync="dialogVisible" width="590px" :before-close="handleClose">
<span class="tips">好办欢迎语支持文字、图片、视频、文件、链接</span>
<el-form label-width="100px" style="margin-top:20px">
<el-form-item label="加好友配置">
...
...
@@ -90,7 +90,7 @@
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" :loading="btnLoading" @click="saveSetting">确 定</el-button>
</span>
</el-dialog>
</el-dialog>
-->
</div>
</template>
<
script
>
...
...
@@ -100,24 +100,25 @@ export default {
props
:
{},
data
()
{
return
{
friendSettingTypeOption
:
[
{
label
:
2
,
content
:
'发送【好办欢迎语】+【带导购参数的公众号二维码】'
},
{
label
:
1
,
content
:
'发送【好办欢迎语】+【带导购参数的会员小程序卡片】'
}
],
//
friendSettingTypeOption: [
//
{ label: 2, content: '发送【好办欢迎语】+【带导购参数的公众号二维码】' },
//
{ label: 1, content: '发送【好办欢迎语】+【带导购参数的会员小程序卡片】' }
//
],
title
:
''
,
wxEnterpriseId
:
localStorage
.
getItem
(
'userInfos'
)
?
JSON
.
parse
(
localStorage
.
getItem
(
'userInfos'
)).
wxEnterpriseId
:
''
,
friendSettingType
:
''
,
//
friendSettingType: '',
type
:
1
,
friendSettingId
:
''
,
btnLoading
:
false
,
dialogVisible
:
false
,
//
dialogVisible: false,
iconType
:
{
1
:
'iconwenjianleixingtupian'
,
2
:
'iconwenjianleixingshipin'
,
3
:
'iconwenjianleixing-wenjian'
,
4
:
'iconwenjianleixing-lianjie'
},
tableData
:
[]
tableData
:
[],
loading
:
false
};
},
mounted
()
{
...
...
@@ -125,19 +126,19 @@ export default {
that
.
$emit
(
'showTab'
,
4
);
document
.
documentElement
.
style
.
backgroundColor
=
'#f0f2f5'
;
that
.
getData
();
this
.
getSetting
();
//
this.getSetting();
},
destroyed
()
{
document
.
documentElement
.
style
.
backgroundColor
=
'#fff'
;
},
computed
:
{
echoFriendData
()
{
let
content
=
''
;
if
(
this
.
friendSettingType
)
{
content
=
this
.
friendSettingTypeOption
.
filter
(
item
=>
item
.
label
==
this
.
friendSettingType
)[
0
].
content
;
}
return
content
;
}
//
echoFriendData() {
//
let content = '';
//
if (this.friendSettingType) {
//
content = this.friendSettingTypeOption.filter(item => item.label == this.friendSettingType)[0].content;
//
}
//
return content;
//
}
},
methods
:
{
/**
...
...
@@ -152,20 +153,20 @@ export default {
clearSearch
()
{
this
.
getData
();
},
openDialog
()
{
this
.
dialogVisible
=
true
;
},
getSetting
()
{
getRequest
(
'/haoban-manage3-web/welcome/get/friend-setting'
,
{
wxEnterpriseId
:
this
.
wxEnterpriseId
}).
then
(
res
=>
{
let
resData
=
res
.
data
;
if
(
resData
.
code
==
0
&&
resData
.
result
)
{
const
{
friendSettingId
,
friendSettingType
}
=
resData
.
result
;
this
.
friendSettingId
=
friendSettingId
;
this
.
type
=
friendSettingType
?
friendSettingType
:
1
;
this
.
friendSettingType
=
friendSettingType
;
}
});
},
//
openDialog() {
//
this.dialogVisible = true;
//
},
//
getSetting() {
//
getRequest('/haoban-manage3-web/welcome/get/friend-setting', { wxEnterpriseId: this.wxEnterpriseId }).then(res => {
//
let resData = res.data;
//
if (resData.code == 0 && resData.result) {
//
const { friendSettingId, friendSettingType } = resData.result;
//
this.friendSettingId = friendSettingId;
//
this.type = friendSettingType ? friendSettingType : 1;
//
this.friendSettingType = friendSettingType;
//
}
//
});
//
},
saveSetting
()
{
let
data
=
{
friendSettingId
:
this
.
friendSettingId
,
...
...
@@ -179,8 +180,8 @@ export default {
let
resData
=
res
.
data
;
if
(
resData
.
code
==
0
&&
resData
.
result
)
{
this
.
$message
.
success
(
resData
.
message
);
this
.
dialogVisible
=
false
;
this
.
getSetting
();
//
this.dialogVisible = false;
//
this.getSetting();
}
})
.
finally
(()
=>
{
...
...
@@ -212,6 +213,7 @@ export default {
* 获取数据
*/
getData
()
{
this
.
loading
=
true
;
postJsonRequest
(
'/haoban-manage3-web/welcome/list'
,
{
title
:
this
.
title
,
wxEnterpriseId
:
this
.
wxEnterpriseId
})
.
then
(
res
=>
{
let
resData
=
res
.
data
;
...
...
@@ -232,6 +234,9 @@ export default {
duration
:
1000
,
message
:
error
.
message
});
})
.
finally
(()
=>
{
this
.
loading
=
false
;
});
}
},
...
...
src/views/enterprise/salutatorySet.vue
View file @
4397d279
...
...
@@ -25,19 +25,19 @@
</p>
</el-popover>
</div>
<div
class=
"mediaEcho"
v-if=
"showEchoData"
>
<div
class=
"mediaEcho"
>
<div
class=
"flexBoxContainer"
v-for=
"(item, index) in form.welcomeMediaList"
:key=
"index"
>
<div
class=
"flexBox"
v-if=
"item.mediaType != 5"
>
<div
class=
"flexBox"
>
<svg-icon
:iconname=
"iconType[item.mediaType]"
size=
"16"
style=
"margin-right: 13px;"
>
</svg-icon>
<span
class=
"popverText"
>
{{
item
.
mediaTitle
}}
</span>
<i
class=
"el-icon-close"
style=
"margin-left: 20px;cursor: pointer;"
@
click=
"handleDelMedia(item, index)"
></i>
</div>
</div>
</div>
<div
class=
"addInfo"
:style=
"
showEchoData
? 'border-top: 1px dashed #dcdfe6;' : ''"
>
<div
class=
"addInfo"
:style=
"
form.welcomeMediaList.length > 0
? 'border-top: 1px dashed #dcdfe6;' : ''"
>
<el-popover
placement=
"top"
trigger=
"click"
>
<ul
class=
"flex flex-wrap"
>
<li
v-for=
"(item, index) in uploadList"
:key=
"index"
:class=
"['uploadListBox', form.welcomeMediaList.length >= 9
? 'disabled' : '']
"
@
click=
"handleUploadList(item, index)"
>
<li
v-for=
"(item, index) in uploadList"
:key=
"index"
:class=
"['uploadListBox', form.welcomeMediaList.length >= 9
|| (index == 5 && publicAccountDisabled) ? 'disabled' : '']"
:style=
"index == 5 ? 'width: 118px;' : ''
"
@
click=
"handleUploadList(item, index)"
>
<i
:class=
"['iconfont-hb3', item.icon]"
style=
"font-size:20px"
></i>
<p>
{{
item
.
title
}}
</p>
<input
type=
"file"
:accept=
"item.fileType"
@
change=
"e => handkeFileChange(e, item)"
class=
"upload-input"
/>
...
...
@@ -45,14 +45,17 @@
</ul>
<div
slot=
"reference"
style=
"cursor: pointer; display: inline-block;"
>
<i
class=
"iconfont-hb3 icontianjiajiahaowubiankuang"
></i>
<p>
添加图片/视频/文件/链接
</p>
<p>
添加图片/视频/文件/链接
/小程序/带参公众号
</p>
</div>
</el-popover>
<p
style=
"font-size:12px;color:#909399"
>
(附件不超过9个,单个大小不超过2M)
</p>
</div>
</el-form-item>
<el-form-item
label=
"使用范围"
required
>
<div
v-if=
"isDefalut"
class=
"scopeContainer"
>
<el-radio
v-model=
"form.defaultWelcomeFlag"
:disabled=
"defaultWelcomeFlag && echoDefaultWelcomeFlag == 0"
:label=
"1"
>
全体成员
</el-radio>
<el-radio
v-model=
"form.defaultWelcomeFlag"
:label=
"0"
>
部分成员
</el-radio>
<span
@
click=
"openScopeDialog"
v-if=
"form.defaultWelcomeFlag == 0"
class=
"color-2f54eb cursor-pointer"
style=
"margin-left:8px;"
>
{{
form
.
suitDepartmentAddList
.
length
?
'修改使用范围'
:
'请选择使用范围'
}}
</span>
<div
class=
"scopeContainer"
v-if=
"form.defaultWelcomeFlag == 1"
>
<div
class=
"wwTag"
>
<span
class=
"font-14 color-2f54eb opacity80 iconfont-hb3 iconqiye-tianchong"
></span>
全体成员
...
...
@@ -66,7 +69,6 @@
<!--
<i
class=
"el-icon-close"
style=
"margin-left: 20px;cursor: pointer;"
></i>
-->
</div>
</div>
<span
@
click=
"openScopeDialog"
class=
"color-2f54eb cursor-pointer"
style=
"margin-left:8px;"
>
{{
form
.
suitDepartmentAddList
.
length
?
'修改使用范围'
:
'请选择使用范围'
}}
</span>
</div>
</el-form-item>
<el-button
type=
"primary"
style=
"margin-left:117px;margin-bottom:20px"
:loading=
"submitbtnLoading"
@
click=
"submit"
>
保存
</el-button>
...
...
@@ -83,10 +85,11 @@
</div>
</div>
<div
class=
"infoListBox"
v-for=
"(item, index) in form.welcomeMediaList"
:key=
"index"
>
<div>
<div
class=
"infoAvatar"
>
<img
src=
"@/assets/head_default.jpg"
/>
</div>
<div
v-if=
"item.mediaType == 1
"
class=
"imgInfo"
>
<div
v-if=
"item.mediaType == 1 || item.mediaType == 7
"
class=
"imgInfo"
>
<img
:src=
"item.mediaUrl"
/>
</div>
<div
v-if=
"item.mediaType == 2"
class=
"videoInfo"
@
click=
"blank(item.mediaUrl)"
>
...
...
@@ -106,7 +109,7 @@
<svg-icon
iconname=
"iconwenjianleixing-lianjie"
size=
"40"
>
</svg-icon>
</div>
</div>
<div
v-if=
"item.mediaType == 5
"
class=
"appletsInfo"
>
<div
v-if=
"item.mediaType == 5 || item.mediaType == 6
"
class=
"appletsInfo"
>
<div
class=
"appletsTitle"
>
{{
item
.
miniProgramName
}}
</div>
<div
class=
"appletsTitle"
style=
"font-size:12px"
>
{{
item
.
mediaTitle
}}
</div>
<img
:src=
"item.mediaUrl"
/>
...
...
@@ -115,6 +118,7 @@
</div>
</div>
</div>
</div>
<el-dialog
title=
"添加公众号"
width=
"585px"
class=
"replay-link-dialog"
:visible
.
sync=
"addReplayDialog"
@
closed=
"onClosed"
>
<el-form
label-position=
"right"
ref=
"form"
:model=
"
{}" label-width="100px" @submit.native.prevent>
<el-form-item
label=
"公众号名称"
>
...
...
@@ -171,6 +175,31 @@
<el-button
type=
"primary"
@
click=
"addSuitDepartment"
>
确认
</el-button>
</div>
</el-dialog>
<el-dialog
title=
"添加小程序"
width=
"600px"
:visible
.
sync=
"appletDialogVisible"
@
closed=
"closeAppletDialog"
>
<div
class=
"admin-tip-body"
>
<div
role=
"alert"
class=
"el-alert el-alert--info"
style=
"width: 550px;"
>
<i
class=
"el-alert__icon el-icon-info"
></i>
<div
class=
"el-alert__content"
>
<p
class=
"el-alert__title"
>
1. 小程序需要在好办后台--企业设置--小程序管理中配置后方可使用
<br
/>
2. 请确保配置的小程序已在企微后台配置好,否则将被企微拦截,导致发送失败;
<br
/>
3. 使用达摩会员小程序才会带有导购参数,建立好友会员关联;
<br
/>
</p>
</div>
</div>
</div>
<el-form
label-position=
"right"
ref=
"form"
:model=
"
{}" label-width="100px" style="margin-top:20px" @submit.native.prevent>
<el-form-item
label=
"小程序配置"
>
<el-select
v-model=
"selectedApple"
style=
"width:458px;"
>
<el-option
v-for=
"item in appTableData"
:key=
"item.miniprogramSettingId"
:label=
"item.miniprogramName"
:value=
"item.miniprogramSettingId"
:disabled=
"handleDiabled(item)"
></el-option>
</el-select>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
""
>
<el-button
@
click=
"closeAppletDialog"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"addApplet"
>
确定
</el-button>
</div>
</el-dialog>
</div>
</div>
</
template
>
...
...
@@ -194,7 +223,8 @@ export default {
welcomeContent
:
'你好,<微信昵称>'
,
welcomeMediaList
:
[],
suitDepartmentAddList
:
[],
suitDepartmentList
:
[]
suitDepartmentList
:
[],
defaultWelcomeFlag
:
0
},
uploadList
:
[
{
...
...
@@ -215,6 +245,14 @@ export default {
{
title
:
'链接'
,
icon
:
'iconlianjie'
},
{
title
:
'小程序'
,
icon
:
'iconxiaochengxu'
},
{
title
:
'带参公众号二维码'
,
icon
:
'icongongzhonghao'
}
],
iconType
:
{
...
...
@@ -222,7 +260,9 @@ export default {
2
:
'iconwenjianleixingshipin'
,
3
:
'iconwenjianleixing-wenjian'
,
4
:
'iconwenjianleixing-lianjie'
,
5
:
'iconwenjianleixing-xiaochengxu'
5
:
'iconwenjianleixing-xiaochengxu'
,
// 小程序
6
:
'iconwenjianleixing-xiaochengxu'
,
// 带参小程序
7
:
'icongongzhonghao1'
// 带参公众号
},
accountName
:
''
,
rules
:
{
...
...
@@ -243,9 +283,13 @@ export default {
btnLoading
:
false
,
submitbtnLoading
:
false
,
selectedTreeData
:
[],
friendSettingType
:
''
,
showTree
:
true
,
isDefalut
:
0
appTableData
:
[],
appletDialogVisible
:
false
,
selectedApple
:
''
,
defaultWelcomeFlag
:
false
,
isNew
:
true
,
echoDefaultWelcomeFlag
:
0
};
},
watch
:
{
...
...
@@ -256,31 +300,24 @@ export default {
}
},
computed
:
{
showEchoData
()
{
let
bool1
=
true
;
let
bool2
=
false
;
if
(
this
.
form
.
welcomeMediaList
&&
this
.
form
.
welcomeMediaList
.
length
&&
this
.
form
.
welcomeMediaList
.
length
==
1
&&
this
.
form
.
welcomeMediaList
[
0
].
mediaType
==
5
)
{
bool1
=
false
;
}
if
(
this
.
form
.
welcomeMediaList
&&
this
.
form
.
welcomeMediaList
.
length
)
{
bool2
=
true
;
publicAccountDisabled
()
{
if
(
this
.
form
.
welcomeMediaList
.
filter
(
item
=>
item
.
mediaType
==
7
).
length
)
{
return
true
;
}
else
{
return
false
;
}
return
bool1
&&
bool2
;
}
},
mounted
()
{
const
that
=
this
;
that
.
$emit
(
'showTab'
,
4
);
this
.
$emit
(
'showTab'
,
4
);
document
.
documentElement
.
style
.
backgroundColor
=
'#f0f2f5'
;
const
{
id
,
type
,
isDefalut
}
=
this
.
$route
.
query
;
const
{
id
}
=
this
.
$route
.
query
;
if
(
id
)
{
that
.
getData
();
this
.
getData
();
this
.
isNew
=
false
;
}
if
(
type
&&
type
==
1
&&
!
id
)
{
this
.
friendSettingType
=
type
;
this
.
getAppData
();
}
this
.
isDefalut
=
isDefalut
;
this
.
getExistDefaultWelcome
();
this
.
getAppleList
();
},
destroyed
()
{
document
.
documentElement
.
style
.
backgroundColor
=
'#fff'
;
...
...
@@ -291,19 +328,57 @@ export default {
multUpload
},
methods
:
{
getAppData
()
{
getExistDefaultWelcome
(
isNew
)
{
getRequest
(
'/haoban-manage3-web/welcome/exist-default-welcome'
,
{
wxEnterpriseId
:
this
.
wxEnterpriseId
}).
then
(
res
=>
{
let
resData
=
res
.
data
;
if
(
resData
.
code
==
0
)
{
this
.
defaultWelcomeFlag
=
res
.
data
.
result
;
if
(
this
.
isNew
)
{
this
.
form
.
defaultWelcomeFlag
=
res
.
data
.
result
?
0
:
1
;
}
}
});
},
handleDiabled
(
val
)
{
console
.
log
(
'handleDiabled'
);
if
(
this
.
form
.
welcomeMediaList
.
filter
(
item
=>
item
.
miniProgramId
&&
item
.
miniProgramId
==
val
.
miniprogramSettingId
).
length
)
{
return
true
;
}
else
{
return
false
;
}
},
addApplet
(
val
)
{
if
(
!
this
.
selectedApple
)
{
this
.
$message
.
error
(
'请选择小程序'
);
return
;
}
const
obj
=
this
.
appTableData
.
filter
(
item
=>
item
.
miniprogramSettingId
==
this
.
selectedApple
)[
0
];
if
(
!
this
.
form
.
welcomeMediaList
.
filter
(
item
=>
item
.
miniProgramId
&&
item
.
miniProgramId
==
obj
.
miniprogramSettingId
).
length
)
{
this
.
form
.
welcomeMediaList
.
push
({
miniProgramName
:
obj
.
miniprogramName
,
mediaType
:
obj
.
miniprogramSettingId
==
6
?
6
:
5
,
mediaUrl
:
obj
.
imageUrl
,
mediaTitle
:
obj
.
mediaTitle
,
miniProgramId
:
obj
.
miniprogramSettingId
});
}
this
.
closeAppletDialog
();
},
closeAppletDialog
()
{
this
.
selectedApple
=
''
;
this
.
appletDialogVisible
=
false
;
},
getAppleList
()
{
// 获取小程序
getRequest
(
'/haoban-manage3-web/list-miniprogram-setting'
,
{})
.
then
(
res
=>
{
let
resData
=
res
.
data
;
if
(
resData
.
errorCode
==
1
&&
resData
.
result
)
{
const
applet
=
resData
.
result
.
length
&&
resData
.
result
[
0
];
this
.
form
.
welcomeMediaList
.
push
({
miniProgramName
:
applet
.
miniprogramName
,
mediaTitle
:
applet
.
title
,
mediaType
:
5
,
mediaUrl
:
applet
.
imageUrl
,
mediaSize
:
''
this
.
appTableData
=
resData
.
result
;
this
.
appTableData
.
push
({
miniprogramName
:
'带参小程序'
,
miniprogramSettingId
:
6
,
mediaTitle
:
'小程序标题'
});
}
})
...
...
@@ -336,8 +411,8 @@ export default {
},
handleSelectedDataCancel
(
item
,
index
)
{
// 删除 右侧 被选中部门树的数据
console
.
log
(
item
);
this
.
$refs
.
tree
.
setChecked
(
item
.
departmentId
,
false
,
true
);
this
.
selectedTreeData
=
this
.
$refs
.
tree
.
getCheckedNodes
();
},
handlefilterTextClear
()
{
// 清空搜索部门树条件
...
...
@@ -387,7 +462,6 @@ export default {
},
handleCheckChange
(
data
,
checked
)
{
// 部门树选中变化时
console
.
log
(
'部门树选中变化时'
,
this
.
selectedTreeData
.
length
);
const
obj
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
if
(
!
checked
)
{
this
.
$nextTick
(()
=>
{
...
...
@@ -456,20 +530,25 @@ export default {
window
.
open
(
url
);
},
handleUploadList
(
item
,
index
)
{
console
.
log
(
item
);
if
([
'图片'
,
'视频'
,
'文件'
].
includes
(
item
.
title
))
{
document
.
getElementsByClassName
(
'upload-input'
)[
index
].
click
();
}
else
if
(
item
.
title
==
'链接'
)
{
this
.
urlDialogVisible
=
true
;
}
else
if
(
item
.
title
==
'小程序'
)
{
this
.
appletDialogVisible
=
true
;
}
else
if
(
item
.
title
==
'带参公众号二维码'
)
{
this
.
form
.
welcomeMediaList
.
push
({
mediaTitle
:
'带参公众号'
,
mediaType
:
7
,
mediaUrl
:
'https://other-1251519181.cos.ap-shanghai.myqcloud.com/haoban/20220310143912/abdf84f1112815e936f3ed4f09dba525.png'
});
}
},
handleDelMedia
(
row
,
index
)
{
this
.
form
.
welcomeMediaList
.
splice
(
index
,
1
);
},
handkeFileChange
(
e
,
item
)
{
console
.
log
(
item
);
const
file
=
e
.
target
.
files
[
0
];
// only use files[0]
console
.
log
(
file
);
let
fileType
=
''
;
if
(
file
.
size
>
2000000
)
{
this
.
$message
.
error
(
'单个大小不超过2M'
);
...
...
@@ -579,9 +658,10 @@ export default {
.
then
(
res
=>
{
let
resData
=
res
.
data
;
if
(
resData
.
code
==
0
&&
resData
.
result
)
{
const
{
suitDepartmentList
,
title
,
welcomeId
,
welcomeContent
,
welcomeMediaList
,
wxEnterpriseId
}
=
resData
.
result
;
this
.
form
=
{
suitDepartmentList
:
suitDepartmentList
||
[],
suitDepartmentAddList
:
JSON
.
parse
(
JSON
.
stringify
(
suitDepartmentList
))
||
[],
title
,
welcomeId
,
welcomeContent
,
welcomeMediaList
,
wxEnterpriseId
};
const
{
suitDepartmentList
,
title
,
welcomeId
,
welcomeContent
,
welcomeMediaList
,
wxEnterpriseId
,
defaultWelcomeFlag
}
=
resData
.
result
;
this
.
form
=
{
suitDepartmentList
:
suitDepartmentList
||
[],
suitDepartmentAddList
:
JSON
.
parse
(
JSON
.
stringify
(
suitDepartmentList
))
||
[],
title
,
welcomeId
,
welcomeContent
,
welcomeMediaList
,
wxEnterpriseId
,
defaultWelcomeFlag
};
this
.
form
=
Object
.
assign
({},
this
.
form
);
this
.
echoDefaultWelcomeFlag
=
defaultWelcomeFlag
;
}
})
.
catch
(
error
=>
{
...
...
@@ -592,14 +672,14 @@ export default {
});
},
submit
()
{
if
(
!
this
.
isDefalut
&&
!
this
.
form
.
suitDepartmentAddList
.
length
)
{
if
(
!
this
.
form
.
defaultWelcomeFlag
&&
!
this
.
form
.
suitDepartmentAddList
.
length
)
{
this
.
$message
.
error
(
'请选择使用范围'
);
return
;
}
this
.
$refs
.
form
.
validate
(
value
=>
{
if
(
value
)
{
const
{
suitDepartmentAddList
,
suitDepartmentList
,
title
,
welcomeId
,
welcomeContent
,
welcomeMediaList
,
wxEnterpriseId
}
=
this
.
form
;
const
para
=
{
title
,
welcomeId
,
welcomeContent
,
welcomeMediaList
,
wxEnterpriseId
:
wxEnterpriseId
||
this
.
wxEnterpriseId
};
const
{
suitDepartmentAddList
,
suitDepartmentList
,
title
,
welcomeId
,
welcomeContent
,
welcomeMediaList
,
wxEnterpriseId
,
defaultWelcomeFlag
}
=
this
.
form
;
const
para
=
{
title
,
welcomeId
,
welcomeContent
,
welcomeMediaList
,
wxEnterpriseId
:
wxEnterpriseId
||
this
.
wxEnterpriseId
,
defaultWelcomeFlag
};
const
addArr
=
[];
const
delArr
=
[];
suitDepartmentAddList
.
forEach
(
ele
=>
{
...
...
@@ -621,7 +701,6 @@ export default {
item
.
selectType
=
1
;
});
console
.
log
(
para
);
para
.
welcomeMediaList
=
para
.
welcomeMediaList
.
filter
(
item
=>
item
.
mediaType
!=
5
);
this
.
submitbtnLoading
=
true
;
postJsonRequest
(
'/haoban-manage3-web/welcome/save'
,
para
)
.
then
(
res
=>
{
...
...
@@ -723,6 +802,7 @@ export default {
max-height
:
500px
;
min-height
:
40px
;
overflow-y
:
auto
;
margin-top
:
10px
;
.wwTag
{
background
:
#ebeffe
;
border-radius
:
4px
;
...
...
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