修改中英文切换

This commit is contained in:
qq787203167
2022-03-04 10:20:19 +08:00
parent bd5308395c
commit fefce57021
12 changed files with 67 additions and 133 deletions
+6 -1
View File
@@ -408,5 +408,10 @@ module.exports = {
PleaseSelectData: 'Please select data first',
MessageContent: 'Message Content',
MessageType: 'Message Type',
NotificationTime: 'Notification Time'
NotificationTime: 'Notification Time',
MessageNotification:'Message Notification',
SeeMore:'See more',
OperationSuccessful:'Operation successful',
operationFailed:'operation failed',
PersonnelSelection:'Personnel selection'
}
+5
View File
@@ -413,4 +413,9 @@ module.exports = {
MessageContent:'消息内容',
MessageType:'消息类型',
NotificationTime:'通知时间',
MessageNotification:'消息通知',
SeeMore:'查看更多',
OperationSuccessful:'操作成功',
operationFailed:'操作失败',
PersonnelSelection:'人员选择',
}
@@ -3,11 +3,11 @@
<div class="box-title-text">
<a-input class="box-input" :value="value" @input="indexclick($event)" :placeholder="$t('PleaseEnterOrSelect')+query.db_field_txt"/>
<a-button type="primary" class="button-box" @click="standardClick">
人员选择
{{this.$t('PersonnelSelection')}}
</a-button>
</div>
<a-drawer
:title="'人员选择'"
:title="$t('PersonnelSelection')"
:maskClosable="false"
:width="600"
placement="right"
@@ -34,7 +34,7 @@
</a-table>
<div class="page" v-if="dataList.length > 0">
<a-pagination
:show-total="total => ` ${total} `"
:show-total="total => $t('total')+`${total}`+$t('strip')"
show-quick-jumper
show-size-changer
:page-size.sync="pageSize"
+7 -8
View File
@@ -277,11 +277,11 @@
}
postAction(url, this.formInline).then((res) => {
if (res.success) {
this.$message.success(res.message)
this.$message.success(this.$t('OperationSuccessful'))
eventBUs.$emit('searchReset')
this.$emit('addFormClick')
} else {
this.$message.warning(res.message)
this.$message.warning(this.$t('operationFailed'))
}
})
} else {
@@ -295,7 +295,6 @@
},
/** 上传文件的回调 */
uploadSuccess(data) {
console.log(data)
let attIdList = []
data.map(item => {
attIdList.push(item.id || data.name)
@@ -319,7 +318,7 @@
if (res.field_show_type === '1') {
rule.push({
required: true,
message: res.db_field_txt + '不能为空',
message: res.db_field_txt + this.$t('cannotEmpty'),
trigger: 'blur'
})
} else if (res.field_show_type === '4' || res.field_show_type === '6' ||
@@ -327,25 +326,25 @@
) {
rule.push({
required: true,
message: res.db_field_txt + '不能为空',
message: res.db_field_txt + this.$t('cannotEmpty'),
trigger: 'change'
})
} else if (res.field_show_type === '2') {
rule.push({
required: true,
message: res.db_field_txt + '不能为空',
message: res.db_field_txt + this.$t('cannotEmpty'),
trigger: 'blur'
})
} else if (res.field_show_type === '8' || res.field_show_type === '9' || res.field_show_type === '10') {
rule.push({
required: true,
message: res.db_field_txt + '不能为空',
message: res.db_field_txt + this.$t('cannotEmpty'),
trigger: 'blur'
})
} else if (res.field_show_type === '3') {
rule.push({
required: true,
message: res.db_field_txt + '不能为空',
message: res.db_field_txt + this.$t('cannotEmpty'),
trigger: 'change'
})
}
@@ -350,11 +350,11 @@
})
postAction(url, formInline).then((res) => {
if (res.success) {
this.$message.success(res.message)
this.$message.success(this.$t('OperationSuccessful'))
eventBUs.$emit('searchReset')
this.$emit('addFormClick')
} else {
this.$message.warning(res.message)
this.$message.warning(this.$t('operationFailed'))
}
})
} else {
@@ -410,7 +410,7 @@
if (res.field_show_type === '1') {
rule.push({
required: true,
message: res.db_field_txt + '不能为空',
message: res.db_field_txt + this.$t('cannotEmpty'),
trigger: 'blur'
})
} else if (res.field_show_type === '4' || res.field_show_type === '6' ||
@@ -418,25 +418,25 @@
) {
rule.push({
required: true,
message: res.db_field_txt + '不能为空',
message: res.db_field_txt + this.$t('cannotEmpty'),
trigger: 'change'
})
} else if (res.field_show_type === '2') {
rule.push({
required: true,
message: res.db_field_txt + '不能为空',
message: res.db_field_txt + this.$t('cannotEmpty'),
trigger: 'blur'
})
} else if (res.field_show_type === '8' || res.field_show_type === '9' || res.field_show_type === '10') {
rule.push({
required: true,
message: res.db_field_txt + '不能为空',
message: res.db_field_txt + this.$t('cannotEmpty'),
trigger: 'blur'
})
} else if (res.field_show_type === '3') {
rule.push({
required: true,
message: res.db_field_txt + '不能为空',
message: res.db_field_txt + this.$t('cannotEmpty'),
trigger: 'change'
})
}
+2 -2
View File
@@ -17,7 +17,7 @@
<a-input-number class="box-input" :placeholder="$t('PleaseEnter')+item.db_field_txt"
v-model="queryParam[item.db_field_name]" :min="1" :max="99999999"/>
</div>
<div class="box-title-text" v-else-if="item.field_show_type == '3'">
<div class="box-title-text" v-else-if="item.field_show_type == '4'">
<div class="title-text" :title="item.db_field_txt">
<span>{{item.db_field_txt}}</span>
</div>
@@ -42,7 +42,7 @@
@change="dateChange(item.db_field_name)"
v-model="queryParam[item.db_field_name]"/>
</div>
<div class="box-title-text" v-else-if="item.field_show_type == '4'">
<div class="box-title-text" v-else-if="item.field_show_type == '3'">
<div class="title-text" :title="item.db_field_txt">
<span>{{item.db_field_txt}}</span>
</div>
+1 -1
View File
@@ -39,7 +39,7 @@
</div>
<div class="page" v-if="dataSource.length > 0">
<a-pagination
:show-total="total => ` ${total} `"
:show-total="total => $t('total')+` ${total} `+$t('strip')"
show-quick-jumper
show-size-changer
:page-size.sync="pageSize"
+18 -94
View File
@@ -13,39 +13,17 @@
<a-tab-pane :tab="msg1Title" key="1">
<a-list>
<a-list-item :key="index" v-for="(record, index) in announcement1">
<div style="margin-left: 5%;width: 80%">
<p><a @click="showAnnouncement(record)">{{ record.titile }}</a></p>
<p style="color: rgba(0,0,0,.45);margin-bottom: 0px">{{ record.createTime }} 发布</p>
<div style="margin-left: 5%;width: 80%;">
<p style="overflow: hidden; text-overflow: ellipsis;white-space: nowrap;color:#00B3BE">
<a :title="record.msgContent" @click="showAnnouncement(record)">{{ record.msgContent }}</a>
</p>
</div>
<!-- <div style="text-align: right">-->
<!-- <a-tag @click="showAnnouncement(record)" v-if="record.priority === 'L'" color="blue">一般消息</a-tag>-->
<!-- <a-tag @click="showAnnouncement(record)" v-if="record.priority === 'M'" color="orange">重要消息</a-tag>-->
<!-- <a-tag @click="showAnnouncement(record)" v-if="record.priority === 'H'" color="red">紧急消息</a-tag>-->
<!-- </div>-->
</a-list-item>
<div style="margin-top: 5px;text-align: center">
<a-button @click="toMyAnnouncement()" type="dashed" block>查看更多</a-button>
<a-button @click="toMyAnnouncement()" type="dashed" block>{{this.$t('SeeMore')}}</a-button>
</div>
</a-list>
</a-tab-pane>
<!-- <a-tab-pane :tab="msg2Title" key="2">-->
<!-- <a-list>-->
<!-- <a-list-item :key="index" v-for="(record, index) in announcement2">-->
<!-- <div style="margin-left: 5%;width: 80%">-->
<!-- <p><a @click="showAnnouncement(record)">{{ record.titile }}</a></p>-->
<!-- <p style="color: rgba(0,0,0,.45);margin-bottom: 0px">{{ record.createTime }} 发布</p>-->
<!-- </div>-->
<!-- <div style="text-align: right">-->
<!-- <a-tag @click="showAnnouncement(record)" v-if="record.priority === 'L'" color="blue">一般消息</a-tag>-->
<!-- <a-tag @click="showAnnouncement(record)" v-if="record.priority === 'M'" color="orange">重要消息</a-tag>-->
<!-- <a-tag @click="showAnnouncement(record)" v-if="record.priority === 'H'" color="red">紧急消息</a-tag>-->
<!-- </div>-->
<!-- </a-list-item>-->
<!-- <div style="margin-top: 5px;text-align: center">-->
<!-- <a-button @click="toMyAnnouncement()" type="dashed" block>查看更多</a-button>-->
<!-- </div>-->
<!-- </a-list>-->
<!-- </a-tab-pane>-->
</a-tabs>
</a-spin>
</template>
@@ -54,14 +32,12 @@
<a-icon style="font-size: 16px; padding: 4px" type="bell"/>
</a-badge>
</span>
<show-announcement ref="ShowAnnouncement" @ok="modalFormOk"></show-announcement>
<dynamic-notice ref="showDynamNotice" :path="openPath" :formData="formData"/>
</a-popover>
</template>
<script>
import { getAction, putAction } from '@/api/manage'
import ShowAnnouncement from './ShowAnnouncement'
import store from '@/store/'
import DynamicNotice from './DynamicNotice'
@@ -70,7 +46,6 @@
name: 'HeaderNotice',
components: {
DynamicNotice,
ShowAnnouncement
},
data() {
return {
@@ -78,14 +53,15 @@
url: {
listCementByUser: '/sys/sysAnnouncementSend/getMessageUnreadList',
editCementSend: '/sys/sysAnnouncementSend/editByAnntIdAndUserId',
queryById: '/sys/annountCement/queryById'
queryById: '/sys/annountCement/queryById',
readAllMsg:'sys/sysAnnouncementSend/read',
},
hovered: false,
announcement1: [],
announcement2: [],
msg1Count: '0',
msg2Count: '0',
msg1Title: '消息通知(0)',
msg1Title: this.$t('MessageNotification')+'(0)',
msg2Title: '',
stopTimer: false,
websock: null,
@@ -102,9 +78,9 @@
},
mounted() {
this.loadData()
//this.timerFun();
// this.timerFun();
this.initWebSocket()
// this.heartCheckFun();
this.heartCheckFun()
},
destroyed: function() { // 离开页面生命周期函数
this.websocketOnclose()
@@ -126,12 +102,9 @@
// 获取系统消息
getAction(this.url.listCementByUser).then((res) => {
if (res.success) {
this.announcement1 = res.result.anntMsgList
this.msg1Count = res.result.anntMsgTotal
this.msg1Title = '消息通知(' + res.result.anntMsgTotal + ')'
this.announcement2 = res.result.sysMsgList
this.msg2Count = res.result.sysMsgTotal
this.msg2Title = '系统消息(' + res.result.sysMsgTotal + ')'
this.announcement1 = res.result
this.msg1Count = res.result.length
this.msg1Title = this.$t('MessageNotification')+'(' + res.result.length + ')'
}
}).catch(error => {
this.stopTimer = true
@@ -148,31 +121,21 @@
this.loadding = true
setTimeout(() => {
this.loadding = false
this.loadData()
}, 200)
},
showAnnouncement(record) {
putAction(this.url.editCementSend, { anntId: record.id }).then((res) => {
if (res.success) {
this.loadData()
}
getAction(this.url.readAllMsg, { ids: record.id }).then((res) => {
})
this.$router.push({
path: '/system/MessageDetails',
query: record
})
this.hovered = false
if (record.openType === 'component') {
this.openPath = record.openPage
this.formData = { id: record.busId }
this.$refs.showDynamNotice.detail(record.openPage)
} else {
this.$refs.ShowAnnouncement.detail(record)
}
},
toMyAnnouncement() {
this.$router.push({
path: '/isps/userAnnouncement'
})
},
modalFormOk() {
},
handleHoverChange(visible) {
this.hovered = visible
},
@@ -181,7 +144,6 @@
// WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
var userId = store.getters.userInfo.id
var url = window._CONFIG['domianWebSocketURL'].replace('https://', 'wss://').replace('http://', 'ws://') + '/websocket/' + userId
//console.log(url);
this.websock = new WebSocket(url)
this.websock.onopen = this.websocketOnopen
this.websock.onerror = this.websocketOnerror
@@ -190,8 +152,6 @@
},
websocketOnopen: function() {
console.log('WebSocket连接成功')
//心跳检测重置
//this.heartCheck.reset().start();
},
websocketOnerror: function(e) {
console.log('WebSocket连接发生错误')
@@ -207,8 +167,6 @@
//用户消息
this.loadData()
}
//心跳检测重置
//this.heartCheck.reset().start();
},
websocketOnclose: function(e) {
console.log('connection closed (' + e + ')')
@@ -225,28 +183,6 @@
}
},
openNotification(data) {
var text = data.msgTxt
const key = `open${Date.now()}`
this.$notification.open({
message: '消息提醒',
placement: 'bottomRight',
description: text,
key,
btn: (h) => {
return h('a-button', {
props: {
type: 'primary',
size: 'small'
},
on: {
click: () => this.showDetail(key, data)
}
}, '查看详情')
}
})
},
reconnect() {
var that = this
if (that.lockReconnect) return
@@ -283,18 +219,6 @@
}, this.timeout)
}
}
},
showDetail(key, data) {
this.$notification.close(key)
var id = data.msgId
getAction(this.url.queryById, { id: id }).then((res) => {
if (res.success) {
var record = res.result
this.showAnnouncement(record)
}
})
}
}
}
@@ -36,7 +36,7 @@
</div>
<div style="overflow: auto;margin-top: 68px;background: #fff">
<div class="detail-content">
<div v-for="(item,index) in detailList" class="content-box" >
<div v-for="(item,index) in detailList" class="content-box">
<div v-for="val in Object.keys(item)" class="content">
<div class="header-text">
{{val}}
@@ -83,7 +83,7 @@
</div>
<a-modal
title="更新log"
:title="$t('UpdateLog')"
:width="900"
:visible="visible"
:confirm-loading="confirmLoading"
@@ -102,10 +102,10 @@
</a-table>
<div class="page" v-if="dataSource.length > 0">
<a-pagination
:show-total="total => ` ${total} `"
:show-total="total => $t('total')+`${total}`+$t('strip')"
show-quick-jumper
show-size-changer
:page-size.sync="pageSize"
:page-size.sync="pageSize "
:total="total"
@change="onChange"
@showSizeChange="SizeChange"
@@ -228,6 +228,7 @@
.doc-detail {
background: #fff;
height: 100%;
.doc-detail-wrap {
.doc-detail-header {
width: 100%;
@@ -177,7 +177,7 @@
}
})
} else {
this.$message.warning('请选择需要删除的数据')
this.$message.warning(this.$t('selectLeastOne'))
}
},
//推送
@@ -202,10 +202,10 @@
onOk() {
deleteAction(_this.url.deleteBatch, { ids: val.id }).then((res) => {
if (res.success) {
_this.$message.success(res.message)
_this.$message.success(_this.$t('OperationSuccessful'))
eventBUs.$emit('searchReset')
} else {
this.$message.warning(res.message)
_this.$message.warning(_this.$t('operationFailed'))
}
})
}
@@ -225,10 +225,10 @@
}
getAction(url, { id: val.id }).then((res) => {
if (res.success) {
_this.$message.success(res.message)
_this.$message.success(_this.$t('OperationSuccessful'))
eventBUs.$emit('searchReset')
} else {
_this.$message.warning(res.message)
_this.$message.warning(_this.$t('operationFailed'))
}
})
}
@@ -248,10 +248,10 @@
}
getAction(url, { id: val.id }).then((res) => {
if (res.success) {
_this.$message.success(res.message)
_this.$message.success(_this.$t('OperationSuccessful'))
eventBUs.$emit('searchReset')
} else {
_this.$message.warning(res.message)
_this.$message.warning(_this.$t('operationFailed'))
}
})
}
@@ -135,10 +135,6 @@
}
},
methods: {
handleDetail: function(record) {
this.$refs.sysAnnouncementModal.detail(record)
this.$refs.sysAnnouncementModal.title = '查看'
},
showAnnouncement(record) {
putAction(this.url.editCementSend, { anntId: record.anntId }).then((res) => {
if (res.success) {
@@ -164,8 +160,10 @@
getAction(that.url.readAllMsg, { ids: selectedRowKeys.join(',') }).then((res) => {
if (res.success) {
that.selectedRowKeys = []
that.$message.success(res.message)
that.$message.success(this.$t('OperationSuccessful'))
that.loadData()
}else{
that.$message.success(this.$t('operationFailed'))
}
})
}
@@ -195,8 +193,10 @@
deleteAction(that.url.deleteUrl, { ids: selectedRowKeys.join(',') }).then((res) => {
if (res.success) {
that.selectedRowKeys = []
that.$message.success(res.message)
that.$message.success(this.$t('OperationSuccessful'))
that.loadData()
}else{
that.$message.success(this.$t('operationFailed'))
}
})
}