| | |
| | | import chooseProject from '@/components/chooseProject' |
| | | import { addData, getDetail, editData } from './service' |
| | | import { customUploadRequest, getFullUrl } from '@/utils/utils' |
| | | import { mapState } from "vuex"; |
| | | export default { |
| | | components: { |
| | | AiEditor, |
| | |
| | | if (this.$route.query.id) { |
| | | this.getDetail() |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapState(["tagList", "isFold"]), |
| | | }, |
| | | |
| | | methods: { |
| | |
| | | editData({ ...data, id: this.$route.query.id }).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('修改成功') |
| | | this.$router.back() |
| | | this.back() |
| | | } else { |
| | | this.$message.error(res.message) |
| | | } |
| | |
| | | addData({ ...data }).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('发布成功') |
| | | this.$router.back() |
| | | this.back() |
| | | } else { |
| | | this.$message.error(res.message) |
| | | } |
| | |
| | | |
| | | } |
| | | }) |
| | | }, |
| | | back() { |
| | | this.$router.back(); |
| | | this.$store.commit( |
| | | "SET_TAGLIST", |
| | | this.tagList.filter((item) => item.path !== this.$route.path) |
| | | ); |
| | | }, |
| | | save() { |
| | | this.$refs.form.validate((valid) => { |
| | |
| | | editData({ ...data, id: this.$route.query.id }).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('修改成功') |
| | | this.$router.back() |
| | | this.back() |
| | | } else { |
| | | this.$message.error(res.message) |
| | | } |
| | |
| | | addData({ ...data }).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('发布成功') |
| | | this.$router.back() |
| | | this.back() |
| | | } else { |
| | | this.$message.error(res.message) |
| | | } |