Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
aixianling
2021-12-13 14:04:26 +08:00
3 changed files with 287 additions and 305 deletions

View File

@@ -180,13 +180,9 @@ export default {
if (item.val == 0) { if (item.val == 0) {
this.show = false; this.show = false;
this.comp = "detail"; return uni.navigateTo({
this.params = { url: "/apps/notification/detail?id=" + this.detail.id
id: this.detail.id, });
flag: true
};
this.showList = false;
return
} }
if ([1,2,4].includes(item.val)) { if ([1,2,4].includes(item.val)) {
@@ -195,12 +191,9 @@ export default {
if(item.val==3){ if(item.val==3){
this.show = false; this.show = false;
this.comp = "add"; return uni.navigateTo({
this.params = { url:"/apps/notification/add?id=" + this.detail.id + "&flag=" + false
id: this.detail.id, });
flag: false
};
this.showList = false;
} }
}, },
color(status) { color(status) {
@@ -216,21 +209,15 @@ export default {
if (this.index == 1) { if (this.index == 1) {
this.show = true; this.show = true;
}else { }else {
this.comp = "detail"; uni.navigateTo({
this.params = { url: "/apps/notification/detail?id=" + this.detail.id + "&flag=" + true
id: this.detail.id, })
flag: true
};
this.showList = false;
} }
}, },
add(){ add(){
this.comp = "add"; uni.navigateTo({
this.params = { url: "/apps/notification/add"
id: null, })
flag: false
};
this.showList = false;
}, },
change(val) { change(val) {
this.index = val; this.index = val;

View File

@@ -100,23 +100,16 @@ export default {
}, },
} }
}, },
watch: {
params: { onLoad(opt) {
handler: function () {
if (this.params?.id) {
this.form.id = this.params?.id;
this.flag = this.params?.flag;
}
},
immediate: true
}
},
created() {
document.title = "新增公告"; document.title = "新增公告";
if (this.params?.id) { if(opt.id) {
this.form.id = opt.id;
this.flag = opt.flag;
this.getDetail(); this.getDetail();
} }
}, },
methods: { methods: {
...mapActions(['selectEnterpriseContact']), ...mapActions(['selectEnterpriseContact']),
handleSelectUser() { handleSelectUser() {
@@ -125,7 +118,6 @@ export default {
type: ["user"], type: ["user"],
selectedUserIds: this.form.persons?.map(e => e.id) selectedUserIds: this.form.persons?.map(e => e.id)
}).then(res => { }).then(res => {
console.log(res);
this.form.persons = res?.userList || [] this.form.persons = res?.userList || []
}) })
}, },

View File

@@ -64,15 +64,21 @@ import {mapActions} from "vuex";
export default { export default {
name: "detail", name: "detail",
props: {
params: Object
},
data() { data() {
return { return {
detailObj: {}, detailObj: {},
pageShow: false id: null,
pageShow: false,
flag: false,
} }
}, },
onLoad(opt) {
document.title = "公告详情";
this.id = opt.id;
this.flag = opt.flag;
},
created() { created() {
this.$loading() this.$loading()
this.injectJWeixin(['sendChatMessage']).then(() => { this.injectJWeixin(['sendChatMessage']).then(() => {
@@ -83,9 +89,6 @@ export default {
}) })
}, },
mounted() {
document.title = "公告详情";
},
methods: { methods: {
...mapActions(['previewFile', 'injectJWeixin']), ...mapActions(['previewFile', 'injectJWeixin']),
preFile(e) { preFile(e) {
@@ -101,8 +104,8 @@ export default {
getDetail() { getDetail() {
this.$http.post("/app/appannouncement/detail", null, { this.$http.post("/app/appannouncement/detail", null, {
params: { params: {
id: this.params?.id, id: this.id,
detail: this.params?.flag detail: this.flag
} }
}).then(res => { }).then(res => {
if (res && res.data) { if (res && res.data) {
@@ -113,9 +116,9 @@ export default {
}) })
}, },
handleClick() { handleClick() {
this.$parent.params = this.params.id; uni.navigateTo({
this.$parent.comp = "read"; url:"/apps/notification/read?id=" + this.id,
this.$parent.showList = false; })
} }
}, },
} }