Commit e1b8c1f5 by wangql

提交代码

1 parent 4aa538c5
...@@ -11,14 +11,14 @@ import { ...@@ -11,14 +11,14 @@ import {
} from './noticeCenter' } from './noticeCenter'
const request = { const request = {
req: params => { req: params => {
// params.source = 'glsx-oss-notice' params.source = 'glsx-oss-notice'
// params.app_key = '48e5e13229b82c1b4e6e8c96151f0637' params.app_key = '48e5e13229b82c1b4e6e8c96151f0637'
// params.timestamp = new Date().getTime() params.timestamp = new Date().getTime()
// params.v = '1.0.0' params.v = '1.0.0'
// params.format = 'json' params.format = 'json'
const url = process.env.NODE_ENV === 'production' ? 'router' : params.method // const url = process.env.NODE_ENV === 'production' ? 'router' : params.method
return GlAxios.get(url, { 'params': sign(params) }) // return GlAxios.get(url, { 'params': sign(params) })
// return GlAxios.get('router', { 'params': sign(params) }) return GlAxios.get('router', { 'params': sign(params) })
} }
} }
export { export {
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
label-width="120px" label-width="120px"
> >
<template> <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="1">通知类</gl-radio-button>
<gl-radio-button label="2">活动类</gl-radio-button> <gl-radio-button label="2">活动类</gl-radio-button>
<gl-radio-button label="3">广告类</gl-radio-button> <gl-radio-button label="3">广告类</gl-radio-button>
...@@ -678,7 +678,7 @@ export default { ...@@ -678,7 +678,7 @@ export default {
}, },
callback: (index, row) => { callback: (index, row) => {
location.href = row[index].attachment 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.$refs['fileA'].click()
// this.$confirm('下载附件', '', { // this.$confirm('下载附件', '', {
// type: 'warning' // type: 'warning'
......
...@@ -81,7 +81,8 @@ ...@@ -81,7 +81,8 @@
> >
<gl-upload <gl-upload
class="upload-demo" class="upload-demo"
action="https://jsonplaceholder.typicode.com/posts/" name="file"
action="http://192.168.2.89:8091/gps/common/uploadFile"
:limit="2" :limit="2"
:before-upload="beforeUpload" :before-upload="beforeUpload"
:on-success="handleSuccess" :on-success="handleSuccess"
...@@ -153,29 +154,29 @@ export default { ...@@ -153,29 +154,29 @@ export default {
title: '创建通知', title: '创建通知',
fileList: [], fileList: [],
sendObjList: [ sendObjList: [
{ // {
label: '爱车保镖分组', // label: '爱车保镖分组',
value: '1' // value: '1'
}, { // }, {
label: '虎哥E盾分组', // label: '虎哥E盾分组',
value: '2' // value: '2'
}, { // }, {
label: '嘀加系统(TSP版)', // label: '嘀加系统(TSP版)',
value: '3' // value: '3'
}, { // }, {
label: '嘀加系统(aaa版)', // label: '嘀加系统(aaa版)',
value: '4' // value: '4'
}, { // }, {
label: '嘀加系统(bbb版)', // label: '嘀加系统(bbb版)',
value: '5' // value: '5'
} // }
], ],
showTypeList: [{ showTypeList: [{
label: '弹出框', label: '弹出框',
value: '1' value: 1
}, { }, {
label: '置顶消息', label: '置顶消息',
value: '2' value: 2
}], }],
rules: { rules: {
title: [{ required: true }], title: [{ required: true }],
...@@ -192,7 +193,7 @@ export default { ...@@ -192,7 +193,7 @@ export default {
}, },
diaWidth: { diaWidth: {
type: String, type: String,
default: '60%' default: '870px'
}, },
noticeForm: Object noticeForm: Object
}, },
...@@ -238,9 +239,13 @@ export default { ...@@ -238,9 +239,13 @@ export default {
!isLT20M && this.$message.error('上传附件大小不能超过20M') !isLT20M && this.$message.error('上传附件大小不能超过20M')
return isLT20M return isLT20M
}, },
handleSuccess(file, fileList) { handleSuccess(res, file, fileList) {
this.fileList = [{ name: fileList.name, url: fileList.url }] // console.log(res)
this.noticeForm.attachment = fileList.url // 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') // this.errorBags.remove('attachment')
}, },
...@@ -258,10 +263,18 @@ export default { ...@@ -258,10 +263,18 @@ export default {
}, },
// 保存草稿 // 保存草稿
handleDraft() { handleDraft() {
if (this.noticeForm.titile !== '') {
this.noticeForm.bulletinType = 1 // 通知
this.noticeForm.publishStatus = 1 // 仅保存
this.noticeForm.checkStatus = 1 // 未审核
this.$emit('handleAddComfirm') this.$emit('handleAddComfirm')
} else {
alert('标题不能为空')
}
}, },
// 审核并发布 // 审核并发布
handleComfrim() { handleComfrim() {
// this.noticeForm.publishStatus = 2 // 仅保存
console.log(this.noticeForm) console.log(this.noticeForm)
// this.$emit('handleAddComfirm') // this.$emit('handleAddComfirm')
this.$validator.validateAll().then((result) => { this.$validator.validateAll().then((result) => {
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
> >
<!-- <a href="http://down8.5156edu.com/showzipdown4.php?f_type1=2&id=96098">下载附件</a> --> <!-- <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://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>
<gl-form-item <gl-form-item
label="展示方式:" label="展示方式:"
...@@ -134,7 +134,7 @@ export default { ...@@ -134,7 +134,7 @@ export default {
}, },
diaWidth: { diaWidth: {
type: String, type: String,
default: '60%' default: '870px'
}, },
noticeForm: Object noticeForm: Object
}, },
......
...@@ -63,8 +63,9 @@ export default { ...@@ -63,8 +63,9 @@ export default {
this.editor = new E(this.$refs.toolbar, this.$refs.editor) this.editor = new E(this.$refs.toolbar, this.$refs.editor)
this.editor.customConfig.uploadImgShowBase64 = true // base 64 存储图片 this.editor.customConfig.uploadImgShowBase64 = true // base 64 存储图片
// this.editor.customConfig.uploadImgServer = uploadPath// 配置服务器端地址 // 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.uploadImgHeaders = { }// 自定义 header
this.editor.customConfig.uploadFileName = 'files' // 后端接受上传文件的参数名 this.editor.customConfig.uploadFileName = 'file' // 后端接受上传文件的参数名
this.editor.customConfig.uploadImgMaxSize = 2 * 1024 * 1024 // 将图片大小限制为 2M this.editor.customConfig.uploadImgMaxSize = 2 * 1024 * 1024 // 将图片大小限制为 2M
this.editor.customConfig.uploadImgMaxLength = 6 // 限制一次最多上传 3 张图片 this.editor.customConfig.uploadImgMaxLength = 6 // 限制一次最多上传 3 张图片
this.editor.customConfig.uploadImgTimeout = 3 * 60 * 1000 // 设置超时时间 this.editor.customConfig.uploadImgTimeout = 3 * 60 * 1000 // 设置超时时间
...@@ -108,15 +109,18 @@ export default { ...@@ -108,15 +109,18 @@ export default {
// 图片上传错误的回调 // 图片上传错误的回调
}, },
customInsert: (insertImg, result, editor) => { customInsert: (insertImg, result, editor) => {
console.log(result)
// 图片上传成功,插入图片的回调 // 图片上传成功,插入图片的回调
// result为上传图片成功的时候返回的数据,这里我打印了一下发现后台返回的是data:[{url:"路径的形式"},...] // result为上传图片成功的时候返回的数据,这里我打印了一下发现后台返回的是data:[{url:"路径的形式"},...]
// console.log(result.data[0].url) // console.log(result.data[0].url)
// insertImg()为插入图片的函数 // insertImg()为插入图片的函数
// 循环插入图片 // 循环插入图片
for (let i = 0; i < result.data.length; i++) { // for (let i = 0; i < result.data.length; i++) {
var url = result.data[i].url // var url = result.data[i].url
insertImg(url) // insertImg(url)
} // }
// insertImg(result.data)
insertImg('http://pic39.nipic.com/20140308/13085675_113419113000_2.jpg')
} }
} }
this.editor.customConfig.onchange = (html) => { this.editor.customConfig.onchange = (html) => {
......
...@@ -231,7 +231,7 @@ export default { ...@@ -231,7 +231,7 @@ export default {
context: '', context: '',
// 发送对象 // 发送对象
targetIds: [], targetIds: [],
attachment: [], attachment: '',
showType: '', showType: '',
publishStatus: '' publishStatus: ''
}, },
...@@ -581,7 +581,7 @@ export default { ...@@ -581,7 +581,7 @@ export default {
}, },
// 新增公告 // 新增公告
handleAdd(isCreate) { 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&amp;quality=80&amp;size=b9999_10000&amp;sec=1555392730451&amp;di=6f2af72a691e8f7a19a436d63a40124b&amp;imgtype=0&amp;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.noticeForm.context = '<p>fdasfdasf</p><p><img src="https://timgsa.baidu.com/timg?image&amp;quality=80&amp;size=b9999_10000&amp;sec=1555392730451&amp;di=6f2af72a691e8f7a19a436d63a40124b&amp;imgtype=0&amp;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 this.addVisible = !this.addVisible
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!