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.

1 line
16 KiB

{"remainingRequest":"D:\\code\\vue\\front\\node_modules\\babel-loader\\lib\\index.js!D:\\code\\vue\\front\\node_modules\\cache-loader\\dist\\cjs.js??ref--1-0!D:\\code\\vue\\front\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\code\\vue\\front\\src\\pages\\forum\\add.vue?vue&type=script&lang=js","dependencies":[{"path":"D:\\code\\vue\\front\\src\\pages\\forum\\add.vue","mtime":1709633805000},{"path":"D:\\code\\vue\\front\\babel.config.js","mtime":1709633798000},{"path":"D:\\code\\vue\\front\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\code\\vue\\front\\node_modules\\babel-loader\\lib\\index.js","mtime":456789000000},{"path":"D:\\code\\vue\\front\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\code\\vue\\front\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":[{"type":"Buffer","data":"base64:aW1wb3J0ICJjb3JlLWpzL21vZHVsZXMvZXMuYXJyYXkucHVzaC5qcyI7CmV4cG9ydCBkZWZhdWx0IHsKICAvL+aVsOaNrumbhuWQiAogIGRhdGEoKSB7CiAgICByZXR1cm4gewogICAgICBmb3JtOiB7CiAgICAgICAgdGl0bGU6ICcnLAogICAgICAgIGlzZG9uZTogJ+W8gOaUvicsCiAgICAgICAgY29udGVudDogJycsCiAgICAgICAgcGFyZW50aWQ6IDAsCiAgICAgICAgdXNlcmlkOiBsb2NhbFN0b3JhZ2UuZ2V0SXRlbSgnZnJvbnRVc2VyaWQnKSwKICAgICAgICB1c2VybmFtZTogbG9jYWxTdG9yYWdlLmdldEl0ZW0oJ3VzZXJuYW1lJyksCiAgICAgICAgdG9wdGltZTogJycKICAgICAgfSwKICAgICAgZWRpdG9yT3B0aW9uOiB7CiAgICAgICAgbW9kdWxlczogewogICAgICAgICAgdG9vbGJhcjogW1siYm9sZCIsICJpdGFsaWMiLCAidW5kZXJsaW5lIiwgInN0cmlrZSJdLCBbImJsb2NrcXVvdGUiLCAiY29kZS1ibG9jayJdLCBbewogICAgICAgICAgICBoZWFkZXI6IDEKICAgICAgICAgIH0sIHsKICAgICAgICAgICAgaGVhZGVyOiAyCiAgICAgICAgICB9XSwgW3sKICAgICAgICAgICAgbGlzdDogIm9yZGVyZWQiCiAgICAgICAgICB9LCB7CiAgICAgICAgICAgIGxpc3Q6ICJidWxsZXQiCiAgICAgICAgICB9XSwgW3sKICAgICAgICAgICAgc2NyaXB0OiAic3ViIgogICAgICAgICAgfSwgewogICAgICAgICAgICBzY3JpcHQ6ICJzdXBlciIKICAgICAgICAgIH1dLCBbewogICAgICAgICAgICBpbmRlbnQ6ICItMSIKICAgICAgICAgIH0sIHsKICAgICAgICAgICAgaW5kZW50OiAiKzEiCiAgICAgICAgICB9XSwgW3sKICAgICAgICAgICAgZGlyZWN0aW9uOiAicnRsIgogICAgICAgICAgfV0sIFt7CiAgICAgICAgICAgIHNpemU6IFsic21hbGwiLCBmYWxzZSwgImxhcmdlIiwgImh1Z2UiXQogICAgICAgICAgfV0sIFt7CiAgICAgICAgICAgIGhlYWRlcjogWzEsIDIsIDMsIDQsIDUsIDYsIGZhbHNlXQogICAgICAgICAgfV0sIFt7CiAgICAgICAgICAgIGNvbG9yOiBbXQogICAgICAgICAgfSwgewogICAgICAgICAgICBiYWNrZ3JvdW5kOiBbXQogICAgICAgICAgfV0sIFt7CiAgICAgICAgICAgIGZvbnQ6IFtdCiAgICAgICAgICB9XSwgW3sKICAgICAgICAgICAgYWxpZ246IFtdCiAgICAgICAgICB9XSwgWyJjbGVhbiJdLCBbImltYWdlIiwgInZpZGVvIl1dCiAgICAgICAgfQogICAgICB9LAogICAgICBpc0VkaXQ6IGZhbHNlLAogICAgICBydWxlczogewogICAgICAgIHRpdGxlOiBbewogICAgICAgICAgcmVxdWlyZWQ6IHRydWUsCiAgICAgICAgICBtZXNz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XMgPT4gewogICAgICAgICAgICBpZiAocmVzLmRhdGEuY29kZSA9PT0gMCkgewogICAgICAgICAgICAgIHRoaXMuJG1lc3NhZ2UoewogICAgICAgICAgICAgICAgbWVzc2FnZTogYCR7dGhpcy5pc0VkaXQgPyAn5L+u5pS5JyA6ICflj5HluIMnfeaIkOWKn2AsCiAgICAgICAgICAgICAgICB0eXBlOiAnc3VjY2VzcycsCiAgICAgICAgICAgICAgICBkdXJhdGlvbjogMTUwMCwKICAgICAgICAgICAgICAgIG9uQ2xvc2U6ICgpID0+IHsKICAgICAgICAgICAgICAgICAgaWYgKHRoaXMuaXNFZGl0KSB7CiAgICAgICAgICAgICAgICAgICAgdGhpcy4kcm91dGVyLnB1c2goJy9pbmRleC9teUZvcnVtTGlzdCcpOwogICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgIHRoaXMuJHJvdXRlci5wdXNoKCcvaW5kZXgvZm9ydW0nKTsKICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIH0pOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgIHRoaXMuJG1lc3NhZ2UuZXJyb3IocmVzLmRhdGEubXNnKTsKICAgICAgICAgICAgfQogICAgICAgICAgfSk7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICB9CiAgICAgIH0pOwogICAgfSwKICAgIHJlc2V0Rm9ybShmb3JtTmFtZSkgewogICAgICB0aGlzLiRyZWZzW2Zvcm1OYW1lXS5yZXNldEZpZWxkcygpOwogICAgfQogIH0KfTs="},{"version":3,"names":["data","form","title","isdone","content","parentid","userid","localStorage","getItem","username","toptime","editorOption","modules","toolbar","header","list","script","indent","direction","size","color","background","font","align","isEdit","rules","required","message","trigger","created","$route","query","id","undefined","$http","get","then","res","code","methods","backClick","history","back","onEditorReady","editor","root","setAttribute","submitForm","formName","$refs","validate","valid","getCurDateTime","post","$message","type","duration","onClose","$router","push","error","msg","resetForm","resetFields"],"sources":["src/pages/forum/add.vue"],"sourcesContent":["<template>\r\n <div :style='{\"width\":\"100%\",\"padding\":\"30px 7% 40px\",\"margin\":\"0px auto\",\"position\":\"relative\",\"background\":\"#fff\"}'>\r\n <div class=\"section-title\" :style='{\"margin\":\"10px 0\",\"color\":\"#fff\",\"textAlign\":\"center\",\"background\":\"#333\",\"width\":\"100%\",\"fontSize\":\"20px\",\"lineHeight\":\"54px\"}'>互动交流</div>\r\n\t<div :style='{\"padding\":\"20px 7%\",\"margin\":\"0px auto\",\"borderColor\":\"#ddd\",\"borderRadius\":\"0px\",\"background\":\"none\",\"borderWidth\":\"0 0 1px\",\"width\":\"100%\",\"borderStyle\":\"solid\"}'>\r\n\t\t<el-button size=\"mini\" @click=\"backClick\">返回</el-button>\r\n\t</div>\r\n <el-form class=\"add-update-preview\" :model=\"form\" :rules=\"rules\" ref=\"form\" label-width=\"180px\">\r\n <el-form-item :style='{\"padding\":\"10px\",\"margin\":\"0 0 10px\",\"background\":\"none\"}' label=\"标题\" prop=\"title\">\r\n <el-input v-model=\"form.title\" placeholder=\"请输入标题\"></el-input>\r\n </el-form-item>\r\n <el-form-item :style='{\"padding\":\"10px\",\"margin\":\"0 0 10px\",\"background\":\"none\"}' label=\"类型\" prop=\"isdone\">\r\n <el-radio-group v-model=\"form.isdone\">\r\n <el-radio label=\"开放\">公开</el-radio>\r\n <el-radio label=\"关闭\">私人</el-radio>\r\n </el-radio-group>\r\n </el-form-item>\r\n <el-form-item :style='{\"padding\":\"10px\",\"margin\":\"0 0 10px\",\"background\":\"none\"}' label=\"内容\" prop=\"content\">\r\n <editor\r\n :style='{\"minHeight\":\"200px\",\"border\":\"0\",\"outline\":\"none\",\"color\":\"#333\",\"borderRadius\":\"4px\",\"width\":\"100%\",\"lineHeight\":\"32px\",\"fontSize\":\"14px\"}'\r\n v-model=\"form.content\" \r\n class=\"editor\" \r\n action=\"file/upload\">\r\n </editor>\r\n </el-form-item>\r\n <el-form-item :style='{\"padding\":\"0\",\"margin\":\"0\"}'>\r\n <el-button :style='{\"border\":\"0\",\"cursor\":\"pointer\",\"padding\":\"0\",\"margin\":\"0 20px 0 0\",\"outline\":\"none\",\"color\":\"rgba(255, 255, 255, 1)\",\"borderRadius\":\"4px\",\"background\":\"#F5BB00\",\"width\":\"128px\",\"lineHeight\":\"40px\",\"fontSize\":\"14px\",\"height\":\"40px\"}' type=\"primary\" @click=\"submitForm('form')\">{{this.isEdit ? '修改' : '发布帖子'}} </el-button>\r\n <el-button :style='{\"border\":\"0px solid rgba(64, 158, 255, 1)\",\"cursor\":\"pointer\",\"padding\":\"0\",\"margin\":\"0\",\"outline\":\"none\",\"color\":\"#fff\",\"borderRadius\":\"4px\",\"background\":\"#333\",\"width\":\"128px\",\"lineHeight\":\"40px\",\"fontSize\":\"14px\",\"height\":\"40px\"}' @click=\"resetForm('form')\">重置</el-button>\r\n </el-form-item>\r\n </el-form>\r\n </div>\r\n</template>\r\n\r\n<script>\r\n export default {\r\n //数据集合\r\n data() {\r\n return {\r\n form: {\r\n title: '',\r\n isdone: '开放',\r\n content: '',\r\n parentid: 0,\r\n userid: localStorage.getItem('frontUserid'),\r\n username: localStorage.getItem('username'),\r\n\t\t toptime: ''\r\n },\r\n editorOption: {\r\n modules: {\r\n toolbar: [\r\n [\"bold\", \"italic\", \"underline\", \"strike\"],\r\n [\"blockquote\", \"code-block\"],\r\n [{ header: 1 }, { header: 2 }],\r\n [{ list: \"ordered\" }, { list: \"bullet\" }],\r\n [{ script: \"sub\" }, { script: \"super\" }],\r\n [{ indent: \"-1\" }, { indent: \"+1\" }],\r\n [{ direction: \"rtl\" }],\r\n [{ size: [\"small\", false, \"large\", \"huge\"] }],\r\n [{ header: [1, 2, 3, 4, 5, 6, false] }],\r\n [{ color: [] }, { background: [] }],\r\n [{ font: [] }],\r\n [{ align: [] }],\r\n [\"clean\"],\r\n [\"image\", \"video\"]\r\n ]\r\n }\r\n },\r\n isEdit: false,\r\n rules: {\r\n title: [\r\n { required: true, message: '请输入标题', trigger: 'blur' }\r\n ]\r\n }\r\n }\r\n },\r\n created() {\r\n if (this.$route.query.id != undefined) {\r\n this.isEdit = true;\r\n this.$http.get('forum/detail/' + this.$route.query.id,{}).then(res=>{\r\n\t\t\tif(res.data.code==0){\r\n\t\t\t\tthis.form = res.data.data\r\n\t\t\t}\r\n\t\t})\r\n }\r\n },\r\n //方法集合\r\n methods: {\r\n\t\t// 返回按钮\r\n\t\tbackClick(){\r\n\t\t\thistory.back()\r\n\t\t},\r\n onEditorReady(editor) {\r\n editor.root.setAttribute('data-placeholder', \"请输入内容...\");\r\n },\r\n submitForm(formName) {\r\n this.$refs[formName].validate((valid) => {\r\n if (valid) {\r\n\t\t\tif(!this.isEdit){\r\n\t\t\t\tthis.form.toptime = this.getCurDateTime()\r\n\t\t\t}\r\n this.$http.post(`forum/${this.isEdit ? 'update' : 'add'}`, this.form).then(res => {\r\n if (res.data.code === 0) {\r\n this.$message({\r\n message: `${this.isEdit ? '修改' : '发布'}成功`,\r\n type: 'success',\r\n duration: 1500,\r\n onClose: () => {\r\n if (this.isEdit) {\r\n this.$router.push('/index/myForumList');\r\n } else {\r\n this.$router.push('/index/forum');\r\n }\r\n }\r\n });\r\n } else {\r\n this.$message.error(res.data.msg);\r\n }\r\n });\r\n } else {\r\n return false;\r\n }\r\n });\r\n },\r\n resetForm(formName) {\r\n this.$refs[formName].resetFields();\r\n }\r\n }\r\n }\r\n</script>\r\n\r\n<style rel=\"stylesheet/scss\" lang=\"scss\" scoped>\r\n .add-update-preview .el-form-item /deep/ .el-form-item__label {\r\n padding: 0 10px 0 0;\r\n color: #666;\r\n font-weight: 500;\r\n width: 180px;\r\n font-size: 14px;\r\n line-height: 40px;\r\n text-align: right;\r\n }\r\n \r\n .add-update-preview .el-form-item /deep/ .el-form-item__content {\r\n margin-left: 180px;\r\n }\r\n \r\n .add-update-preview .el-input /deep/ .el-input__inner {\r\n border: 1px solid #ddd;\r\n border-radius: 4px;\r\n padding: 0 12px;\r\n box-shadow: 0 0 0px rgba(64, 158, 255, .5);\r\n outline: none;\r\n color: #666;\r\n background: #fff;\r\n width: 400px;\r\n font-size: 14px;\r\n height: 40px;\r\n }\r\n \r\n .add-update-preview .el-select /deep/ .el-input__inner {\r\n border: 1px solid #ddd;\r\n border-radius: 4px;\r\n padding: 0 10px;\r\n box-shadow: 0 0 0px rgba(64, 158, 255, .5);\r\n outline: none;\r\n color: #666;\r\n background: #fff;\r\n width: 200px;\r\n font-size: 14px;\r\n height: 40px;\r\n }\r\n \r\n .add-update-preview .el-date-editor /deep/ .el-input__inner {\r\n border: 1px solid #ddd;\r\n border-radius: 4px;\r\n padding: 0 10px 0 30px;\r\n box-shadow: 0 0 0px rgba(64, 158, 255, .5);\r\n outline: none;\r\n color: #666;\r\n background: #fff;\r\n width: 200px;\r\n font-size: 14px;\r\n height: 40px;\r\n }\r\n \r\n .add-update-preview /deep/ .el-upload--picture-card {\r\n \tbackground: transparent;\r\n \tborder: 0;\r\n \tborder-radius: 0;\r\n \twidth: auto;\r\n \theight: auto;\r\n \tline-height: initial;\r\n \tvertical-align: middle;\r\n }\r\n \r\n .add-update-preview /deep/ .upload .upload-img {\r\n border: 1px solid #ddd;\r\n cursor: pointer;\r\n border-radius: 6px;\r\n color: #999;\r\n background: #fff;\r\n width: 200px;\r\n font-size: 32px;\r\n line-height: 100px;\r\n text-align: center;\r\n height: 100px;\r\n }\r\n \r\n .add-update-preview /deep/ .el-upload-list .el-upload-list__item {\r\n border: 1px solid #ddd;\r\n cursor: pointer;\r\n border-radius: 6px;\r\n color: #999;\r\n background: #fff;\r\n width: 200px;\r\n font-size: 32px;\r\n line-height: 100px;\r\n text-align: center;\r\n height: 100px;\r\n }\r\n \r\n .add-update-preview /deep/ .el-upload .el-icon-plus {\r\n border: 1px solid #ddd;\r\n cursor: pointer;\r\n border-radius: 6px;\r\n color: #999;\r\n background: #fff;\r\n width: 200px;\r\n font-size: 32px;\r\n line-height: 100px;\r\n text-align: center;\r\n height: 100px;\r\n }\r\n \r\n .add-update-preview .el-textarea /deep/ .el-textarea__inner {\r\n border: 1px solid #ddd;\r\n border-radius: 4px;\r\n padding: 12px;\r\n box-shadow: 0 0 0px rgba(64, 158, 255, .5);\r\n outline: none;\r\n color: #666;\r\n background: #fff;\r\n width: 400px;\r\n font-size: 14px;\r\n height: 120px;\r\n }\r\n</style>\r\n"],"mappings":";AAiCA;EACA;EACAA,KAAA;IACA;MACAC,IAAA;QACAC,KAAA;QACAC,MAAA;QACAC,OAAA;QACAC,QAAA;QACAC,MAAA,EAAAC,YAAA,CAAAC,OAAA;QACAC,QAAA,EAAAF,YAAA,CAAAC,OAAA;QACAE,OAAA;MACA;MACAC,YAAA;QACAC,OAAA;UACAC,OAAA,GACA,2CACA,8BACA;YAAAC,MAAA;UAAA;YAAAA,MAAA;UAAA,IACA;YAAAC,IAAA;UAAA;YAAAA,IAAA;UAAA,IACA;YAAAC,MAAA;UAAA;YAAAA,MAAA;UAAA,IACA;YAAAC,MAAA;UAAA;YAAAA,MAAA;UAAA,IACA;YAAAC,SAAA;UAAA,IACA;YAAAC,IAAA;UAAA,IACA;YAAAL,MAAA;UAAA,IACA;YAAAM,KAAA;UAAA;YAAAC,UAAA;UAAA,IACA;YAAAC,IAAA;UAAA,IACA;YAAAC,KAAA;UAAA,IACA,WACA;QAEA;MACA;MACAC,MAAA;MACAC,KAAA;QACAvB,KAAA,GACA;UAAAwB,QAAA;UAAAC,OAAA;UAAAC,OAAA;QAAA;MAEA;IACA;EACA;EACAC,QAAA;IACA,SAAAC,MAAA,CAAAC,KAAA,CAAAC,EAAA,IAAAC,SAAA;MACA,KAAAT,MAAA;MACA,KAAAU,KAAA,CAAAC,GAAA,wBAAAL,MAAA,CAAAC,KAAA,CAAAC,EAAA,MAAAI,IAAA,CAAAC,GAAA;QACA,IAAAA,GAAA,CAAArC,IAAA,CAAAsC,IAAA;UACA,KAAArC,IAAA,GAAAoC,GAAA,CAAArC,IAA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