修改中英文切换

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