From 57e3bead08715d72efaeffe90fafa179b8366473 Mon Sep 17 00:00:00 2001 From: inleft <inleft@qq.com> Date: Sat, 18 May 2024 12:02:14 +0800 Subject: [PATCH] 1.RSS更新 2.调整标签hover位置 3.font size --- src/components/group/MyModal.vue | 63 +++++++++++++++++++++++++------ 1 files changed, 51 insertions(+), 12 deletions(-) diff --git a/src/components/group/MyModal.vue b/src/components/group/MyModal.vue index 6ccd798..00bbada 100644 --- a/src/components/group/MyModal.vue +++ b/src/components/group/MyModal.vue @@ -1,7 +1,7 @@ <template> <div class="myModal"> - <a-modal v-model="visible" title="日志添加" on-ok="handleOk" - :bodyStyle="{'overflow':'overlay','maxHeight': '550px'}"> + <a-modal v-drag-modal ref="blogAddModal" v-model="visible" title="日志添加" on-ok="handleOk" + :bodyStyle="{'overflow':'overlay','maxHeight': '550px'}" :destroyOnClose="destroyOnClose"> <template slot="footer"> <a-button key="reset" @click="reset" type="danger"> 擦掉重来 @@ -21,11 +21,11 @@ <script> import box10 from "../mini/box10-add.vue" - + import { blogAdd } from '../../api/blogArticle.js' - + import md5 from 'js-md5'; export default { components: { box10 @@ -34,6 +34,7 @@ return { visible: false, loading: false, + destroyOnClose: false, } }, methods: { @@ -45,28 +46,66 @@ }, handleOk(e) { console.log(this.$refs.modalBox.form); - var res = this.$refs.modalBox.$refs.myForm.validate(valid => { + var res; + this.$refs.modalBox.$refs.myForm.validate(valid => { if (valid) { this.$message.info("校验通过") + res = true; } else { this.$message.info("校验失败") - return false; + res = false; } }); - if (!res) return; - this.$message.info("提交表单") + let tempData = this.$refs.modalBox.form; + var param = { + introduce: tempData.introduce, + secret: tempData.secret == "" ? null : md5(tempData.secret), + title: tempData.title, + articleTypeId: tempData.class, + isOnline: !tempData.online ? 1 : 0, + articleFileId: tempData.fileId, + content: tempData.content, + articleFileType: tempData.blogType, + coverFileId: tempData.coverFile, + pictureIds: tempData.pictureIds, + videoIds: tempData.videoIds, + publishDate: tempData.publishDate, + isTop: tempData.top ? 1 : 0, + topValue: tempData.sliderValue, + isLock: tempData.lock ? 1 : 0, + authStatus: tempData.auth, + authPassword: tempData.password == "" ? null : md5(tempData.password), + editorStatus: !tempData.tempSave ? 1 : 0 + } + console.log(param) this.loading = true; - setTimeout(() => { - this.visible = false; + blogAdd(param).then((res) => { + + if (res.code == 200) { + this.$message.info("生成日志成功..") + this.visible = false; + } else{ + this.$message.error('生成日志失败:' + res.message) + } this.loading = false; - }, 3000); + }); + // setTimeout(() => { + // this.visible = false; + // this.loading = false; + // }, 3000); }, reset(e) { - var res = this.$refs.modalBox.$refs.myForm.resetFields() + // var res = this.$refs.modalBox.$refs.myForm.resetFields(); + //this.$refs.modalBox.reset(); + this.destroyOnClose = true; + this.visible = false; + setTimeout(() => { + this.destroyOnClose = false; + }, 500) }, handleCancel(e) { this.visible = false; -- Gitblit v1.9.1