ddb95828 by 蔡俊立

系统通知

1 parent d788fadb
1 import request from '@/utils/request'
2 import SERVER from './config'
3
4 // 获取首页通知公告列表
5 export function getHomeNoticeList () {
6 return request({
7 url: SERVER.SERVERAPI + '/rest/workBench/getHomeNoticeList',
8 method: 'get'
9 })
10 }
11
12 // 获取首页待办事项
13 export function getHomeTodoList () {
14 return request({
15 url: SERVER.SERVERAPI + '/rest/workBench/getHomeTodoList',
16 method: 'get'
17 })
18 }
19
20 //获取首页已办事项
21 export function getHomeDoneList () {
22 return request({
23 url: SERVER.SERVERAPI + '/rest/workBench/getHomeDoneList',
24 method: 'get'
25 })
26 }
1 import request from '@/utils/request'
2 import SERVER from './config'
3
4 // 新增系统通知
5 export function addSysNotice (data) {
6 return request({
7 url: SERVER.SERVERAPI + '/rest/system/sysNotice/addSysNotice',
8 method: 'post',
9 data
10 })
11 }
12
13 // 获取通知列表
14 export function getSysNoticeList (data) {
15 return request({
16 url: SERVER.SERVERAPI + '/rest/system/sysNotice/getSysNoticeList',
17 method: 'post',
18 data
19 })
20 }
21
22 //获取法律法规列表
23 export function getSysPolicyList (data) {
24 return request({
25 url: SERVER.SERVERAPI + '/rest/system/sysNotice/getSysPolicyList',
26 method: 'post',
27 data
28 })
29 }
30
31 //删除系统通知
32 export function deleteSysNotice (params) {
33 return request({
34 url: SERVER.SERVERAPI + '/rest/system/sysNotice/deleteSysNotice',
35 method: 'get',
36 params: params
37 })
38 }
39
40 //发布通知
41 export function publishNotice (params) {
42 return request({
43 url: SERVER.SERVERAPI + '/rest/system/sysNotice/publishNotice',
44 method: 'get',
45 params: params
46 })
47 }
48
49 //取消发布通知
50 export function unPublishNotice (params) {
51 return request({
52 url: SERVER.SERVERAPI + '/rest/system/sysNotice/unPublishNotice',
53 method: 'get',
54 params: params
55 })
56 }
57
58 //设置已读状态
59 export function setReadStatus (params) {
60 return request({
61 url: SERVER.SERVERAPI + '/rest/system/sysNotice/setReadStatus',
62 method: 'get',
63 params: params
64 })
65 }
1 import request from '@/utils/request' 1 import request from '@/utils/request'
2 import SERVER from './config' 2 import SERVER from './config'
3
4 // 上传单个文件
5 export function upload (data) {
6 return request({
7 url: SERVER.SERVERAPI + '/rest/file/upload',
8 method: 'post',
9 data
10 })
11 }
12
3 /* 13 /*
4 系统管理 14 系统管理
5 申请业务规则API-根据条件进行列表查询 15 申请业务规则API-根据条件进行列表查询
......
...@@ -261,6 +261,22 @@ export const asyncRoutes = [ ...@@ -261,6 +261,22 @@ export const asyncRoutes = [
261 name: 'dymbgl', 261 name: 'dymbgl',
262 meta: { title: '打印模板管理' } 262 meta: { title: '打印模板管理' }
263 }, 263 },
264 {
265 path: 'xttz',
266 id: '95',
267 parentId: '9',
268 component: () => import('@/views/system/xttz/xttz.vue'),
269 name: 'xttz',
270 meta: { title: '系统通知' }
271 },
272 {
273 path: 'flfg',
274 id: '96',
275 parentId: '9',
276 component: () => import('@/views/system/flfg/flfg.vue'),
277 name: 'flfg',
278 meta: { title: '法律法规' }
279 },
264 ] 280 ]
265 }, 281 },
266 { 282 {
......
...@@ -69,5 +69,21 @@ ...@@ -69,5 +69,21 @@
69 .home-right { 69 .home-right {
70 padding-left: 4px; 70 padding-left: 4px;
71 width: 30%; 71 width: 30%;
72
73 .list-title {
74 overflow: hidden;
75 text-overflow: ellipsis;
76 white-space: nowrap;
77 }
78
79 ul {
80 li {
81 line-height: 36px;
82
83 p {
84 white-space: nowrap;
85 }
86 }
87 }
72 } 88 }
73 } 89 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -14,16 +14,17 @@ ...@@ -14,16 +14,17 @@
14 </el-card> 14 </el-card>
15 </el-col> 15 </el-col>
16 <el-col :span="12"> 16 <el-col :span="12">
17 <el-card shadow="hover"> 17 <el-card shadow="hover" style="height:245px">
18 <div slot="header" class="flexst"> 18 <div slot="header" class="flexst">
19 <h5 class="title">通知公告</h5> 19 <h5 class="title">系统通知</h5>
20 <i class="el-icon-s-unfold pointer"></i> 20 <i class="el-icon-s-unfold pointer"></i>
21 </div> 21 </div>
22 <ul> 22 <ul>
23 <li v-for="(item, index) in notice" :key="index" class="flexst pointer"> 23 <li v-for="(item, index) in noticeList" :key="index" class="flexst pointer">
24 <p class="list-title">{{ item.title }}</p> 24 <p class="list-title">{{ item.noticeTitle }}</p>
25 <p class="marginZL15">{{ item.date }}</p> 25 <p class="marginZL15">{{ item.createtime }}</p>
26 <p>{{ item.state }}</p> 26 <p v-if="item.userBrowse == '1'" style="color:red">未读</p>
27 <p v-else>已读</p>
27 </li> 28 </li>
28 </ul> 29 </ul>
29 </el-card> 30 </el-card>
...@@ -31,29 +32,29 @@ ...@@ -31,29 +32,29 @@
31 </el-row> 32 </el-row>
32 <el-row :gutter="8" class="marginTop10"> 33 <el-row :gutter="8" class="marginTop10">
33 <el-col :span="12"> 34 <el-col :span="12">
34 <el-card shadow="hover"> 35 <el-card shadow="hover" style="height:280px">
35 <div slot="header" class="flexst"> 36 <div slot="header" class="flexst">
36 <h5 class="title">待办事项</h5> 37 <h5 class="title">待办事项</h5>
37 <i class="el-icon-s-unfold pointer"></i> 38 <i class="el-icon-s-unfold pointer"></i>
38 </div> 39 </div>
39 <ul> 40 <ul>
40 <li v-for="(item, index) in toList" :key="index" class="flexst"> 41 <li v-for="(item, index) in todoList" :key="index" class="flexst">
41 <p class="right15">{{ item.date }}</p> 42 <p class="right15">{{ item.dealTime }}</p>
42 <p class="list-title">{{ item.title }}</p> 43 <p class="list-title">{{ item.dealBusiness }} ({{item.dealStep+ '环节'}})</p>
43 </li> 44 </li>
44 </ul> 45 </ul>
45 </el-card> 46 </el-card>
46 </el-col> 47 </el-col>
47 <el-col :span="12"> 48 <el-col :span="12">
48 <el-card shadow="hover"> 49 <el-card shadow="hover" style="height:280px">
49 <div slot="header" class="flexst"> 50 <div slot="header" class="flexst">
50 <h5 class="title">法律法规</h5> 51 <h5 class="title">法律法规</h5>
51 <i class="el-icon-s-unfold pointer"></i> 52 <i class="el-icon-s-unfold pointer"></i>
52 </div> 53 </div>
53 <ul> 54 <ul>
54 <li v-for="(item, index) in mailList" @click="handleView" :key="index" class="flexst pointer"> 55 <li v-for="(item, index) in policyList" @click="handleView(item.noticeFileUrl)" :key="index" class="flexst pointer">
55 <p class="right15">{{ item.date }}</p> 56 <p class="right15">{{ item.noticeTitle }}</p>
56 <p class="list-title">{{ item.title }}</p> 57 <p class="list-title">{{ item.createtime }}</p>
57 </li> 58 </li>
58 </ul> 59 </ul>
59 </el-card> 60 </el-card>
...@@ -66,7 +67,16 @@ ...@@ -66,7 +67,16 @@
66 <div class="home-right"> 67 <div class="home-right">
67 <calendar /> 68 <calendar />
68 <el-card shadow="hover" class="marginTop10"> 69 <el-card shadow="hover" class="marginTop10">
69 鼠标悬浮时显示 70 <div slot="header" class="flexst">
71 <h5 class="title">动态信息</h5>
72 <i class="el-icon-s-unfold pointer"></i>
73 </div>
74 <ul>
75 <li v-for="(item, index) in doneList" :key="index" class="flexst">
76 <p class="right15">{{ item.dealTime }}</p>
77 <p class="list-title">{{ item.dealBusiness }} ({{item.dealStep+ '环节'}})</p>
78 </li>
79 </ul>
70 </el-card> 80 </el-card>
71 </div> 81 </div>
72 </div> 82 </div>
...@@ -74,6 +84,8 @@ ...@@ -74,6 +84,8 @@
74 <script> 84 <script>
75 import * as G2 from '@antv/g2' 85 import * as G2 from '@antv/g2'
76 import calendar from '@/components/Calendar/index' 86 import calendar from '@/components/Calendar/index'
87 import { getHomeNoticeList, getHomeTodoList, getHomeDoneList } from "@/api/home.js";
88 import { setReadStatus } from "@/api/notice.js";
77 export default { 89 export default {
78 name: 'home', 90 name: 'home',
79 components: { calendar }, 91 components: { calendar },
...@@ -136,76 +148,51 @@ export default { ...@@ -136,76 +148,51 @@ export default {
136 year: '1996', 148 year: '1996',
137 value: 31056 149 value: 31056
138 }], 150 }],
139 notice: [ 151 noticeList: [],
140 { 152 todoList: [],
141 title: '坚持以人民为中心发展推进解决房地产历史遗房地产历史遗', 153 doneList: [],
142 date: '2022-12', 154 policyList: []
143 state: '未读' 155 }
144 },
145 {
146 title: '坚持以人民为中心发展推进解决房地产历史遗房地产历史遗',
147 date: '2022-12',
148 state: '未读'
149 },
150 {
151 title: '坚持以人民为中心发展推进解决房地产历史遗房地产历史遗',
152 date: '2022-12',
153 state: '未读'
154 }, 156 },
155 { 157 mounted () {
156 title: '坚持以人民为中心发展推进解决房地产历史遗房地产历史遗', 158 this.buildChart();
157 date: '2022-12', 159 this.queryTodoList();
158 state: '未读' 160 this.queryDoneList();
161 this.queryNoticeList();
159 }, 162 },
160 ], 163 methods: {
161 toList: [ 164 handleView (pdfUrl) {
162 { 165 const href = pdfUrl
163 title: '坚持以人民为中心发展推进解决房地产历史遗房地产历史遗', 166 window.open(href, '_blank');
164 date: '2022-12',
165 }, 167 },
166 { 168 //获取待办事项列表
167 title: '坚持以人民为中心发展推进解决房地产历史遗房地产历史遗', 169 queryTodoList(){
168 date: '2022-12', 170 getHomeTodoList().then(res => {
171 if(res.result){
172 this.todoList = res.result
169 } 173 }
170 , 174 })
171 {
172 title: '坚持以人民为中心发展推进解决房地产历史遗房地产历史遗',
173 date: '2022-12',
174 }
175 ,
176 {
177 title: '坚持以人民为中心发展推进解决房地产历史遗房地产历史遗',
178 date: '2022-12',
179 }
180 ],
181 mailList: [
182 {
183 title: '坚持以人民为中心发展推进解决房地产历史遗房地产历史遗',
184 date: '2022-12',
185 },
186 {
187 title: '坚持以人民为中心发展推进解决房地产历史遗房地产历史遗',
188 date: '2022-12',
189 }, 175 },
190 { 176 //获取已办事项列表
191 title: '坚持以人民为中心发展推进解决房地产历史遗房地产历史遗', 177 queryDoneList(){
192 date: '2022-12', 178 getHomeDoneList().then(res => {
193 } 179 if(res.result){
194 , 180 this.doneList = res.result
195 {
196 title: '坚持以人民为中心发展推进解决房地产历史遗房地产历史遗',
197 date: '2022-12',
198 }
199 ]
200 } 181 }
182 })
201 }, 183 },
202 mounted () { 184 //获取通知列表
203 this.buildChart(); 185 queryNoticeList(){
186 getHomeNoticeList().then(res => {
187 if(res.result){
188 this.noticeList = res.result.noticeList
189 this.policyList = res.result.policyList
190 }
191 })
204 }, 192 },
205 methods: { 193 //点击通知调取已读接口
206 handleView () { 194 toSetRead(bsmNotice){
207 const href = 'http://storage.xuetangx.com/public_assets/xuetangx/PDF/PlayerAPI_v1.0.6.pdf' 195 setReadStatus({'bsmNotice':bsmNotice})
208 window.open(href, '_blank');
209 }, 196 },
210 buildChart () { 197 buildChart () {
211 var chart = new G2.Chart({ 198 var chart = new G2.Chart({
......
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" :rules="rules">
5 <el-row>
6 <el-col :span="12">
7 <el-form-item label="标题:" prop="noticeTitle">
8 <el-input v-model="ruleForm.noticeTitle"></el-input>
9 </el-form-item>
10 </el-col>
11 </el-row>
12 <el-row>
13 <el-col :span="8">
14 <el-form-item label="附件:" prop="noticeFileUrl">
15 <el-upload action="" :file-list="fileList" multiple :auto-upload="false" :limit="1"
16 :on-change="handleChange" :before-upload="beforeUpload">
17 <el-button icon="el-icon-upload" type="primary">上传</el-button>
18 <div slot="tip" class="el-upload__tip">支持上传doc、docx、xls、xlsx、pdf文件,大小不超过20MB</div>
19 </el-upload>
20 </el-form-item>
21 </el-col>
22 </el-row>
23 </el-form>
24 </dialogBox>
25 </template>
26
27 <script>
28 import '@/styles/package/theme/index.scss'
29 import { addSysNotice} from "@/api/notice.js"
30 import { upload} from "@/api/system.js"
31 export default {
32 props: {
33 value: { type: Boolean, default: false },
34 },
35 data () {
36 return {
37 ruleForm: {
38 noticeTitle: '',
39 noticeContent: '',
40 noticeFileUrl: '',
41 noticeType: '2'
42 },
43 rules: {
44 noticeTitle: [
45 { required: true, message: '请输入法律法规标题', trigger: 'blur' }
46 ]
47 },
48 }
49 },
50
51 methods: {
52 submitForm () {
53 let that = this;
54 that.$refs.ruleForm.validate(valid => {
55 if (valid) {
56 addSysNotice(this.ruleForm).then(res => {
57 if (res.code == 200) {
58 this.$message.success('保存成功')
59 this.$emit("input", false);
60 this.$parent.queryClick();
61 } else {
62 this.$message.error(res.message)
63 }})
64 } else {
65 // console.log('error submit!!');
66 return false;
67 }
68 });
69 },
70 //关闭窗口
71 closeDialog () {
72 this.$emit("input", false);
73 this.resetRuleForm();
74 },
75 //
76 resetRuleForm(){
77 this.$refs['ruleForm'].resetFields();
78 this.ruleForm.noticeType = '2'
79 },
80 beforeUpload (file) {
81 return true;
82 },
83 async handleChange (file) {
84 var formdata = new FormData();
85 formdata.append("file", file.raw);
86 upload(formdata).then(res => {
87 this.ruleForm.noticeFileUrl = res.message
88 })
89 },
90 }
91 }
92 </script>
93 <style scoped lang="scss">
94 @import "~@/styles/public.scss";
95 </style>
...\ No newline at end of file ...\ No newline at end of file
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" @click="openDialog()">新增</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" />
29 </div>
30 </template>
31 <script>
32 import table from "@/utils/mixin/table";
33 import { datas, sendThis } from "./flfgdata";
34 import { getSysPolicyList,deleteSysNotice } from "@/api/notice.js"
35 import addDialog from "./components/addDialog.vue";
36 export default {
37 name: "xttz",
38 components: { addDialog},
39 mixins: [table],
40 mounted () {
41 sendThis(this);
42 this.queryClick()
43 },
44 data () {
45 return {
46 isDialog: false,
47 viewDialog: false,
48 ruleForm: {
49 noticeTitle: ''
50 },
51 tableData: {
52 total: 0,
53 columns: datas.columns(),
54 data: [],
55 },
56 isDiglog: false
57 }
58 },
59 methods: {
60 // 列表渲染接口
61 queryClick () {
62 this.$startLoading()
63 getSysPolicyList({ ...this.ruleForm, ...this.pageData }, { 'target': '#flfgLoading' }).then(res => {
64 if (res.code === 200) {
65 this.$endLoading()
66 let { total, records } = res.result
67 this.tableData.total = total;
68 this.tableData.data = records
69 }
70 })
71 },
72 //打开新增弹窗
73 openDialog() {
74 this.isDialog = true;
75 },
76 downloadFile(item){
77 const href = item.noticeFileUrl
78 window.open(href, '_blank');
79 },
80 //删除
81 delNotice(item){
82 this.$confirm('是否确定删除', '提示', {
83 confirmButtonText: '确定',
84 cancelButtonText: '取消',
85 type: 'warning'
86 }).then(() => {
87 deleteSysNotice({ "bsmNotice": item.bsmNotice }).then(res => {
88 if (res.code == 200) {
89 this.$message.success('删除成功')
90 this.queryClick();
91 } else {
92 this.$message.error(res.message)
93 }
94 })
95 }).catch(() => {
96 this.$message({
97 type: 'info',
98 message: '已取消删除'
99 });
100 });
101 },
102 },
103 };
104 </script>
105 <style scoped lang="scss">
106 @import "~@/styles/public.scss";
107 </style>
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: "noticeFileName",
30 label: "附件",
31 render: (h, scope) => {
32 return <div class="pointer" onClick={() => { vm.downloadFile(scope.row) }}>{scope.row.noticeFileName}</div>
33 }
34 },
35 {
36 prop: "creater",
37 width: '120',
38 label: "创建人",
39 },
40 {
41 prop: "createtime",
42 label: "创建时间",
43 },
44 {
45 label: '操作',
46 align: 'center',
47 fixed: 'right',
48 render: (h, scope) => {
49 return <div>
50 <el-button type="text" icon="el-icon-delete" onClick={() => { vm.delNotice(scope.row) }}>删除</el-button>
51 </div>
52 }
53 }
54 ]
55 }
56
57 ywlys () {
58 return [
59 { value: 1, label: "办事大厅" },
60 { value: 2, label: "微信小程序" },
61 { value: 3, label: "法院端" },
62 { value: 4, label: "银行端" },
63 ]
64 }
65
66 }
67 let datas = new data()
68 export {
69 datas,
70 sendThis
71 }
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" :rules="rules">
5 <el-row>
6 <el-col :span="12">
7 <el-form-item label="通知标题:" prop="noticeTitle">
8 <el-input v-model="ruleForm.noticeTitle"></el-input>
9 </el-form-item>
10 </el-col>
11 </el-row>
12 <el-row>
13 <el-col :span="24">
14 <el-form-item label="通知内容:" prop="noticeContent">
15 <el-input v-model="ruleForm.noticeContent" type="textarea" :rows="16"></el-input>
16 </el-form-item>
17 </el-col>
18 </el-row>
19 <el-row>
20 <el-col :span="8">
21 <el-form-item label="附件:" prop="noticeFileUrl">
22 <el-upload action="" :file-list="fileList" multiple :auto-upload="false" :limit="1"
23 :on-change="handleChange" :before-upload="beforeUpload">
24 <el-button icon="el-icon-upload" type="primary">上传</el-button>
25 <div slot="tip" class="el-upload__tip">文件大小不超过20MB</div>
26 </el-upload>
27 </el-form-item>
28 </el-col>
29 </el-row>
30 </el-form>
31 </dialogBox>
32 </template>
33
34 <script>
35 import '@/styles/package/theme/index.scss'
36 import { addSysNotice} from "@/api/notice.js"
37 import { upload} from "@/api/system.js"
38 export default {
39 props: {
40 value: { type: Boolean, default: false },
41 },
42 data () {
43 return {
44 ruleForm: {
45 noticeTitle: '',
46 noticeContent: '',
47 noticeFileUrl: '',
48 noticeType: '1'
49 },
50 rules: {
51 noticeTitle: [
52 { required: true, message: '请输入通知标题', trigger: 'blur' }
53 ],
54 noticeContent: [
55 { required: true, message: '请输入通知内容', trigger: 'blur' }
56 ]
57 },
58 }
59 },
60
61 methods: {
62 submitForm () {
63 let that = this;
64 that.$refs.ruleForm.validate(valid => {
65 if (valid) {
66 addSysNotice(this.ruleForm).then(res => {
67 if (res.code == 200) {
68 this.$message.success('保存成功')
69 this.$emit("input", false);
70 this.$parent.queryClick();
71 } else {
72 this.$message.error(res.message)
73 }})
74 } else {
75 // console.log('error submit!!');
76 return false;
77 }
78 });
79 },
80 //关闭窗口
81 closeDialog () {
82 this.$emit("input", false);
83 this.resetRuleForm();
84 },
85 //
86 resetRuleForm(){
87 this.$refs['ruleForm'].resetFields();
88 this.ruleForm.noticeType = '1'
89 },
90 beforeUpload (file) {
91 return true
92 },
93 async handleChange (file) {
94 var formdata = new FormData();
95 formdata.append("file", file.raw);
96 upload(formdata).then(res => {
97 this.ruleForm.noticeFileUrl = res.message
98 })
99 },
100 }
101 }
102 </script>
103 <style scoped lang="scss">
104 @import "~@/styles/public.scss";
105 </style>
...\ No newline at end of file ...\ No newline at end of file
1 <template>
2 <div>
3 <el-row :gutter="8">
4 <el-col :span="16">
5 通知标题:
6 <el-input v-model="formData.item.noticeTitle"></el-input>
7 </el-col>
8 </el-row>
9 <el-row :gutter="8">
10 <el-col :span="24" class="margin-top-middle">
11 通知内容:
12 <el-input type="textarea" :rows="20" v-model="formData.item.noticeContent"></el-input>
13 </el-col>
14 </el-row>
15 <el-row :gutter="8">
16 <el-col :span="24" class="margin-top-middle">
17 附件:
18 <div @click="handleView(formData.item.noticeFileUrl)" class="pointer">{{formData.item.noticeFileName}}</div>
19 </el-col>
20 </el-row>
21 </div>
22 </template>
23 <script>
24 export default {
25 data () {
26 return {
27 };
28 },
29 components: { },
30 props: {
31 formData: {
32 type: Object,
33 default: () => {}
34 },
35 },
36 created(){
37 console.log(this.formData);
38 },
39 computed: {
40
41 },
42
43 methods: {
44
45 },
46 };
47 </script>
48 <style scoped lang='scss'>
49 @import "~@/styles/public.scss";
50 .margin-top-middle {
51 margin-top:10px
52 }
53 </style>
...\ No newline at end of file ...\ No newline at end of file
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="5">
13 <el-form-item label="通知状态">
14 <el-select v-model="ruleForm.noticeStatus" class="width100" filterable clearable placeholder="请选择通知状态">
15 <el-option v-for="item in noticeStatusList" :key="item.value" :label="item.label" :value="item.value">
16 </el-option>
17 </el-select>
18 </el-form-item>
19 </el-col>
20 <el-col :span="14" class="btnColRight">
21 <el-form-item>
22 <el-button type="primary" native-type="submit" @click="queryClick()">查询</el-button>
23 <el-button type="primary" @click="openDialog()">新增</el-button>
24 </el-form-item>
25 </el-col>
26 </el-row>
27 </el-form>
28 </div>
29 <!-- 表格 -->
30 <div class="from-clues-content">
31 <lb-table :page-size="pageData.size" border :current-page.sync="pageData.current" :total="tableData.total"
32 @size-change="handleSizeChange" @p-current-change="handleCurrentChange" :column="tableData.columns"
33 :data="tableData.data">
34 </lb-table>
35 </div>
36 <addDialog ref="addDialog" v-model="isDialog" />
37 </div>
38 </template>
39 <script>
40 import table from "@/utils/mixin/table";
41 import { datas, sendThis } from "./xttzdata";
42 import { getSysNoticeList,deleteSysNotice,publishNotice,unPublishNotice } from "@/api/notice.js"
43 import addDialog from "./components/addDialog.vue";
44 export default {
45 name: "xttz",
46 components: { addDialog},
47 mixins: [table],
48 mounted () {
49 sendThis(this);
50 this.queryClick()
51 },
52 data () {
53 return {
54 isDialog: false,
55 viewDialog: false,
56 ruleForm: {
57 noticeTitle: '',
58 noticeStatus: ''
59 },
60 noticeStatusList: [
61 {"label": '未发布','value':'1'},
62 {'label': '已发布','value':'2'}
63 ],
64 tableData: {
65 total: 0,
66 columns: datas.columns(),
67 data: [],
68 },
69 isDiglog: false
70 }
71 },
72 methods: {
73 // 列表渲染接口
74 queryClick () {
75 this.$startLoading()
76 getSysNoticeList({ ...this.ruleForm, ...this.pageData }, { 'target': '#xttzLoading' }).then(res => {
77 if (res.code === 200) {
78 this.$endLoading()
79 let { total, records } = res.result
80 this.tableData.total = total;
81 this.tableData.data = records
82 }
83 })
84 },
85 //打开新增弹窗
86 openDialog() {
87 this.isDialog = true;
88 },
89 //删除
90 delNotice(item){
91 this.$confirm('是否确定删除', '提示', {
92 confirmButtonText: '确定',
93 cancelButtonText: '取消',
94 type: 'warning'
95 }).then(() => {
96 deleteSysNotice({ "bsmNotice": item.bsmNotice }).then(res => {
97 if (res.code == 200) {
98 this.$message.success('删除成功')
99 this.queryClick();
100 } else {
101 this.$message.error(res.message)
102 }
103 })
104 }).catch(() => {
105 this.$message({
106 type: 'info',
107 message: '已取消删除'
108 });
109 });
110 },
111 //发布
112 toPublish(item){
113 this.$confirm('是否确定发布', '提示', {
114 confirmButtonText: '确定',
115 cancelButtonText: '取消',
116 type: 'warning'
117 }).then(() => {
118 publishNotice({ "bsmNotice": item.bsmNotice }).then(res => {
119 if (res.code == 200) {
120 this.$message.success('发布成功')
121 this.queryClick();
122 } else {
123 this.$message.error(res.message)
124 }
125 })
126 }).catch(() => {
127 this.$message({
128 type: 'info',
129 message: '操作取消'
130 });
131 });
132 },
133 //取消发布
134 toUnPublish(item){
135 this.$confirm('是否确定取消发布', '提示', {
136 confirmButtonText: '确定',
137 cancelButtonText: '取消',
138 type: 'warning'
139 }).then(() => {
140 unPublishNotice({ "bsmNotice": item.bsmNotice }).then(res => {
141 if (res.code == 200) {
142 this.$message.success('删除成功')
143 this.queryClick();
144 } else {
145 this.$message.error(res.message)
146 }
147 })
148 }).catch(() => {
149 this.$message({
150 type: 'info',
151 message: '操作取消'
152 });
153 });
154 },
155 downloadFile(item){
156 const href = item.noticeFileUrl
157 window.open(href, '_blank');
158 },
159 viewDetail(e){
160 this.$popup("错误日志", "system/xttz/components/viewDialog", {
161 formData: {
162 item: e
163 }
164 })
165 }
166 },
167 };
168 </script>
169 <style scoped lang="scss">
170 @import "~@/styles/public.scss";
171 </style>
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 label: "通知内容",
30 render: (h, scope) => {
31 return <div class="item-cwnr">{scope.row.noticeContent}</div>
32 }
33 },
34 {
35 prop: "noticeFileName",
36 label: "通知附件",
37 render: (h, scope) => {
38 return <div class="pointer" onClick={() => { vm.downloadFile(scope.row) }}>{scope.row.noticeFileName}</div>
39 }
40 },
41 {
42 label: "发布状态",
43 width: '80',
44 render: (h, scope) => {
45 switch (scope.row.noticeStatus) {
46 case '1':
47 return <div class='prohibit'>未发布</div>
48 case '2':
49 return <div class='allow'>已发布</div>
50 }
51 }
52 },
53 {
54 prop: "creater",
55 width: '120',
56 label: "创建人",
57 },
58 {
59 prop: "createtime",
60 label: "创建时间",
61 },
62 {
63 label: '操作',
64 align: 'center',
65 fixed: 'right',
66 render: (h, scope) => {
67 switch (scope.row.noticeStatus) {
68 case '1':
69 return <div>
70 <el-button type="text" icon="el-icon-edit-outline" onClick={() => { vm.toPublish(scope.row) }}>发布</el-button>
71 <el-button type="text" onClick={() => { vm.viewDetail(scope.row) }}>查看</el-button>
72 <el-button type="text" icon="el-icon-delete" onClick={() => { vm.delNotice(scope.row) }}>删除</el-button>
73 </div>
74 case '2':
75 return <div>
76 <el-button type="text" onClick={() => { vm.viewDetail(scope.row) }}>查看</el-button>
77 <el-button type="text" icon="el-icon-edit-outline" onClick={() => { vm.toUnPublish(scope.row) }}>取消发布</el-button>
78 </div>
79 }
80 }
81 }
82 ]
83 }
84
85 ywlys () {
86 return [
87 { value: 1, label: "办事大厅" },
88 { value: 2, label: "微信小程序" },
89 { value: 3, label: "法院端" },
90 { value: 4, label: "银行端" },
91 ]
92 }
93
94 }
95 let datas = new data()
96 export {
97 datas,
98 sendThis
99 }