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