【fix ESLint】src/components/tools

This commit is contained in:
zhaoxiao
2023-03-06 10:05:21 +08:00
parent e60ab2b2e1
commit 516af1cb77
6 changed files with 22 additions and 23 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
<template>
<a-breadcrumb class="breadcrumb">
<a-breadcrumb-item v-for="(item, index) in breadList" :key="index">
<router-link v-if="item.name != name" :to="{ path: item.path }">
<router-link v-if="item.name + '' !== name + ''" :to="{ path: item.path }">
{{ item.meta.title }}
</router-link>
<span v-else>{{ item.meta.title }}</span>
@@ -20,9 +20,9 @@
<template slot="title">
<span>您隶属于多部门请选择当前所在部门</span>
</template>
<a-avatar style="backgroundColor:#87d068" icon="gold" />
<a-avatar style="background-color:#87d068" icon="gold" />
</a-tooltip>
<a-select v-model="departSelected" :class="{'valid-error':validate_status=='error'}" placeholder="请选择登录部门" style="margin-left:10px;width: 80%">
<a-select v-model="departSelected" :class="{'valid-error':validate_status + '' === 'error' + ''}" placeholder="请选择登录部门" style="margin-left:10px;width: 80%">
<a-icon slot="suffixIcon" type="gold" />
<a-select-option
v-for="d in departList"
@@ -94,7 +94,7 @@ export default {
const orgCode = res.result.orgCode
if (departs && departs.length > 0) {
for (const i of departs) {
if (i.orgCode == orgCode) {
if (i.orgCode + '' === orgCode + '') {
this.currDepartName = i.departName
break
}
+1 -3
View File
@@ -44,9 +44,7 @@ const responsive = {
export default {
name: 'DetailList',
Item: Item,
components: {
Col
},
components: { Col },
props: {
title: {
type: String,
+15 -15
View File
@@ -32,7 +32,7 @@
<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>
<p style="color: rgba(0,0,0,.45);margin-bottom: 0">{{ record.createTime }} 发布</p>
</div>
<div style="text-align: right">
<a-tag @click="showAnnouncement(record)" v-if="record.priority === 'L'" color="blue">一般消息</a-tag>
@@ -50,7 +50,7 @@
<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>
<p style="color: rgba(0,0,0,.45);margin-bottom: 0">{{ record.createTime }} 发布</p>
</div>
<div style="text-align: right">
<a-tag @click="showAnnouncement(record)" v-if="record.priority === 'L'" color="blue">一般消息</a-tag>
@@ -130,7 +130,7 @@ export default {
this.stopTimer = false
const myTimer = setInterval(() => {
// 停止定时器
if (this.stopTimer == true) {
if (this.stopTimer === true) {
clearInterval(myTimer)
return
}
@@ -197,8 +197,8 @@ export default {
initWebSocket: function () {
// WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
var userId = store.getters.userInfo.id
var url = window._CONFIG.domianWebSocketURL.replace('https://', 'wss://').replace('http://', 'ws://') + '/websocket/' + userId
const userId = store.getters.userInfo.id
const 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
@@ -211,17 +211,17 @@ export default {
// 心跳检测重置
// this.heartCheck.reset().start();
},
websocketOnerror: function (e) {
websocketOnerror: function () {
console.log('WebSocket连接发生错误')
this.reconnect()
},
websocketOnmessage: function (e) {
console.log('-----接收消息-------', e.data)
var data = eval('(' + e.data + ')') // 解析对象
if (data.cmd == 'topic') {
const data = eval('(' + e.data + ')') // 解析对象
if (data.cmd + '' === 'topic') {
// 系统通知
this.loadData()
} else if (data.cmd == 'user') {
} else if (data.cmd + '' === 'user') {
// 用户消息
this.loadData()
}
@@ -244,7 +244,7 @@ export default {
},
openNotification (data) {
var text = data.msgTxt
const text = data.msgTxt
const key = `open${Date.now()}`
this.$notification.open({
message: '消息提醒',
@@ -266,7 +266,7 @@ export default {
},
reconnect () {
var that = this
const that = this
if (that.lockReconnect) return
that.lockReconnect = true
// 没连接上会一直重连,设置延迟避免请求过多
@@ -277,7 +277,7 @@ export default {
}, 5000)
},
heartCheckFun () {
var that = this
const that = this
// 心跳检测,每20s心跳一次
that.heartCheck = {
timeout: 20000,
@@ -289,7 +289,7 @@ export default {
return this
},
start: function () {
var self = this
// const self = this
this.timeoutObj = setTimeout(function () {
// 这里发送一个心跳,后端收到后,返回一个心跳消息,
// onmessage拿到返回的心跳就说明连接正常
@@ -305,10 +305,10 @@ export default {
showDetail (key, data) {
this.$notification.close(key)
var id = data.msgId
const id = data.msgId
getAction(this.url.queryById, { id: id }).then((res) => {
if (res.success) {
var record = res.result
const record = res.result
this.showAnnouncement(record)
}
})
+1 -1
View File
@@ -135,7 +135,7 @@ export default {
},
mounted () {
// 如果是单点登录模式
if (process.env.VUE_APP_SSO == 'true') {
if (process.env.VUE_APP_SSO + '' === 'true') {
const depart = this.userInfo().orgCode
if (!depart) {
this.updateCurrentDepart()
@@ -136,6 +136,7 @@ export default {
compareToFirstPassword (rule, value, callback) {
const form = this.form
if (value && value !== form.getFieldValue('password')) {
// eslint-disable-next-line standard/no-callback-literal
callback('两次输入的密码不一样')
} else {
callback()