no message

This commit is contained in:
kuaifan 2022-05-16 11:06:13 +08:00
parent 3755402f37
commit e8dc71c71f
20 changed files with 220 additions and 67 deletions

22
electron/build.js vendored
View File

@ -98,6 +98,13 @@ function genericPublish({url, version, output}) {
// 生成配置、编译应用
function startBuild(data, publish) {
const systemInfo = {
title: data.name,
version: config.version,
origin: "./",
homeUrl: utils.formatUrl(data.url),
apiUrl: utils.formatUrl(data.url) + "api/",
}
// information
if (data.id === 'app') {
console.log("Name: " + data.name);
@ -108,16 +115,9 @@ function startBuild(data, publish) {
console.log("Version: " + config.version);
console.log("Platform: " + data.platform);
console.log("Publish: " + (publish ? 'Yes' : 'No'));
// drawio
cloneDrawio(systemInfo)
}
let systemInfo = {
title: data.name,
version: config.version,
origin: "./",
homeUrl: utils.formatUrl(data.url),
apiUrl: utils.formatUrl(data.url) + "api/",
}
// drawio
cloneDrawio(systemInfo)
// config.js
fs.writeFileSync(electronDir + "/config.js", "window.systemInfo = " + JSON.stringify(systemInfo), 'utf8');
fs.writeFileSync(nativeCachePath, utils.formatUrl(data.url));
@ -128,7 +128,9 @@ function startBuild(data, publish) {
indexString = indexString.replace(/<title>(.*?)<\/title>/g, `<title>${data.name}</title>`);
fs.writeFileSync(indexFile, indexString, 'utf8');
if (data.id === 'app') {
fse.copySync(electronDir, path.resolve(__dirname, "../resources/mobile/src/public"))
const publicDir = path.resolve(__dirname, "../resources/mobile/src/public");
fse.removeSync(publicDir)
fse.copySync(electronDir, publicDir)
return;
}
// package.json Backup

View File

@ -32,20 +32,13 @@ export default {
},
created() {
if ($A.urlParameter('token')) {
this.$store.state.userToken = $A.urlParameter('token');
}
this.electronEvents();
},
mounted() {
let hash = window.location.hash;
if (hash.indexOf("#") === 0) {
hash = hash.substr(1);
if (hash) {
this.$nextTick(() => {
hash = $A.removeURLParameter(hash, 'token');
this.goForward({path: hash});
});
}
}
this.sessionStorage('/', 1);
let pathname = window.location.pathname;
if (pathname && this.sessionStorage(pathname) === 0) {

View File

@ -3,8 +3,6 @@
</template>
<script>
import {mapState} from "vuex";
export default {
name: "MobileBack",
props: {

View File

@ -1,6 +1,17 @@
<template>
<div class="mobile-tabbar">
<ul>
<div class="mobile-tabbar" :class="{'more-show': isMore}" @click="toggleRoute('more')">
<div @click.stop="" class="more-box">
<div class="tabbar-more-title">{{$L('更多')}}</div>
<ul>
<li v-for="item in navMore" @click="toggleRoute(item.name)" :class="{active: activeName === item.name}">
<div class="more-item">
<i class="taskfont" v-html="item.icon"></i>
<div class="tabbar-title">{{$L(item.label)}}</div>
</div>
</li>
</ul>
</div>
<ul @click.stop="">
<li v-for="item in navList" @click="toggleRoute(item.name)" :class="{active: activeName === item.name}">
<i class="taskfont" v-html="item.icon"></i>
<div class="tabbar-title">{{$L(item.label)}}</div>
@ -26,12 +37,19 @@ export default {
data() {
return {
isMore: false,
navList: [
{icon: '&#xe736;', name: 'dashboard', label: '仪表盘'},
{icon: '&#xe732;', name: 'project', label: '项目'},
{icon: '&#xe71e;', name: 'dialog', label: '消息'},
{icon: '&#xe6b2;', name: 'contacts', label: '通讯录'},
{icon: '&#xe61a;', name: 'setting', label: '我的'},
{icon: '&#xe6e9;', name: 'more', label: '更多'},
],
navMore: [
{icon: '&#xe6f5;', name: 'calendar', label: '日历'},
{icon: '&#xe6f3;', name: 'file', label: '文件'},
{icon: '&#xe67b;', name: 'setting', label: '设置'},
]
};
},
@ -58,27 +76,6 @@ export default {
return this.$route.name
},
activeName() {
if (this.routeName === 'manage-dashboard') {
return 'dashboard';
}
if (this.routeName === 'manage-project' && !/^\d+$/.test(this.$route.params.projectId)) {
return 'project';
}
if (this.routeName === 'manage-messenger') {
if (this.$route.params.dialogId === 'contacts') {
return 'contacts'
} else {
return 'dialog'
}
}
if (this.routeName === 'manage-setting') {
return 'setting';
}
return ''
},
msgUnreadMention() {
let num = 0;
let mention = 0;
@ -100,12 +97,38 @@ export default {
}
return String(num);
},
activeName() {
if (this.isMore || ['manage-calendar', 'manage-file', 'manage-setting'].includes(this.routeName)) {
return 'more';
}
if (this.routeName === 'manage-dashboard') {
return 'dashboard';
}
if (this.routeName === 'manage-project' && !/^\d+$/.test(this.$route.params.projectId)) {
return 'project';
}
if (this.routeName === 'manage-messenger') {
if (this.$route.params.dialogId === 'contacts') {
return 'contacts'
} else {
return 'dialog'
}
}
return ''
},
},
methods: {
toggleRoute(path) {
let location;
switch (path) {
case 'more':
this.isMore = !this.isMore;
return;
case 'project':
location = {name: 'manage-project', params: {projectId: 'all'}};
break;
@ -122,6 +145,7 @@ export default {
location = {name: 'manage-' + path};
break;
}
this.isMore = false;
this.goForward(location);
},
},

View File

@ -632,7 +632,7 @@
},
urlParameterAll() {
let search = window.location.search || "";
let search = window.location.search || window.location.hash || "";
let arr = [];
if (this.strExists(search, "?")) {
arr = this.getMiddle(search, "?").split("&");

View File

@ -633,16 +633,13 @@ export default {
},
showMobileTabbar() {
if (this.routeName === 'manage-dashboard') {
return true;
}
if (this.routeName === 'manage-project' && !/^\d+$/.test(this.$route.params.projectId)) {
return true;
}
if (this.routeName === 'manage-messenger' && !/^\d+$/.test(this.$route.params.dialogId)) {
return true;
}
return this.routeName === 'manage-setting';
return ['manage-dashboard', 'manage-calendar', 'manage-file', 'manage-setting'].includes(this.routeName)
},
},

View File

@ -318,7 +318,7 @@ export default {
const eeui = requireModuleJs("eeui");
eeui.openPage({
pageType: 'web',
url: $A.apiUrl(`../single/file/msg/${this.msgData.id}?token=${this.userToken}`)
url: $A.apiUrl(`../#/single/file/msg/${this.msgData.id}?token=${this.userToken}`)
}, _ => {});
} else {
window.open($A.apiUrl(`../single/file/msg/${this.msgData.id}`))

View File

@ -356,15 +356,12 @@ export default {
msgText = this.msgText;
this.msgText = '';
}
if (msgText == '' && this.isDesktop) {
if (msgText == '') {
this.$refs.input.focus();
return;
}
msgText = msgText.replace(/<\/span> <\/p>$/, "</span></p>")
//
if (!this.isDesktop) {
this.$refs.input.blur();
}
this.onToBottom();
this.onActive();
//
@ -451,9 +448,6 @@ export default {
chatFile(type, file) {
switch (type) {
case 'progress':
if (!this.isDesktop) {
this.$refs.input.blur();
}
this.onToBottom();
this.onActive();
//

View File

@ -203,7 +203,7 @@ export default {
const eeui = requireModuleJs("eeui");
eeui.openPage({
pageType: 'web',
url: $A.apiUrl(`../single/file/${this.fileId}?history_id=${row.id}&history_at=${row.created_at}&token=${this.userToken}`)
url: $A.apiUrl(`../#/single/file/${this.fileId}?history_id=${row.id}&history_at=${row.created_at}&token=${this.userToken}`)
}, _ => {});
} else {
window.open($A.apiUrl(`../single/file/${this.fileId}?history_id=${row.id}&history_at=${row.created_at}`))

View File

@ -1267,7 +1267,7 @@ export default {
const eeui = requireModuleJs("eeui");
eeui.openPage({
pageType: 'web',
url: $A.apiUrl(`../single/file/task/${file.id}?token=${this.userToken}`)
url: $A.apiUrl(`../#/single/file/task/${file.id}?token=${this.userToken}`)
}, _ => {});
} else {
window.open($A.apiUrl(`../single/file/task/${file.id}`))

View File

@ -68,6 +68,7 @@ export default {
menu() {
let menu = [
{path: 'personal', name: '个人设置'},
{path: 'language', name: '语言设置'},
{path: 'password', name: '密码设置'},
]
if (!this.isDesktop) {

View File

@ -0,0 +1,57 @@
<template>
<div class="setting-item submit">
<Form ref="formData" :model="formData" :rules="ruleData" label-width="auto" @submit.native.prevent>
<FormItem :label="$L('选择语言')" prop="language">
<Select v-model="formData.language" :placeholder="$L('选项语言')">
<Option v-for="(item, index) in languageList" :value="index" :key="index">{{ item }}</Option>
</Select>
</FormItem>
</Form>
<div class="setting-footer">
<Button :loading="loadIng > 0" type="primary" @click="submitForm">{{$L('提交')}}</Button>
<Button :loading="loadIng > 0" @click="resetForm" style="margin-left: 8px">{{$L('重置')}}</Button>
</div>
</div>
</template>
<script>
import ImgUpload from "../../../components/ImgUpload";
export default {
components: {ImgUpload},
data() {
return {
loadIng: 0,
formData: {
language: '',
},
ruleData: { },
}
},
mounted() {
this.initData();
},
methods: {
initData() {
this.$set(this.formData, 'language', this.getLanguage());
this.formData_bak = $A.cloneJSON(this.formData);
},
submitForm() {
this.$refs.formData.validate((valid) => {
if (valid) {
this.setLanguage(this.formData.language)
}
})
},
resetForm() {
this.formData = $A.cloneJSON(this.formData_bak);
}
}
}
</script>

View File

@ -9,10 +9,10 @@
<Input v-model="userInfo.email" disabled></Input>
</FormItem>
<FormItem :label="$L('昵称')" prop="nickname">
<Input v-model="formData.nickname" :maxlength="20"></Input>
<Input v-model="formData.nickname" :maxlength="20" :placeholder="$L('请输入昵称')"></Input>
</FormItem>
<FormItem :label="$L('职位/职称')" prop="profession">
<Input v-model="formData.profession" :maxlength="20"></Input>
<Input v-model="formData.profession" :maxlength="20" :placeholder="$L('请输入职位/职称')"></Input>
</FormItem>
</Form>
<div class="setting-footer">

View File

@ -37,6 +37,11 @@ export default [
path: 'personal',
component: () => import('./pages/manage/setting/personal.vue'),
},
{
name: 'manage-setting-language',
path: 'language',
component: () => import('./pages/manage/setting/language.vue'),
},
{
name: 'manage-setting-password',
path: 'password',

View File

@ -1,12 +1,13 @@
.mobile-tabbar {
display: none;
flex-direction: column;
justify-content: flex-end;
position: fixed;
left: 0;
bottom: 0;
right: 0;
background-color: #f8f8f8;
box-shadow: 0 0 2px rgba(28, 34, 43, 0.15);
z-index: 99;
> ul {
display: flex;
align-items: center;
@ -14,6 +15,9 @@
padding: 0;
margin: 0;
height: 60px;
background-color: #f8f8f8;
box-shadow: 0 0 2px rgba(28, 34, 43, 0.15);
> li {
flex: 1;
height: 100%;
@ -26,29 +30,100 @@
margin: 0;
color: $primary-text-color;
position: relative;
.taskfont {
font-size: 24px;
line-height: 34px;
}
.tabbar-title {
font-size: 12px;
line-height: 18px;
}
.tabbar-badge {
position: absolute;
top: 0;
left: 50%;
transform: scale(0.8);
.ivu-badge-count {
font-size: 14px;
}
}
&.active {
color: $primary-color;
}
}
}
.more-box {
display: none;
margin-bottom: -2px;
border-radius: 16px 16px 0 0;
background-color: rgba(250, 250, 250, 0.98);
border-top: 1px solid #f1f1f1;
.tabbar-more-title {
font-size: 18px;
font-weight: 500;
padding: 14px 14px 0;
}
> ul {
padding: 36px 12px 16px;
> li {
list-style: none;
display: inline-block;
width: 25%;
margin-bottom: 20px;
.more-item {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.taskfont {
display: flex;
align-items: center;
justify-content: center;
width: 56px;
height: 56px;
font-size: 26px;
color: #0bc037;
background-color: #f1f1f1;
border-radius: 12px;
}
.tabbar-title {
padding-top: 6px;
font-size: 14px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
}
}
&.more-show {
top: 0;
background-color: rgba(0, 0, 0, 0.15);
> ul {
box-shadow: 0 0 1px rgba(28, 34, 43, 0.15);
}
.more-box {
display: block;
}
}
}
.mobile-back {
display: none;
position: fixed;
@ -61,13 +136,16 @@
border-radius: 50%;
transform: translate(-460px, -50%);
transition: left 0.2s;
&.show-back {
left: 0;
}
}
@media (max-width: 640px) {
.mobile-tabbar,
.mobile-tabbar {
display: flex;
}
.mobile-back {
display: block;
}

View File

@ -439,6 +439,11 @@ body {
}
}
}
.ivu-tabs-nav-next,
.ivu-tabs-nav-prev {
padding-top: 2px;
}
}
*[hidden="hidden"] {

View File

@ -300,7 +300,6 @@
padding: 12px 32px;
> li {
padding: 0 8px;
font-size: 16px;
&:hover {
background-color: transparent;
}