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() {
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;
}
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 {
this.goForward({name: 'manage-messenger'});
}

View File

@ -1104,7 +1104,7 @@ export default {
};
this.msgFile = [];
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);
} else {
this.sendDialogMsg();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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