4e343721ff5c6e747df2dd7d8eca60e4.json 15 KB

1
  1. {"remainingRequest":"/usr/local/develop/php/www/waibao/project/NN2022060801/addons/admin/node_modules/vue-loader/lib/index.js??vue-loader-options!/usr/local/develop/php/www/waibao/project/NN2022060801/addons/admin/src/views/system/notice/index.vue?vue&type=style&index=0&id=85cb19de&scoped=true&lang=css&","dependencies":[{"path":"/usr/local/develop/php/www/waibao/project/NN2022060801/addons/admin/src/views/system/notice/index.vue","mtime":1618041504000},{"path":"/usr/local/develop/php/www/waibao/project/NN2022060801/addons/admin/node_modules/css-loader/dist/cjs.js","mtime":499162500000},{"path":"/usr/local/develop/php/www/waibao/project/NN2022060801/addons/admin/node_modules/vue-loader/lib/loaders/stylePostLoader.js","mtime":499162500000},{"path":"/usr/local/develop/php/www/waibao/project/NN2022060801/addons/admin/node_modules/postcss-loader/src/index.js","mtime":499162500000},{"path":"/usr/local/develop/php/www/waibao/project/NN2022060801/addons/admin/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/usr/local/develop/php/www/waibao/project/NN2022060801/addons/admin/node_modules/vue-loader/lib/index.js","mtime":499162500000}],"contextDependencies":[],"result":[{"type":"Buffer","data":"base64:CgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoNCi5lbGUtYmxvY2sgPj4+IC5lbC11cGxvYWQsIC5lbGUtYmxvY2sgPj4+IC5lbC11cGxvYWQtZHJhZ2dlciB7DQogIHdpZHRoOiAxMDAlOw0KfQ0K"},{"version":3,"sources":["index.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoRA;AACA;AACA","file":"index.vue","sourceRoot":"src/views/system/notice","sourcesContent":["<template>\r\n <div class=\"ele-body\">\r\n <el-card shadow=\"never\">\r\n <!-- 搜索表单 -->\r\n <el-form :model=\"table.where\" label-width=\"77px\" class=\"ele-form-search\"\r\n @keyup.enter.native=\"$refs.table.reload()\" @submit.native.prevent>\r\n <el-row :gutter=\"15\">\r\n <el-col :md=\"6\" :sm=\"12\">\r\n <el-form-item label=\"通知标题:\">\r\n <el-input v-model=\"table.where.title\" placeholder=\"请输入通知标题\" clearable/>\r\n </el-form-item>\r\n </el-col>\r\n <el-col :md=\"6\" :sm=\"12\">\r\n <div class=\"ele-form-actions\">\r\n <el-button type=\"primary\" @click=\"$refs.table.reload()\" icon=\"el-icon-search\" class=\"ele-btn-icon\">查询\r\n </el-button>\r\n <el-button @click=\"(table.where={})&&$refs.table.reload()\">重置</el-button>\r\n </div>\r\n </el-col>\r\n </el-row>\r\n </el-form>\r\n <!-- 操作按钮 -->\r\n <div class=\"ele-table-tool ele-table-tool-default\">\r\n <el-button @click=\"showEdit=true\" type=\"primary\" icon=\"el-icon-plus\" class=\"ele-btn-icon\" size=\"small\" v-if=\"permission.includes('sys:notice:add')\">添加\r\n </el-button>\r\n <el-button @click=\"remove()\" type=\"danger\" icon=\"el-icon-delete\" class=\"ele-btn-icon\" size=\"small\" v-if=\"permission.includes('sys:notice:dall')\">批量删除\r\n </el-button>\r\n </div>\r\n <!-- 数据表格 -->\r\n <ele-data-table ref=\"table\" :config=\"table\" :choose.sync=\"choose\" height=\"calc(100vh - 315px)\" highlight-current-row>\r\n <template slot-scope=\"{index}\">\r\n <el-table-column type=\"selection\" width=\"45\" align=\"center\" fixed=\"left\"/>\r\n <el-table-column type=\"index\" :index=\"index\" label=\"编号\" width=\"60\" align=\"center\" fixed=\"left\" show-overflow-tooltip/>\r\n <el-table-column prop=\"title\" label=\"通知标题\" sortable=\"custom\" show-overflow-tooltip min-width=\"250\"/>\r\n <el-table-column label=\"通知来源\" min-width=\"100\" align=\"center\">\r\n <template slot-scope=\"{row}\">\r\n <el-tag :type=\"['primary','success'][row.source]\" size=\"mini\">{{ ['内部通知', '外部新闻'][row.source] }}</el-tag>\r\n </template>\r\n </el-table-column>\r\n <el-table-column prop=\"is_top\" label=\"是否置顶\" sortable=\"custom\" :resizable=\"false\" min-width=\"120\">\r\n <template slot-scope=\"{row}\">\r\n <el-switch v-model=\"row.is_top\" @change=\"editIsTop(row)\" :active-value=\"1\" :inactive-value=\"2\"/>\r\n </template>\r\n </el-table-column>\r\n <el-table-column prop=\"status\" label=\"通知状态\" sortable=\"custom\" :resizable=\"false\" min-width=\"120\">\r\n <template slot-scope=\"{row}\">\r\n <el-switch v-model=\"row.status\" @change=\"editStatus(row)\" :active-value=\"1\" :inactive-value=\"2\"/>\r\n </template>\r\n </el-table-column>\r\n <el-table-column prop=\"browse\" label=\"浏览量\" sortable=\"custom\" show-overflow-tooltip min-width=\"100\"/>\r\n <el-table-column label=\"创建时间\" sortable=\"custom\" show-overflow-tooltip min-width=\"160\">\r\n <template slot-scope=\"{row}\">{{ row.create_time | toDateString }}</template>\r\n </el-table-column>\r\n <el-table-column label=\"更新时间\" sortable=\"custom\" show-overflow-tooltip min-width=\"160\">\r\n <template slot-scope=\"{row}\">{{ row.update_time | toDateString }}</template>\r\n </el-table-column>\r\n <el-table-column label=\"操作\" width=\"130px\" align=\"center\" :resizable=\"false\" fixed=\"right\">\r\n <template slot-scope=\"{row}\">\r\n <el-link @click=\"edit(row)\" icon=\"el-icon-edit\" type=\"primary\" :underline=\"false\" v-if=\"permission.includes('sys:notice:edit')\">修改</el-link>\r\n <el-popconfirm title=\"确定要删除此通知吗?\" @confirm=\"remove(row)\" class=\"ele-action\">\r\n <el-link slot=\"reference\" icon=\"el-icon-delete\" type=\"danger\" :underline=\"false\" v-if=\"permission.includes('sys:notice:delete')\">删除</el-link>\r\n </el-popconfirm>\r\n </template>\r\n </el-table-column>\r\n </template>\r\n </ele-data-table>\r\n </el-card>\r\n <!-- 编辑弹窗 -->\r\n <el-dialog :title=\"editForm.id?'修改通知':'修改通知'\" :visible.sync=\"showEdit\" width=\"600px\"\r\n @closed=\"editForm={}\" :destroy-on-close=\"true\" custom-class=\"ele-dialog-form\" :lock-scroll=\"false\">\r\n <el-form :model=\"editForm\" ref=\"editForm\" :rules=\"editRules\" label-width=\"82px\">\r\n <el-row :gutter=\"15\">\r\n <el-col :sm=\"12\">\r\n <el-form-item label=\"通知标题:\" prop=\"title\">\r\n <el-input v-model=\"editForm.title\" placeholder=\"请输入通知标题\" clearable/>\r\n </el-form-item>\r\n <el-form-item label=\"通知状态:\">\r\n <el-radio-group v-model=\"editForm.status\">\r\n <el-radio :label=\"1\">正常</el-radio>\r\n <el-radio :label=\"2\">禁用</el-radio>\r\n </el-radio-group>\r\n </el-form-item>\r\n </el-col>\r\n <el-col :sm=\"12\">\r\n <el-form-item label=\"通知来源:\">\r\n <el-radio-group v-model=\"editForm.source\">\r\n <el-radio :label=\"1\">内部通知</el-radio>\r\n <el-radio :label=\"2\">外部新闻</el-radio>\r\n </el-radio-group>\r\n </el-form-item>\r\n <el-form-item label=\"是否置顶:\">\r\n <el-radio-group v-model=\"editForm.is_top\">\r\n <el-radio :label=\"1\">置顶</el-radio>\r\n <el-radio :label=\"2\">不置顶</el-radio>\r\n </el-radio-group>\r\n </el-form-item>\r\n </el-col>\r\n </el-row>\r\n <!-- 富文本编辑器 -->\r\n <tinymce-editor v-model=\"editForm.content\" :init=\"editContent\"/>\r\n </el-form>\r\n <div slot=\"footer\">\r\n <el-button @click=\"showEdit=false\">取消</el-button>\r\n <el-button type=\"primary\" @click=\"save\">保存</el-button>\r\n </div>\r\n </el-dialog>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport TinymceEditor from '@/components/TinymceEditor'\r\nimport { mapGetters } from \"vuex\";\r\nexport default {\r\n name: \"SysNotice\",\r\n components: {TinymceEditor},\r\n data() {\r\n return {\r\n table: {url: '/notice/index', where: {}}, // 表格配置\r\n choose: [], // 表格选中数据\r\n showEdit: false, // 是否显示表单弹窗\r\n editForm: {source:1,status:1,is_top:2}, // 表单数据\r\n editRules: { // 表单验证规则\r\n title: [\r\n {required: true, message: '请输入通知标题', trigger: 'blur'}\r\n ],\r\n status: [\r\n {required: true, message: '请输入选择通知状态', trigger: 'blur'}\r\n ],\r\n source: [\r\n {required: true, message: '请输入选择通知来源', trigger: 'blur'}\r\n ],\r\n is_top: [\r\n {required: true, message: '请输入选择是否置顶', trigger: 'blur'}\r\n ],\r\n },\r\n // 自定义文件上传(这里使用把选择的文件转成blob演示)\r\n file_picker_callback: (callback, value, meta) => {\r\n let input = document.createElement('input');\r\n input.setAttribute('type', 'file');\r\n // 设定文件可选类型\r\n if (meta.filetype === 'image') {\r\n input.setAttribute('accept', 'image/*');\r\n } else if (meta.filetype === 'media') {\r\n input.setAttribute('accept', 'video/*');\r\n }\r\n input.onchange = () => {\r\n let file = input.files[0];\r\n let reader = new FileReader();\r\n reader.onload = (e) => {\r\n let blob = new Blob([e.target.result], {type: file.type});\r\n callback(URL.createObjectURL(blob));\r\n };\r\n reader.readAsArrayBuffer(file);\r\n }\r\n input.click();\r\n }\r\n }\r\n },\r\n computed: {\r\n ...mapGetters([\"permission\"]),\r\n \r\n editContent() {\r\n return {\r\n menubar: false,\r\n file_picker_callback: this.file_picker_callback,\r\n skin_url: this.$store.state.theme.theme === 'dark' ? '/tinymce/skins/ui/oxide-dark' : '/tinymce/skins/ui/oxide',\r\n content_css: this.$store.state.theme.theme === 'dark' ? '/tinymce/skins/content/dark/content.css' : '/tinymce/skins/content/default/content.css'\r\n };\r\n }\r\n },\r\n mounted() {\r\n },\r\n methods: {\r\n /* 显示编辑 */\r\n edit(row) {\r\n this.editForm = Object.assign({}, row);\r\n this.showEdit = true;\r\n },\r\n /* 保存编辑 */\r\n save() {\r\n this.$refs['editForm'].validate((valid) => {\r\n if (valid) {\r\n const loading = this.$loading({lock: true});\r\n this.$http.post('/notice/edit', this.editForm).then(res => {\r\n loading.close();\r\n if (res.data.code === 0) {\r\n this.showEdit = false;\r\n this.$message({type: 'success', message: res.data.msg});\r\n this.$refs.table.reload();\r\n } else {\r\n this.$message.error(res.data.msg);\r\n }\r\n }).catch(e => {\r\n loading.close();\r\n this.$message.error(e.message);\r\n });\r\n } else {\r\n return false;\r\n }\r\n });\r\n },\r\n /* 删除 */\r\n remove(row) {\r\n if (!row) { // 批量删除\r\n if (this.choose.length === 0) return this.$message.error('请至少选择一条数据');\r\n let ids = this.choose.map(d => d.id);\r\n this.$confirm('确定要删除选中的通知吗?', '提示', {type: 'warning'}).then(() => {\r\n const loading = this.$loading({lock: true});\r\n this.$http.post('/notice/delete', {id: ids}).then(res => {\r\n loading.close();\r\n if (res.data.code === 0) {\r\n this.$message({type: 'success', message: res.data.msg});\r\n this.$refs.table.reload();\r\n } else {\r\n this.$message.error(res.data.msg);\r\n }\r\n }).catch(e => {\r\n loading.close();\r\n this.$message.error(e.message);\r\n });\r\n }).catch(() => 0);\r\n } else { // 单个删除\r\n const loading = this.$loading({lock: true});\r\n this.$http.post('/notice/delete', {id:row.id}).then(res => {\r\n loading.close();\r\n if (res.data.code === 0) {\r\n this.$message({type: 'success', message: res.data.msg});\r\n this.$refs.table.reload();\r\n } else {\r\n this.$message.error(res.data.msg);\r\n }\r\n }).catch(e => {\r\n loading.close();\r\n this.$message.error(e.message);\r\n });\r\n }\r\n },\r\n /* 更改状态 */\r\n editStatus(row) {\r\n const loading = this.$loading({lock: true});\r\n let params = Object.assign({}, row);\r\n this.$http.post('/notice/status', params).then(res => {\r\n loading.close();\r\n if (res.data.code === 0) {\r\n this.$message({type: 'success', message: res.data.msg});\r\n } else {\r\n row.status = !row.status ? 2 : 1;\r\n this.$message.error(res.data.msg);\r\n }\r\n }).catch(e => {\r\n loading.close();\r\n this.$message.error(e.message);\r\n });\r\n },\r\n /* 是否置顶 */\r\n editIsTop(row) {\r\n const loading = this.$loading({lock: true});\r\n let params = Object.assign({}, row);\r\n this.$http.post('/notice/setIsTop', params).then(res => {\r\n loading.close();\r\n if (res.data.code === 0) {\r\n this.$message({type: 'success', message: res.data.msg});\r\n } else {\r\n row.isTop = !row.isTop ? 2 : 1;\r\n this.$message.error(res.data.msg);\r\n }\r\n }).catch(e => {\r\n loading.close();\r\n this.$message.error(e.message);\r\n });\r\n },\r\n }\r\n}\r\n</script>\r\n\r\n<style scoped>\r\n.ele-block >>> .el-upload, .ele-block >>> .el-upload-dragger {\r\n width: 100%;\r\n}\r\n</style>"]}]}