【fix ESLint】src/views/system/modules
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
<div style="width: 100%;">
|
||||
<span>{{ title }}</span>
|
||||
<span style="display:inline-block;width:calc(100% - 51px);padding-right:10px;text-align: right">
|
||||
<a-button @click="toggleScreen" icon="appstore" style="height:20px;width:20px;border:0px"></a-button>
|
||||
<a-button @click="toggleScreen" icon="appstore" style="height:20px;width:20px;border:0"></a-button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
<a-radio :value="2">上级</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="负责部门" :labelCol="labelCol" :wrapperCol="wrapperCol" v-if="departIdShow==true">
|
||||
<a-form-model-item label="负责部门" :labelCol="labelCol" :wrapperCol="wrapperCol" v-if="departIdShow===true">
|
||||
<j-multi-select-tag
|
||||
:disabled="disableSubmit"
|
||||
v-model="model.departIds"
|
||||
@@ -140,7 +140,7 @@ import moment from 'moment'
|
||||
import Vue from 'vue'
|
||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||
import { getAction } from '@/api/manage'
|
||||
import { addUser, editUser, queryUserRole, queryall, duplicateCheck } from '@/api/api'
|
||||
import { addUser, duplicateCheck, editUser, queryall, queryUserRole } from '@/api/api'
|
||||
import { disabledAuthFilter } from '@/utils/authFilter'
|
||||
|
||||
import { getRSAPublicKey } from '@/utils/encryption.js'
|
||||
@@ -192,7 +192,7 @@ export default {
|
||||
headers: {},
|
||||
url: {
|
||||
fileUpload: window._CONFIG.domianURL + '/sys/common/upload',
|
||||
userWithDepart: '/sys/user/userDepartList', // 引入为指定用户查看部门信息需要的url
|
||||
userWithDepart: '/sys/user/userDepartList', // 引入为指定用户查看部门 信息需要的url
|
||||
userId: '/sys/user/generateUserId', // 引入生成添加用户情况下的url
|
||||
syncUserByUserName: '/act/process/extActProcess/doSyncUserByUserName', // 同步用户到工作流
|
||||
queryTenantList: '/sys/tenant/queryList'
|
||||
@@ -226,12 +226,9 @@ export default {
|
||||
this.resetScreenSize()
|
||||
that.model = Object.assign({}, { selectedroles: '', selecteddeparts: '' }, record)
|
||||
// 身份为上级显示负责部门,否则不显示
|
||||
if (this.model.userIdentity == 2) {
|
||||
this.departIdShow = true
|
||||
} else {
|
||||
this.departIdShow = false
|
||||
}
|
||||
this.departIdShow = this.model.userIdentity === 2
|
||||
|
||||
// eslint-disable-next-line no-prototype-builtins
|
||||
if (record.hasOwnProperty('id')) {
|
||||
that.userId = record.id
|
||||
that.getUserRoles(record.id)
|
||||
@@ -263,9 +260,8 @@ export default {
|
||||
initTenantList () {
|
||||
getAction(this.url.queryTenantList).then(res => {
|
||||
if (res.success) {
|
||||
this.tenantsOptions = res.result.map((item, index, arr) => {
|
||||
const c = { label: item.name, value: item.id + '' }
|
||||
return c
|
||||
this.tenantsOptions = res.result.map((item) => {
|
||||
return { label: item.name, value: item.id + '' }
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -274,9 +270,8 @@ export default {
|
||||
initRoleList () {
|
||||
queryall().then((res) => {
|
||||
if (res.success) {
|
||||
this.rolesOptions = res.result.map((item, index, arr) => {
|
||||
const c = { label: item.roleName, value: item.id }
|
||||
return c
|
||||
this.rolesOptions = res.result.map((item) => {
|
||||
return { label: item.roleName, value: item.id }
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -309,9 +304,8 @@ export default {
|
||||
},
|
||||
backDepartInfo (info) {
|
||||
this.model.departIds = this.model.selecteddeparts
|
||||
this.nextDepartOptions = info.map((item, index, arr) => {
|
||||
const c = { label: item.text, value: item.value + '' }
|
||||
return c
|
||||
this.nextDepartOptions = info.map((item) => {
|
||||
return { label: item.text, value: item.value + '' }
|
||||
})
|
||||
},
|
||||
refresh () {
|
||||
@@ -347,21 +341,15 @@ export default {
|
||||
const encrypt = new JSEncrypt()
|
||||
encrypt.setPublicKey(that.rsaPublicKey)
|
||||
|
||||
if (this.model.password != '' &&
|
||||
this.model.password != null &&
|
||||
this.model.password != undefined) {
|
||||
if (this.model.password) {
|
||||
this.model.password = encrypt.encrypt(this.model.password)
|
||||
}
|
||||
|
||||
if (this.model.phone != '' &&
|
||||
this.model.phone != null &&
|
||||
this.model.phone != undefined) {
|
||||
if (this.model.phone) {
|
||||
this.model.phone = encrypt.encrypt(this.model.phone)
|
||||
}
|
||||
|
||||
if (this.model.email != '' &&
|
||||
this.model.email != null &&
|
||||
this.model.email != undefined) {
|
||||
if (this.model.email) {
|
||||
this.model.email = encrypt.encrypt(this.model.email)
|
||||
}
|
||||
this.model.rsaPublicKey = that.rsaPublicKey
|
||||
@@ -398,6 +386,7 @@ export default {
|
||||
const confirmpassword = this.model.confirmpassword
|
||||
|
||||
if (value && confirmpassword && value !== confirmpassword) {
|
||||
// eslint-disable-next-line standard/no-callback-literal
|
||||
callback('两次输入的密码不一样!')
|
||||
}
|
||||
if (value && this.confirmDirty) {
|
||||
@@ -407,6 +396,7 @@ export default {
|
||||
},
|
||||
compareToFirstPassword (rule, value, callback) {
|
||||
if (value && value !== this.model.password) {
|
||||
// eslint-disable-next-line standard/no-callback-literal
|
||||
callback('两次输入的密码不一样!')
|
||||
} else {
|
||||
callback()
|
||||
@@ -416,8 +406,8 @@ export default {
|
||||
if (!value) {
|
||||
callback()
|
||||
} else {
|
||||
if (new RegExp(/^1[3|4|5|7|8|9][0-9]\d{8}$/).test(value)) {
|
||||
var params = {
|
||||
if (new RegExp(/^1[345789][0-9]\d{8}$/).test(value)) {
|
||||
const params = {
|
||||
tableName: 'sys_user',
|
||||
fieldName: 'phone',
|
||||
fieldVal: value,
|
||||
@@ -427,10 +417,12 @@ export default {
|
||||
if (res.success) {
|
||||
callback()
|
||||
} else {
|
||||
// eslint-disable-next-line standard/no-callback-literal
|
||||
callback('手机号已存在!')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
// eslint-disable-next-line standard/no-callback-literal
|
||||
callback('请输入正确格式的手机号码!')
|
||||
}
|
||||
}
|
||||
@@ -439,8 +431,9 @@ export default {
|
||||
if (!value) {
|
||||
callback()
|
||||
} else {
|
||||
// eslint-disable-next-line
|
||||
if (new RegExp(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/).test(value)) {
|
||||
var params = {
|
||||
const params = {
|
||||
tableName: 'sys_user',
|
||||
fieldName: 'email',
|
||||
fieldVal: value,
|
||||
@@ -451,16 +444,18 @@ export default {
|
||||
if (res.success) {
|
||||
callback()
|
||||
} else {
|
||||
// eslint-disable-next-line standard/no-callback-literal
|
||||
callback('邮箱已存在!')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
// eslint-disable-next-line standard/no-callback-literal
|
||||
callback('请输入正确格式的邮箱!')
|
||||
}
|
||||
}
|
||||
},
|
||||
validateUsername (rule, value, callback) {
|
||||
var params = {
|
||||
const params = {
|
||||
tableName: 'sys_user',
|
||||
fieldName: 'username',
|
||||
fieldVal: value,
|
||||
@@ -470,12 +465,13 @@ export default {
|
||||
if (res.success) {
|
||||
callback()
|
||||
} else {
|
||||
// eslint-disable-next-line standard/no-callback-literal
|
||||
callback('用户名已存在!')
|
||||
}
|
||||
})
|
||||
},
|
||||
validateWorkNo (rule, value, callback) {
|
||||
var params = {
|
||||
const params = {
|
||||
tableName: 'sys_user',
|
||||
fieldName: 'work_no',
|
||||
fieldVal: value,
|
||||
@@ -485,6 +481,7 @@ export default {
|
||||
if (res.success) {
|
||||
callback()
|
||||
} else {
|
||||
// eslint-disable-next-line standard/no-callback-literal
|
||||
callback('工号已存在!')
|
||||
}
|
||||
})
|
||||
@@ -494,7 +491,7 @@ export default {
|
||||
this.confirmDirty = this.confirmDirty || !!value
|
||||
},
|
||||
beforeUpload: function (file) {
|
||||
var fileType = file.type
|
||||
const fileType = file.type
|
||||
if (fileType.indexOf('image') < 0) {
|
||||
this.$message.warning('请上传图片')
|
||||
return false
|
||||
@@ -507,11 +504,7 @@ export default {
|
||||
this.$refs.departWindow.add(this.checkedDepartKeys, this.userId)
|
||||
},
|
||||
identityChange (e) {
|
||||
if (e.target.value === 1) {
|
||||
this.departIdShow = false
|
||||
} else {
|
||||
this.departIdShow = true
|
||||
}
|
||||
this.departIdShow = e.target.value !== 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user