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