You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
rcgy_xmf_qrcode/css/chunk-727b4313.0c6d034e.css...

1 line
29 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

{"version":3,"sources":["webpack:///src/views/operation/page/src/views/operation/page/announcementManagement.vue"],"names":[],"mappings":"AAkrBA,iCACA,UAAA,CACA,WAAA,CACA,YAAA,CACA,kBAEA,CAEA,8BACA,cAAA,CACA,cAAA,CACA,YAAA,CACA,kBAAA,CACA,0CAAA,CACA,eAAA,CACA,UAAA,CACA,gBACA,CAEA,+BACA,UAAA,CACA,yBAAA,CACA,YAAA,CACA,kBAAA,CACA,sBACA,CAGA,8BACA,WAAA,CACA,YAAA,CACA,yDAAA,CACA,yBACA,CAEA,gCACA,cACA,CAEA,kCACA,2BAAA,CACA,yBAAA,CACA,eACA,CAEA,gCACA,iBAAA,CACA,yCAAA,CACA,cAAA,CACA,eAAA,CACA,UAAA,CACA,gBACA,CAEA,sCACA,WAAA,CACA,WAAA,CACA,gBAAA,CACA,eACA,CAEA,uCACA,cAAA,CACA,eAAA,CACA,UAAA,CACA,gBAAA,CACA,oBACA,CAEA,yCACA,cAAA,CACA,eAAA,CACA,UAAA,CACA,iBAAA,CACA,oBACA","file":"chunk-727b4313.0c6d034e.css","sourcesContent":["<template>\n <div class=\"main-content\">\n <div class=\"main-titel\">\n <span>公告管理</span>\n </div>\n <div class=\"content\">\n <div class=\"content-btn\">\n <el-button class=\"init-button\"\n @click=\"add()\"\n icon=\"el-icon-plus\">新增公告</el-button>\n </div>\n <!-- 查询重制 -->\n <div class=\"\">\n <VueTable ref=\"table\"\n :config='config'\n @tableCheck=\"tableCheck\">\n <template slot=\"footer\">\n <div class=\"table-footer\">\n <!-- <button @click=\"dialogPreview = true\">预览</button> -->\n <button @click=\"edit(table_row)\">修改</button>\n <!-- <button>打印</button> -->\n <button @click=\"release(table_row)\">发布</button>\n <button @click='del(table_row)'>删除</button>\n </div>\n </template>\n</VueTable>\n\n<!-- 新增修改公告 -->\n<Drawer :drawerTitle=\"announceTitle\" @drawerClose=\"announceClose\" :drawerVrisible='announce_vrisible'>\n <div style=\"padding:30px\">\n <FromCard>\n <template slot=\"title\">基本信息</template>\n <template>\n <VueForm ref=\"announceVueForm\"\n @ruleSuccess='announceRuleSubmit'\n :formObj='announceForm'>\n <template slot='excelFileUrls'>\n <template>\n <el-upload :action=\"`${$baseUrl}upload/uploadAnnouncement`\"\n :on-success=\"ImgeSuccess\"\n :file-list=\"imglist\"\n :on-exceed=\"handleExceed\"\n :limit=\"1\"\n accept=\".jpg,.png,.JPG,.PNG\"\n :before-upload=\"beforeAvatarUpload\">\n <el-button icon=\"el-icon-edit\"\n size=\"small\">上传图片</el-button>\n <span style='margin-left:10px;font-size:12px;color:#444444'>建议比例3:2</span>\n <div slot=\"tip\"\n class=\"el-upload__tip\">\n <span>支持扩展名png,jpg</span>\n </div>\n </el-upload>\n </template>\n </template>\n <template slot='fileDocUrl'>\n <template>\n <el-upload :action=\"`${$baseUrl}upload/uploadAnnouncementDoc`\"\n :on-success=\"fileSuccess\"\n :on-remove=\"wordRemove\"\n :on-exceed=\"handleExceed\"\n :file-list=\"wordList\"\n accept=\".doc,.DOC,.docx,.DOCX\"\n :limit=\"1\"\n :before-upload=\"beforeFileUpload\">\n <el-button icon=\"el-icon-edit\"\n size=\"small\">上传文件</el-button>\n <div slot=\"tip\"\n class=\"el-upload__tip\">\n <span>支持扩展名doc,docx</span>\n </div>\n </el-upload>\n </template>\n </template>\n </VueForm>\n </template>\n </FromCard>\n </div>\n <div slot=\"footer\">\n <button class=\"btn-orange\" @click=\"announceSubmit()\"><span> <i class=\"el-icon-circle-check\"></i>提交</span></button>\n <button class=\"btn-gray\" @click=\"announceClose\"><span>取消</span></button>\n </div>\n</Drawer>\n<!-- 预览 -->\n<el-dialog class=\"dialogPreview\" title=\"预览\" :visible.sync=\"dialogPreview\" width=\"100%%\" height=\"100%\" top=\"0\" Dialog>\n <div class=\"preview-header\">\n <div class=\"esc-preview\" @click=\"dialogPreview = false\">\n <i class=\"el-icon-s-marketing\" style=\"font-size:24px;margin-left:33px;margin-right:9px\"></i>\n <span>退出预览</span>\n </div>\n </div>\n <div class=\"preview-body\">\n <div class=\"body-content\">\n <div class=\"preview-img\">\n <div class=\"preview-content\">\n <div class=\"preview-title\">\n <span>新政!宁波市“无房家庭”可优先购买一套商品房</span>\n </div>\n <div class=\"preview-content-img\"></div>\n <div class=\"preview-content-text\">\n <p>\n 今天,宁波市住房和城乡建设局、宁波市自然资源和规 划局联合发布《关于进一步完善商品住房销售行为切实保障居民自住需求的通知》(以下简称《通知》)。 该《通知》意在保障居民自住需求,抑制投机投资行为, 《通知》明确符合条件的“无房家庭”可在市六区优先认购1套商品 住房该套房要求在取得不动产权属证书满5年后方可转让该新政从发布之日起实施。\n </p>\n <p>\n 今天,宁波市住房和城乡建设局、宁波市自然资源和规 划局联合发布《关于进一步完善商品住房销售行为切实保障居民自住需求的通知》(以下简称《通知》)。 该《通知》意在保障居民自住需求,抑制投机投资行为, 《通知》明确符合条件的“无房家庭”可在市六区优先认购1套商品 住房该套房要求在取得不动产权属证书满5年后方可转让该新政从发布之日起实施。\n </p>\n <p>\n 今天,宁波市住房和城乡建设局、宁波市自然资源和规 划局联合发布《关于进一步完善商品住房销售行为切实保障居民自住需求的通知》(以下简称《通知》)。 该《通知》意在保障居民自住需求,抑制投机投资行为, 《通知》明确符合条件的“无房家庭”可在市六区优先认购1套商品 住房该套房要求在取得不动产权属证书满5年后方可转让该新政从发布之日起实施。\n </p>\n <p>\n 今天,宁波市住房和城乡建设局、宁波市自然资源和规 划局联合发布《关于进一步完善商品住房销售行为切实保障居民自住需求的通知》(以下简称《通知》)。 该《通知》意在保障居民自住需求,抑制投机投资行为, 《通知》明确符合条件的“无房家庭”可在市六区优先认购1套商品 住房该套房要求在取得不动产权属证书满5年后方可转让该新政从发布之日起实施。\n </p>\n </div>\n <div class=\"preview-content-footer\">\n <span>新城悦物业服务有限公司 发布于 2020-08-12</span>\n </div>\n </div>\n </div>\n </div>\n </div>\n</el-dialog>\n</div>\n</div>\n</div>\n</template>\n<script>\n import {\n announcementManagementRelease,\n announcementManagementFindById,\n announcementManagementInsert,\n announcementManagementUpdate\n } from '@/api/operation.js'\n import previewImg from '@/assets/images/dialogPreviewbg.png'\n export default {\n data() {\n return {\n // 添加\n announceTitle: '新增公告',\n announce_vrisible: false,\n previewImg: previewImg,\n dialogPreview: false,\n table_row: [],\n // 上传word文件\n wordList: [],\n // 上传img文件\n imglist: [],\n config: {\n thead: [{\n label: '序号',\n type: 'index',\n width: '80'\n }, {\n label: '公告标题',\n prop: 'title',\n width: 'auto'\n }, {\n label: '推送对象',\n prop: 'pushObject',\n width: 'auto',\n type: 'function',\n callback: (row, prop) => {\n switch (row.pushObject) {\n case 1:\n return '业主'\n break\n case 2:\n return '租户'\n break\n case 3:\n return '业主和租户'\n break\n case 4:\n return '管家'\n break\n }\n }\n }, {\n label: '阅读量',\n prop: 'readingVolume',\n width: 'auto'\n }, {\n label: '状态',\n prop: 'status',\n width: 'auto',\n type: 'function',\n callback: (row, prop) => {\n switch (row.status) {\n case 1:\n return '未发布'\n break\n case 2:\n return '已发布'\n break\n case 3:\n return '定时发布'\n break\n }\n }\n }, {\n label: '创建人',\n prop: 'createName',\n width: 'auto'\n }, {\n label: '更新时间',\n prop: 'updateDate',\n width: 'auto'\n }],\n table_data: [],\n url: 'announcementManagementList',\n search_item: [{\n type: 'Input',\n label: '公告标题',\n placeholder: '请输入内容',\n prop: 'title'\n }, {\n type: 'select',\n label: '公告状态',\n value: '',\n options: [{\n label: '未发布',\n value: '1'\n }, {\n label: '已发布',\n value: '2'\n }],\n placeholder: '请选择',\n prop: 'status'\n }],\n data: {\n pageNum: 1,\n size: 10\n }\n },\n announceForm: {\n ruleForm: {\n title: null,\n pushObject: null,\n excelFileUrls: [],\n content: null,\n fileDocUrl: null,\n fileDocName:null,\n status: 1,\n scheduledReleaseTime: null\n },\n form_item: [{\n type: 'Input',\n label: '公告标题',\n placeholder: '请输入',\n width: '100%',\n prop: 'title'\n }, {\n type: 'Select',\n label: '推送对象',\n placeholder: '请输入',\n width: '100%',\n prop: 'pushObject',\n options: [{\n label: '业主',\n value: 1\n }, {\n label: '租户',\n value: 2\n }, {\n label: '业主和租户',\n value: 3\n },{\n label: '管家',\n value: 4\n }]\n }, {\n type: 'Slot',\n label: '公告图片',\n placeholder: '请输入',\n width: '100%',\n prop: 'excelFileUrls',\n slotName: 'excelFileUrls'\n }, {\n type: 'textarea',\n label: '公告内容',\n placeholder: '请输入公告内容',\n prop: 'content',\n width: '100%',\n rows: 5\n }, {\n type: 'Slot',\n label: '上传文件',\n placeholder: '请输入',\n width: '100%',\n prop: 'fileDocUrl',\n slotName: 'fileDocUrl'\n }, {\n type: 'Select',\n label: '状态',\n placeholder: '请输入',\n prop: 'status',\n width: '100%',\n options: [{\n label: '未发布',\n value: 1\n }, {\n label: '已发布',\n value: 2\n }, {\n label: '定时发布',\n value: 3\n }]\n }, {\n type: 'DateTime',\n label: '定时时间',\n placeholder: '请输入',\n width: '100%',\n disabled: true,\n prop: 'scheduledReleaseTime'\n // disabled:true\n }],\n rules: {\n title: [{\n required: true,\n message: '请输入',\n trigger: 'blur'\n }],\n pushObject: [{\n required: true,\n message: '请输入',\n trigger: 'change'\n }],\n excelFileUrls: [{\n required: true,\n message: '请上传图片',\n trigger: 'change'\n }],\n content: [{\n required: true,\n message: '请输入公告内容',\n trigger: 'blur'\n }],\n // fileDocUrl: [{\n // required: true,\n // message: '请选择文件',\n // trigger: 'change'\n // }],\n status: [{\n required: true,\n message: '请选择状态',\n trigger: 'change'\n }]\n }\n }\n }\n },\n methods: {\n // 表格选中\n tableCheck(data) {\n this.table_row = data\n },\n // 弹窗关闭\n announceClose() {\n this.announce_vrisible = false\n this.wordList = []\n this.imglist = []\n this.$refs.announceVueForm.reset()\n },\n // 提交验证通过\n announceRuleSubmit() {\n let resData = {\n title: this.announceForm.ruleForm.title,\n pushObject: this.announceForm.ruleForm.pushObject,\n excelFileUrls: this.announceForm.ruleForm.excelFileUrls,\n content: this.announceForm.ruleForm.content,\n fileDocUrl: this.announceForm.ruleForm.fileDocUrl,\n status: this.announceForm.ruleForm.status,\n fileDocName: this.announceForm.ruleForm.fileDocName,\n scheduledReleaseTime: this.announceForm.ruleForm\n .scheduledReleaseTime\n }\n // scheduledReleaseTime\n if (\n this.announceForm.ruleForm.status === 3 &&\n !this.announceForm.ruleForm.scheduledReleaseTime\n ) {\n this.$message.error('请选择定时时间')\n\n return\n }\n\n if (this.announceTitle === '新增公告') {\n // 新增公告\n announcementManagementInsert(resData).then((res) => {\n console.log(res)\n if (res.status) {\n this.$message({\n message: res.message,\n type: 'success'\n })\n this.announceClose()\n this.$refs.table.loadData()\n }\n })\n } else {\n resData.id = this.table_row[0].id\n // 修改公告\n announcementManagementUpdate(resData).then((res) => {\n console.log(res)\n if (res.status) {\n this.$message({\n message: res.message,\n type: 'success'\n })\n this.announceClose()\n this.$refs.table.loadData()\n }\n })\n }\n\n },\n // 提交验证\n announceSubmit() {\n this.$refs.announceVueForm.submitForm()\n },\n // 添加\n add() {\n this.announceTitle = '新增公告'\n this.announce_vrisible = true\n },\n // 修改\n edit(data) {\n if (data.length) {\n if (data.length > 1) {\n this.$message.error('只能单条数据修改')\n return\n }\n } else {\n this.$message.error('请选中需要修改的数据')\n return\n }\n let resData = {\n id: data[0].id\n }\n announcementManagementFindById(resData).then((res) => {\n if (res.status) {\n console.log(res.data)\n const data = res.data\n this.announceForm.ruleForm.title = data.title\n this.announceForm.ruleForm.pushObject = data.pushObject\n this.announceForm.ruleForm.excelFileUrls[0] =\n data.imgUrls[0].url\n\n this.announceForm.ruleForm.content = data.content\n this.announceForm.ruleForm.fileDocUrl = data.fileDocUrl\n this.announceForm.ruleForm.status = data.status\n this.announceForm.ruleForm.scheduledReleaseTime =\n data.scheduledReleaseTime\n // this.wordList[0].name = data.fileDocUrl\n // this.wordList[0].url = data.url\n\n let obj = {\n name: data.fileDocUrl,\n url: data.fileDocUrl\n }\n this.$set(this.wordList, '0', obj)\n\n let imgObj = {\n name: data.imgUrls[0].url,\n url: data.imgUrls[0].url\n }\n this.$set(this.imglist, '0', imgObj)\n this.announceTitle = '修改公告'\n\n this.announce_vrisible = true\n }\n })\n },\n // 图片上传成功\n ImgeSuccess(res, file) {\n this.announceForm.ruleForm.excelFileUrls[0] = file.response.url\n },\n // 图片文件上传之前\n beforeAvatarUpload(file) {\n const isLt2M = file.size / 1024 / 1024 < 2\n const isJPG = file.type === 'image/png'\n const isPNG = file.type === 'image/jpeg'\n if (!isJPG && !isPNG) {\n this.$message.error('上传头像图片只能是 JPG/PNG 格式!')\n }\n if (!isLt2M) {\n this.$message.error('上传头像图片大小不能超过 2MB!')\n }\n return (isJPG || isPNG) && isLt2M\n },\n // word 文件上传成功\n fileSuccess(res, file) {\n this.announceForm.ruleForm.fileDocUrl = file.response.url\n },\n // word 文件上传限制提示\n handleExceed(files, fileList) {\n this.$message.warning(\n `当前限制选择 1 个文件,本次选择了 ${\n files.length\n } 个文件,共选择了 ${files.length + fileList.length} 个文件`\n )\n },\n wordRemove() {\n this.announceForm.ruleForm.fileDocUrl = null\n },\n // word 文件上传之前\n beforeFileUpload(file) {\n console.log(file)\n this.announceForm.ruleForm.fileDocName = file.name\n const isLt2M = file.size / 1024 / 1024 < 2\n const fileType =\n file.name.endsWith('.doc') || file.name.endsWith('.docx')\n console.log(fileType)\n if (!fileType) {\n this.$message.error('上传头像图片只能是 doc/docx 格式!')\n }\n if (!isLt2M) {\n this.$message.error('上传文件大小不能超过 2MB!')\n }\n return fileType && isLt2M\n },\n // 删除\n del(data) {\n if (data.length) {\n let arr = []\n for (let i = 0; i < this.table_row.length; i++) {\n arr.push(this.table_row[i].id)\n }\n this.$confirm('是否确认删除?删除不可恢复', '删除', {\n confirmButtonText: '确定',\n cancelButtonText: '取消',\n confirmButtonClass: 'confirmButton',\n cancelButtonClass: 'cancelButton'\n })\n .then(() => {\n this.$refs.table.tableDelete(arr)\n })\n .catch((action) => {})\n } else {\n this.$message.error('请选中需要删除的数据')\n }\n },\n // 发布\n release(data) {\n if(data.length!=1){\n this.$message.error('只能选择一条公告发布')\n return\n }\n if(data[0].status===2){\n this.$message({\n type:'error',\n message:'已发布'\n })\n return\n }\n let arr = []\n for (let i = 0; i < this.table_row.length; i++) {\n arr.push(this.table_row[i].id)\n }\n this.$confirm('确认现在发布?', '发布提示', {\n confirmButtonText: '确定',\n cancelButtonText: '取消',\n confirmButtonClass: 'confirmButton',\n cancelButtonClass: 'cancelButton'\n })\n .then(() => {\n let resData = {\n ids: arr\n }\n announcementManagementRelease(resData).then(\n (result) => {\n if (result.status) {\n this.$message({\n type: 'success',\n message: result.message\n })\n this.$refs.table.loadData()\n }\n }\n )\n })\n .catch((action) => {})\n \n }\n },\n watch: {\n // announceForm: {\n // ruleForm:\n 'announceForm.ruleForm.status': {\n handler(newValue) {\n console.log(newValue)\n if (newValue === 3) {\n // // form_item\n // scheduledReleaseTime\n this.announceForm.form_item.find((item) => {\n if (item.prop === 'scheduledReleaseTime') {\n item.disabled = false\n }\n })\n } else {\n this.announceForm.form_item.find((item) => {\n if (item.prop === 'scheduledReleaseTime') {\n item.disabled = true\n }\n })\n }\n },\n immediate: true\n }\n },\n\n }\n</script>\n<style scoped>\n .preview-header {\n width: 100%;\n height: 62px;\n display: flex;\n align-items: center;\n /* background: #e6e7e9; */\n }\n \n .esc-preview {\n cursor: pointer;\n font-size: 14px;\n display: flex;\n align-items: center;\n font-family: PingFangSC-Regular, PingFang SC;\n font-weight: 400;\n color: #333333;\n line-height: 20px;\n }\n \n .body-content {\n width: 100%;\n height: calc(100vh - 62px);\n display: flex;\n align-items: center;\n justify-content: center;\n }\n /* previewImg */\n \n .preview-img {\n width: 344px;\n height: 689px;\n background-image: url(../../../assets/images/dialogPreviewbg.png);\n background-size: 100% 100%;\n }\n \n .preview-titel {\n font-size: 20px;\n }\n \n .preview-content {\n margin: 120px 30px 90px 30px;\n height: calc(100% - 210px);\n overflow-y: auto;\n }\n \n .preview-title {\n text-align: center;\n font-family: PingFangSC-Medium, PingFang SC;\n font-size: 12px;\n font-weight: 600;\n color: #000000;\n line-height: 17px;\n }\n \n .preview-content-img {\n width: 276px;\n height: 94px;\n margin: 22px auto;\n background: gray;\n }\n \n .preview-content-text {\n font-size: 12px;\n font-weight: 400;\n color: #333333;\n line-height: 23px;\n transform: scale(0.91);\n }\n \n .preview-content-footer {\n font-size: 12px;\n font-weight: 400;\n color: #999999;\n margin-left: -20px;\n transform: scale(0.75);\n }\n</style>"]}