{"remainingRequest":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\bbsl-fvue\\src\\views\\infoManagement\\components\\newsR-dialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\src\\views\\infoManagement\\components\\newsR-dialog.vue","mtime":1684458239215},{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nimport {\n\tmapState\n} from 'vuex'\nimport req from '@/request.js'\nimport latitude from '@/mixins/latitude'\nimport moment from 'moment';\nimport dictUtils from '@/components/dict/DictSelectUtils.js'\n// import flashFloods from '@/api/flashFloods.js'\nimport newsRelease from '@/api/newsRelease.js'\nimport iconDialog from './iconDialog.vue'\nimport 'quill/dist/quill.core.css'\nimport 'quill/dist/quill.snow.css'\nimport 'quill/dist/quill.bubble.css'\nimport {\n\tquillEditor\n} from 'vue-quill-editor'\nconst toolbarOptions = [\n\t['bold', 'italic', 'underline', 'strike'], // 加粗,斜体,下划线,删除线\n\t['blockquote', 'code-block'], //引用,代码块\n\t[{\n\t\t\theader: 1\n\t\t},\n\t\t{\n\t\t\theader: 2\n\t\t}\n\t], // 几级标题\n\t[{\n\t\t\tlist: 'ordered'\n\t\t},\n\t\t{\n\t\t\tlist: 'bullet'\n\t\t}\n\t], // 有序列表,无序列表\n\t[{\n\t\t\tscript: 'sub'\n\t\t},\n\t\t{\n\t\t\tscript: 'super'\n\t\t}\n\t], // 下角标,上角标\n\t[{\n\t\t\tindent: '-1'\n\t\t},\n\t\t{\n\t\t\tindent: '+1'\n\t\t}\n\t], // 缩进\n\t[{\n\t\tdirection: 'rtl'\n\t}], // 文字输入方向\n\t[{\n\t\tsize: ['small', false, 'large', 'huge']\n\t}], // 字体大小\n\t[{\n\t\theader: [1, 2, 3, 4, 5, 6, false]\n\t}], // 标题\n\t[{\n\t\t\tcolor: []\n\t\t},\n\t\t{\n\t\t\tbackground: []\n\t\t}\n\t], // 颜色选择\n\t[{\n\t\tfont: [\n\t\t\t'SimSun',\n\t\t\t'SimHei',\n\t\t\t'Microsoft-YaHei',\n\t\t\t'KaiTi',\n\t\t\t'FangSong',\n\t\t\t'Arial'\n\t\t]\n\t}], // 字体\n\t[{\n\t\talign: []\n\t}], // 居中\n\t['clean'], // 清除样式,\n\t['link', 'image'] // 上传图片、上传视频\n]\nexport default {\n\tname: 'falshForm',\n\tprops: {\n\t\tshowFormDia: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false\n\t\t},\n\t\ttitle: {\n\t\t\ttype: String,\n\t\t\tdefault: ''\n\t\t},\n\t\tpId: {\n\t\t\ttype: String,\n\t\t\tdefault: ''\n\t\t}\n\t},\n\tcomponents: {\n\t\tquillEditor,\n\t\ticonDialog\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tpreviewUrl: window.context.portal + '/file/onlinePreviewController/v1/getFileById_',\n\t\t\tuploadUrl: window.context.portal + '/file/v1/uploadFileForConfig', // 服务器上传地址\n\t\t\taccept: '.bmp,.jpg,.png,.tif,.gif,.pcx,.tga,.exif,.fpx,.svg,.psd,.cdr,.pcd,.dxf,.ufo,.eps,.ai,.raw,.WMF,.webp,.avif,.apng,.xls,.docx,.docm,.doc,.dotx,.pptx,.pptm,.ppt,.pdf,.xps,.potx,.txt,.xls,.xlsx,.xps,.zip,.rar,.7z',\n\t\t\tacceptImg: '.jpg,.jpeg,.png,.JPG,.JPEG,.gif,.PNG,.GIF',\n\t\t\tfileList: [],\n\t\t\tparams: {\n\t\t\t\ttype: null,\n\t\t\t\ttitle: null,\n\t\t\t\ttitleDescription: null,\n\t\t\t\tisUrl: true,\n\t\t\t\turl: null,\n\t\t\t\tendTime: null,\n\t\t\t\tdrafter: null,\n\t\t\t\trotatingDisplayPictures: null,\n\t\t\t\tfile: null,\n\t\t\t\ttype: null,\n\t\t\t\tcontent: null,\n\t\t\t\tcreateTime: moment().format('YYYY-MM-DD HH:mm:ss')\n\t\t\t},\n\t\t\trotatingDisplayPictures: null,\n\t\t\tclassifyNames: [{\n\t\t\t\t\tname: '新闻公告',\n\t\t\t\t\tvalue: 1\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: '轮播图',\n\t\t\t\t\tvalue: 2\n\t\t\t\t}\n\t\t\t],\n\t\t\tcrOverTypes: [], //跨界类型字典数组\n\t\t\tbasGrads: [], //流域级别字典类型\n\t\t\tbasAdNames: [], //行政下拉\n\t\t\tAdName: null, //接受每次选中的值\n\t\t\tsetKesLabel: {\n\t\t\t\tvalue: 'code',\n\t\t\t\tlabel: 'name',\n\t\t\t\tchildren: 'children'\n\t\t\t},\n\t\t\trules: {\n\t\t\t\ttype: [{\n\t\t\t\t\trequired: true,\n\t\t\t\t\tmessage: '请选择所属类型',\n\t\t\t\t\ttrigger: 'change'\n\t\t\t\t}],\n\t\t\t\ttitle: [{\n\t\t\t\t\trequired: true,\n\t\t\t\t\tmessage: '请输入标题',\n\t\t\t\t\ttrigger: 'blur'\n\t\t\t\t}],\n\t\t\t\tisUrl: [{\n\t\t\t\t\trequired: true,\n\t\t\t\t\tmessage: '请选择是否外部链接',\n\t\t\t\t\ttrigger: 'blur'\n\t\t\t\t}],\n\t\t\t\turl: [{\n\t\t\t\t\trequired: true,\n\t\t\t\t\tmessage: '请输入外部链接',\n\t\t\t\t\ttrigger: 'blur'\n\t\t\t\t}],\n\n\t\t\t\trotatingDisplayPictures: [{\n\t\t\t\t\trequired: true,\n\t\t\t\t\tmessage: '请上传轮播展示图片',\n\t\t\t\t\ttrigger: 'blur'\n\t\t\t\t}],\n\n\t\t\t\tdrafter: [{\n\t\t\t\t\trequired: true,\n\t\t\t\t\tmessage: '请输入拟稿人',\n\t\t\t\t\ttrigger: 'blur'\n\t\t\t\t}]\n\t\t\t},\n\t\t\tbuildTypes: [],\n\t\t\tbuildStructures: [],\n\t\t\t// 富文本配置\n\t\t\teditorOption: {\n\t\t\t\tplaceholder: '请在这里输入',\n\t\t\t\ttheme: 'snow', //主题 snow/bubble\n\t\t\t\tmodules: {\n\t\t\t\t\thistory: {\n\t\t\t\t\t\tdelay: 1000,\n\t\t\t\t\t\tmaxStack: 50,\n\t\t\t\t\t\tuserOnly: false\n\t\t\t\t\t},\n\t\t\t\t\ttoolbar: {\n\t\t\t\t\t\tcontainer: toolbarOptions,\n\t\t\t\t\t\thandlers: {\n\t\t\t\t\t\t\timage: function(value) {\n\t\t\t\t\t\t\t\tif (value) {\n\t\t\t\t\t\t\t\t\t// 调用element的图片上传组件\n\t\t\t\t\t\t\t\t\tdocument.querySelector('.avatar-qeuploader input').click()\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tthis.quill.format('image', false)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\tcreated() {\n\t\tthis.getDetailInfo()\n\t\tthis.buildTypes = dictUtils.getDictItemsFromCache('shzhfz-zfjzlx')\n\t\tthis.buildStructures = dictUtils.getDictItemsFromCache('shzhfz-zfjgxs')\n\t},\n\tcomputed: mapState({\n\t\theader: state => {\n\t\t\treturn {\n\t\t\t\tAuthorization: `Bearer ${state.login.currentUser.token}`\n\t\t\t}\n\t\t}\n\t}),\n\tmethods: {\n\t\thandleAvatarSuccess(res, file) {\n\t\t\tconsole.log(res.fileId)\n\t\t\tconsole.log(this.previewUrl + res.fileId)\n\t\t\tthis.$set(this.params, 'rotatingDisplayPictures', res.fileId)\n\t\t\tthis.rotatingDisplayPictures = this.previewUrl + res.fileId\n\t\t\t// this.$set(this.params, 'rotatingDisplayPictures', res.fileId)\n\t\t\t// this.params.rotatingDisplayPictures = URL.createObjectURL(file.raw);\n\t\t},\n\t\tbeforeAvatarUpload(file) {\n\t\t\tconst suffix =\n\t\t\t\tfile.type === 'image/jpg' ||\n\t\t\t\tfile.type === 'image/png' ||\n\t\t\t\tfile.type === 'image/jpeg'\n\t\t\tif (!suffix) {\n\t\t\t\tthis.$message.error('上传轮播图片支持格式-JPG/PNG/JPEG!')\n\t\t\t}\n\t\t\treturn suffix\n\t\t},\n\t\thandleClose() {\n\t\t\tthis.params = {}\n\t\t\tthis.$emit('closeFormDiao')\n\t\t},\n\t\tuploadData() {\n\t\t\treturn {\n\t\t\t\tbody: JSON.stringify({\n\t\t\t\t\tbizCode: 'newAccessory',\n\t\t\t\t\tbizId: ''\n\t\t\t\t})\n\t\t\t}\n\t\t},\n\t\tselectIcon(data) {\n\t\t\tthis.params.icon = data\n\t\t\tthis.$forceUpdate()\n\t\t},\n\t\t// 失去焦点\n\t\tonEditorBlur(editor) {},\n\t\t// 获得焦点\n\t\tonEditorFocus(editor) {},\n\t\t// 开始\n\t\tonEditorReady(editor) {},\n\t\t// 值发生变化\n\t\tonEditorChange(editor) {\n\t\t\tthis.params.content = editor.html\n\t\t},\n\t\tqeuploadSuccess(res) {\n\t\t\t// 获取富文本组件实例\n\t\t\tlet quill = this.$refs.QuillEditor.quill\n\t\t\t// 如果上传成功\n\t\t\tif (res) {\n\t\t\t\t// 获取光标所在位置\n\t\t\t\tlet fileId = res.fileId\n\t\t\t\tlet url = this.previewUrl + fileId\n\t\t\t\tlet length = quill.getSelection().index\n\t\t\t\t// 插入图片,res为服务器返回的图片链接地址\n\t\t\t\tquill.insertEmbed(length, 'image', url)\n\t\t\t\t// 调整光标到最后\n\t\t\t\tquill.setSelection(length + 1)\n\t\t\t} else {\n\t\t\t\t// 提示信息,需引入Message\n\t\t\t\tthis.$message.error('图片插入失败!')\n\t\t\t}\n\t\t},\n\t\tuploadSuccess(res) {\n\t\t\tif (res) {\n\t\t\t\tconsole.log(res)\n\t\t\t\tlet arr = []\n\t\t\t\tarr.push({\n\t\t\t\t\tfileName: res.fileName,\n\t\t\t\t\tfileId: res.fileId\n\t\t\t\t})\n\t\t\t\tthis.params.file = JSON.stringify(arr)\n\t\t\t} else {\n\t\t\t\t// 提示信息,需引入Message\n\t\t\t\tthis.$message.error('上传失败!')\n\t\t\t}\n\t\t},\n\t\tbeforeUpload(file) {\n\t\t\treturn true\n\t\t},\n\t\t// 根据ID查询\n\t\tgetDetailInfo() {\n\t\t\tif (this.title === '修改') {\n\t\t\t\tnewsRelease.detailId(this.pId, res => {\n\t\t\t\t\tthis.params = res\n\t\t\t\t\tthis.params.isUrl =\n\t\t\t\t\t\tres.isUrl == 'false' ? false : res.isUrl == 'true' ? true : ''\n\t\t\t\t\tthis.rotatingDisplayPictures =\n\t\t\t\t\t\tthis.previewUrl + res.rotatingDisplayPictures\n\t\t\t\t\tthis.params.file = res.file\n\t\t\t\t\tif (res.file) {\n\t\t\t\t\t\tlet aaa = JSON.parse(res.file)\n\t\t\t\t\t\taaa.forEach(e => {\n\t\t\t\t\t\t\tthis.fileList.push({\n\t\t\t\t\t\t\t\tname: e.fileName,\n\t\t\t\t\t\t\t\turl: this.previewUrl + e.fileId\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t} else {}\n\t\t},\n\t\tgoInfo() {\n\t\t\tif (!this.params.isUrl) {\n\t\t\t\tthis.params.url = ''\n\t\t\t} else if (this.params.isUrl) {\n\t\t\t\tthis.params.content = ''\n\t\t\t} else {\n\t\t\t\tthis.params.url = ''\n\t\t\t\tthis.params.content = ''\n\t\t\t}\n\t\t\tif (this.params.type == '1') {\n\t\t\t\tthis.params.rotatingDisplayPictures = ''\n\t\t\t} else if (this.params.type == '2') {\n\t\t\t\tthis.params.icon = ''\n\t\t\t} else {\n\t\t\t\tthis.params.rotatingDisplayPictures = ''\n\t\t\t\tthis.icon = ''\n\t\t\t}\n\t\t\tthis.$refs.formInfo.validate(valid => {\n\t\t\t\tif (valid) {\n\t\t\t\t\tif (this.title === '新增') {\n\t\t\t\t\t\tnewsRelease.addSave(this.params, response => {\n\t\t\t\t\t\t\tif (response.state) {\n\t\t\t\t\t\t\t\tthis.$notify({\n\t\t\t\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t\t\t\t\tmessage: '新增成功',\n\t\t\t\t\t\t\t\t\tduration: 2000\n\t\t\t\t\t\t\t\t\t// offset: 80\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\tthis.$emit('closeFormDiao')\n\t\t\t\t\t\t\t\tthis.$emit('refList')\n\t\t\t\t\t\t\t} else {}\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\tif (this.title === '修改') {\n\t\t\t\t\t\tnewsRelease.upData(this.params, response => {\n\t\t\t\t\t\t\tif (response.state) {\n\t\t\t\t\t\t\t\tthis.$notify({\n\t\t\t\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t\t\t\t\tmessage: '修改成功',\n\t\t\t\t\t\t\t\t\tduration: 2000\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\tthis.$emit('closeFormDiao')\n\t\t\t\t\t\t\t\tthis.$emit('refList')\n\t\t\t\t\t\t\t} else {}\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t}\n}\n",null]}