Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
confucius
Project
Project
Details
Activity
Releases
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
罗超
confucius
Commits
34122328
Commit
34122328
authored
Aug 11, 2021
by
Mac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
74e816eb
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
483 additions
and
160 deletions
+483
-160
applet-form.vue
src/components/enterprise/applet-form.vue
+103
-42
imagetext-form.vue
src/components/enterprise/imagetext-form.vue
+116
-44
selectMaterial.vue
src/components/enterprise/selectMaterial.vue
+154
-53
addWelcome.vue
src/pages/enterprise/addWelcome.vue
+109
-20
welcomeList.vue
src/pages/enterprise/welcomeList.vue
+1
-1
No files found.
src/components/enterprise/applet-form.vue
View file @
34122328
...
...
@@ -61,42 +61,37 @@
<q-card-section
class=
"q-pt-none"
>
<el-form
ref=
"addMsg"
:model=
"addMsg"
label-width=
"120px"
>
<el-form-item
label=
"添加方式:"
>
<q-radio
v-model=
"addMsg.Addtype"
val=
"1"
label=
"新建"
/>
<q-radio
v-model=
"addMsg.Addtype"
val=
"2"
label=
"导入"
/>
<q-radio
v-model=
"Addtype"
val=
"1"
label=
"新建"
/>
<q-radio
v-model=
"Addtype"
val=
"2"
label=
"导入"
/>
</el-form-item>
<div
v-if=
"Addtype ==1 "
>
<el-form-item
label=
"素材分组:"
>
<q-select
filled
stack-label
option-value=
"Id"
option-label=
"Name"
style=
"width: 80%;"
v-model=
"addMsg.MediaGroupId"
ref=
"Id"
:options=
"classifyList"
label=
"分组"
:dense=
"false"
emit-value
map-options
/>
</el-form-item>
<div
v-if=
"addMsg.Addtype ==1 "
>
<el-form-item
label=
"图片封面:"
required
>
<div
class=
"up-box"
@
click=
"selectimg(2)"
>
<span
v-if=
"addMsg.
CoverImage
==''"
>
+
</span>
<q-img
v-else
:src=
"addMsg.
CoverImage
"
style=
"width: 100%;height: 100%;display: flex;"
>
<span
v-if=
"addMsg.
AppletModel.ImagePath
==''"
>
+
</span>
<q-img
v-else
:src=
"addMsg.
AppletModel.ImagePath
"
style=
"width: 100%;height: 100%;display: flex;"
>
</q-img>
</div>
</el-form-item>
<el-form-item
label=
"添加标题:"
required
>
<q-input
clearable
standout=
"bg-primary text-white"
v-model=
"addMsg.title"
label=
"标题"
style=
"width: 80%;"
/>
<q-input
clearable
standout=
"bg-primary text-white"
filled
v-model=
"addMsg.AppletModel.Title"
label=
"标题"
style=
"width: 80%;"
:rules=
"[val => !!val || '请输入标题']"
/>
</el-form-item>
<el-form-item
label=
"AppID:"
required
>
<q-input
clearable
standout=
"bg-primary text-white"
v-model=
"addMsg.AppID"
label=
"请填写小程序AppID,必须是关联到企业的小程序应用"
style=
"width: 80%;"
/>
<q-input
clearable
standout=
"bg-primary text-white"
filled
v-model=
"addMsg.AppletModel.AppletId"
label=
"请填写小程序AppID,必须是关联到企业的小程序应用"
style=
"width: 80%;"
:rules=
"[val => !!val || '请输入小程序ID']"
/>
</el-form-item>
<el-form-item
label=
"page路径:"
required
>
<q-input
clearable
standout=
"bg-primary text-white"
v-model=
"addMsg.link"
label=
"请填写小程序路径,例如:pages/index"
style=
"width: 80%;"
/>
<q-input
clearable
standout=
"bg-primary text-white"
filled
v-model=
"addMsg.AppletModel.Page"
label=
"请填写小程序路径,例如:pages/index"
style=
"width: 80%;"
:rules=
"[val => !!val || '请输入路径']"
/>
</el-form-item>
<el-form-item
label=
"素材同步:"
>
<div
class=
"q-gutter-sm"
style=
"align-items: flex-start;display: flex;"
>
<q-radio
v-model=
"addMsg.issynchro"
val=
"2"
label=
"不同步"
/>
<q-radio
v-model=
"addMsg.issynchro"
val=
"1"
label=
"同步至【内容引擎】"
/>
<div
v-if=
"addMsg.issynchro==1"
style=
"width: 200px;"
>
<q-select
filled
stack-label
option-value=
"ID"
option-label=
"Name"
v-model=
"addMsg.classifyId"
ref=
"ID"
:options=
"classifyList"
label=
"分类"
:dense=
"false"
emit-value
map-options
/>
</div>
</div>
</el-form-item>
</div>
<div
v-if=
"
addMsg.
Addtype ==2 "
>
<div
v-if=
"Addtype ==2 "
>
<el-form-item
label=
"小程序:"
required
>
<q-btn
color=
"accent"
class=
"q-mr-md"
label=
"选择小程序"
@
click=
"selectimg(
4
)"
/>
<q-btn
color=
"accent"
class=
"q-mr-md"
label=
"选择小程序"
@
click=
"selectimg(
6
)"
/>
</el-form-item>
</div>
...
...
@@ -106,12 +101,12 @@
<q-separator
/>
<q-card-actions
align=
"right"
class=
"bg-white"
>
<q-btn
class=
"q-mr-md"
label=
"取消"
@
click=
"closeEditOrder"
/>
<q-btn
color=
"accent"
class=
"q-mr-md"
label=
"
保存
"
@
click=
"saveOrderInfo()"
/>
<q-btn
color=
"accent"
class=
"q-mr-md"
label=
"
确定
"
@
click=
"saveOrderInfo()"
/>
</q-card-actions>
</q-card>
</q-dialog>
<!-- 图片 -->
<selectMaterial
v-if=
"isshowselectMaterial"
:materialType=
"materialType"
:saveobj=
'Selectobj'
<selectMaterial
v-if=
"isshowselectMaterial"
:materialType=
"materialType"
:saveobj=
'Selectobj'
:classifyList=
'classifyList'
@
close=
"getclose()"
@
success=
'getsuccess'
>
</selectMaterial>
</div>
...
...
@@ -121,6 +116,9 @@
import
{
UploadSelfFile
}
from
"../../api/common/common"
;
//上传图片
import
{
setWeChatMediumInfo
,
//新增素材
}
from
'../../api/system/wechat'
;
import
selectMaterial
from
"./selectMaterial"
export
default
{
...
...
@@ -129,6 +127,10 @@
type
:
Object
,
default
:
null
,
},
classifyList
:
{
type
:
Array
,
default
:
[],
},
},
components
:
{
selectMaterial
,
...
...
@@ -136,30 +138,28 @@
data
()
{
return
{
IsShow
:
true
,
Addtype
:
"1"
,
//添加方式 1为新建
addMsg
:
{
Addtype
:
'1'
,
//添加方式 1为新建
CoverImage
:
''
,
title
:
''
,
Content
:
''
,
issynchro
:
'1'
,
classifyId
:
''
,
AppID
:
''
,
link
:
''
,
Id
:
0
,
Type
:
6
,
Is_Sync
:
1
,
MediaGroupId
:
''
,
AppletModel
:{
AppletId
:
''
,
Page
:
''
,
Title
:
''
,
ImageName
:
''
,
ImagePath
:
''
,
}
},
materialType
:
2
,
Selectobj
:
{},
isshowselectMaterial
:
false
,
classifyList
:[
{
Name
:
'活动'
,
ID
:
1
,},
{
Name
:
'产品'
,
ID
:
2
,},
{
Name
:
'校园'
,
ID
:
3
,},
],
}
},
created
()
{
if
(
JSON
.
stringify
(
this
.
saveobj
)
!==
'{}'
)
{
this
.
addMsg
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
saveobj
))
}
},
mounted
()
{
...
...
@@ -180,15 +180,76 @@
this
.
isshowselectMaterial
=
false
},
getsuccess
(
data
)
{
//选择数据回来
this
.
Selectobj
=
data
if
(
this
.
materialType
==
2
){
this
.
addMsg
.
AppletModel
.
ImageName
=
data
.
ImageModel
.
ImageName
this
.
addMsg
.
AppletModel
.
ImagePath
=
data
.
ImageModel
.
ImagePath
}
else
{
this
.
$emit
(
'success'
,
data
)
}
this
.
addMsg
.
CoverImage
=
data
.
img
this
.
isshowselectMaterial
=
false
},
saveOrderInfo
(){
this
.
$emit
(
'success'
,
this
.
addMsg
)
setWeChat
(){
setWeChatMediumInfo
(
this
.
addMsg
).
then
(
res
=>
{
this
.
$q
.
notify
({
icon
:
'iconfont icon-chenggong'
,
color
:
'accent'
,
timeout
:
2000
,
message
:
'操作成功'
,
position
:
'top'
})
this
.
Selectobj
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
addMsg
))
this
.
Selectobj
.
Id
=
res
.
Data
this
.
$emit
(
'success'
,
this
.
Selectobj
)
})
},
saveOrderInfo
()
{
//小程序
if
(
this
.
addMsg
.
MediaGroupId
==
''
)
{
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`请选择分组选择`
,
position
:
'top'
})
return
}
if
(
this
.
addMsg
.
AppletModel
.
ImagePath
==
''
)
{
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`请填写上传图片`
,
position
:
'top'
})
return
}
if
(
this
.
addMsg
.
AppletModel
.
AppletId
==
''
)
{
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`请填写小程序ID`
,
position
:
'top'
})
return
}
if
(
this
.
addMsg
.
AppletModel
.
Page
==
''
)
{
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`请填写路径`
,
position
:
'top'
})
return
}
if
(
this
.
addMsg
.
AppletModel
.
Title
==
''
)
{
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`请填写小程序标题`
,
position
:
'top'
})
return
}
this
.
setWeChat
()
},
...
...
src/components/enterprise/imagetext-form.vue
View file @
34122328
...
...
@@ -61,39 +61,41 @@
<q-card-section
class=
"q-pt-none"
>
<el-form
ref=
"addMsg"
:model=
"addMsg"
label-width=
"120px"
>
<el-form-item
label=
"添加方式:"
>
<q-radio
v-model=
"addMsg.Addtype"
val=
"1"
label=
"新建"
/>
<q-radio
v-model=
"addMsg.Addtype"
val=
"2"
label=
"导入"
/>
<q-radio
v-model=
"Addtype"
val=
"1"
label=
"新建"
/>
<q-radio
v-model=
"Addtype"
val=
"2"
label=
"导入"
/>
</el-form-item>
<div
v-if=
"Addtype ==1 "
>
<el-form-item
label=
"分组:"
>
<q-select
filled
stack-label
option-value=
"Id"
option-label=
"Name"
style=
"width: 80%;"
v-model=
"addMsg.MediaGroupId"
ref=
"Id"
:options=
"classifyList"
label=
"分组"
:dense=
"false"
emit-value
map-options
/>
</el-form-item>
<div
v-if=
"addMsg.Addtype ==1 "
>
<el-form-item
label=
"图片封面:"
required
>
<div
class=
"up-box"
@
click=
"selectimg(2)"
>
<span
v-if=
"addMsg.CoverImage==''"
>
+
</span>
<q-img
v-else
:src=
"addMsg.CoverImage"
style=
"width: 100%;height: 100%;display: flex;"
>
<span
v-if=
"addMsg.ImgTextModel.ImgPath==''"
>
+
</span>
<q-img
v-else
:src=
"addMsg.ImgTextModel.ImgPath"
style=
"width: 100%;height: 100%;display: flex;"
>
</q-img>
</div>
</el-form-item>
<el-form-item
label=
"添加标题:"
required
>
<q-input
clearable
standout=
"bg-primary text-white"
v-model=
"addMsg.title"
label=
"标题"
style=
"width: 80%;"
/>
</el-form-item>
<el-form-item
label=
"添加描述:"
>
<q-input
v-model=
"addMsg.Content"
filled
clearable
type=
"textarea"
label=
"文本内容"
style=
"width: 80%;"
/>
</el-form-item>
<el-form-item
label=
"素材同步:"
>
<div
class=
"q-gutter-sm"
style=
"align-items: flex-start;display: flex;"
>
<q-radio
v-model=
"addMsg.issynchro"
val=
"2"
label=
"不同步"
/>
<q-radio
v-model=
"addMsg.issynchro"
val=
"1"
label=
"同步至【内容引擎】"
/>
<div
v-if=
"addMsg.issynchro==1"
style=
"width: 200px;"
>
<q-select
filled
stack-label
option-value=
"ID"
option-label=
"Name"
v-model=
"addMsg.classifyId"
ref=
"ID"
:options=
"classifyList"
label=
"分类"
:dense=
"false"
emit-value
map-options
/>
</div>
</div>
<q-input
clearable
standout=
"bg-primary text-white"
filled
v-model=
"addMsg.ImgTextModel.Title"
label=
"标题"
style=
"width: 80%;"
:rules=
"[val => !!val || '请输入标题']"
/>
</el-form-item>
<el-form-item
label=
"点击链接:"
required
>
<q-input
clearable
standout=
"bg-primary text-white"
v-model=
"addMsg.link"
label=
"请输入跳转链接,且必须以http://或https://开头"
style=
"width: 80%;"
/>
<q-input
clearable
standout=
"bg-primary text-white"
filled
v-model=
"addMsg.ImgTextModel.ImgLink"
label=
"请输入跳转链接,且必须以http://或https://开头"
style=
"width: 80%;"
:rules=
"[ val => !!val || '请输入跳转链接']"
/>
</el-form-item>
<el-form-item
label=
"添加描述:"
>
<q-input
v-model=
"addMsg.ImgTextModel.Description"
filled
clearable
type=
"textarea"
label=
"文本内容"
style=
"width: 80%;"
/>
</el-form-item>
</div>
<div
v-if=
"
addMsg.
Addtype ==2 "
>
<div
v-if=
"Addtype ==2 "
>
<el-form-item
label=
"图片:"
required
>
<q-btn
color=
"accent"
class=
"q-mr-md"
label=
"选择图文"
@
click=
"selectimg(3)"
/>
</el-form-item>
...
...
@@ -105,12 +107,12 @@
<q-separator
/>
<q-card-actions
align=
"right"
class=
"bg-white"
>
<q-btn
class=
"q-mr-md"
label=
"取消"
@
click=
"closeEditOrder"
/>
<q-btn
color=
"accent"
class=
"q-mr-md"
label=
"
保存
"
@
click=
"saveOrderInfo()"
/>
<q-btn
color=
"accent"
class=
"q-mr-md"
label=
"
确定
"
@
click=
"saveOrderInfo()"
/>
</q-card-actions>
</q-card>
</q-dialog>
<!-- 图片 -->
<selectMaterial
v-if=
"isshowselectMaterial"
:materialType=
"materialType"
:
saveobj=
'Selectobj
'
<selectMaterial
v-if=
"isshowselectMaterial"
:materialType=
"materialType"
:
classifyList=
'classifyList
'
@
close=
"getclose()"
@
success=
'getsuccess'
>
</selectMaterial>
</div>
...
...
@@ -120,6 +122,9 @@
import
{
UploadSelfFile
}
from
"../../api/common/common"
;
//上传图片
import
{
setWeChatMediumInfo
,
//新增素材
}
from
'../../api/system/wechat'
;
import
selectMaterial
from
"./selectMaterial"
export
default
{
...
...
@@ -128,6 +133,10 @@
type
:
Object
,
default
:
null
,
},
classifyList
:
{
type
:
Array
,
default
:
[],
},
},
components
:
{
selectMaterial
,
...
...
@@ -135,29 +144,28 @@
data
()
{
return
{
IsShow
:
true
,
Addtype
:
"1"
,
//添加方式 1为新建
addMsg
:
{
Addtype
:
'1'
,
//添加方式 1为新建
CoverImage
:
''
,
title
:
''
,
Content
:
''
,
issynchro
:
'1'
,
classifyId
:
''
,
link
:
''
,
Id
:
0
,
Type
:
3
,
Is_Sync
:
1
,
MediaGroupId
:
''
,
ImgTextModel
:
{
ImgName
:
''
,
ImgPath
:
''
,
Title
:
''
,
Description
:
''
,
ImgLink
:
''
,
}
},
materialType
:
2
,
Selectobj
:
{},
isshowselectMaterial
:
false
,
classifyList
:[
{
Name
:
'活动'
,
ID
:
1
,},
{
Name
:
'产品'
,
ID
:
2
,},
{
Name
:
'校园'
,
ID
:
3
,},
],
}
},
created
()
{
if
(
JSON
.
stringify
(
this
.
saveobj
)
!==
'{}'
)
{
this
.
addMsg
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
saveobj
))
}
},
mounted
()
{
...
...
@@ -178,13 +186,77 @@
this
.
isshowselectMaterial
=
false
},
getsuccess
(
data
)
{
//选择数据回来
this
.
Selectobj
=
data
this
.
addMsg
.
CoverImage
=
data
.
img
console
.
log
(
data
)
if
(
this
.
materialType
==
2
){
this
.
addMsg
.
ImgTextModel
.
ImgName
=
data
.
ImageModel
.
ImageName
this
.
addMsg
.
ImgTextModel
.
ImgPath
=
data
.
ImageModel
.
ImagePath
}
else
{
this
.
$emit
(
'success'
,
data
)
}
this
.
isshowselectMaterial
=
false
},
saveOrderInfo
(){
this
.
$emit
(
'success'
,
this
.
addMsg
)
saveOrderInfo
()
{
//图文提交
if
(
this
.
addMsg
.
MediaGroupId
==
''
)
{
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`请选择分组选择`
,
position
:
'top'
})
return
}
if
(
this
.
addMsg
.
ImgTextModel
.
ImgPath
==
''
)
{
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`请上传图片`
,
position
:
'top'
})
return
}
if
(
this
.
addMsg
.
ImgTextModel
.
Title
==
''
)
{
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`请填写标题`
,
position
:
'top'
})
return
}
if
(
this
.
addMsg
.
ImgTextModel
.
ImgLink
==
''
)
{
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`请填写跳转链接`
,
position
:
'top'
})
return
}
var
Expression
=
/http
(
s
)?
:
\/\/([\w
-
]
+
\.)
+
[\w
-
]
+
(\/[\w
- .
\/
?%&=
]
*
)?
/
;
var
objExp
=
new
RegExp
(
Expression
);
if
(
objExp
.
test
(
this
.
addMsg
.
ImgTextModel
.
ImgLink
))
{
// plus.runtime.openWeb(this.link)
}
else
{
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`上传的链接开头非http或https`
,
position
:
'top'
})
return
}
this
.
setWeChat
()
},
setWeChat
()
{
setWeChatMediumInfo
(
this
.
addMsg
).
then
(
res
=>
{
this
.
$q
.
notify
({
icon
:
'iconfont icon-chenggong'
,
color
:
'accent'
,
timeout
:
2000
,
message
:
'操作成功'
,
position
:
'top'
})
this
.
Selectobj
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
addMsg
))
this
.
Selectobj
.
Id
=
res
.
Data
this
.
$emit
(
'success'
,
this
.
Selectobj
)
})
}
...
...
src/components/enterprise/selectMaterial.vue
View file @
34122328
<
style
>
.selectMaterial
.imgstyle
{
width
:
100%
;
height
:
126px
;
...
...
@@ -27,7 +23,8 @@
border
:
1px
dashed
#d9d9d9
;
line-height
:
118px
;
}
.selectMaterial
.onetext
{
.selceimg
.onetext
{
overflow
:
hidden
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
...
...
@@ -51,7 +48,7 @@
<div
class=
"col row wrap q-mr-lg q-col-gutter-md"
style=
"margin-top: 0;"
>
<div
class=
"col-4"
>
<q-select
filled
stack-label
@
input=
"resetSearch"
option-value=
"Id"
option-label=
"Name"
v-model=
"msg.MediaGroupId"
ref=
"Id"
:options=
"
classify
List"
label=
"分组"
:dense=
"false"
emit-value
v-model=
"msg.MediaGroupId"
ref=
"Id"
:options=
"
xiala
List"
label=
"分组"
:dense=
"false"
emit-value
map-options
/>
</div>
<div
class=
"col-4"
>
...
...
@@ -65,13 +62,28 @@
</div>
<div
class=
"q-pa-md"
>
<div
class=
"q-col-gutter-md row items-start"
v-if=
"data.length>0"
>
<div
class=
"col-2"
v-for=
"(x,y) in data"
@
click=
"Selectobj = x"
>
<q-img
:src=
"x.ImageModel.ImagePath"
class=
"imgstyle"
v-if=
"x.Type==2"
:style=
"
{border:x.Id == Selectobj.Id?'2px solid #91d5ff':'2px solid #FFF'}">
<div
class=
"absolute-bottom text-subtitle1 text-center onetext"
style=
"padding: 0;padding: 0 5px;font-size: 12px;"
>
<div
class=
"col-2 selceimg"
v-for=
"(x,y) in data"
@
click=
"Selectobj = x"
>
<q-img
v-if=
"x.Type==2"
:src=
"x.ImageModel.ImagePath"
class=
"imgstyle"
:style=
"
{border:x.Id == Selectobj.Id?'3px solid #91d5ff':'3px solid #FFF'}">
<div
class=
"absolute-bottom text-subtitle1 text-center onetext"
style=
"padding: 0;padding: 0 5px;font-size: 12px;"
>
{{
x
.
ImageModel
.
ImageName
}}
</div>
</q-img>
<q-img
v-if=
"x.Type==3 && x.ImgTextModel"
:src=
"x.ImgTextModel.ImgPath"
class=
"imgstyle"
:style=
"
{border:x.Id == Selectobj.Id?'3px solid #91d5ff':'3px solid #FFF'}">
<div
class=
"absolute-bottom text-subtitle1 text-center onetext"
style=
"padding: 0;padding: 0 5px;font-size: 12px;"
>
{{
x
.
ImgTextModel
.
Title
}}
</div>
</q-img>
<q-img
v-if=
"x.Type==6 && x.AppletModel"
:src=
"x.AppletModel.ImagePath"
class=
"imgstyle"
:style=
"
{border:x.Id == Selectobj.Id?'3px solid #91d5ff':'3px solid #FFF'}">
<div
class=
"absolute-bottom text-subtitle1 text-center onetext"
style=
"padding: 0;padding: 0 5px;font-size: 12px;"
>
{{
x
.
AppletModel
.
Title
}}
</div>
</q-img>
</div>
<q-pagination
class=
"full-width justify-end"
v-model=
"msg.pageIndex"
color=
"primary"
:max=
"pageCount"
:input=
"true"
@
input=
"changePage"
/>
...
...
@@ -87,7 +99,7 @@
<q-separator
/>
<q-card-actions
align=
"right"
class=
"bg-white"
>
<q-btn
class=
"q-mr-md"
label=
"取消"
@
click=
"closeEditOrder"
/>
<q-btn
color=
"accent"
class=
"q-mr-md"
label=
"
保存
"
@
click=
"saveOrderInfo()"
/>
<q-btn
color=
"accent"
class=
"q-mr-md"
label=
"
确定
"
@
click=
"saveOrderInfo()"
/>
</q-card-actions>
</q-card>
</q-dialog>
...
...
@@ -98,29 +110,27 @@
</q-card-section>
<q-separator
/>
<q-card-section
class=
"q-pt-none"
style=
"margin-top: 15px;height: 300px;"
>
<el-form
ref=
"localMsg"
:model=
"localMsg"
label-width=
"120px"
>
<el-form
ref=
"localMsg"
:model=
"localMsg"
label-width=
"120px"
v-if=
"materialType==2 "
>
<el-form-item
label=
"素材分组:"
>
<div
class=
"q-gutter-sm"
style=
"align-items: flex-start;display: flex;"
>
<div
style=
"width: 400px;"
>
<q-select
filled
stack-label
option-value=
"Id"
option-label=
"Name"
v-model=
"localMsg.MediaGroupId"
ref=
"Id"
:options=
"classifyList"
label=
"分组"
:dense=
"false"
emit-value
map-options
/>
</div>
</div>
</el-form-item>
<el-form-item
label=
"上传图片:"
>
<el-upload
class=
"avatar-uploader addDutyMain"
action=
""
:before-upload=
"uploadFile"
:show-file-list=
"false"
>
<i
class=
"el-icon-plus avatar-uploader-icon"
v-if=
"localMsg.
img
==''"
></i>
<q-img
v-else
:src=
"localMsg.
img
"
style=
"width: 100%;height: 100%;border-radius: 6px;display: flex;"
>
<i
class=
"el-icon-plus avatar-uploader-icon"
v-if=
"localMsg.
ImageModel.ImagePath
==''"
></i>
<q-img
v-else
:src=
"localMsg.
ImageModel.ImagePath
"
style=
"width: 100%;height: 100%;border-radius: 6px;display: flex;"
>
</q-img>
</el-upload>
<div>
(图片大小不超过2M,支持JPG、JPEG及PNG格式)
</div>
</el-form-item>
<el-form-item
label=
"素材同步:"
>
<div
class=
"q-gutter-sm"
style=
"align-items: flex-start;display: flex;"
>
<q-radio
v-model=
"localMsg.issynchro"
val=
"2"
label=
"不同步"
/>
<q-radio
v-model=
"localMsg.issynchro"
val=
"1"
label=
"同步至【内容引擎】"
/>
<div
v-if=
"localMsg.issynchro==1"
style=
"width: 200px;"
>
<q-select
filled
stack-label
option-value=
"ID"
option-label=
"Name"
v-model=
"localMsg.classifyId"
ref=
"ID"
:options=
"classifyList"
label=
"分类"
:dense=
"false"
emit-value
map-options
/>
</div>
</div>
</el-form-item>
</el-form>
</q-card-section>
<q-separator
/>
...
...
@@ -142,13 +152,11 @@
getMediumTypeEnumList
,
getWeChatMediumGroupList
,
getWeChatMediumPageList
,
//素材列表
setWeChatMediumInfo
,
//新增素材
}
from
'../../api/system/wechat'
;
export
default
{
props
:
{
saveobj
:
{
type
:
Object
,
default
:
null
,
},
materialType
:
{
type
:
Number
,
default
:
1
...
...
@@ -174,22 +182,27 @@
},
data
:
[],
pageCount
:
0
,
Selectobj
:
null
,
Selectobj
:
{
Id
:
0
}
,
localMsg
:
{
//本地上传对象
img
:
''
,
issynchro
:
'1'
,
//是否同步 1是
classifyID
:
0
,
//同步的时候的分类id
}
Id
:
0
,
Type
:
0
,
Is_Sync
:
1
,
MediaGroupId
:
''
,
},
xialaList
:
[],
}
},
created
()
{
this
.
Selectobj
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
saveobj
))
this
.
msg
.
Type
=
this
.
materialType
;
let
obj
=
{
Id
:
0
,
Name
:
'全部'
this
.
gettype
()
let
obj
=
{
Id
:
0
,
Name
:
'全部'
}
this
.
classifyList
=
this
.
classifyList
.
unshift
(
obj
)
let
data
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
classifyList
))
data
.
unshift
(
obj
)
this
.
xialaList
=
data
this
.
getList
()
},
mounted
()
{
...
...
@@ -199,6 +212,34 @@
},
methods
:
{
gettype
()
{
this
.
localMsg
.
Type
=
this
.
materialType
;
this
.
localMsg
.
Id
=
0
;
this
.
localMsg
.
Is_Sync
=
1
;
this
.
localMsg
.
MediaGroupId
=
''
;
if
(
this
.
materialType
==
2
)
{
//图片
this
.
localMsg
.
ImageModel
=
{
ImageName
:
''
,
ImagePath
:
''
};
}
else
if
(
this
.
materialType
==
3
)
{
//图文
this
.
localMsg
.
ImgTextModel
=
{
ImgName
:
''
,
ImgPath
:
''
,
Title
:
''
,
Description
:
''
,
ImgLink
:
''
,
};
}
else
if
(
this
.
materialType
==
6
)
{
//小程序
this
.
localMsg
.
AppletModel
=
{
AppletId
:
''
,
Page
:
''
,
Title
:
''
,
ImageName
:
''
,
ImagePath
:
''
,
};
}
},
//关闭弹窗
closeEditOrder
()
{
// this.IsShowEditOrder = false;
...
...
@@ -210,7 +251,7 @@
this
.
loading
=
false
this
.
data
=
res
.
Data
.
PageData
;
this
.
pageCount
=
res
.
Data
.
PageCount
this
.
data
List
.
forEach
(
x
=>
{
this
.
data
.
forEach
(
x
=>
{
x
.
check
=
false
})
...
...
@@ -226,7 +267,7 @@
this
.
getList
()
},
saveOrderInfo
()
{
//保存返回数据
if
(
JSON
.
stringify
(
this
.
Selectobj
)
==
"{}"
)
{
if
(
this
.
Selectobj
.
Id
==
0
)
{
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`还未选择`
,
...
...
@@ -243,13 +284,73 @@
savelocal
()
{
//本地上传操作
//这里做上传操作 刷新列表
setWeChatMediumInfo
(
this
.
localMsg
).
then
(
res
=>
{
this
.
$q
.
notify
({
icon
:
'iconfont icon-chenggong'
,
color
:
'accent'
,
timeout
:
2000
,
message
:
'操作成功'
,
position
:
'top'
})
this
.
Selectobj
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
localMsg
))
this
.
Selectobj
.
Id
=
res
.
Data
this
.
$emit
(
'success'
,
this
.
Selectobj
)
this
.
gettype
()
})
},
uploadFile
(
files
)
{
UploadSelfFile
(
"course"
,
files
,
res
=>
{
uploadFile
(
files
)
{
//图片上传
if
(
this
.
materialType
==
2
||
this
.
materialType
==
3
||
this
.
materialType
==
6
)
{
//图文和图片、小程序的时候处理
let
types
=
[
'image/jpeg'
,
'image/jpg'
,
'image/png'
];
const
isImage
=
types
.
includes
(
files
.
type
);
if
(
this
.
materialType
==
2
||
this
.
materialType
==
3
)
{
const
isLtSize
=
files
.
size
/
1024
/
1024
<
2
;
if
(
!
isLtSize
)
{
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`上传图片大小不能超过 2MB!`
,
position
:
'top'
})
return
false
;
}
}
else
{
const
isLtSize
=
files
.
size
/
1024
/
1024
<
1
;
if
(
!
isLtSize
)
{
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`上传图片大小不能超过 1MB!`
,
position
:
'top'
})
return
false
;
}
}
if
(
!
isImage
)
{
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`上传图片只能是 JPG、JPEG、PNG 格式!`
,
position
:
'top'
})
}
else
{
wechatUploadSelfFile
(
'wechatcatalogue'
,
files
,
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
localMsg
.
img
=
res
.
FileUrl
;
if
(
this
.
materialType
==
2
)
{
this
.
localMsg
.
ImageModel
.
ImageName
=
res
.
FileName
;
this
.
localMsg
.
ImageModel
.
ImagePath
=
res
.
FileUrl
;
}
else
if
(
this
.
materialType
==
3
)
{
this
.
localMsg
.
ImgTextModel
.
ImgName
=
res
.
FileName
;
this
.
localMsg
.
ImgTextModel
.
ImgPath
=
res
.
FileUrl
;
}
else
{
this
.
localMsg
.
AppletModel
.
ImageName
=
res
.
FileName
;
this
.
localMsg
.
AppletModel
.
ImagePath
=
res
.
FileUrl
;
}
});
this
.
$forceUpdate
();
}
})
}
}
},
...
...
src/pages/enterprise/addWelcome.vue
View file @
34122328
...
...
@@ -56,6 +56,37 @@
{{
addMsg
.
Content
}}
</div>
</div>
<div
style=
"display: flex;align-items: flex-start;margin-top: 15px;"
v-for=
"(item,index) in MediumModel"
:key=
"index"
>
<i
class=
"el-icon-user"
style=
"margin-right:20px;font-size: 40px;color: #1890ff;"
></i>
<div
v-if=
"item.Type==2"
style=
"width: 1px; flex:1;"
>
<q-img
:src=
"item.ImageModel.ImagePath"
style=
"width: 70%;"
>
</q-img>
</div>
<div
v-if=
"item.Type==3"
style=
"width: 1px; flex:1;padding: 10px 15px; border: 1px solid #eee; border-radius: 4px; background: #fff;"
>
<div>
{{
item
.
ImgTextModel
.
Title
}}
</div>
<div
style=
"display: flex;align-items: flex-start;justify-content: space-between;"
>
<div
style=
"width: 1px;flex:1"
>
{{
item
.
ImgTextModel
.
Description
}}
</div>
<q-img
:src=
"item.ImgTextModel.ImgPath"
style=
"width: 80px;height: 80px;margin-left: 10px;"
>
</q-img>
</div>
</div>
<div
v-if=
"item.Type==6"
style=
"width: 70%;padding: 10px 15px; border: 1px solid #eee; border-radius: 4px; background: #fff;"
>
<div>
{{
item
.
AppletModel
.
Title
}}
</div>
<q-img
:src=
"item.AppletModel.ImagePath"
style=
"width: 100%;"
>
</q-img>
</div>
</div>
</div>
</div>
<div
class=
"box_r"
>
...
...
@@ -87,8 +118,9 @@
<div
v-if=
"MediumModel.length>0"
>
<div
class=
"row items-center"
v-for=
"(x,y) in MediumModel"
:key=
"y"
>
<i
class=
"el-icon-link"
></i>
<span
style=
"margin-left: 10px;cursor: pointer;"
@
click=
"selectimg"
>
{{
Selectobj
.
name
}}
</span>
<i
style=
"margin-left: 10px;cursor: pointer"
class=
"el-icon-close"
@
click=
"Selectobj=
{}">
</i>
<span
style=
"margin-left: 10px;cursor: pointer;"
>
{{
getType
(
x
,
'title'
)
}}
</span>
<i
style=
"margin-left: 10px;cursor: pointer"
class=
"el-icon-close"
@
click=
"deleteModel(y)"
></i>
</div>
</div>
...
...
@@ -108,7 +140,8 @@
</el-form-item>
</el-form>
<q-card-actions
align=
"left"
class=
"bg-white"
style=
"margin-top: 15px;"
>
<q-btn
color=
"accent"
class=
"q-mr-md"
label=
"保存"
@
click=
"savemove()"
style=
"width: 100px;"
:loading=
"loading"
/>
<q-btn
color=
"accent"
class=
"q-mr-md"
label=
"保存"
@
click=
"savemove()"
style=
"width: 100px;"
:loading=
"loading"
/>
<q-btn
class=
"q-mr-md"
label=
"返回"
@
click=
"goblck()"
style=
"width: 60px;"
/>
</q-card-actions>
</div>
...
...
@@ -139,14 +172,13 @@
</div>
</el-dialog>
<!-- 图片 -->
<selectMaterial
v-if=
"isshowselectMaterial"
:materialType=
"materialType"
:
saveobj=
'Selectobj'
:
classifyList=
'classifyList'
<selectMaterial
v-if=
"isshowselectMaterial"
:materialType=
"materialType"
:classifyList=
'classifyList'
@
close=
"getclose()"
@
success=
'getsuccess'
>
</selectMaterial>
<!-- 图文 -->
<imagetextform
v-if=
"isshowimagetext"
:saveobj=
'Selectobj'
@
close=
"gettwclose()"
@
success=
'gettwsuccess'
>
</imagetextform>
<imagetextform
v-if=
"isshowimagetext"
@
close=
"gettwclose()"
@
success=
'gettwsuccess'
:classifyList=
'classifyList'
></imagetextform>
<!-- 小程序 -->
<appletform
v-if=
"isshowapplet"
:saveobj=
'Selectobj'
@
close=
"getxcxclose()"
@
success=
'getxcxsuccess
'
>
<appletform
v-if=
"isshowapplet"
@
close=
"getxcxclose()"
@
success=
'getxcxsuccess'
:classifyList=
'classifyList
'
>
</appletform>
</div>
</
template
>
...
...
@@ -179,7 +211,7 @@
outerVisible
:
false
,
//选择人员弹窗
filterText
:
''
,
//人员选择 帅选
memberList
:
[],
//
allmemberList
:[],
allmemberList
:
[],
showMember
:
[],
membertype
:
'1'
,
ryList
:
[],
...
...
@@ -198,9 +230,8 @@
isshowselectMaterial
:
false
,
isshowimagetext
:
false
,
isshowapplet
:
false
,
Selectobj
:
{},
//选中对象
MediumModel
:[],
classifyList
:[],
MediumModel
:
[],
//已选的添加内容
classifyList
:
[],
}
},
created
()
{
...
...
@@ -219,7 +250,7 @@
queryEmployee
({}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
memberList
=
res
.
Data
;
this
.
allmemberList
=
JSON
.
parse
(
JSON
.
stringify
(
res
.
Data
))
;
this
.
allmemberList
=
JSON
.
parse
(
JSON
.
stringify
(
res
.
Data
));
}
}).
catch
(()
=>
{
...
...
@@ -258,7 +289,7 @@
if
(
!
value
)
return
true
;
return
data
.
DepartmentName
.
indexOf
(
value
)
!==
-
1
;
},
getmemlist
(){
getmemlist
()
{
if
(
this
.
filterText
===
''
)
{
this
.
memberList
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
allmemberList
))
}
else
{
...
...
@@ -285,9 +316,34 @@
},
getsuccess
(
data
)
{
//选择数据回来
this
.
Selectobj
=
data
this
.
ISidentical
(
data
)
this
.
isshowselectMaterial
=
false
},
ISidentical
(
data
){
//返回来的数据进行判断再添加
if
(
this
.
MediumModel
.
length
>
0
){
let
isyes
=
false
this
.
MediumModel
.
map
(
x
=>
{
if
(
x
.
Id
==
data
.
Id
){
isyes
=
true
;
return
}
})
if
(
isyes
==
false
){
this
.
MediumModel
.
push
(
data
)
}
else
{
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`重复选择、请您重新选择!`
,
position
:
'top'
})
return
}
}
else
{
this
.
MediumModel
=
[];
this
.
MediumModel
.
push
(
data
)
}
},
selecttextimg
()
{
//图文
this
.
isshowimagetext
=
true
;
...
...
@@ -299,7 +355,7 @@
this
.
isshowimagetext
=
false
;
},
gettwsuccess
(
data
)
{
//图文返回成功
this
.
Selectobj
=
data
this
.
ISidentical
(
data
)
this
.
isshowimagetext
=
false
},
...
...
@@ -314,8 +370,8 @@
getxcxclose
()
{
//小程序 关闭
this
.
isshowapplet
=
false
;
},
getxcxsuccess
()
{
//小程序 关闭
this
.
Selectobj
=
data
getxcxsuccess
(
data
)
{
//小程序 关闭
this
.
ISidentical
(
data
)
this
.
isshowapplet
=
false
},
savemove
()
{
//保存
...
...
@@ -336,6 +392,16 @@
return
}
}
this
.
addMsg
.
MediumIds
==
''
if
(
this
.
MediumModel
&&
this
.
MediumModel
.
length
>
0
){
let
ids
=
[]
this
.
MediumModel
.
forEach
(
x
=>
{
ids
.
push
(
x
.
Id
)
})
this
.
addMsg
.
MediumIds
=
ids
.
join
(
','
)
}
if
(
this
.
addMsg
.
MediumIds
==
''
)
{
this
.
addMsg
.
Type
=
1
;
if
(
this
.
addMsg
.
Content
==
''
)
{
...
...
@@ -367,6 +433,29 @@
goblck
()
{
//返回上一个页面
this
.
$router
.
go
(
-
1
);
//返回上一层
},
getType
(
row
,
name
)
{
let
title
=
''
let
content
=
''
if
(
row
.
Type
==
2
)
{
title
=
row
.
ImageModel
.
ImageName
content
=
row
.
ImageModel
.
ImagePath
}
else
if
(
row
.
Type
==
3
)
{
title
=
row
.
ImgTextModel
.
Title
content
=
row
.
ImgTextModel
.
ImgPath
}
else
if
(
row
.
Type
==
6
)
{
title
=
row
.
AppletModel
.
Title
content
=
row
.
AppletModel
.
ImagePath
}
if
(
name
==
'title'
)
{
return
title
}
else
if
(
name
==
'content'
)
{
return
content
}
},
deleteModel
(
index
){
this
.
MediumModel
.
splice
(
index
,
1
)
}
}
...
...
src/pages/enterprise/welcomeList.vue
View file @
34122328
...
...
@@ -161,7 +161,7 @@
getWeChatWelcomesPageList
(
this
.
msg
).
then
(
res
=>
{
this
.
loading
=
false
this
.
data
=
res
.
Data
.
PageData
;
this
.
pageCount
=
res
.
Data
.
Count
this
.
pageCount
=
res
.
Data
.
Page
Count
this
.
data
.
forEach
(
x
=>
{
x
.
UserIdName
=
''
x
.
UserIdList
.
map
((
j
,
i
)
=>
{
...
...
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