【fix ESLint】src/views/system/modules

This commit is contained in:
danshihao
2023-03-07 14:23:25 +08:00
parent 0e41300963
commit 9e05297813
33 changed files with 179 additions and 183 deletions
@@ -107,7 +107,11 @@ import SysDataSourceModal from './modules/SysDataSourceModal'
export default {
name: 'SysDataSourceList',
mixins: [JeroListMixin],
components: { JEllipsis, SysDataSourceModal },
components: {
// eslint-disable-next-line vue/no-unused-components
JEllipsis,
SysDataSourceModal
},
data () {
const ellipsis = (v, l = 20) => (<j-ellipsis value={v} length={l}/>)
return {
@@ -22,7 +22,7 @@
<span slot="dataVersionTitle2"><a-icon type="smile-o" /> 版本:{{dataVersion2Num}}</span>
<template slot="avatarslot" slot-scope="text, record">
<div class="anty-img-wrap">
<img :src="getAvatarView(record)"/>
<img :src="getAvatarView(record)" alt=""/>
</div>
</template>
@@ -95,9 +95,9 @@ export default {
that.dataVersion2Num = res.result[1].dataVersion
const json1 = JSON.parse(res.result[0].dataContent)
const json2 = JSON.parse(res.result[1].dataContent)
for (var item1 in json1) {
for (var item2 in json2) {
if (item1 == item2) {
for (const item1 in json1) {
for (const item2 in json2) {
if (item1 === item2) {
this.dataSource.push({
code: item1,
imgshow: '',
@@ -130,12 +130,12 @@ export default {
const className = 'trcolor'
const dataVersion1 = record.dataVersion1
const dataVersion2 = record.dataVersion2
if (dataVersion1 != dataVersion2) {
if (dataVersion1 !== dataVersion2) {
return className
}
},
getAvatarView: function (avatar) {
if (avatar.dataVersion1 != avatar.dataVersion2) {
if (avatar.dataVersion1 !== avatar.dataVersion2) {
return '/goright.png'
} else {
return ''
@@ -145,7 +145,7 @@ export default {
}
</script>
<style scoped>
<style lang="less" scoped>
.anty-img-wrap {
height: 25px;
position: relative;
@@ -123,8 +123,8 @@ export default {
this.DataVersionList = res.result
} else {
this.DataVersionList = []
this.dataId1 = '',
this.dataId2 = '',
this.dataId1 = ''
this.dataId2 = ''
console.log(res.message)
}
})
@@ -5,7 +5,7 @@
<a-form>
<a-form-item label='所拥有的权限'>
<a-tree
checkable
:checkable="true"
@check="onCheck"
:checkedKeys="checkedKeys"
:treeData="treeData"
@@ -71,7 +71,7 @@ export default {
})
},
saveDataruleForRole () {
if (!this.dataruleChecked || this.dataruleChecked.length == 0) {
if (!this.dataruleChecked || this.dataruleChecked.length === 0) {
this.$message.warning('请注意现未勾选任何数据权限!')
}
const params = {
@@ -18,10 +18,10 @@
label="机构名称"
prop="departName"
:hidden="false"
hasFeedback >
:hasFeedback="true" >
<a-input id="departName" placeholder="请输入机构/部门名称" v-model="model.departName"/>
</a-form-model-item>
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" :hidden="seen" label="上级部门" hasFeedback>
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" :hidden="seen" label="上级部门" :hasFeedback="true">
<a-tree-select
style="width:100%"
:dropdownStyle="{maxHeight:'200px',overflow:'auto'}"
@@ -93,7 +93,7 @@
<script>
import { httpAction } from '@/api/manage'
import { queryIdTree } from '@/api/api'
import pick from 'lodash.pick'
// import pick from 'lodash.pick'
import ATextarea from 'ant-design-vue/es/input/TextArea'
export default {
name: 'SysDepartModal',
@@ -142,7 +142,7 @@ export default {
},
methods: {
loadTreeData () {
var that = this
const that = this
queryIdTree().then((res) => {
if (res.success) {
that.departTree = []
@@ -210,6 +210,7 @@ export default {
if (!value || new RegExp(/^1([38][0-9]|4[579]|5[0-3,5-9]|6[6]|7[0135678]|9[89])\d{8}$/).test(value)) {
callback()
} else {
// eslint-disable-next-line standard/no-callback-literal
callback('您的手机号码格式不正确!')
}
}
@@ -16,7 +16,7 @@
<a-tree
multiple
treeCheckable="tree"
checkable
:checkable="true"
@expand="onExpand"
:expandedKeys="expandedKeysss"
:checkedKeys="checkedKeys"
@@ -119,5 +119,5 @@ export default {
}
</script>
<style scoped>
@import '~@assets/less/common.less'
@import '~@assets/less/common.less';
</style>
@@ -20,7 +20,7 @@
</a-form>
</div>
<!-- 操作按钮区域 -->
<div class="table-operator" :md="24" :sm="24" style="margin-top: -15px">
<div class="table-operator" style="margin-top: -15px">
<!--<a-button @click="handleEdit" type="primary" icon="edit" style="margin-top: 16px">用户编辑</a-button>-->
<a-button @click="handleAddUserDepart" type="primary" icon="plus">添加已有用户</a-button>
<a-button @click="handleAdd" type="primary" icon="plus" style="margin-top: 16px">新建用户</a-button>
@@ -70,7 +70,7 @@
<a-menu slot="overlay">
<a-menu-item>
<a href="javascript:;" @click="handleDetail(record)">用户详情</a>
<a href="javascript:" @click="handleDetail(record)">用户详情</a>
</a-menu-item>
<a-menu-item>
@@ -191,11 +191,11 @@ export default {
if (this.selectedRowKeys.length <= 0) {
this.$message.warning('请选择一条记录!')
} else {
var ids = ''
for (var a = 0; a < this.selectedRowKeys.length; a++) {
let ids = ''
for (let a = 0; a < this.selectedRowKeys.length; a++) {
ids += this.selectedRowKeys[a] + ','
}
var that = this
const that = this
console.log(this.currentDeptId)
this.$confirm({
title: '确认取消',
@@ -224,13 +224,13 @@ export default {
return
}
var that = this
const that = this
deleteAction(that.url.delete, { depId: this.currentDeptId, userId: id }).then((res) => {
if (res.success) {
that.$message.success('删除用户与选中部门关系成功!')
if (this.selectedRowKeys.length > 0) {
for (let i = 0; i < this.selectedRowKeys.length; i++) {
if (this.selectedRowKeys[i] == id) {
if (this.selectedRowKeys[i] === id) {
this.selectedRowKeys.splice(i, 1)
break
}
@@ -252,14 +252,14 @@ export default {
this.dataSource = []
},
hasSelectDept () {
if (this.currentDeptId == '') {
if (!this.currentDeptId) {
this.$message.error('请选择一个部门!')
return false
}
return true
},
handleAddUserDepart () {
if (this.currentDeptId == '') {
if (!this.currentDeptId) {
this.$message.error('请选择一个部门!')
} else {
this.$refs.selectUserModal.visible = true
@@ -272,7 +272,7 @@ export default {
this.$refs.modalForm.edit(record)
},
handleAdd: function () {
if (this.currentDeptId == '') {
if (!this.currentDeptId) {
this.$message.error('请选择一个部门!')
} else {
this.$refs.modalForm.departDisabled = true
@@ -286,7 +286,7 @@ export default {
const params = {}
params.depId = this.currentDeptId
params.userIdList = []
for (var a = 0; a < data.length; a++) {
for (let a = 0; a < data.length; a++) {
params.userIdList.push(data[a])
}
console.log(params)
@@ -46,7 +46,7 @@
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="是否启用"
hasFeedback>
:hasFeedback="true">
<a-switch checkedChildren="启用" unCheckedChildren="禁用" @change="onChose" v-model="visibleCheck"/>
</a-form-model-item>
@@ -56,7 +56,7 @@
</template>
<script>
import pick from 'lodash.pick'
// import pick from 'lodash.pick'
import { addDictItem, editDictItem } from '@/api/api'
import { getAction } from '@api/manage'
@@ -98,7 +98,7 @@ export default {
this.dictId = record.dictId
}
this.status = record.status
this.visibleCheck = (record.status == 1)
this.visibleCheck = (record.status === 1)
this.model = Object.assign({}, record)
this.model.dictId = this.dictId
this.model.status = this.status
@@ -166,6 +166,7 @@ export default {
if (value) {
const reg = new RegExp("[`_~!@#$^&*()=|{}'.<>《》/?!¥()—【】‘;:”“。,、?]")
if (reg.test(value)) {
// eslint-disable-next-line standard/no-callback-literal
callback('数据值不能包含特殊字符')
} else {
// update--begin--autor:lvdandan-----date:20201203------forJT-27【数据字典】字典 - 数据值可重复
@@ -42,7 +42,7 @@
</template>
<script>
import pick from 'lodash.pick'
// import pick from 'lodash.pick'
import { addDict, editDict, duplicateCheck } from '@/api/api'
export default {
@@ -75,7 +75,7 @@ export default {
methods: {
validateDictCode (rule, value, callback) {
// 重复校验
var params = {
const params = {
tableName: 'sys_dict',
fieldName: 'dict_code',
fieldVal: value,
@@ -96,11 +96,7 @@ export default {
this.edit({})
},
edit (record) {
if (record.id) {
this.visiblekey = true
} else {
this.visiblekey = false
}
this.visiblekey = !!record.id
this.model = Object.assign({}, record)
this.visible = true
},
@@ -20,17 +20,18 @@
<a-input v-model="router.uri" placeholder="路由URL"/>
</a-form-model-item>
<a-form-model-item label="路由状态" prop="status">
<a-switch default-checked v-model="router.status"/>
<a-switch :default-checked="true" v-model="router.status"/>
</a-form-model-item>
<a-form-model-item prop="predicates" label="路由条件">
<div v-for="(item,index) in router.predicates">
<div v-for="(item,index) in router.predicates" :key="item.name + index">
<a-divider>{{item.name}}
<a-icon type="delete" size="22" @click="removePredicate(router,index)"/>
</a-divider>
<div>
<template v-for="(tag, index) in item.args">
<a-input v-if="index==currentTagIndex" ref="input" type="text" size="small"
<a-input v-if="index===currentTagIndex" ref="input" type="text" size="small"
:key="tag + index"
:style="{ width: '190px' }"
:value="tag"
@change="handleInputChange" @blur="handleInputEditConfirm(item,tag,index)"
@@ -39,12 +40,12 @@
{{ tag }}
</a-tag>
</template>
<a-input v-if="inputVisible&&index==currentNameIndex" ref="input" type="text" size="small"
<a-input v-if="inputVisible&&index===currentNameIndex" ref="input" type="text" size="small"
:style="{ width: '100px' }"
:value="inputValue"
@change="handleInputChange" @blur="handleInputConfirm(item)"
@keyup.enter="handleInputConfirm(item)"/>
<a-tag v-else style="background: #fff; borderStyle: dashed;" @click="showInput(item,index)">
<a-tag v-else style="background: #fff; border-style: dashed;" @click="showInput(item,index)">
<a-icon type="plus"/>
新建{{item.name}}
</a-tag>
@@ -62,7 +63,7 @@
</p>
</a-form-model-item>
<a-form-model-item prop="predicates" label="过滤器">
<div v-for="(item,index) in router.filters">
<div v-for="(item,index) in router.filters" :key="item.name + index">
<a-divider>{{item.name}}
<a-icon type="delete" size="22" @click="removeFilter(router,index)"/>
</a-divider>
@@ -157,8 +158,7 @@ export default {
},
// 删除路由条件配置项
removeTag (item, removedTag) {
const tags = item.args.filter(tag => tag !== removedTag)
item.args = tags
item.args = item.args.filter(tag => tag !== removedTag)
},
// 添加路由选项
predicatesHandleMenuClick (e) {
@@ -200,7 +200,7 @@ export default {
},
// 过滤器添加事件
filterHandleMenuClick (e) {
if (e.key == 0) {
if (e.key === 0) {
this.router.filters.push({
args: [{
key: 'name',
@@ -213,7 +213,7 @@ export default {
title: this.filterArray[0].name
})
}
if (e.key == 1) {
if (e.key === 1) {
this.router.filters.push({
args: [{
key: 'key-resolver',
@@ -248,8 +248,7 @@ export default {
// 输入框确认
handleInputEditConfirm (item, tag, index) {
if (this.inputValue) {
const inputValue = this.inputValue
item.args[index] = inputValue
item.args[index] = this.inputValue
}
this.currentTagIndex = -1
},
@@ -16,11 +16,11 @@
<a-input placeholder="请输入用户账号" v-decorator="[ 'username', {}]" :readOnly="true"/>
</a-form-item>
<a-form-item label="登录密码" :labelCol="labelCol" :wrapperCol="wrapperCol" hasFeedback >
<a-form-item label="登录密码" :labelCol="labelCol" :wrapperCol="wrapperCol" :hasFeedback="true" >
<a-input type="password" placeholder="请输入登录密码" v-decorator="[ 'password', validatorRules.password]" />
</a-form-item>
<a-form-item label="确认密码" :labelCol="labelCol" :wrapperCol="wrapperCol" hasFeedback >
<a-form-item label="确认密码" :labelCol="labelCol" :wrapperCol="wrapperCol" :hasFeedback="true" >
<a-input type="password" @blur="handleConfirmBlur" placeholder="请重新输入登录密码" v-decorator="[ 'confirmpassword', validatorRules.confirmpassword]"/>
</a-form-item>
@@ -118,6 +118,7 @@ export default {
const confirmpassword = form.getFieldValue('confirmpassword')
console.log('confirmpassword==>', confirmpassword)
if (value && confirmpassword && value !== confirmpassword) {
// eslint-disable-next-line standard/no-callback-literal
callback('两次输入的密码不一样!')
}
if (value && this.confirmDirty) {
@@ -128,6 +129,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()
@@ -122,7 +122,7 @@ export default {
if (valid) {
that.confirmLoading = true
let httpurl = ''
let method = ''
let method
if (!this.model.id) {
httpurl += this.url.add
method = 'post'
@@ -151,14 +151,10 @@ export default {
this.close()
},
initRuleCondition () {
if (this.model.ruleConditions && this.model.ruleConditions == 'USE_SQL_RULES') {
this.showRuleColumn = false
} else {
this.showRuleColumn = true
}
this.showRuleColumn = !(this.model.ruleConditions && this.model.ruleConditions === 'USE_SQL_RULES')
},
handleChangeRuleCondition (val) {
if (val == 'USE_SQL_RULES') {
if (val === 'USE_SQL_RULES') {
this.model.ruleColumn = ''
this.showRuleColumn = false
} else {
@@ -23,19 +23,19 @@
:wrapperCol="wrapperCol"
:label="menuLabel"
prop="name"
hasFeedback >
:hasFeedback="true" >
<a-input placeholder="请输入菜单名称" v-model="model.name" :readOnly="disableSubmit"/>
</a-form-model-item>
<a-form-model-item
v-show="model.menuType!=0"
v-show="(model.menuType + '')!=='0'"
label="上级菜单"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
:validate-status="validateStatus"
:hasFeedback="true"
:required="true">
<span slot="help">{{ validateStatus=='error'?'请选择上级菜单':'&nbsp;&nbsp;' }}</span>
<span slot="help">{{ validateStatus==='error'?'请选择上级菜单':'&nbsp;&nbsp;' }}</span>
<a-tree-select
style="width:100%"
:dropdownStyle="{ maxHeight: '200px', overflow: 'auto' }"
@@ -65,7 +65,7 @@
</a-form-model-item>
<a-form-model-item
v-show="model.menuType==0"
v-show="(model.menuType + '')==='0'"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="默认跳转地址">
@@ -217,7 +217,7 @@ export default {
},
methods: {
loadTree () {
var that = this
const that = this
queryTreeList().then((res) => {
if (res.success) {
that.treeData = []
@@ -241,8 +241,8 @@ export default {
// --------------------------------------------------------------------------------------------------
// 根据菜单类型,动态展示页面字段
console.log('record: ', record)
this.show = record.menuType != 2
this.menuLabel = record.menuType == 2 ? '按钮/权限' : '菜单名称'
this.show = (record.menuType + '') !== '2'
this.menuLabel = (record.menuType + '') === '2' ? '按钮/权限' : '菜单名称'
this.visible = true
this.loadTree()
@@ -258,7 +258,7 @@ export default {
// 触发表单验证
this.$refs.form.validate(valid => {
if (valid) {
if ((this.model.menuType == 1 || this.model.menuType == 2) && !this.model.parentId) {
if (((this.model.menuType + '') === '1' || (this.model.menuType + '') === '2') && !this.model.parentId) {
that.validateStatus = 'error'
that.$message.error('请检查你填的类型以及信息是否正确')
return
@@ -295,13 +295,14 @@ export default {
if (!value || new RegExp(/^[0-9]*[1-9][0-9]*$/).test(value)) {
callback()
} else {
// eslint-disable-next-line standard/no-callback-literal
callback('请输入正整数!')
}
},
validatePerms (rule, value, callback) {
if (value && value.length > 0) {
// 校验授权标识是否存在
var params = {
const params = {
tableName: 'sys_permission',
fieldName: 'perms',
fieldVal: value,
@@ -311,6 +312,7 @@ export default {
if (res.success) {
callback()
} else {
// eslint-disable-next-line standard/no-callback-literal
callback('授权标识已存在!')
}
})
@@ -318,8 +320,8 @@ export default {
callback()
}
},
onChangeMenuType (e) {
if (this.model.menuType == 2) {
onChangeMenuType (/* e */) {
if ((this.model.menuType + '') === '2') {
this.show = false
this.menuLabel = '按钮/权限'
} else {
@@ -12,7 +12,7 @@
<a-spin :spinning="confirmLoading">
<a-form-model ref="form" :model="model" :rules="validatorRules">
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="任务类名" prop="jobClassName" hasFeedback >
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="任务类名" prop="jobClassName" :hasFeedback="true" >
<a-input placeholder="请输入任务类名" v-model="model.jobClassName" />
</a-form-model-item>
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="Cron表达式" prop="cronExpression">
@@ -99,11 +99,11 @@ export default {
handleOk () {
const that = this
// 触发表单验证
this.$refs.form.validate((ok, err) => {
this.$refs.form.validate((ok/* , err */) => {
if (ok) {
that.confirmLoading = true
let httpurl = ''
let method = ''
let method
if (!this.model.id) {
httpurl += this.url.add
method = 'post'
@@ -20,8 +20,8 @@
<a-row :gutter='24'>
<a-col :span='24'>
<a-form-item label="角色配置" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select mode="multiple" placeholder="请选择角色" v-model:value="selectedRole">
<a-select-option v-for="(role,roleindex) in roleList" :key="role.id" :value="role.id">
<a-select mode="multiple" placeholder="请选择角色" v-model="selectedRole">
<a-select-option v-for="(role) in roleList" :key="role.id" :value="role.id">
<span style="display: inline-block;width: 100%">
{{ role.roleName }}
</span>
@@ -80,7 +80,7 @@ export default {
props: {
selectedRowKeysArray: {
type: Array,
default: [],
default: () => [],
require: true
}
},
@@ -74,7 +74,7 @@ export default {
})
},
saveDataruleForRole () {
if (!this.dataruleChecked || this.dataruleChecked.length == 0) {
if (!this.dataruleChecked || this.dataruleChecked.length === 0) {
this.$message.warning('请注意现未勾选任何数据权限!')
}
const params = {
@@ -69,11 +69,7 @@ export default {
this.model = Object.assign({}, record)
this.visible = true
// 编辑页面禁止修改角色编码
if (this.model.id) {
this.roleDisabled = true
} else {
this.roleDisabled = false
}
this.roleDisabled = !!this.model.id
},
close () {
this.$refs.form.clearValidate()
@@ -113,6 +109,7 @@ export default {
},
validateRoleCode (rule, value, callback) {
if (/[\u4E00-\u9FA5]/g.test(value)) {
// eslint-disable-next-line standard/no-callback-literal
callback('角色编码不可输入汉字!')
} else {
const params = {
@@ -108,9 +108,9 @@ export default {
align: 'center',
dataIndex: 'sex',
customRender: function (text) {
if (text == 1) {
if ((text + '') === '1') {
return '男'
} else if (text == 2) {
} else if ((text + '') === '2') {
return '女'
} else {
return text
@@ -129,9 +129,9 @@ export default {
align: 'center',
dataIndex: 'status',
customRender: function (text) {
if (text == 1) {
if ((text + '') === '1') {
return '正常'
} else if (text == 2) {
} else if ((text + '') === '2') {
return '冻结'
} else {
return text
@@ -178,7 +178,7 @@ export default {
if (!selectUser) {
this.selectionRows = []
} else {
var that = this
const that = this
that.selectionRows = []
selectUser.forEach(function (record, index) {
console.log(record)
@@ -222,11 +222,11 @@ export default {
this.selectedRowKeys = selectedRowKeys
},
onSelect (record, selected) {
if (selected == true) {
if (selected === true) {
this.selectionRows.push(record)
} else {
this.selectionRows.forEach(function (item, index, arr) {
if (item.id == record.id) {
if (item.id === record.id) {
arr.splice(index, 1)
}
})
@@ -245,7 +245,7 @@ export default {
// TODO 筛选
if (Object.keys(sorter).length > 0) {
this.isorter.column = sorter.field
this.isorter.order = sorter.order == 'ascend' ? 'asc' : 'desc'
this.isorter.order = sorter.order === 'ascend' ? 'asc' : 'desc'
}
this.ipagination = pagination
this.loadData()
@@ -185,7 +185,7 @@ export default {
if (arg === 1) {
this.ipagination.current = 1
}
var params = this.getQueryParams()// 查询条件
const params = this.getQueryParams()// 查询条件
getAction(this.url.list, params).then((res) => {
if (res.success) {
this.dataSource1 = res.result.records
@@ -194,7 +194,7 @@ export default {
})
},
getQueryParams () {
var param = Object.assign({}, this.queryParam, this.isorter)
const param = Object.assign({}, this.queryParam, this.isorter)
param.field = this.getQueryField()
param.pageNo = this.ipagination.current
param.pageSize = this.ipagination.pageSize
@@ -205,11 +205,11 @@ export default {
},
onSelectAll (selected, selectedRows, changeRows) {
if (selected === true) {
for (var a = 0; a < changeRows.length; a++) {
for (let a = 0; a < changeRows.length; a++) {
this.dataSource2.push(changeRows[a])
}
} else {
for (var b = 0; b < changeRows.length; b++) {
for (let b = 0; b < changeRows.length; b++) {
this.dataSource2.splice(this.dataSource2.indexOf(changeRows[b]), 1)
}
}
@@ -219,7 +219,7 @@ export default {
if (selected === true) {
this.dataSource2.push(record)
} else {
var index = this.dataSource2.indexOf(record)
const index = this.dataSource2.indexOf(record)
// console.log();
if (index >= 0) {
this.dataSource2.splice(this.dataSource2.indexOf(record), 1)
@@ -243,7 +243,7 @@ export default {
// TODO 筛选
if (Object.keys(sorter).length > 0) {
this.isorter.column = sorter.field
this.isorter.order = sorter.order == 'ascend' ? 'asc' : 'desc'
this.isorter.order = sorter.order === 'ascend' ? 'asc' : 'desc'
}
this.ipagination = pagination
this.loadData()
@@ -142,7 +142,7 @@
<script>
import { httpAction, getAction } from '@/api/manage'
import pick from 'lodash.pick'
// import pick from 'lodash.pick'
import JDate from '@/components/jero/JDate'
import JEditor from '@/components/jero/JEditor'
@@ -217,9 +217,9 @@ export default {
getAction(this.url.queryByIds, { userIds: this.userIds }).then((res) => {
if (res.success) {
// update--begin--autor:wangshuai-----date:20200601------for:系统公告选人后,不能删除------
var userList = []
for (var i = 0; i < res.result.length; i++) {
var user = {}
const userList = []
for (let i = 0; i < res.result.length; i++) {
const user = {}
user.label = res.result[i].realname
user.key = res.result[i].id
userList.push(user)
@@ -249,7 +249,7 @@ export default {
if (valid) {
that.confirmLoading = true
let httpurl = ''
let method = ''
let method
if (!this.model.id) {
httpurl += this.url.add
method = 'post'
@@ -294,7 +294,7 @@ export default {
this.$refs.UserListModal.add(this.selectedUser, this.userIds)
},
chooseMsgType (value) {
if (value == 'USER') {
if (value === 'USER') {
this.userType = true
} else {
this.userType = false
@@ -306,9 +306,9 @@ export default {
choseUser: function (userList) {
this.selectedUser = []
this.userIds = []
for (var i = 0; i < userList.length; i++) {
for (let i = 0; i < userList.length; i++) {
// update--begin--autor:wangshuai-----date:20200601------for:系统公告选人后,不能删除------
var user = {}
const user = {}
user.label = userList[i].realname
user.key = userList[i].id
this.selectedUser.push(user)
@@ -323,6 +323,7 @@ export default {
} else if (moment(value).isBefore(endTime)) {
callback()
} else {
// eslint-disable-next-line standard/no-callback-literal
callback('开始时间需小于结束时间')
}
},
@@ -333,15 +334,16 @@ export default {
} else if (moment(startTime).isBefore(value)) {
callback()
} else {
// eslint-disable-next-line standard/no-callback-literal
callback('结束时间需大于开始时间')
}
},
handleChange (userList) {
const users = []
if (userList) {
this.userIds = []
var users = []
for (var i = 0; i < userList.length; i++) {
var user = {}
for (let i = 0; i < userList.length; i++) {
const user = {}
user.id = userList[i].key
user.realname = userList[i].label
this.userIds += userList[i].key + ','
@@ -34,7 +34,7 @@
<script>
import { httpAction, getAction } from '@/api/manage'
import { httpAction } from '@/api/manage'
import JTreeSelect from '@/components/jero/JTreeSelect'
export default {
@@ -100,7 +100,7 @@ export default {
if (valid) {
that.confirmLoading = true
let httpurl = ''
let method = ''
let method
if (!this.model.id) {
httpurl += this.url.add
method = 'post'
@@ -133,7 +133,7 @@ export default {
const treeData = this.$refs.treeSelect.getCurrTreeData()
this.expandedRowKeys = []
this.getExpandKeysByPid(formData[this.pidField], treeData, treeData)
if (formData.pid && this.expandedRowKeys.length == 0) {
if (formData.pid && this.expandedRowKeys.length === 0) {
this.expandedRowKeys = this.subExpandedKeys
}
this.$emit('ok', formData, this.expandedRowKeys.reverse())
@@ -144,7 +144,7 @@ export default {
getExpandKeysByPid (pid, arr, all) {
if (pid && arr && arr.length > 0) {
for (let i = 0; i < arr.length; i++) {
if (arr[i].key == pid) {
if (arr[i].key === pid) {
this.expandedRowKeys.push(arr[i].key)
this.getExpandKeysByPid(arr[i].parentId, all, all)
} else {
@@ -162,6 +162,7 @@ export default {
width: '20%',
type: FormTypes.input,
validateRules: [
// eslint-disable-next-line no-template-curly-in-string
{ required: true, message: '${title}不能为空' }
]
},
@@ -184,6 +185,7 @@ export default {
width: '15%',
type: FormTypes.inputNumber,
validateRules: [
// eslint-disable-next-line no-template-curly-in-string
{ required: true, message: '${title}不能为空' },
{ pattern: /^[1-9]\d*$/, message: '请输入零以上的正整数' }
]
@@ -204,6 +206,7 @@ export default {
width: '20%',
type: FormTypes.input,
validateRules: [
// eslint-disable-next-line no-template-curly-in-string
{ required: true, message: '${title}不能为空' }
]
},
@@ -228,15 +231,19 @@ export default {
},
methods: {
validatePatternHandler (type, value, row, column, callback, target) {
validatePatternHandler (type, value, row, column, callback) {
if (type === 'blur' || type === 'getValues') {
try {
// eslint-disable-next-line no-new
new RegExp(value)
// eslint-disable-next-line standard/no-callback-literal
callback(true)
} catch (e) {
// eslint-disable-next-line standard/no-callback-literal
callback(false, '请输入正确的正则表达式')
}
} else {
// eslint-disable-next-line standard/no-callback-literal
callback(true) // 不填写或者填写 null 代表不进行任何操作
}
},
@@ -290,12 +297,15 @@ export default {
const [mainResult, designResult, globalResult] = results
if (mainResult.type === failedSymbol) {
// eslint-disable-next-line prefer-promise-reject-errors
return Promise.reject('主表校验未通过')
} else if (designResult.type === failedSymbol) {
this.tabs.activeKey = this.tabs.design.key
// eslint-disable-next-line prefer-promise-reject-errors
return Promise.reject('局部规则子表校验未通过')
} else if (globalResult.type === failedSymbol) {
this.tabs.activeKey = this.tabs.global.key
// eslint-disable-next-line prefer-promise-reject-errors
return Promise.reject('全局规则子表校验未通过')
} else {
// 所有校验已通过,这一步是整合数据
@@ -8,7 +8,7 @@
>
<a-form :form="form">
<a-form-item label="功能测试">
<a-input placeholder="请输入" v-decorator="['test', validatorRules.test]" @change="e=>testValue=e.target.value"/>
<a-input placeholder="请输入" v-decorator="['test', validatorRules.test]" @change="e=>this.testValue=e.target.value"/>
</a-form-item>
</a-form>
<a-row type="flex" :gutter="8">
@@ -104,6 +104,7 @@ export default {
validator: (rule, value, callback) => {
const pattern = /^[a-z|A-Z][a-z|A-Z\d_-]{0,}$/
if (!pattern.test(value)) {
// eslint-disable-next-line standard/no-callback-literal
callback('编码必须以字母开头可包含数字下划线横杠')
} else {
validateDuplicateValue('sys_data_source', 'code', value, this.model.id, callback)
@@ -244,12 +245,12 @@ export default {
// 获取以上字段的值,并清除校验状态
const fieldsValues = this.form.getFieldsValue(keys)
const setFields = {}
keys.forEach(key => setFields[key] = { value: fieldsValues[key], errors: null })
keys.forEach(key => (setFields[key] = { value: fieldsValues[key], errors: null }))
// 清除校验状态,目的是可以让错误文字闪烁
this.form.setFields(setFields)
// 重新校验
this.$nextTick(() => {
this.form.validateFields(keys, (errors, values) => {
this.form.validateFields(keys, (errors/* , values */) => {
if (!errors) {
const loading = this.$message.loading('连接中', 0)
postAction('/online/cgreport/api/testConnection', fieldsValues).then(res => {
@@ -58,13 +58,16 @@ export default {
try {
const json = JSON.parse(value)
if (json instanceof Array) {
// eslint-disable-next-line standard/no-callback-literal
callback('只能传递JSON对象不能传递JSON数组')
} else if (json instanceof Object) {
callback()
} else {
// eslint-disable-next-line standard/no-callback-literal
callback('请输入JSON字符串')
}
} catch {
// eslint-disable-next-line standard/no-callback-literal
callback('请输入JSON字符串')
}
}
@@ -101,7 +104,7 @@ export default {
handleOk () {
const that = this
// 触发表单验证
this.$refs.form.validate((ok, err) => {
this.$refs.form.validate((ok) => {
if (ok) {
that.confirmLoading = true
let httpUrl = this.url.add; let method = 'post'
@@ -76,7 +76,7 @@ export default {
{ required: true, message: '请输入职务编码' },
{
validator: (rule, value, callback) => {
// 函数消抖的简单实现,防止一段时间内发送多次请求
// 函数消抖的简单实现,防止一段时间内重复发送请求
if (validatorCodeTimer) {
// 停止上次开启的定时器
clearTimeout(validatorCodeTimer)
@@ -117,11 +117,7 @@ export default {
edit (record) {
this.model = Object.assign({}, record)
this.visible = true
if (record.id) {
this.readOnly = true
} else {
this.readOnly = false
}
this.readOnly = !!record.id
},
close () {
this.$emit('close')
@@ -135,7 +131,7 @@ export default {
if (valid) {
that.confirmLoading = true
let httpurl = ''
let method = ''
let method
if (!this.model.id) {
httpurl += this.url.add
method = 'post'
@@ -113,7 +113,7 @@ export default {
this.init()
},
init () {
var params = { userName: this.username }// 查询条件
const params = { userName: this.username }// 查询条件
getAction(this.url.queryByUserName, params).then((res) => {
if (res.success) {
console.log('获取流程节点信息', res)
@@ -142,7 +142,7 @@ export default {
if (!err) {
that.confirmLoading = true
let httpurl = ''
let method = ''
let method
if (!this.model.id) {
httpurl += this.url.add
method = 'post'
@@ -44,7 +44,7 @@
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
// import { validateDuplicateValue } from '@/utils/util'
import JFormContainer from '@/components/jero/JFormContainer'
import JDate from '@/components/jero/JDate'
import JDictSelectTag from '@/components/dict/JDictSelectTag'
@@ -54,6 +54,7 @@ export default {
components: {
JFormContainer,
JDate,
// eslint-disable-next-line vue/no-unused-components
JDictSelectTag
},
props: {
@@ -99,11 +100,7 @@ export default {
computed: {
formDisabled () {
if (this.normal === false) {
if (this.formData.disabled === false) {
return false
} else {
return true
}
return this.formData.disabled !== false
}
return this.disabled
},
@@ -112,11 +109,7 @@ export default {
},
showFlowSubmitButton () {
if (this.normal === false) {
if (this.formData.disabled === false) {
return true
} else {
return false
}
return this.formData.disabled === false
} else {
return false
}
@@ -148,7 +141,7 @@ export default {
if (valid) {
that.confirmLoading = true
let httpurl = ''
let method = ''
let method
if (!this.id) {
httpurl += this.url.add
method = 'post'
@@ -161,7 +154,7 @@ export default {
that.$message.success(res.message)
that.$emit('ok')
} else {
if (res.message == '该编号已存在!') {
if (res.message === '该编号已存在!') {
this.model.id = ''
}
that.$message.warning(res.message)
+31 -38
View File
@@ -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
}
}
}
@@ -36,7 +36,7 @@
>
<!-- 显示头像 -->
<template slot="avatarslot" slot-scope="text, record, index">
<template slot="avatarslot" slot-scope="text, record">
<div class="anty-img-wrap">
<a-avatar shape="square" :src="url.getAvatar(record.avatar)" icon="user"/>
</div>
@@ -123,7 +123,7 @@ export default {
superRequest.call(this, {
loading: true,
promise: this.$http.get(this.url.recycleBin),
success: res => this.dataSource = res.result
success: res => (this.dataSource = res.result)
})
},
handleOk () {
@@ -160,7 +160,7 @@ export default {
</div>),
centered: true,
onOk: () => {
var that = this
const that = this
deleteAction(that.url.deleteRecycleBin, { userIds: userIds.join(',') }).then((res) => {
if (res.success) {
this.loadData()
@@ -12,7 +12,7 @@
<a-form>
<a-form-item label='所拥有的权限'>
<a-tree
checkable
:checkable="true"
@check="onCheck"
:checkedKeys="checkedKeys"
:treeData="treeData"
@@ -126,9 +126,9 @@ export default {
this.checkedKeys = []
},
switchCheckStrictly (v) {
if (v == 1) {
if (v === 1) {
this.checkStrictly = false
} else if (v == 2) {
} else if (v === 2) {
this.checkStrictly = true
}
},