Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
bdc
/
bdcdj-web
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
e7566d89
authored
2022-11-18 15:50:25 +0800
by
蔡俊立
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
通知完善
1 parent
ddae0b3c
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
95 additions
and
97 deletions
src/api/notice.js
src/views/home/index.vue
src/views/system/xttz/components/addDialog.vue
src/views/system/xttz/components/viewDialog.vue
src/views/system/xttz/xttz.vue
src/views/system/xttz/xttzdata.js
src/api/notice.js
View file @
e7566d8
...
...
@@ -10,6 +10,15 @@ export function addSysNotice (data) {
})
}
//编辑系统通知
export
function
updateSysNotice
(
data
)
{
return
request
({
url
:
SERVER
.
SERVERAPI
+
'/rest/system/sysNotice/updateSysNotice'
,
method
:
'post'
,
data
})
}
// 获取通知列表
export
function
getSysNoticeList
(
data
)
{
return
request
({
...
...
src/views/home/index.vue
View file @
e7566d8
...
...
@@ -22,7 +22,7 @@
<ul>
<li
v-for=
"(item, index) in noticeList"
:key=
"index"
@
click=
"handleNotice(item)"
class=
"flexst pointer"
>
<p
class=
"list-title"
>
{{
item
.
noticeTitle
}}
</p>
<p
class=
"marginZL15"
>
{{
item
.
createt
ime
.
substring
(
0
,
10
)
}}
</p>
<p
class=
"marginZL15"
>
{{
item
.
noticePublishT
ime
.
substring
(
0
,
10
)
}}
</p>
<p
v-if=
"item.userBrowse == '1'"
style=
"color:red"
>
未读
</p>
<p
v-else
>
已读
</p>
</li>
...
...
@@ -192,7 +192,7 @@ export default {
if
(
res
.
result
)
{
this
.
noticeList
=
res
.
result
.
noticeList
this
.
noticeList
.
forEach
(
item
=>
{
item
.
createtime
=
this
.
_timedate
(
item
.
createt
ime
)
item
.
noticePublishTime
=
this
.
_timedate
(
item
.
noticePublishT
ime
)
})
this
.
policyList
=
res
.
result
.
policyList
}
...
...
src/views/system/xttz/components/addDialog.vue
View file @
e7566d8
<
template
>
<dialogBox
title=
"新增系统通知
"
@
submitForm=
"submitForm"
saveButton=
"保存"
:isFullscreen=
"false"
width=
"50%"
@
closeDialog=
"closeDialog"
v-model=
"value"
>
<dialogBox
:title=
"title
"
@
submitForm=
"submitForm"
saveButton=
"保存"
:isFullscreen=
"false"
width=
"50%"
@
closeDialog=
"closeDialog"
v-model=
"value"
:isButton=
"isButtonFlag"
>
<el-form
ref=
"ruleForm"
:model=
"ruleForm"
label-width=
"100px"
:rules=
"rules"
>
<el-row>
<el-col
:span=
"24"
>
...
...
@@ -23,7 +23,7 @@
@
change=
"onEditorChange($event)"
@
ready=
"onEditorReady($event)"
></quill-editor>
</el-form-item>
</el-row>
<el-row>
<
!--
<
el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"附件:"
prop=
"noticeFileUrl"
>
<el-upload
action
multiple
:auto-upload=
"false"
:limit=
"1"
:on-change=
"handleChange"
...
...
@@ -33,7 +33,8 @@
</el-upload>
</el-form-item>
</el-col>
</el-row>
</el-row>
-->
<!-- 隐藏上传按钮 用于代替触发富文本上传事件 -->
<div
v-show=
"false"
>
<el-upload
action
multiple
:auto-upload=
"false"
:on-change=
"RichTexthandleChange"
:before-upload=
"beforeUpload"
class=
"richUpload"
>
...
...
@@ -46,12 +47,14 @@
</
template
>
<
script
>
import
{
addSysNotice
}
from
"@/api/notice.js"
;
import
{
addSysNotice
,
updateSysNotice
}
from
"@/api/notice.js"
;
import
{
upload
}
from
"@/api/system.js"
;
import
{
quillEditor
}
from
"vue-quill-editor"
;
export
default
{
props
:
{
value
:
{
type
:
Boolean
,
default
:
false
}
value
:
{
type
:
Boolean
,
default
:
false
},
isButtonFlag
:
{
type
:
Boolean
,
default
:
true
},
title
:
{
type
:
String
,
default
:
'新增系统通知'
}
},
components
:
{
quillEditor
},
data
()
{
...
...
@@ -142,12 +145,30 @@ export default {
}
}
},
mounted
()
{
},
mounted
()
{},
methods
:
{
submitForm
()
{
let
that
=
this
;
that
.
$refs
.
ruleForm
.
validate
(
valid
=>
{
if
(
valid
)
{
if
(
that
.
ruleForm
.
bsmNotice
){
that
.
editNotice
();
}
else
{
that
.
addNotice
();
}
}
else
{
// console.log('error submit!!');
return
false
;
}
});
},
//关闭窗口
closeDialog
()
{
this
.
$emit
(
"input"
,
false
);
this
.
resetRuleForm
();
},
//新增通知
addNotice
(){
addSysNotice
(
this
.
ruleForm
).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
$message
.
success
(
"保存成功"
);
...
...
@@ -158,21 +179,30 @@ export default {
this
.
$message
.
error
(
res
.
message
);
}
});
}
else
{
// console.log('error submit!!');
return
false
;
}
});
},
//关闭窗口
closeDialog
()
{
//编辑通知
editNotice
(){
updateSysNotice
(
this
.
ruleForm
).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
$message
.
success
(
"编辑成功"
);
this
.
$emit
(
"input"
,
false
);
this
.
resetRuleForm
();
this
.
$parent
.
queryClick
();
}
else
{
this
.
$message
.
error
(
res
.
message
);
}
});
},
//
//
重置表单
resetRuleForm
()
{
this
.
$refs
[
"ruleForm"
].
resetFields
();
this
.
ruleForm
.
noticeType
=
"1"
;
this
.
ruleForm
=
{
noticeTitle
:
""
,
noticeContent
:
""
,
noticeFileUrl
:
""
,
noticeSource
:
""
,
noticeType
:
"1"
}
this
.
isButtonFlag
=
true
;
},
beforeUpload
(
file
)
{
return
true
;
...
...
@@ -193,6 +223,9 @@ export default {
clipboardPictureChange
(
file
)
{
this
.
uploadPicture
(
file
)
},
getDetailInfo
(
item
){
this
.
ruleForm
=
item
},
uploadPicture
(
file
)
{
let
that
=
this
;
var
formdata
=
new
FormData
();
...
...
src/views/system/xttz/components/viewDialog.vue
deleted
100644 → 0
View file @
ddae0b3
<
template
>
<div>
<el-row
:gutter=
"8"
>
<el-col
:span=
"16"
>
通知标题:
<el-input
v-model=
"formData.item.noticeTitle"
></el-input>
</el-col>
</el-row>
<el-row
:gutter=
"8"
>
<el-col
:span=
"24"
class=
"margin-top-middle"
>
通知内容:
<quill-editor
class=
"ql-editor"
v-model=
"formData.item.noticeContent"
ref=
"myQuillEditor"
:options=
"editorOption"
>
</quill-editor>
</el-col>
</el-row>
<el-row
:gutter=
"8"
>
<el-col
:span=
"24"
class=
"margin-top-middle"
>
附件:
<div
@
click=
"handleView(formData.item.noticeFileUrl)"
class=
"pointer"
>
{{
formData
.
item
.
noticeFileName
}}
</div>
</el-col>
</el-row>
</div>
</
template
>
<
script
>
import
{
quillEditor
}
from
"vue-quill-editor"
;
export
default
{
components
:
{
quillEditor
},
data
()
{
return
{
// 富文本编辑器配置
editorOption
:
{
theme
:
"snow"
,
// or 'bubble'
placeholder
:
"请输入正文"
,
},
};
},
components
:
{},
props
:
{
formData
:
{
type
:
Object
,
default
:
()
=>
{
}
},
},
created
()
{
console
.
log
(
this
.
formData
);
},
computed
:
{
},
methods
:
{
},
};
</
script
>
<
style
scoped
lang=
'scss'
>
.margin-top-middle
{
margin-top
:
10px
}
/
deep
/
.ql-editor
{
padding
:
0px
;
}
</
style
>
\ No newline at end of file
src/views/system/xttz/xttz.vue
View file @
e7566d8
...
...
@@ -33,7 +33,7 @@
:data=
"tableData.data"
>
</lb-table>
</div>
<addDialog
ref=
"addDialog"
v-model=
"isDialog"
/>
<addDialog
ref=
"addDialog"
v-model=
"isDialog"
:isButtonFlag=
"isButtonFlag"
:title=
"dialogTitle"
/>
</div>
</
template
>
<
script
>
...
...
@@ -52,8 +52,8 @@ export default {
data
()
{
return
{
isDialog
:
false
,
viewDialog
:
fals
e
,
isButtonFlag
:
tru
e
,
dialogTitle
:
''
,
ruleForm
:
{
noticeTitle
:
''
,
noticeStatus
:
''
...
...
@@ -84,7 +84,17 @@ export default {
})
},
//打开新增弹窗
openDialog
()
{
openDialog
(
item
)
{
if
(
item
)
{
this
.
$nextTick
(()
=>
{
this
.
isButtonFlag
=
false
;
this
.
$refs
.
addDialog
.
getDetailInfo
(
item
);
this
.
dialogTitle
=
'系统通知详情'
})
}
else
{
this
.
isButtonFlag
=
true
;
this
.
dialogTitle
=
'新增系统通知'
}
this
.
isDialog
=
true
;
},
//删除
...
...
@@ -153,16 +163,18 @@ export default {
});
});
},
//编辑通知
editNotice
(
item
)
{
this
.
$nextTick
(()
=>
{
this
.
isButtonFlag
=
true
;
this
.
$refs
.
addDialog
.
getDetailInfo
(
item
);
this
.
dialogTitle
=
'编辑系统通知'
this
.
isDialog
=
true
;
})
},
downloadFile
(
item
)
{
const
href
=
item
.
noticeFileUrl
window
.
open
(
href
,
'_blank'
);
},
viewDetail
(
e
)
{
this
.
$popup
(
"错误日志"
,
"system/xttz/components/viewDialog"
,
{
formData
:
{
item
:
e
}
})
}
},
};
...
...
src/views/system/xttz/xttzdata.js
View file @
e7566d8
...
...
@@ -26,6 +26,10 @@ class data extends filter {
label
:
"通知标题"
,
},
{
prop
:
"noticeSource"
,
label
:
"通知来源"
,
},
{
label
:
"通知内容"
,
render
:
(
h
,
scope
)
=>
{
return
<
div
class
=
"item-cwnr"
domPropsInnerHTML
=
{
scope
.
row
.
noticeContent
}
><
/div
>
...
...
@@ -51,6 +55,10 @@ class data extends filter {
}
},
{
prop
:
"noticePublishTime"
,
label
:
"发布时间"
,
},
{
prop
:
"creater"
,
width
:
'120'
,
label
:
"创建人"
,
...
...
@@ -67,13 +75,14 @@ class data extends filter {
switch
(
scope
.
row
.
noticeStatus
)
{
case
'1'
:
return
<
div
>
<
el
-
button
type
=
"text"
icon
=
"el-icon-view"
onClick
=
{()
=>
{
vm
.
openDialog
(
scope
.
row
)
}}
>
查看
<
/el-button
>
<
el
-
button
type
=
"text"
icon
=
"el-icon-edit"
onClick
=
{()
=>
{
vm
.
editNotice
(
scope
.
row
)
}}
>
编辑
<
/el-button
>
<
el
-
button
type
=
"text"
icon
=
"el-icon-edit-outline"
onClick
=
{()
=>
{
vm
.
toPublish
(
scope
.
row
)
}}
>
发布
<
/el-button
>
<
el
-
button
type
=
"text"
onClick
=
{()
=>
{
vm
.
viewDetail
(
scope
.
row
)
}}
>
查看
<
/el-button
>
<
el
-
button
type
=
"text"
icon
=
"el-icon-delete"
onClick
=
{()
=>
{
vm
.
delNotice
(
scope
.
row
)
}}
>
删除
<
/el-button
>
<
/div
>
case
'2'
:
return
<
div
>
<
el
-
button
type
=
"text"
onClick
=
{()
=>
{
vm
.
viewDetail
(
scope
.
row
)
}}
>
查看
<
/el-button
>
<
el
-
button
type
=
"text"
icon
=
"el-icon-view"
onClick
=
{()
=>
{
vm
.
openDialog
(
scope
.
row
)
}}
>
查看
<
/el-button
>
<
el
-
button
type
=
"text"
icon
=
"el-icon-edit-outline"
onClick
=
{()
=>
{
vm
.
toUnPublish
(
scope
.
row
)
}}
>
撤销通知
<
/el-button
>
<
/div
>
}
...
...
Please
register
or
sign in
to post a comment