{"remainingRequest":"D:\\jenkins\\workspace\\reform-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\reform-fvue\\src\\views\\WorkItems\\components\\newsR-dialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\reform-fvue\\src\\views\\WorkItems\\components\\newsR-dialog.vue","mtime":1686215346968},{"path":"D:\\jenkins\\workspace\\reform-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\reform-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\reform-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//\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//\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//\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\r\nimport dictUtils from '@/components/dict/DictSelectUtils.js'\r\n// import flashFloods from '@/api/flashFloods.js'\r\nimport newsRelease from '@/api/newsRelease.js'\r\n// import iconDialog from './iconDialog.vue'\r\nimport 'quill/dist/quill.core.css'\r\nimport 'quill/dist/quill.snow.css'\r\nimport 'quill/dist/quill.bubble.css'\r\nimport {quillEditor} from 'vue-quill-editor'\r\nimport RejectInfoDialog from '@/components/dialog/RejectInfoDialog.vue'\r\nimport utils from '@/utils.js'\r\nconst toolbarOptions = [\r\n ['bold', 'italic', 'underline', 'strike'], // 加粗,斜体,下划线,删除线\r\n ['blockquote', 'code-block'], //引用,代码块\r\n [\r\n {\r\n header: 1\r\n },\r\n {\r\n header: 2\r\n }\r\n ], // 几级标题\r\n [\r\n {\r\n list: 'ordered'\r\n },\r\n {\r\n list: 'bullet'\r\n }\r\n ], // 有序列表,无序列表\r\n [\r\n {\r\n script: 'sub'\r\n },\r\n {\r\n script: 'super'\r\n }\r\n ], // 下角标,上角标\r\n [\r\n {\r\n indent: '-1'\r\n },\r\n {\r\n indent: '+1'\r\n }\r\n ], // 缩进\r\n [\r\n {\r\n direction: 'rtl'\r\n }\r\n ], // 文字输入方向\r\n [\r\n {\r\n size: ['small', false, 'large', 'huge']\r\n }\r\n ], // 字体大小\r\n [\r\n {\r\n header: [1, 2, 3, 4, 5, 6, false]\r\n }\r\n ], // 标题\r\n [\r\n {\r\n color: []\r\n },\r\n {\r\n background: []\r\n }\r\n ], // 颜色选择\r\n [\r\n {\r\n font: [\r\n 'SimSun',\r\n 'SimHei',\r\n 'Microsoft-YaHei',\r\n 'KaiTi',\r\n 'FangSong',\r\n 'Arial'\r\n ]\r\n }\r\n ], // 字体\r\n [\r\n {\r\n align: []\r\n }\r\n ], // 居中\r\n ['clean'], // 清除样式,\r\n ['link', 'image'] // 上传图片、上传视频\r\n]\r\nexport default {\r\n name: 'falshForm',\r\n props: {\r\n showFormDia: {\r\n type: Boolean,\r\n default: false\r\n },\r\n title: {\r\n type: String,\r\n default: ''\r\n },\r\n pId: {\r\n type: String,\r\n default: ''\r\n }\r\n },\r\n components: {\r\n quillEditor,\r\n RejectInfoDialog\r\n // iconDialog\r\n },\r\n data() {\r\n return {\r\n markLoading: false,\r\n activeCollapse: ['1'],\r\n reqLoading: false,\r\n previewUrl:\r\n window.context.portal + '/file/onlinePreviewController/v1/getFileById_',\r\n uploadUrl: window.context.portal + '/file/v1/uploadFileForConfig', // 服务器上传地址\r\n accept:\r\n '.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',\r\n acceptImg: '.jpg,.jpeg,.png,.JPG,.JPEG,.gif,.PNG,.GIF',\r\n header: {\r\n Authorization: `Bearer ${this.$store.state.login.currentUser.token}`\r\n },\r\n fileList: [],\r\n params: {\r\n type: 2,\r\n title: null,\r\n titleDescription: null,\r\n isUrl: 0,\r\n url: null,\r\n endTime: null,\r\n drafter: null,\r\n operateType: 2,\r\n projectId: '',\r\n // rotatingDisplayPictures: null,\r\n file: null,\r\n content: null,\r\n excellent: ''\r\n // createTime: moment().format('YYYY-MM-DD HH:mm:ss')\r\n },\r\n rotatingDisplayPictures: null,\r\n // classifyNames: [\r\n // {\r\n // name: '区县工作动态',\r\n // value: '1635207542319882240'\r\n // },\r\n // {\r\n // name: '领导关注',\r\n // value: '1635207757647060992'\r\n // },\r\n // {\r\n // name: '工作部署',\r\n // value: '1635207810117804032'\r\n // }\r\n // ],\r\n crOverTypes: [], //跨界类型字典数组\r\n basGrads: [], //流域级别字典类型\r\n basAdNames: [], //行政下拉\r\n AdName: null, //接受每次选中的值\r\n setKesLabel: {\r\n value: 'code',\r\n label: 'name',\r\n children: 'children'\r\n },\r\n rules: {\r\n newsType: [\r\n {\r\n required: true,\r\n message: '请选择类型',\r\n trigger: 'blur'\r\n }\r\n ],\r\n excellent: [\r\n {\r\n required: true,\r\n message: '请选择优秀程度',\r\n trigger: 'blur'\r\n }\r\n ],\r\n operateType: [\r\n {\r\n required: true,\r\n message: '请选择工作动态类型',\r\n trigger: 'change'\r\n }\r\n ],\r\n projectId: [\r\n {\r\n required: true,\r\n message: '请选择涉及项目',\r\n trigger: 'change'\r\n }\r\n ],\r\n title: [\r\n {\r\n required: true,\r\n message: '请输入标题',\r\n trigger: 'blur'\r\n }\r\n ],\r\n isUrl: [\r\n {\r\n required: true,\r\n message: '请选择是否外部链接',\r\n trigger: 'blur'\r\n }\r\n ],\r\n url: [\r\n {\r\n required: true,\r\n message: '请输入外部链接',\r\n trigger: 'blur'\r\n }\r\n ],\r\n\r\n // rotatingDisplayPictures: [\r\n // {\r\n // required: true,\r\n // message: '请上传轮播展示图片',\r\n // trigger: 'blur'\r\n // }\r\n // ],\r\n\r\n drafter: [\r\n {\r\n required: true,\r\n message: '请输入拟稿人',\r\n trigger: 'blur'\r\n }\r\n ]\r\n },\r\n buildTypes: [],\r\n buildStructures: [],\r\n // 优秀程度\r\n options: [\r\n {label: '不接受', value: '1'},\r\n {label: '上分屏', value: '2'},\r\n {label: '上主屏', value: '3'}\r\n ],\r\n // 富文本配置\r\n editorOption: {\r\n placeholder: '请在这里输入',\r\n theme: 'snow', //主题 snow/bubble\r\n modules: {\r\n history: {\r\n delay: 1000,\r\n maxStack: 50,\r\n userOnly: false,\r\n imageDrop: true,\r\n imageResize: {\r\n displayStyles: {\r\n width: '200px',\r\n backgroundColor: 'black',\r\n border: 'none',\r\n color: 'white'\r\n },\r\n modules: ['Resize', 'DisplaySize', 'Toolbar']\r\n }\r\n },\r\n toolbar: {\r\n container: toolbarOptions,\r\n handlers: {\r\n image: function(value) {\r\n if (value) {\r\n // 调用element的图片上传组件\r\n document.querySelector('.avatar-qeuploader input').click()\r\n } else {\r\n this.quill.format('image', false)\r\n }\r\n }\r\n }\r\n }\r\n }\r\n },\r\n pickerOptions: {\r\n disabledDate: time => {\r\n return time.getTime() < Date.now()\r\n }\r\n },\r\n workTypeOptions: [\r\n {label: '重大项目',value: 1},\r\n {label: '区县动态',value: 2}\r\n ],\r\n projectOptions: []\r\n }\r\n },\r\n created() {\r\n this.getProjectAll()\r\n this.getDetailInfo()\r\n this.buildTypes = dictUtils.getDictItemsFromCache('shzhfz-zfjzlx')\r\n this.buildStructures = dictUtils.getDictItemsFromCache('shzhfz-zfjgxs')\r\n },\r\n // computed: mapState({\r\n // header: state => {\r\n // return {\r\n // Authorization: `Bearer ${state.login.currentUser.token}`\r\n // }\r\n // }\r\n // }),\r\n methods: {\r\n // 根据项目id获取项目名称\r\n getProjectName(id) {\r\n let name = ''\r\n this.projectOptions.forEach(item => {\r\n if (item.id === id) {\r\n name = item.projectName\r\n }\r\n })\r\n return name\r\n },\r\n // 获取项目列表\r\n getProjectAll() {\r\n newsRelease.getProjectAllByUser(res=> {\r\n this.projectOptions = res\r\n })\r\n },\r\n getDictName(code, value) {\r\n return utils.getDictName(code, value)\r\n },\r\n // handleAvatarSuccess(res, file) {\r\n // console.log(res);\r\n // this.$set(this.params, 'rotatingDisplayPictures', res.fileId)\r\n // this.rotatingDisplayPictures = this.previewUrl + res.fileId\r\n // },\r\n // beforeAvatarUpload(file) {\r\n // const suffix =\r\n // file.type === 'image/jpg' ||\r\n // file.type === 'image/png' ||\r\n // file.type === 'image/jpeg'\r\n // if (!suffix) {\r\n // this.$message.error('上传轮播图片支持格式-JPG/PNG/JPEG!')\r\n // }\r\n // return suffix\r\n // },\r\n handleClose() {\r\n this.params = {\r\n operateType: 2,\r\n }\r\n this.$emit('closeFormDiao')\r\n },\r\n // uploadData() {\r\n // return {\r\n // body: JSON.stringify({\r\n // bizCode: 'Accessory',\r\n // bizId: ''\r\n // })\r\n // }\r\n // },\r\n // selectIcon(data) {\r\n // this.params.icon = data\r\n // this.$forceUpdate()\r\n // },\r\n // 失去焦点\r\n onEditorBlur(editor) {},\r\n // 获得焦点\r\n onEditorFocus(editor) {},\r\n // 开始\r\n onEditorReady(editor) {\r\n let quill = this.$refs.QuillEditor.quill\r\n\r\n quill.setSelection(length + 1)\r\n },\r\n // 值发生变化\r\n onEditorChange(editor) {\r\n this.params.content = editor.html\r\n },\r\n qeuploadSuccess(res) {\r\n console.log(res)\r\n // 获取富文本组件实例\r\n let quill = this.$refs.QuillEditor.quill\r\n // 如果上传成功\r\n if (res) {\r\n // 获取光标所在位置\r\n let fileId = res.fileId\r\n let url = this.previewUrl + fileId\r\n let length = quill.getSelection().index\r\n ? quill.getSelection().index\r\n : quill.getLength()\r\n // 插入图片,res为服务器返回的图片链接地址\r\n quill.insertEmbed(length, 'image', url)\r\n // 调整光标到最后\r\n quill.setSelection(length + 1)\r\n this.reqLoading = false\r\n } else {\r\n // 提示信息,需引入Message\r\n this.$message.error('图片插入失败!')\r\n this.reqLoading = false\r\n }\r\n },\r\n uploadSuccess(res) {\r\n if (res) {\r\n console.log(res)\r\n let arr = []\r\n arr.push({\r\n fileName: res.fileName,\r\n fileId: res.fileId\r\n })\r\n this.params.file = JSON.stringify(arr)\r\n } else {\r\n // 提示信息,需引入Message\r\n this.$message.error('上传失败!')\r\n }\r\n },\r\n beforeUpload(file) {\r\n console.log(file)\r\n this.reqLoading = true\r\n // return true\r\n },\r\n // 根据ID查询\r\n getDetailInfo() {\r\n this.reqLoading = true\r\n if (\r\n this.title === '修改' ||\r\n this.title === '审核' ||\r\n this.title === '详情'\r\n ) {\r\n newsRelease.detailId(this.pId, res => {\r\n this.params = res\r\n this.params.approvalComments = res.approvalComments\r\n ? res.approvalComments.split('$_$')\r\n : []\r\n // this.params.isUrl =\r\n // res.isUrl == 'false' ? false : res.isUrl == 'true' ? true : ''\r\n this.rotatingDisplayPictures =\r\n this.previewUrl + res.rotatingDisplayPictures\r\n this.params.file = res.file\r\n if (res.file) {\r\n let aaa = JSON.parse(res.file)\r\n aaa.forEach(e => {\r\n this.fileList.push({\r\n name: e.fileName,\r\n url: this.previewUrl + e.fileId\r\n })\r\n })\r\n }\r\n this.reqLoading = false\r\n })\r\n } else {\r\n this.reqLoading = false\r\n }\r\n },\r\n goInfo(status, type) {\r\n if (!this.params.isUrl) {\r\n this.params.url = ''\r\n } else if (this.params.isUrl) {\r\n this.params.content = ''\r\n } else {\r\n this.params.url = ''\r\n this.params.content = ''\r\n }\r\n if (this.params.type == '1') {\r\n this.params.rotatingDisplayPictures = ''\r\n } else if (this.params.type == '2') {\r\n this.params.icon = ''\r\n } else {\r\n this.params.rotatingDisplayPictures = ''\r\n this.icon = ''\r\n }\r\n this.$refs.formInfo.validate(valid => {\r\n // console.log(this.title);\r\n if (valid) {\r\n // console.log(this.params)\r\n // if (this.title == '新增') {\r\n let data = JSON.parse(JSON.stringify(this.params))\r\n if (type === 'edit') {\r\n data.status = status\r\n } else if (type === 'audit') {\r\n data.status = this.$route.name == 'WorkReportsAudit' ? 3 : 5\r\n }\r\n data.approvalComments = data.approvalComments\r\n ? data.approvalComments.join('$_$')\r\n : ''\r\n let msg = !data.status\r\n ? '提交保存为草稿成功'\r\n : data.status === 1\r\n ? '提交并上报成功'\r\n : '通过成功'\r\n if (this.title == '修改' && !status && !type) {\r\n msg = '修改保存成功'\r\n }\r\n newsRelease.dynamicSaveOrUpdate(data, response => {\r\n if (response.state) {\r\n this.$notify({\r\n type: 'success',\r\n message: msg,\r\n duration: 2000\r\n // offset: 80\r\n })\r\n this.$emit('closeFormDiao')\r\n this.$emit('refList')\r\n } else {\r\n }\r\n })\r\n // }\r\n // if (this.title == '修改') {\r\n // newsRelease.upData(this.params, response => {\r\n // if (response.state) {\r\n // this.$notify({\r\n // type: 'success',\r\n // message: '修改成功',\r\n // duration: 2000\r\n // })\r\n // this.$emit('closeFormDiao')\r\n // this.$emit('refList')\r\n // } else {\r\n // }\r\n // })\r\n // }\r\n } else {\r\n return false\r\n }\r\n })\r\n },\r\n // 驳回\r\n openInputVisible() {\r\n this.$confirm('确认驳回吗?', this.$t('common.tips'), {\r\n confirmButtonText: this.$t('common.confirm'),\r\n cancelButtonText: this.$t('common.cancel'),\r\n type: 'error'\r\n }).then(() => {\r\n this.$refs.RejectInfoDialog.open()\r\n })\r\n },\r\n sendRejectInfo(approvalComments) {\r\n this.markLoading = true\r\n let data = JSON.parse(JSON.stringify(this.params))\r\n data.status = this.$route.name == 'WorkReportsAudit' ? 2 : 4\r\n data.approvalComments = approvalComments\r\n newsRelease.dynamicSaveOrUpdate(data, response => {\r\n if (response.state) {\r\n this.$message.success('驳回成功')\r\n } else {\r\n this.$message.success('驳回失败')\r\n }\r\n this.$emit('closeFormDiao')\r\n this.$emit('refList')\r\n this.markLoading = false\r\n })\r\n }\r\n }\r\n}\r\n",null]}