工作台、系统通知
Showing
6 changed files
with
391 additions
and
53 deletions
... | @@ -24,3 +24,20 @@ export function getHomeDoneList () { | ... | @@ -24,3 +24,20 @@ export function getHomeDoneList () { |
24 | method: 'get' | 24 | method: 'get' |
25 | }) | 25 | }) |
26 | } | 26 | } |
27 | |||
28 | //获取首页常办项目 | ||
29 | export function getHomeFrequentProjects () { | ||
30 | return request({ | ||
31 | url: SERVER.SERVERAPI + '/rest/workBench/getHomeFrequentProjects', | ||
32 | method: 'get' | ||
33 | }) | ||
34 | } | ||
35 | |||
36 | //保存常办项目 | ||
37 | export function saveFrequentProjectsList (data) { | ||
38 | return request({ | ||
39 | url: SERVER.SERVERAPI + '/rest/workBench/saveFrequentProjectsList', | ||
40 | method: 'post', | ||
41 | data | ||
42 | }) | ||
43 | } | ... | ... |
... | @@ -72,3 +72,11 @@ export function setReadStatus (params) { | ... | @@ -72,3 +72,11 @@ export function setReadStatus (params) { |
72 | params: params | 72 | params: params |
73 | }) | 73 | }) |
74 | } | 74 | } |
75 | |||
76 | //一键设置已读 | ||
77 | export function setAllRead () { | ||
78 | return request({ | ||
79 | url: SERVER.SERVERAPI + '/rest/system/sysNotice/setAllRead', | ||
80 | method: 'get' | ||
81 | }) | ||
82 | } | ... | ... |
src/views/home/components/addProject.vue
0 → 100644
1 | <template> | ||
2 | <dialogBox title="配置常办项目" @submitForm="submitForm" saveButton="保存" :isFullscreen="false" width="50%" | ||
3 | @closeDialog="closeDialog" v-model="value"> | ||
4 | <el-form ref="ruleForm" :model="ruleForm" label-width="100px" > | ||
5 | <el-tree | ||
6 | :data="projectList" | ||
7 | show-checkbox | ||
8 | node-key="id" | ||
9 | ref="tree" | ||
10 | check-strictly | ||
11 | :highlight-current='true' | ||
12 | :check-on-click-node="true" | ||
13 | :accordion="true" | ||
14 | :props="defaultProps" | ||
15 | :default-expand-all="true" | ||
16 | @check-change="handleClick" | ||
17 | ></el-tree> | ||
18 | </el-form> | ||
19 | </dialogBox> | ||
20 | </template> | ||
21 | <script> | ||
22 | import { getMenuInfo} from "@/api/user.js"; | ||
23 | import { saveFrequentProjectsList } from "@/api/home.js"; | ||
24 | export default { | ||
25 | props: { | ||
26 | value: { type: Boolean, default: false }, | ||
27 | bindItem: {type:Array, default: []} | ||
28 | }, | ||
29 | data () { | ||
30 | return { | ||
31 | projectList: [], | ||
32 | ruleForm: { | ||
33 | |||
34 | }, | ||
35 | checkedItem: [], | ||
36 | defaultProps: { | ||
37 | children: "children", | ||
38 | label: "name", | ||
39 | disabled:function(data,node){ | ||
40 | if(data.children && data.children.length > 0){ | ||
41 | return true | ||
42 | }else{ | ||
43 | return false | ||
44 | } | ||
45 | } | ||
46 | }, | ||
47 | uniqueValue:''//最后拿到的唯一选择的moduldCode值,相当于id | ||
48 | } | ||
49 | }, | ||
50 | mounted () { | ||
51 | this.queryClick() | ||
52 | this.dealCheckedItem(); | ||
53 | }, | ||
54 | methods: { | ||
55 | submitForm () { | ||
56 | var checkedNodes = this.$refs.tree.getCheckedNodes(); | ||
57 | if(checkedNodes.length > 6){ | ||
58 | this.$message.error("最多选择6个项目!"); | ||
59 | return | ||
60 | } | ||
61 | saveFrequentProjectsList(checkedNodes).then(res => { | ||
62 | if(res.code == 200){ | ||
63 | this.$parent.queryProjectList(); | ||
64 | this.$message.success("保存成功"); | ||
65 | this.$emit("input", false); | ||
66 | }else{ | ||
67 | this.$message.error(res.message); | ||
68 | } | ||
69 | }) | ||
70 | }, | ||
71 | queryClick(){ | ||
72 | getMenuInfo().then(res => { | ||
73 | this.projectList = res.result | ||
74 | }) | ||
75 | }, | ||
76 | dealCheckedItem(){ | ||
77 | }, | ||
78 | //关闭窗口 | ||
79 | closeDialog () { | ||
80 | this.$emit("input", false); | ||
81 | }, | ||
82 | //节点选择状态发生改变时 | ||
83 | handleClick(data,checked, node){ | ||
84 | var checkedNodes = this.$refs.tree.getCheckedNodes(); | ||
85 | if(checked){ | ||
86 | checkedNodes.push(data); | ||
87 | } | ||
88 | this.$refs.tree.setCheckedNodes(checkedNodes); | ||
89 | console.log(this.$refs.tree.getCheckedNodes()); | ||
90 | }, | ||
91 | } | ||
92 | } | ||
93 | </script> | ||
94 | <style scoped lang='scss'> | ||
95 | </style> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
... | @@ -3,28 +3,37 @@ | ... | @@ -3,28 +3,37 @@ |
3 | <div class="home-left"> | 3 | <div class="home-left"> |
4 | <el-row :gutter="8"> | 4 | <el-row :gutter="8"> |
5 | <el-col :span="12"> | 5 | <el-col :span="12"> |
6 | <el-card shadow="hover" :body-style="{ padding: '0' }"> | 6 | <el-card shadow="hover" :body-style="{ padding: '0' }" style="height:302px"> |
7 | <div slot="header" class="flexst"> | ||
8 | <h5 class="title">常办项目</h5> | ||
9 | <el-button type="primary" @click="setFrequencyProject()">配置常办</el-button> | ||
10 | </div> | ||
7 | <ul class="workbench flexst"> | 11 | <ul class="workbench flexst"> |
8 | <li v-for="(item, index) in newsListData" class="pointer" :key="index" | 12 | <li v-for="(item, index) in projectList" class="pointer" :key="index" |
9 | :style="{ backgroundColor: item.color }"> | 13 | :style="{ backgroundColor: newsListData[index] }"> |
10 | <i class="el-icon-s-claim"></i> | 14 | <i class="el-icon-s-claim"></i> |
11 | {{ item.title }} | 15 | {{ item.name }} |
12 | </li> | 16 | </li> |
13 | </ul> | 17 | </ul> |
14 | </el-card> | 18 | </el-card> |
15 | </el-col> | 19 | </el-col> |
16 | <el-col :span="12"> | 20 | <el-col :span="12"> |
17 | <el-card shadow="hover" style="height:247px"> | 21 | <el-card shadow="hover" style="height:302px"> |
18 | <div slot="header" class="flexst"> | 22 | <div slot="header" class="flexst"> |
19 | <h5 class="title">系统通知</h5> | 23 | <h5 class="title">系统通知</h5> |
20 | <i class="el-icon-s-unfold pointer"></i> | 24 | <el-popover placement="right" width="50" trigger="hover"> |
25 | <ul class="pointer"> | ||
26 | <li @click="$store.dispatch('tagsView/addView', moreNotice)">查看更多</li> | ||
27 | </ul> | ||
28 | <i class="el-icon-s-unfold pointer" slot="reference"></i> | ||
29 | </el-popover> | ||
21 | </div> | 30 | </div> |
22 | <ul> | 31 | <ul> |
23 | <li v-for="(item, index) in noticeList" :key="index" @click="handleNotice(item)" class="flexst pointer"> | 32 | <li v-for="(item, index) in noticeList" :key="index" @click="handleNotice(item)" class="flexst pointer"> |
24 | <p class="list-title">{{ item.noticeTitle }}</p> | 33 | <p class="list-title">{{ item.noticeTitle }}</p> |
25 | <p class="marginZL15">{{ item.noticePublishTime.substring(0, 10) }}</p> | 34 | <p class="marginZL15">{{ item.noticePublishTime.substring(0, 10) }}</p> |
26 | <p v-if="item.userBrowse == '1'" style="color:red">未读</p> | 35 | <p v-if="item.userBrowse == '1'" style="color:red">未读</p> |
27 | <p v-else>已读</p> | 36 | <p v-else style="color:green">已读</p> |
28 | </li> | 37 | </li> |
29 | </ul> | 38 | </ul> |
30 | </el-card> | 39 | </el-card> |
... | @@ -49,7 +58,12 @@ | ... | @@ -49,7 +58,12 @@ |
49 | <el-card shadow="hover" style="height:247px"> | 58 | <el-card shadow="hover" style="height:247px"> |
50 | <div slot="header" class="flexst"> | 59 | <div slot="header" class="flexst"> |
51 | <h5 class="title">政策法规</h5> | 60 | <h5 class="title">政策法规</h5> |
52 | <i class="el-icon-s-unfold pointer"></i> | 61 | <el-popover placement="right" width="50" trigger="hover"> |
62 | <ul class="pointer"> | ||
63 | <li @click="$store.dispatch('tagsView/addView', moreNotice)">查看更多</li> | ||
64 | </ul> | ||
65 | <i class="el-icon-s-unfold pointer" slot="reference"></i> | ||
66 | </el-popover> | ||
53 | </div> | 67 | </div> |
54 | <ul> | 68 | <ul> |
55 | <li v-for="(item, index) in policyList" @click="handleView(item.noticeFileUrl)" :key="index" | 69 | <li v-for="(item, index) in policyList" @click="handleView(item.noticeFileUrl)" :key="index" |
... | @@ -81,51 +95,22 @@ | ... | @@ -81,51 +95,22 @@ |
81 | </ul> | 95 | </ul> |
82 | </el-card> | 96 | </el-card> |
83 | </div> | 97 | </div> |
98 | <addDialog ref="addProject" v-model="projectDialog" :bindItem="projectList"/> | ||
84 | </div> | 99 | </div> |
85 | </template> | 100 | </template> |
86 | <script> | 101 | <script> |
87 | import * as G2 from '@antv/g2' | 102 | import * as G2 from '@antv/g2' |
88 | import calendar from '@/components/Calendar/index' | 103 | import calendar from '@/components/Calendar/index' |
89 | import vueSeamlessScroll from "vue-seamless-scroll" | 104 | import vueSeamlessScroll from "vue-seamless-scroll" |
90 | import { getHomeNoticeList, getHomeTodoList, getHomeDoneList } from "@/api/home.js"; | 105 | import { getHomeNoticeList, getHomeTodoList, getHomeDoneList,getHomeFrequentProjects } from "@/api/home.js"; |
91 | import { setReadStatus } from "@/api/notice.js"; | 106 | import { setReadStatus } from "@/api/notice.js"; |
107 | import addDialog from "./components/addProject.vue"; | ||
92 | export default { | 108 | export default { |
93 | name: 'home', | 109 | name: 'home', |
94 | components: { calendar, vueSeamlessScroll }, | 110 | components: { calendar, vueSeamlessScroll,addDialog }, |
95 | data () { | 111 | data () { |
96 | return { | 112 | return { |
97 | newsListData: [ | 113 | newsListData: ['#61AEFF','#43DEB3','#F3C143','#F09936','#9C92FF','#589FFF',], |
98 | { | ||
99 | icon: '', | ||
100 | title: '任务', | ||
101 | color: '#61AEFF' | ||
102 | }, | ||
103 | { | ||
104 | icon: '', | ||
105 | title: '邮件', | ||
106 | color: '#43DEB3' | ||
107 | }, | ||
108 | { | ||
109 | icon: '', | ||
110 | title: '消息', | ||
111 | color: '#F3C143' | ||
112 | }, | ||
113 | { | ||
114 | icon: '', | ||
115 | title: '日历', | ||
116 | color: '#F09936' | ||
117 | }, | ||
118 | { | ||
119 | icon: '', | ||
120 | title: '常用功能', | ||
121 | color: '#9C92FF' | ||
122 | }, | ||
123 | { | ||
124 | icon: '', | ||
125 | title: '申请', | ||
126 | color: '#589FFF' | ||
127 | } | ||
128 | ], | ||
129 | chartData: [{ | 114 | chartData: [{ |
130 | year: '1991', | 115 | year: '1991', |
131 | value: 15468 | 116 | value: 15468 |
... | @@ -149,21 +134,27 @@ export default { | ... | @@ -149,21 +134,27 @@ export default { |
149 | value: 31056 | 134 | value: 31056 |
150 | }], | 135 | }], |
151 | // 系统通知 | 136 | // 系统通知 |
152 | noticeData: { | 137 | noticeData: {}, |
153 | 138 | noticeList: [],//通知列表 | |
139 | todoList: [],//待办列表 | ||
140 | doneList: [],//已办列表 | ||
141 | policyList: [],//法律法规列表 | ||
142 | projectList: [],//常办项目列表 | ||
143 | projectDialog: false, | ||
144 | moreNotice: { | ||
145 | fullPath: '/system/xttz/xttzview', | ||
146 | name: '系统通知', | ||
147 | path: '/system/xttz/xttzview', | ||
148 | meta: { title: '系统通知' } | ||
154 | }, | 149 | }, |
155 | noticeList: [], | ||
156 | todoList: [], | ||
157 | doneList: [], | ||
158 | policyList: [], | ||
159 | |||
160 | } | 150 | } |
161 | }, | 151 | }, |
162 | mounted () { | 152 | mounted () { |
163 | this.buildChart(); | 153 | this.buildChart();//构建图标 |
164 | this.queryTodoList(); | 154 | this.queryTodoList();//获取待办列表 |
165 | this.queryDoneList(); | 155 | this.queryDoneList();//获取已办列表 |
166 | this.queryNoticeList(); | 156 | this.queryNoticeList();//获取通知、法律法规列表 |
157 | this.queryProjectList();//获取常办项目列表 | ||
167 | }, | 158 | }, |
168 | methods: { | 159 | methods: { |
169 | handleView (pdfUrl) { | 160 | handleView (pdfUrl) { |
... | @@ -198,6 +189,14 @@ export default { | ... | @@ -198,6 +189,14 @@ export default { |
198 | } | 189 | } |
199 | }) | 190 | }) |
200 | }, | 191 | }, |
192 | //获取常办项目列表 | ||
193 | queryProjectList(){ | ||
194 | getHomeFrequentProjects().then(res => { | ||
195 | if(res.result){ | ||
196 | this.projectList = res.result | ||
197 | } | ||
198 | }) | ||
199 | }, | ||
201 | _timedate (d) { | 200 | _timedate (d) { |
202 | var td = new Date(); | 201 | var td = new Date(); |
203 | td = new Date(td.getFullYear(), td.getMonth(), td.getDate()); | 202 | td = new Date(td.getFullYear(), td.getMonth(), td.getDate()); |
... | @@ -242,6 +241,15 @@ export default { | ... | @@ -242,6 +241,15 @@ export default { |
242 | chart.line().position('year*value').size(2).shape('smooth'); | 241 | chart.line().position('year*value').size(2).shape('smooth'); |
243 | chart.render(); | 242 | chart.render(); |
244 | }, | 243 | }, |
244 | //跳转到更多通知列表页面 | ||
245 | jumpToMoreNotice(){ | ||
246 | console.log(this.$route); | ||
247 | |||
248 | }, | ||
249 | //配置常办项目 | ||
250 | setFrequencyProject(){ | ||
251 | this.projectDialog = true; | ||
252 | }, | ||
245 | handleNotice (item) { | 253 | handleNotice (item) { |
246 | this.$alertMes(item.noticeTitle, item.noticeContent) | 254 | this.$alertMes(item.noticeTitle, item.noticeContent) |
247 | } | 255 | } | ... | ... |
src/views/system/xttz/xttzview.vue
0 → 100644
1 | <template> | ||
2 | <div class="from-clues"> | ||
3 | <!-- 表单部分 --> | ||
4 | <div class="from-clues-header"> | ||
5 | <el-form :model="ruleForm" @submit.native.prevent label-width="80px"> | ||
6 | <el-row> | ||
7 | <el-col :span="5"> | ||
8 | <el-form-item label="通知标题"> | ||
9 | <el-input v-model="ruleForm.noticeTitle" @clear="queryClick()" clearable placeholder="通知标题"></el-input> | ||
10 | </el-form-item> | ||
11 | </el-col> | ||
12 | <el-col :span="19" class="btnColRight"> | ||
13 | <el-form-item> | ||
14 | <el-button type="primary" native-type="submit" @click="queryClick()">查询</el-button> | ||
15 | <el-button type="primary" native-type="submit" @click="toReadAll()">一键已读</el-button> | ||
16 | </el-form-item> | ||
17 | </el-col> | ||
18 | </el-row> | ||
19 | </el-form> | ||
20 | </div> | ||
21 | <!-- 表格 --> | ||
22 | <div class="from-clues-content"> | ||
23 | <lb-table :page-size="pageData.size" border :current-page.sync="pageData.current" :total="tableData.total" | ||
24 | @size-change="handleSizeChange" @p-current-change="handleCurrentChange" :column="tableData.columns" | ||
25 | :data="tableData.data"> | ||
26 | </lb-table> | ||
27 | </div> | ||
28 | <addDialog ref="addDialog" v-model="isDialog" :isButtonFlag="isButtonFlag" :title="dialogTitle"/> | ||
29 | </div> | ||
30 | </template> | ||
31 | <script> | ||
32 | import table from "@/utils/mixin/table"; | ||
33 | import { datas, sendThis } from "./xttzviewdata"; | ||
34 | import { getSysNoticeList,setReadStatus,setAllRead} from "@/api/notice.js" | ||
35 | import addDialog from "./components/addDialog.vue"; | ||
36 | export default { | ||
37 | name: "xttzview", | ||
38 | components: { addDialog }, | ||
39 | mixins: [table], | ||
40 | mounted () { | ||
41 | sendThis(this); | ||
42 | this.queryClick() | ||
43 | }, | ||
44 | data () { | ||
45 | return { | ||
46 | isDialog: false, | ||
47 | isButtonFlag: true, | ||
48 | dialogTitle: '', | ||
49 | ruleForm: { | ||
50 | noticeTitle: '', | ||
51 | noticeStatus: '2' | ||
52 | }, | ||
53 | tableData: { | ||
54 | total: 0, | ||
55 | columns: datas.columns(), | ||
56 | data: [], | ||
57 | }, | ||
58 | isDiglog: false | ||
59 | } | ||
60 | }, | ||
61 | methods: { | ||
62 | // 列表渲染接口 | ||
63 | queryClick () { | ||
64 | this.$startLoading() | ||
65 | getSysNoticeList({ ...this.ruleForm, ...this.pageData }, { 'target': '#xttzLoading' }).then(res => { | ||
66 | if (res.code === 200) { | ||
67 | this.$endLoading() | ||
68 | let { total, records } = res.result | ||
69 | this.tableData.total = total; | ||
70 | this.tableData.data = records | ||
71 | } | ||
72 | }) | ||
73 | }, | ||
74 | //打开新增弹窗 | ||
75 | openDialog (item) { | ||
76 | this.$nextTick(() => { | ||
77 | this.isButtonFlag = false; | ||
78 | this.$refs.addDialog.getDetailInfo(item); | ||
79 | this.dialogTitle = '系统通知详情' | ||
80 | this.isDialog = true; | ||
81 | }) | ||
82 | let that = this; | ||
83 | if(item.isRead == 1){ | ||
84 | setReadStatus({bsmNotice: item.bsmNotice}).then(res => { | ||
85 | if(res.code == 200){ | ||
86 | that.$nextTick(()=> { | ||
87 | item.isRead = 2 | ||
88 | }) | ||
89 | } | ||
90 | }) | ||
91 | } | ||
92 | }, | ||
93 | //一键已读 | ||
94 | toReadAll(){ | ||
95 | setAllRead().then(res => { | ||
96 | if(res.code == 200){ | ||
97 | this.$message.success('设置成功') | ||
98 | this.queryClick(); | ||
99 | }else{ | ||
100 | this.$message.error("设置失败") | ||
101 | } | ||
102 | }) | ||
103 | }, | ||
104 | downloadFile (item) { | ||
105 | const href = item.noticeFileUrl | ||
106 | window.open(href, '_blank'); | ||
107 | } | ||
108 | }, | ||
109 | }; | ||
110 | </script> | ||
111 | <style scoped lang="scss"> | ||
112 | @import "~@/styles/public.scss"; | ||
113 | </style> |
src/views/system/xttz/xttzviewdata.js
0 → 100644
1 | import filter from '@/utils/filter.js' | ||
2 | let vm = null | ||
3 | const sendThis = (_this) => { | ||
4 | vm = _this | ||
5 | } | ||
6 | class data extends filter { | ||
7 | constructor() { | ||
8 | super() | ||
9 | } | ||
10 | columns () { | ||
11 | return [ | ||
12 | { | ||
13 | label: '序号', | ||
14 | type: 'index', | ||
15 | width: '50', | ||
16 | render: (h, scope) => { | ||
17 | return ( | ||
18 | <div> | ||
19 | {(vm.pageData.currentPage - 1) * vm.pageData.pageSize + scope.$index + 1} | ||
20 | </div> | ||
21 | ) | ||
22 | } | ||
23 | }, | ||
24 | { | ||
25 | prop: "noticeTitle", | ||
26 | label: "通知标题", | ||
27 | }, | ||
28 | { | ||
29 | prop: "noticeSource", | ||
30 | label: "通知来源", | ||
31 | }, | ||
32 | { | ||
33 | label: "通知内容", | ||
34 | render: (h, scope) => { | ||
35 | return <div class="item-cwnr" domPropsInnerHTML={scope.row.noticeContent}></div> | ||
36 | } | ||
37 | }, | ||
38 | { | ||
39 | prop: "noticeFileName", | ||
40 | label: "通知附件", | ||
41 | render: (h, scope) => { | ||
42 | return <div class="pointer" onClick={() => { vm.downloadFile(scope.row) }}>{scope.row.noticeFileName}</div> | ||
43 | } | ||
44 | }, | ||
45 | { | ||
46 | prop: "noticePublishTime", | ||
47 | label: "发布时间", | ||
48 | }, | ||
49 | { | ||
50 | prop: "creater", | ||
51 | width: '120', | ||
52 | label: "发布人", | ||
53 | }, | ||
54 | { | ||
55 | prop: "noticePublishTime", | ||
56 | label: "发布时间", | ||
57 | }, | ||
58 | { | ||
59 | label: "是否已读", | ||
60 | width: '80', | ||
61 | render: (h, scope) => { | ||
62 | switch (scope.row.isRead) { | ||
63 | case '1': | ||
64 | return <div class='prohibit'>未读</div> | ||
65 | case '2': | ||
66 | return <div class='allow'>已读</div> | ||
67 | } | ||
68 | } | ||
69 | }, | ||
70 | { | ||
71 | label: '操作', | ||
72 | align: 'center', | ||
73 | fixed: 'right', | ||
74 | render: (h, scope) => { | ||
75 | return <div> | ||
76 | <el-button type="text" icon="el-icon-view" onClick={() => { vm.openDialog(scope.row) }}>查看</el-button> | ||
77 | </div> | ||
78 | } | ||
79 | } | ||
80 | ] | ||
81 | } | ||
82 | |||
83 | ywlys () { | ||
84 | return [ | ||
85 | { value: 1, label: "办事大厅" }, | ||
86 | { value: 2, label: "微信小程序" }, | ||
87 | { value: 3, label: "法院端" }, | ||
88 | { value: 4, label: "银行端" }, | ||
89 | ] | ||
90 | } | ||
91 | |||
92 | } | ||
93 | let datas = new data() | ||
94 | export { | ||
95 | datas, | ||
96 | sendThis | ||
97 | } |
-
Please register or sign in to post a comment