Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-web
/
glsx-oss-notice
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 e1b8c1f5
authored
Apr 19, 2019
by
wangql
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交代码
1 parent
4aa538c5
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
60 additions
and
43 deletions
src/api/index.js
src/views/noticeCenter/index.vue
src/views/noticeManage/AddDialog.vue
src/views/noticeManage/DetailDialog.vue
src/views/noticeManage/Editor.vue
src/views/noticeManage/index.vue
src/api/index.js
View file @
e1b8c1f
...
...
@@ -11,14 +11,14 @@ import {
}
from
'./noticeCenter'
const
request
=
{
req
:
params
=>
{
//
params.source = 'glsx-oss-notice'
//
params.app_key = '48e5e13229b82c1b4e6e8c96151f0637'
//
params.timestamp = new Date().getTime()
//
params.v = '1.0.0'
//
params.format = 'json'
const
url
=
process
.
env
.
NODE_ENV
===
'production'
?
'router'
:
params
.
method
return
GlAxios
.
get
(
url
,
{
'params'
:
sign
(
params
)
})
//
return GlAxios.get('router', { 'params': sign(params) })
params
.
source
=
'glsx-oss-notice'
params
.
app_key
=
'48e5e13229b82c1b4e6e8c96151f0637'
params
.
timestamp
=
new
Date
().
getTime
()
params
.
v
=
'1.0.0'
params
.
format
=
'json'
//
const url = process.env.NODE_ENV === 'production' ? 'router' : params.method
//
return GlAxios.get(url, { 'params': sign(params) })
return
GlAxios
.
get
(
'router'
,
{
'params'
:
sign
(
params
)
})
}
}
export
{
...
...
src/views/noticeCenter/index.vue
View file @
e1b8c1f
...
...
@@ -6,7 +6,7 @@
label-width=
"120px"
>
<template>
<gl-radio-group
v-model=
"searchParams.bulletinType"
style=
"margin-bottom: 30px;"
>
<gl-radio-group
v-model=
"searchParams.bulletinType"
@
change=
"loadingGetList"
style=
"margin-bottom: 30px;"
>
<gl-radio-button
label=
"1"
>
通知类
</gl-radio-button>
<gl-radio-button
label=
"2"
>
活动类
</gl-radio-button>
<gl-radio-button
label=
"3"
>
广告类
</gl-radio-button>
...
...
@@ -678,7 +678,7 @@ export default {
},
callback
:
(
index
,
row
)
=>
{
location
.
href
=
row
[
index
].
attachment
// this.fileUrl = 'https://
timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1555336969854&di=a2dda17c201301584b60bbfc5d184682&imgtype=0&src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F20182%2F21%2F2018221142159_MZ33z.jpeg
'
// this.fileUrl = 'https://
dz.80txt.com/57199/极品全能学生.zip
'
// this.$refs['fileA'].click()
// this.$confirm('下载附件', '', {
// type: 'warning'
...
...
src/views/noticeManage/AddDialog.vue
View file @
e1b8c1f
...
...
@@ -81,7 +81,8 @@
>
<gl-upload
class=
"upload-demo"
action=
"https://jsonplaceholder.typicode.com/posts/"
name=
"file"
action=
"http://192.168.2.89:8091/gps/common/uploadFile"
:limit=
"2"
:before-upload=
"beforeUpload"
:on-success=
"handleSuccess"
...
...
@@ -153,29 +154,29 @@ export default {
title
:
'创建通知'
,
fileList
:
[],
sendObjList
:
[
{
label
:
'爱车保镖分组'
,
value
:
'1'
},
{
label
:
'虎哥E盾分组'
,
value
:
'2'
},
{
label
:
'嘀加系统(TSP版)'
,
value
:
'3'
},
{
label
:
'嘀加系统(aaa版)'
,
value
:
'4'
},
{
label
:
'嘀加系统(bbb版)'
,
value
:
'5'
}
//
{
//
label: '爱车保镖分组',
//
value: '1'
//
}, {
//
label: '虎哥E盾分组',
//
value: '2'
//
}, {
//
label: '嘀加系统(TSP版)',
//
value: '3'
//
}, {
//
label: '嘀加系统(aaa版)',
//
value: '4'
//
}, {
//
label: '嘀加系统(bbb版)',
//
value: '5'
//
}
],
showTypeList
:
[{
label
:
'弹出框'
,
value
:
'1'
value
:
1
},
{
label
:
'置顶消息'
,
value
:
'2'
value
:
2
}],
rules
:
{
title
:
[{
required
:
true
}],
...
...
@@ -192,7 +193,7 @@ export default {
},
diaWidth
:
{
type
:
String
,
default
:
'
60%
'
default
:
'
870px
'
},
noticeForm
:
Object
},
...
...
@@ -238,9 +239,13 @@ export default {
!
isLT20M
&&
this
.
$message
.
error
(
'上传附件大小不能超过20M'
)
return
isLT20M
},
handleSuccess
(
file
,
fileList
)
{
this
.
fileList
=
[{
name
:
fileList
.
name
,
url
:
fileList
.
url
}]
this
.
noticeForm
.
attachment
=
fileList
.
url
handleSuccess
(
res
,
file
,
fileList
)
{
// console.log(res)
// console.log(file)
// console.log(fileList)
this
.
fileList
=
[{
name
:
file
.
name
,
url
:
file
.
response
.
data
}]
this
.
noticeForm
.
attachment
=
file
.
response
.
data
// this.noticeForm.attachment = 'https://dz.80txt.com/57199/极品全能学生.zip'
// 移除验证
// this.errorBags.remove('attachment')
},
...
...
@@ -258,10 +263,18 @@ export default {
},
// 保存草稿
handleDraft
()
{
this
.
$emit
(
'handleAddComfirm'
)
if
(
this
.
noticeForm
.
titile
!==
''
)
{
this
.
noticeForm
.
bulletinType
=
1
// 通知
this
.
noticeForm
.
publishStatus
=
1
// 仅保存
this
.
noticeForm
.
checkStatus
=
1
// 未审核
this
.
$emit
(
'handleAddComfirm'
)
}
else
{
alert
(
'标题不能为空'
)
}
},
// 审核并发布
handleComfrim
()
{
// this.noticeForm.publishStatus = 2 // 仅保存
console
.
log
(
this
.
noticeForm
)
// this.$emit('handleAddComfirm')
this
.
$validator
.
validateAll
().
then
((
result
)
=>
{
...
...
src/views/noticeManage/DetailDialog.vue
View file @
e1b8c1f
...
...
@@ -53,7 +53,7 @@
>
<!--
<a
href=
"http://down8.5156edu.com/showzipdown4.php?f_type1=2&id=96098"
>
下载附件
</a>
-->
<!--
<a
href=
"https://cdn.shopify.com/s/files/1/1545/3617/files/SH01_User_Manaul.pdf"
download=
"SH01_User_Manaul.pdf"
>
下载附件
</a>
-->
<a
href=
"https://down1.jyrd.com/2010/WPS.Office_ankty.rar
"
>
下载附件
</a>
<a
:href=
"noticeForm.attachment
"
>
下载附件
</a>
</gl-form-item>
<gl-form-item
label=
"展示方式:"
...
...
@@ -134,7 +134,7 @@ export default {
},
diaWidth
:
{
type
:
String
,
default
:
'
60%
'
default
:
'
870px
'
},
noticeForm
:
Object
},
...
...
src/views/noticeManage/Editor.vue
View file @
e1b8c1f
...
...
@@ -63,8 +63,9 @@ export default {
this
.
editor
=
new
E
(
this
.
$refs
.
toolbar
,
this
.
$refs
.
editor
)
this
.
editor
.
customConfig
.
uploadImgShowBase64
=
true
// base 64 存储图片
// this.editor.customConfig.uploadImgServer = uploadPath// 配置服务器端地址
this
.
editor
.
customConfig
.
uploadImgServer
=
'http://192.168.2.89:8091/gps/common/uploadImage'
// 配置服务器端地址
this
.
editor
.
customConfig
.
uploadImgHeaders
=
{
}
// 自定义 header
this
.
editor
.
customConfig
.
uploadFileName
=
'file
s
'
// 后端接受上传文件的参数名
this
.
editor
.
customConfig
.
uploadFileName
=
'file'
// 后端接受上传文件的参数名
this
.
editor
.
customConfig
.
uploadImgMaxSize
=
2
*
1024
*
1024
// 将图片大小限制为 2M
this
.
editor
.
customConfig
.
uploadImgMaxLength
=
6
// 限制一次最多上传 3 张图片
this
.
editor
.
customConfig
.
uploadImgTimeout
=
3
*
60
*
1000
// 设置超时时间
...
...
@@ -108,15 +109,18 @@ export default {
// 图片上传错误的回调
},
customInsert
:
(
insertImg
,
result
,
editor
)
=>
{
console
.
log
(
result
)
// 图片上传成功,插入图片的回调
// result为上传图片成功的时候返回的数据,这里我打印了一下发现后台返回的是data:[{url:"路径的形式"},...]
// console.log(result.data[0].url)
// insertImg()为插入图片的函数
// 循环插入图片
for
(
let
i
=
0
;
i
<
result
.
data
.
length
;
i
++
)
{
var
url
=
result
.
data
[
i
].
url
insertImg
(
url
)
}
// for (let i = 0; i < result.data.length; i++) {
// var url = result.data[i].url
// insertImg(url)
// }
// insertImg(result.data)
insertImg
(
'http://pic39.nipic.com/20140308/13085675_113419113000_2.jpg'
)
}
}
this
.
editor
.
customConfig
.
onchange
=
(
html
)
=>
{
...
...
src/views/noticeManage/index.vue
View file @
e1b8c1f
...
...
@@ -231,7 +231,7 @@ export default {
context
:
''
,
// 发送对象
targetIds
:
[],
attachment
:
[]
,
attachment
:
''
,
showType
:
''
,
publishStatus
:
''
},
...
...
@@ -581,7 +581,7 @@ export default {
},
// 新增公告
handleAdd
(
isCreate
)
{
isCreate
&&
(
this
.
noticeForm
.
showType
=
'1'
)
isCreate
&&
(
this
.
noticeForm
.
showType
=
1
)
// this.noticeForm.context = '<p>fdasfdasf</p><p><img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1555392730451&di=6f2af72a691e8f7a19a436d63a40124b&imgtype=0&src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F20182%2F21%2F2018221142159_MZ33z.jpeg" style="max-width:100%;"></p><p></p><p>gfdgdg</p><p>gfdgdg</p>'
this
.
addVisible
=
!
this
.
addVisible
},
...
...
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