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
e051eff3
Commit
e051eff3
authored
Dec 02, 2020
by
Mac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
50b23939
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
506 additions
and
0 deletions
+506
-0
document.js
src/api/system/document.js
+65
-0
document.vue
src/pages/system/document.vue
+436
-0
routes.js
src/router/routes.js
+5
-0
No files found.
src/api/system/document.js
0 → 100644
View file @
e051eff3
import
request
from
'../../utils/request'
/**
* 获取公告分页列表
*/
export
function
getNoticePageList
(
data
)
{
return
request
({
url
:
'/UserCenter/GetNoticePageList'
,
method
:
'post'
,
data
});
}
/**
* 获取 公告状态枚举 列表
*/
export
function
getNoticeStateEnumList
(
data
)
{
return
request
({
url
:
'/UserCenter/GetNoticeStateEnumList'
,
method
:
'post'
,
data
});
}
/**
* 获取 公告配置
*/
export
function
getNoticeBaseInfo
(
data
)
{
return
request
({
url
:
'/UserCenter/GetNoticeBaseInfo'
,
method
:
'post'
,
data
});
}
/**
* 获取编号规则 枚举列表
*/
export
function
getNoticeRuleEnumList
(
data
)
{
return
request
({
url
:
'/UserCenter/GetNoticeRuleEnumList'
,
method
:
'post'
,
data
});
}
/**
* 新增修改 公告配置
*/
export
function
setNoticeBaseInfo
(
data
)
{
return
request
({
url
:
'/UserCenter/SetNoticeBaseInfo'
,
method
:
'post'
,
data
});
}
/**
* 公告操作
*/
export
function
setNoticeOperation
(
data
)
{
return
request
({
url
:
'/UserCenter/SetNoticeOperation'
,
method
:
'post'
,
data
});
}
src/pages/system/document.vue
0 → 100644
View file @
e051eff3
<
template
>
<div
class=
"page-body document"
>
<q-tabs
style=
"margin-bottom:20px;"
v-model=
"tabCheck"
@
input=
"tabChange()"
narrow-indicator
dense
align=
"left"
class=
"text-primary"
>
<q-tab
:ripple=
"false"
name=
"first"
label=
"公文"
/>
<q-tab
:ripple=
"false"
name=
"second"
label=
"基础设置"
/>
</q-tabs>
<template
v-if=
"tabCheck=='first'"
>
<div
class=
"page-search row items-center"
>
<div
class=
"col row wrap q-mr-lg q-col-gutter-md"
>
<div
class=
"col-3"
>
<q-input
clearable
@
change=
"getList"
standout=
"bg-primary text-white"
v-model=
"msg.Title"
label=
"公文标题"
/>
</div>
<div
class=
"col-3"
>
<q-input
clearable
@
change=
"getList"
standout=
"bg-primary text-white"
v-model=
"msg.Number"
label=
"编号/ID"
/>
</div>
<q-select
@
input=
"getList"
filled
stack-label
option-value=
"Id"
option-label=
"EmployeeName"
use-input
v-model=
"msg.UpdateBy"
ref=
"DeptTier"
:options=
"PersionList"
label=
"发布人"
:dense=
"false"
class=
"col-3 q-pr-lg q-pb-lg"
emit-value
map-options
clearable
@
clear=
"getList"
@
filter=
"filterFn"
>
<template
v-slot:no-option
>
<q-item>
<q-item-section
class=
"text-grey"
>
未找到相关数据
</q-item-section>
</q-item>
</
template
>
</q-select>
<div
class=
"col-3"
>
<q-select
@
input=
"getList"
filled
stack-label
option-value=
"Id"
option-label=
"Name"
v-model=
"msg.NoticeState"
ref=
"DeptTier"
:options=
"NoticeList"
label=
"发布状态"
:dense=
"false"
class=
"col-6 q-pr-lg q-pb-lg"
emit-value
map-options
clearable
@
clear=
"getList"
/>
</div>
</div>
<div
class=
"page-option"
>
<q-btn
color=
"accent"
class=
"q-mr-md"
icon=
"add"
label=
"发布公文"
@
click=
"addDoc(null)"
/>
</div>
</div>
<div
class=
"page-content"
>
<q-table
:pagination=
"msg"
:loading=
"loading"
no-data-label=
"暂无相关数据"
flat
class=
"sticky-tow-column-table"
separator=
"none"
title=
""
:data=
"data"
:columns=
"columns"
row-key=
"name"
>
<
template
v-slot:body-cell-optioned=
"props"
>
<q-td
:props=
"props"
>
<q-btn
flat
size=
"xs"
icon=
"edit"
color=
"accent"
style=
"font-weight:400"
label=
"详情"
@
click=
"EditDept(props.row)"
/>
<q-btn
flat
size=
"xs"
icon=
"edit"
color=
"accent"
style=
"font-weight:400"
label=
"修改"
v-if=
"props.row.NoticeState==2"
@
click=
"EditDept(props.row)"
/>
</q-td>
</
template
>
</q-table>
</div>
</template>
<
template
v-if=
"tabCheck=='second'"
>
<div
class=
"page-content "
>
<div
class=
"second-item col-6 q-pr-lg q-pb-lg"
>
<div
class=
"col-2 q-pr-lg q-pb-lg"
>
<q-uploader
style=
"display: inline-block;max-height: 320px;max-width: 100%; background-repeat:no-repeat"
:style=
"
{'background-image':'url(' + NoticeBaseInfo.Image + ')'}" max-files="1" hide-upload-btn
@rejected="onRejected" label="公文抬头图片" :max-file-size="512*1024" accept=".jpg, image/*" auto-upload
:factory="uploadFile" no-thumbnails>
</q-uploader>
</div>
<div
class=
"row"
>
<div
class=
"col-3"
>
<q-input
clearable
standout=
"bg-primary text-white"
v-model=
"NoticeBaseInfo.From"
label=
"公文标题"
/>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-3"
style=
"margin-top: 20px"
>
<q-select
filled
stack-label
option-value=
"Id"
option-label=
"Name"
v-model=
"NoticeBaseInfo.NumberRule"
ref=
"DeptTier"
:options=
"RuleEnumList"
label=
"编号规则"
:dense=
"false"
class=
"col-6 q-pr-lg q-pb-lg"
emit-value
map-options
clearable
/>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-3"
>
<q-select
class=
"col-6 q-pb-lg q-pr-lg"
multiple
clearable
filled
stack-label
use-input
use-chips
option-value=
"Id"
option-label=
"EmployeeName"
v-model=
"tempManager"
ref=
"ManagerId"
:options=
"PersionList"
label=
"默认抄送"
:dense=
"false"
emit-value
map-options
@
filter=
"filterFn"
>
<template
v-slot:no-option
>
<q-item>
<q-item-section
class=
"text-grey"
>
未找到相关数据
</q-item-section>
</q-item>
</
template
>
</q-select>
</div>
</div>
<q-btn
label=
"立即提交"
color=
"accent q-px-md"
style=
"font-weight:400 !important"
:loading=
"saveLoading"
@
click=
"save"
/>
</div>
</div>
</template>
<q-dialog
v-model=
"persistent"
content-class=
"bg-grey-1"
persistent
transition-show=
"scale"
transition-hide=
"scale"
>
<q-card
style=
"width: 800px;max-width:900px;"
>
<q-card-section>
<div
class=
"text-h6"
>
{{addMsg.Id==0?'发布公告':'修改公告'}}
</div>
</q-card-section>
<div
class=
"text-caption q-mb-lg q-px-md text-grey-6"
>
基本资料
</div>
<q-card-section
class=
"q-pt-none"
>
<div
class=
"row wrap"
>
<q-input
clearable
class=
"col-6 q-pb-lg q-pr-lg"
standout=
"bg-primary text-white"
v-model=
"addMsg.From"
label=
"公文来源(FR)"
/>
<q-input
clearable
class=
"col-6 q-pb-lg q-pr-lg"
standout=
"bg-primary text-white"
v-model=
"addMsg.From"
label=
"To"
/>
<q-select
class=
"col-6 q-pb-lg q-pr-lg"
multiple
clearable
filled
stack-label
use-input
use-chips
option-value=
"Id"
option-label=
"EmployeeName"
v-model=
"tempManager2"
ref=
"ManagerId"
:options=
"PersionList"
label=
"默认抄送"
:dense=
"false"
emit-value
map-options
@
filter=
"filterFn"
>
<
template
v-slot:no-option
>
<q-item>
<q-item-section
class=
"text-grey"
>
未找到相关数据
</q-item-section>
</q-item>
</
template
>
</q-select>
<q-input
clearable
class=
"col-12 q-pb-lg q-pr-lg"
standout=
"bg-primary text-white"
v-model=
"addMsg.Title"
label=
"标题"
/>
<div
class=
"text-caption q-my-md q-px-xs text-grey-6"
><
公告内容
></
公告内容
>
</div>
<ext-editor
:defaultMsg=
"addMsg.Content"
classStr=
"col-12"
@
getEditValue=
"getEditValue"
></ext-editor>
<q-uploader
@
rejected=
"onRejected"
:factory=
"uploadFile2"
label=
"附件"
multiple
style=
"max-width: 300px;margin-top: 10px"
hide-upload-btn
no-thumbnails
auto-upload
/>
</div>
</q-card-section>
<q-separator
/>
<q-card-actions
align=
"right"
class=
"bg-white"
>
<q-btn
label=
"取消"
color=
"dark"
style=
"font-weight:400 !important"
@
click=
"closeSaveForm"
/>
<q-btn
label=
"草稿"
color=
"accent q-px-md"
style=
"font-weight:400 !important"
:loading=
"saveLoading"
@
click=
"save_t"
/>
<q-btn
label=
"立即提交"
color=
"accent q-px-md"
style=
"font-weight:400 !important"
:loading=
"saveLoading"
@
click=
"save_t"
/>
</q-card-actions>
</q-card>
</q-dialog>
</div>
</template>
<
script
>
import
{
getNoticePageList
,
getNoticeStateEnumList
,
getNoticeBaseInfo
,
//获取 公告配置
getNoticeRuleEnumList
,
//获取编号规则 枚举列表
setNoticeBaseInfo
,
//新增修改 公告配置
setNoticeOperation
,
//公告操作
}
from
'../../api/system/document'
;
import
{
queryEmployee
}
from
'../../api/users/user'
import
{
UploadSelfFile
,
}
from
'../../api/common/common'
import
extEditor
from
'../../components/common/ext-editor'
export
default
{
components
:
{
extEditor
,
},
name
:
"document"
,
data
(){
return
{
tabCheck
:
'first'
,
msg
:{
PageIndex
:
1
,
PageSize
:
20
,
Title
:
''
,
Number
:
''
,
NoticeState
:
0
,
Is_Top
:
0
,
UpdateBy
:
0
},
loading
:
true
,
//公告column
columns
:
[{
name
:
'NoticeStateName'
,
label
:
'状态'
,
field
:
'NoticeStateName'
,
align
:
'left'
},
{
name
:
'Number'
,
field
:
'Number'
,
label
:
'编号'
,
align
:
'left'
,
},
{
name
:
'Title'
,
label
:
'标题'
,
field
:
'Title'
,
align
:
'left'
},
{
name
:
'ReadNum'
,
label
:
'阅读情况'
,
field
:
'ReadNum'
,
align
:
'left'
},
{
name
:
'UpdateByName'
,
label
:
'发布人'
,
field
:
'UpdateByName'
,
align
:
'left'
},
{
name
:
'UpdateTime'
,
label
:
'发布时间'
,
align
:
'left'
,
field
:
'UpdateTime'
},
{
name
:
'optioned'
,
label
:
'操作'
,
field
:
'DeptId'
}],
data
:[],
pageCount
:
0
,
NoticeList
:[],
PersionList
:
[],
//员工列表
AllemployeeList
:
[],
//所有员工
NoticeBaseInfo
:{
//基础配置
Id
:
0
,
Image
:
''
,
From
:
''
,
NumberRule
:
''
,
NumberRuleName
:
''
,
CopyPeople
:
''
,
},
tempManager
:
[],
//默认抄送
tempManager2
:[],
//发布公告 默认抄送
RuleEnumList
:[],
//编号规则列表
saveLoading
:
false
,
persistent
:
false
,
addMsg
:{
//添加和修改公告
Id
:
0
,
From
:
''
,
To
:
''
,
//抄送部门
CopyPeople
:
''
,
//抄送人
Title
:
''
,
Content
:
''
,
NoticeState
:
1
,
//状态 1发布 2草稿
Is_Top
:
2
,
//是否置顶 1是 2否
FileList
:[],
//附件列表
}
}
},
mounted
()
{
this
.
getList
();
this
.
getNoticeList
()
this
.
getEmployee
()
this
.
getNoticeBase
()
this
.
getNoticeRule
()
//获取编号规则 枚举列表
},
methods
:{
//获取编辑器值
getEditValue
(
obj
)
{
this
.
addMsg
.
Content
=
obj
;
},
tabChange
()
{
if
(
this
.
tabCheck
==
'first'
)
{
this
.
getList
();
}
else
if
(
this
.
tabCheck
==
'second'
)
{
this
.
getNoticeBase
()
}
},
onRejected
(
rejectedEntries
)
{
this
.
$q
.
notify
({
type
:
'negative'
,
position
:
"top"
,
message
:
`文件验证失败,请重新上传`
})
},
uploadFile
(
files
)
{
UploadSelfFile
(
'studentIcon'
,
files
[
0
],
res
=>
{
if
(
res
.
resultCode
==
1
)
{
this
.
NoticeBaseInfo
.
Image
=
res
.
FileUrl
;
}
})
},
uploadFile2
(
files
){
UploadSelfFile
(
'studentIcon'
,
files
[
0
],
res
=>
{
if
(
res
.
resultCode
==
1
)
{
let
obj
=
{
FileName
:
res
.
FileName
,
FileUrl
:
res
.
FileUrl
,
}
this
.
addMsg
.
FileList
.
push
(
obj
)
}
})
},
getList
(){
if
(
this
.
msg
.
UpdateBy
==
''
||
this
.
msg
.
UpdateBy
==
null
){
this
.
msg
.
UpdateBy
=
0
}
this
.
loading
=
false
;
getNoticePageList
(
this
.
msg
).
then
(
res
=>
{
this
.
data
=
res
.
Data
.
PageData
;
this
.
loading
=
false
;
this
.
pageCount
=
res
.
Data
.
PageCount
;
}).
catch
(()
=>
{
this
.
loading
=
false
})
},
getNoticeList
(){
this
.
loading
=
false
;
getNoticeStateEnumList
({
Name
:
''
,
Id
:
''
}).
then
(
res
=>
{
this
.
NoticeList
=
res
.
Data
}).
catch
(()
=>
{
this
.
loading
=
false
})
},
//筛选员工
filterFn
(
val
,
update
)
{
update
(()
=>
{
if
(
val
===
''
)
{
this
.
PersionList
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
AllemployeeList
))
}
else
{
const
needle
=
val
.
toLowerCase
()
this
.
PersionList
=
this
.
AllemployeeList
.
filter
(
v
=>
v
.
EmployeeName
.
toLowerCase
().
indexOf
(
needle
)
>
-
1
)
}
})
},
//获取员工列表
getEmployee
(){
var
qMsg
=
{
EmployeeName
:
""
}
queryEmployee
(
qMsg
).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
var
jsonData
=
res
.
Data
;
if
(
jsonData
&&
jsonData
.
length
>
0
)
{
this
.
AllemployeeList
=
JSON
.
parse
(
JSON
.
stringify
(
jsonData
));
this
.
PersionList
=
JSON
.
parse
(
JSON
.
stringify
(
jsonData
));;
}
}
})
},
////获取 公告配置
getNoticeBase
(){
getNoticeBaseInfo
({}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
NoticeBaseInfo
=
res
.
Data
this
.
tempManager
=
res
.
Data
.
CopyPeople
.
split
(
','
).
map
(
Number
);
//字符串转为数组map 是转为数字
}
})
},
getNoticeRule
(){
getNoticeRuleEnumList
({
Name
:
''
,
Id
:
''
}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
RuleEnumList
=
res
.
Data
}
})
},
save
(){
this
.
saveLoading
=
true
;
var
tempStr
=
""
;
console
.
log
(
this
.
tempManager
)
if
(
this
.
tempManager
&&
this
.
tempManager
.
length
>
0
)
{
this
.
tempManager
.
forEach
(
item
=>
{
tempStr
+=
","
+
item
;
});
}
if
(
tempStr
&&
tempStr
!=
''
)
{
//去掉第一个字符
tempStr
=
tempStr
.
substr
(
1
);
}
this
.
NoticeBaseInfo
.
CopyPeople
=
tempStr
;
setNoticeBaseInfo
(
this
.
NoticeBaseInfo
).
then
(
res
=>
{
this
.
saveLoading
=
false
if
(
res
.
Code
==
1
)
{
this
.
$q
.
notify
({
icon
:
'iconfont icon-chenggong'
,
color
:
'accent'
,
timeout
:
2000
,
message
:
'数据保存成功!'
,
position
:
'top'
})
this
.
$emit
(
"success"
)
}
}).
catch
(()
=>
{
this
.
saveLoading
=
false
})
},
addDoc
(
id
){
if
(
id
)
{
let
obj
=
this
.
data
.
filter
(
x
=>
{
if
(
x
.
SId
==
id
)
{
return
x
}
return
false
})
this
.
objOption
=
obj
[
0
];
this
.
returnString
.
push
(
this
.
objOption
.
Dept_Id
.
toString
());
}
else
{
this
.
tempManager2
=
this
.
tempManager
?
this
.
tempManager
:[]
this
.
addMsg
.
From
=
this
.
NoticeBaseInfo
.
From
;
this
.
addMsg
.
Title
=
this
.
NoticeBaseInfo
.
Title
;
this
.
addMsg
.
Id
=
0
;
this
.
addMsg
.
Content
=
this
.
NoticeBaseInfo
.
Content
;
this
.
addMsg
.
NoticeState
=
1
;
this
.
addMsg
.
Is_Top
=
2
;
this
.
addMsg
.
Is_Top
=
[];
}
this
.
persistent
=
true
;
},
closeSaveForm
()
{
this
.
persistent
=
false
},
save_t
(){
}
}
}
</
script
>
<
style
scoped
>
.second-item
{
}
</
style
>
src/router/routes.js
View file @
e051eff3
...
...
@@ -87,6 +87,11 @@ const routes = [{
component
:
()
=>
import
(
"pages/system/msgmanage.vue"
)
},
{
path
:
"/system/document"
,
//行政公告
component
:
()
=>
import
(
"pages/system/document.vue"
)
},
{
path
:
"/course/catagory"
,
//课程分类
component
:
()
=>
...
...
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