| | |
| | | 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, |
| | |
| | | this.getDetail() |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapState(["tagList", "isFold"]), |
| | | }, |
| | | |
| | | methods: { |
| | | getDetail() { |
| | |
| | | this.tableData = [{ ...res.projectTeam, staffName: res.staffNames }] |
| | | // 处理文件回显 |
| | | if (res.feasibilityReportFiles && res.feasibilityReportFiles.length > 0) { |
| | | this.fileList = res.feasibilityReportFiles.map(file => ({ |
| | | name: file.fileName, |
| | | url: getFullUrl(file.fileUrl), |
| | | uid: file.id |
| | | })) |
| | | this.form.feasibilityReportFiles = res.fileList |
| | | this.fileList = res.feasibilityReportFiles.map(file => { |
| | | return { |
| | | name: file.fileName, |
| | | url: getFullUrl(file.fileUrl), |
| | | uid: file.id |
| | | } |
| | | }) |
| | | this.form.feasibilityReportFiles = res.feasibilityReportFiles |
| | | } else { |
| | | this.fileList = [] |
| | | this.form.feasibilityReportFiles = [] |
| | |
| | | customUploadRequest({ |
| | | file, |
| | | onSuccess: (res) => { |
| | | console.log() |
| | | if (res.code === 200) { |
| | | const fileObj = { |
| | | id: new Date().getTime(), |
| | |
| | | } |
| | | }, |
| | | submit() { |
| | | console.log(this.$refs.materialEditor.getContent()); |
| | | if (this.tableData.length == 0) { |
| | | this.$message.error('请选择项目组') |
| | | return |
| | |
| | | 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) => { |
| | | let data = { |
| | |
| | | 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) |
| | | } |