no message

This commit is contained in:
kuaifan 2022-04-12 15:19:26 +08:00
parent 91c62ee55e
commit be755a6f4e
13 changed files with 68 additions and 50 deletions

View File

@ -213,7 +213,7 @@
openDialog() { openDialog() {
this.$store.dispatch("openDialogUserid", this.userid).then(({data}) => { this.$store.dispatch("openDialogUserid", this.userid).then(({data}) => {
this.goForward({name: 'manage-messenger', params: {id: data.id}}); this.goForward({name: 'manage-messenger', params: {dialogId: data.id}});
}); });
} }
} }

View File

@ -1006,7 +1006,7 @@ export default {
return; return;
} }
if (data.dialog_id) { if (data.dialog_id) {
this.goForward({name: 'manage-messenger', params: {id: data.dialog_id}}); this.goForward({name: 'manage-messenger', params: {dialogId: data.dialog_id}});
} else { } else {
this.goForward({name: 'manage-messenger'}); this.goForward({name: 'manage-messenger'});
} }

View File

@ -1104,7 +1104,7 @@ export default {
}; };
this.msgFile = []; this.msgFile = [];
this.msgText = ""; this.msgText = "";
this.goForward({name: 'manage-messenger', params: {id: data.dialog_id}}); this.goForward({name: 'manage-messenger', params: {dialogId: data.dialog_id}});
this.$store.dispatch('openTask', 0); this.$store.dispatch('openTask', 0);
} else { } else {
this.sendDialogMsg(); this.sendDialogMsg();

View File

@ -513,13 +513,13 @@ export default {
...mapState(['userId', 'userToken', 'userIsAdmin', 'userInfo', 'files', 'wsOpenNum']), ...mapState(['userId', 'userToken', 'userIsAdmin', 'userInfo', 'files', 'wsOpenNum']),
pid() { pid() {
const {pid} = this.$route.params; const {folderId} = this.$route.params;
return parseInt(this.$route.name === 'manage-file' && /^\d+$/.test(pid) ? pid : 0); return parseInt(/^\d+$/.test(folderId) ? folderId : 0);
}, },
fid() { fid() {
const {fid} = this.$route.params; const {fileId} = this.$route.params;
return parseInt(this.$route.name === 'manage-file' && /^\d+$/.test(fid) ? fid : 0); return parseInt(/^\d+$/.test(fileId) ? fileId : 0);
}, },
actionUrl() { actionUrl() {
@ -899,7 +899,7 @@ export default {
browseFolder(id) { browseFolder(id) {
if (id > 0) { if (id > 0) {
this.goForward({params: {pid: id, fid: undefined}}); this.goForward({params: {folderId: id, fileId: null}});
} else { } else {
this.goForward({name: 'manage-file'}); this.goForward({name: 'manage-file'});
} }
@ -907,7 +907,7 @@ export default {
browseFile(id) { browseFile(id) {
if (id > 0) { if (id > 0) {
this.goForward({params: {pid: this.pid, fid: id}}); this.goForward({params: {folderId: this.pid, fileId: id}});
} else { } else {
this.browseFolder(this.pid); this.browseFolder(this.pid);
} }

View File

@ -159,8 +159,8 @@ export default {
...mapState(['userId', 'cacheDialogs']), ...mapState(['userId', 'cacheDialogs']),
dialogId() { dialogId() {
const {id} = this.$route.params; const {dialogId} = this.$route.params;
return parseInt(this.$route.name == 'manage-messenger' && /^\d+$/.test(id) ? id : 0); return parseInt(/^\d+$/.test(dialogId) ? dialogId : 0);
}, },
dialogList() { dialogList() {
@ -253,7 +253,10 @@ export default {
} }
}, },
dialogId(id) { dialogId(id) {
this.$route.name == 'manage-messenger' && $A.setStorage("messenger::dialogId", id); if (id > 0) {
$A.setStorage("messenger::dialogId", id);
this.scrollIntoActive()
}
}, },
contactsKey(val) { contactsKey(val) {
setTimeout(() => { setTimeout(() => {
@ -295,9 +298,9 @@ export default {
this.dialogActive = type this.dialogActive = type
}, },
openDialog(id) { openDialog(dialogId) {
if (id > 0) { if (dialogId > 0) {
this.goForward({name: 'manage-messenger', params: {id}}); this.goForward({name: 'manage-messenger', params: {dialogId}});
} else { } else {
this.goForward({name: 'manage-messenger'}); this.goForward({name: 'manage-messenger'});
} }
@ -306,7 +309,7 @@ export default {
openContacts(user) { openContacts(user) {
this.tabActive = 'dialog'; this.tabActive = 'dialog';
this.$store.dispatch("openDialogUserid", user.userid).then(({data}) => { this.$store.dispatch("openDialogUserid", user.userid).then(({data}) => {
this.goForward({name: 'manage-messenger', params: {id: data.id}}); this.openDialog(data.id)
}); });
}, },
@ -417,13 +420,13 @@ export default {
return null; return null;
}, },
scrollIntoActive(smooth) { scrollIntoActive() {
this.$nextTick(() => { this.$nextTick(() => {
if (this.$refs.list) { if (this.$refs.list) {
let active = this.$refs.list.querySelector(".active") let active = this.$refs.list.querySelector(".active")
if (active) { if (active) {
$A.scrollToView(active, { $A.scrollToView(active, {
behavior: smooth === true ? 'smooth' : 'instant', behavior: 'instant',
scrollMode: 'if-needed', scrollMode: 'if-needed',
}); });
} else { } else {
@ -434,7 +437,7 @@ export default {
let active = this.$refs.list.querySelector(".active") let active = this.$refs.list.querySelector(".active")
if (active) { if (active) {
$A.scrollToView(active, { $A.scrollToView(active, {
behavior: smooth === true ? 'smooth' : 'instant', behavior: 'instant',
scrollMode: 'if-needed', scrollMode: 'if-needed',
}); });
} }
@ -471,9 +474,7 @@ export default {
}, },
}).then(({data}) => { }).then(({data}) => {
this.$store.dispatch("saveDialog", data); this.$store.dispatch("saveDialog", data);
this.$nextTick(() => { this.$nextTick(this.scrollIntoActive);
this.scrollIntoActive(false)
});
}).catch(({msg}) => { }).catch(({msg}) => {
$A.modalError(msg); $A.modalError(msg);
}); });

View File

@ -21,8 +21,8 @@ export default {
...mapGetters(['projectParameter']), ...mapGetters(['projectParameter']),
projectId() { projectId() {
const {id} = this.$route.params; const {projectId} = this.$route.params;
return parseInt(this.$route.name == 'manage-project' && /^\d+$/.test(id) ? id : 0); return parseInt(/^\d+$/.test(projectId) ? projectId : 0);
} }
}, },

View File

@ -48,12 +48,12 @@ export default {
}, },
methods: { methods: {
getInfo() { getInfo() {
let id = this.$route.params.id; let {codeOrFileId} = this.$route.params;
let data = {id}; let data = {id: codeOrFileId};
if (/^\d+$/.test(id)) { if (/^\d+$/.test(codeOrFileId)) {
this.code = null; this.code = null;
} else if (id) { } else if (codeOrFileId) {
this.code = id; this.code = codeOrFileId;
} else { } else {
return; return;
} }

View File

@ -89,7 +89,8 @@ export default {
}, },
computed: { computed: {
msgId() { msgId() {
return $A.runNum(this.$route.params.id); const {msgId} = this.$route.params;
return parseInt(/^\d+$/.test(msgId) ? msgId : 0);
}, },
title() { title() {

View File

@ -89,7 +89,8 @@ export default {
}, },
computed: { computed: {
fileId() { fileId() {
return $A.runNum(this.$route.params.id); const {fileId} = this.$route.params;
return parseInt(/^\d+$/.test(fileId) ? fileId : 0);
}, },
title() { title() {

View File

@ -22,8 +22,14 @@ export default {
detailData: {}, detailData: {},
}; };
}, },
computed: {
reportDetailId() {
const {reportDetailId} = this.$route.params;
return parseInt(/^\d+$/.test(reportDetailId) ? reportDetailId : 0);
},
},
watch: { watch: {
'$route': { reportDetailId: {
handler() { handler() {
this.getDetail(); this.getDetail();
}, },
@ -32,10 +38,13 @@ export default {
}, },
methods: { methods: {
getDetail() { getDetail() {
if (this.reportDetailId <= 0) {
return;
}
this.$store.dispatch("call", { this.$store.dispatch("call", {
url: 'report/detail', url: 'report/detail',
data: { data: {
id: $A.runNum(this.$route.params.id), id: this.reportDetailId,
}, },
}).then(({data}) => { }).then(({data}) => {
this.detailData = data; this.detailData = data;

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="electron-report"> <div class="electron-report">
<PageTitle :title="title"/> <PageTitle :title="title"/>
<ReportEdit :id="id" @saveSuccess="saveSuccess"/> <ReportEdit :id="reportEditId" @saveSuccess="saveSuccess"/>
</div> </div>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -23,11 +23,15 @@ export default {
} }
}, },
computed: { computed: {
id() { reportEditId() {
return $A.runNum(this.detail.id || this.$route.params.id) if (/^\d+$/.test(this.detail.id)) {
return parseInt(this.detail.id)
}
const {reportEditId} = this.$route.params;
return parseInt(/^\d+$/.test(reportEditId) ? reportEditId : 0);
}, },
title() { title() {
return this.$L(this.id > 0 ? '修改报告' : '新增报告'); return this.$L(this.reportEditId > 0 ? '修改报告' : '新增报告');
} }
}, },
methods: { methods: {

View File

@ -45,8 +45,6 @@ export default {
data() { data() {
return { return {
loadIng: 0, loadIng: 0,
taskId: 0,
canUpdateBlur: true canUpdateBlur: true
} }
}, },
@ -80,12 +78,17 @@ export default {
computed: { computed: {
...mapState(['cacheTasks']), ...mapState(['cacheTasks']),
taskId() {
const {taskId} = this.$route.params;
return parseInt(/^\d+$/.test(taskId) ? taskId : 0);
},
taskInfo() { taskInfo() {
return this.cacheTasks.find(({id}) => id === this.taskId) || {} return this.cacheTasks.find(({id}) => id === this.taskId) || {}
} }
}, },
watch: { watch: {
'$route': { taskId: {
handler() { handler() {
this.getInfo(); this.getInfo();
}, },
@ -94,7 +97,6 @@ export default {
}, },
methods: { methods: {
getInfo() { getInfo() {
this.taskId = $A.runNum(this.$route.params.id);
if (this.taskId <= 0) { if (this.taskId <= 0) {
return; return;
} }

View File

@ -24,7 +24,7 @@ export default [
}, },
{ {
name: 'manage-messenger', name: 'manage-messenger',
path: 'messenger/:id?', path: 'messenger/:dialogId?',
component: () => import('./pages/manage/messenger.vue'), component: () => import('./pages/manage/messenger.vue'),
}, },
{ {
@ -60,34 +60,34 @@ export default [
}, },
{ {
name: 'manage-project', name: 'manage-project',
path: 'project/:id', path: 'project/:projectId',
component: () => import('./pages/manage/project.vue'), component: () => import('./pages/manage/project.vue'),
}, },
{ {
name: 'manage-file', name: 'manage-file',
path: 'file/:pid?/:fid?', path: 'file/:folderId?/:fileId?',
component: () => import('./pages/manage/file.vue'), component: () => import('./pages/manage/file.vue'),
}, },
] ]
}, },
{ {
name: 'single-file-msg', name: 'single-file-msg',
path: '/single/file/msg/:id', path: '/single/file/msg/:msgId',
component: () => import('./pages/single/fileMsg.vue'), component: () => import('./pages/single/fileMsg.vue'),
}, },
{ {
name: 'single-file-task', name: 'single-file-task',
path: '/single/file/task/:id', path: '/single/file/task/:fileId',
component: () => import('./pages/single/fileTask.vue'), component: () => import('./pages/single/fileTask.vue'),
}, },
{ {
name: 'single-file', name: 'single-file',
path: '/single/file/:id', path: '/single/file/:codeOrFileId',
component: () => import('./pages/single/file.vue'), component: () => import('./pages/single/file.vue'),
}, },
{ {
name: 'single-task', name: 'single-task',
path: '/single/task/:id', path: '/single/task/:taskId',
component: () => import('./pages/single/task.vue'), component: () => import('./pages/single/task.vue'),
}, },
{ {
@ -98,12 +98,12 @@ export default [
}, },
{ {
name: 'report-edit', name: 'report-edit',
path: '/single/report/edit/:id', path: '/single/report/edit/:reportEditId',
component: () => import('./pages/single/reportEdit.vue') component: () => import('./pages/single/reportEdit.vue')
}, },
{ {
name: 'report-detail', name: 'report-detail',
path: '/single/report/detail/:id', path: '/single/report/detail/:reportDetailId',
component: () => import('./pages/single/reportDetail.vue') component: () => import('./pages/single/reportDetail.vue')
}, },
{ {