| | |
| | | >更新说明</a-button |
| | | > |
| | | <a-button |
| | | v-if=" |
| | | record.soft.lockFlag !== -1 |
| | | ? canLock |
| | | : tester.some((v) => v == user.name) |
| | | " |
| | | v-if="record.soft.lockFlag !== -1 ? canLock : isTester" |
| | | type="primary" |
| | | @click="lock(record)" |
| | | >{{ record.soft.lockFlag ? "解锁" : "锁定" }}</a-button |
| | |
| | | } from "./apis"; |
| | | import { mapGetters } from "vuex"; |
| | | import EmailCard from "../../components/emailCard"; |
| | | import { |
| | | searchDefaultMailUser, |
| | | sendMail, |
| | | } from "../../components/emailCard/apis"; |
| | | |
| | | // TODO |
| | | const tester = ["李桂华"]; |
| | |
| | | name: "", |
| | | data() { |
| | | return { |
| | | mailList: [], |
| | | tester, |
| | | versionTime: moment().format("YYYY-MM-DD HH:mm:ss"), |
| | | reasonVisible: false, |
| | |
| | | if (code && data) { |
| | | this.$message.success("操作成功"); |
| | | this.reasonVisible = false; |
| | | // 如果是测试人员解锁确认 则自动发送邮件 |
| | | if (lockFlagNow == -1 && this.isTester) { |
| | | this.sendEmail(); |
| | | } |
| | | this.searchData(); |
| | | } else { |
| | | this.$message.error("操作失败"); |
| | | } |
| | | }); |
| | | }, |
| | | sendEmail() { |
| | | let { title, content } = this.handleEmailShow(this.currentObj, true); |
| | | let params = { mailList: this.mailList, title, content }; |
| | | sendMail(params); |
| | | }, |
| | | lock(record) { |
| | | this.reason = ""; |
| | | this.currentObj = record; |
| | | this.reasonVisible = true; |
| | | }, |
| | | handleEmailShow(record) { |
| | | handleEmailShow(record, get) { |
| | | this.emailInfo.title = |
| | | "[软件发布记录]" + |
| | | record.soft.fileName + |
| | |
| | | }); |
| | | content.push("发布说明: " + soft.releaseNotes); |
| | | this.emailInfo.content = content.join("\n"); |
| | | if (get) { |
| | | return { |
| | | title: this.emailInfo.title, |
| | | content: content.join("\n"), |
| | | }; |
| | | } |
| | | this.emailShow = true; |
| | | }, |
| | | emailCancel() { |
| | |
| | | let rs = res.data; |
| | | if (rs.code && rs.data) { |
| | | this.userList = rs.data2; |
| | | this.searchDefaultMailUser(); |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | console.log(error); |
| | | }); |
| | | }, |
| | | searchDefaultMailUser() { |
| | | // 软件 type为1 |
| | | let type = 1; |
| | | searchDefaultMailUser(type).then((res) => { |
| | | let rs = res.data; |
| | | let data = []; |
| | | if (rs.code === 1) { |
| | | data = rs.data.map((item) => { |
| | | return item.user; |
| | | }); |
| | | } |
| | | this.mailList = this.userList |
| | | .filter((o) => data.includes(o.name) && o.mail) |
| | | .map((item) => { |
| | | return item.mail; |
| | | }); |
| | | }); |
| | | }, |
| | | }, |
| | | watch: { |
| | |
| | | canLock() { |
| | | return checkPermit(PERMITS.lockOther, this.permits); |
| | | }, |
| | | isTester() { |
| | | return this.tester.some((v) => v == this.user.name); |
| | | }, |
| | | }, |
| | | mounted() { |
| | | this.searchData(); |