Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
micro-system
/
system
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 25e8e9a0
authored
Nov 04, 2020
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修复bug
1 parent
648a4a1b
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
63 additions
and
396 deletions
src/components/d2-form/index.vue
src/components/index.js
src/components/rule-form/index.vue
src/components/table-tree-column/index.vue
src/components/table-tree-column/index1.vue
src/utils/common.js
src/views/dictionaryManage/dictionaryData/index.vue
src/views/dictionaryManage/index.vue
src/views/menuManage/index.vue
src/views/orginizaManage/index.vue
src/views/role/index.vue
src/views/user/index.vue
src/views/workLog/index.vue
src/components/d2-form/index.vue
deleted
100644 → 0
View file @
648a4a1
<
template
>
<div>
<el-form
:inline=
"inline"
:model=
"formModel"
:size=
"size || 'small'"
:clearable=
"clearable"
>
<el-form-item
v-for=
"(item, index) in formList"
:key=
"index"
:label=
"item.label || ''"
>
<el-input
v-if=
"item.type == 'input'"
v-model=
"formModel[item.model]"
:type=
"item.inputType || 'text'"
:placeholder=
"item.placeholder || '请输入'"
:clearable=
"item.clearable || false"
:maxlength=
"item.maxlength || 10"
:minlength=
"item.minlength || 4"
:show-word-limit=
"item.showWordLimit"
:show-password=
"item.showPassword"
:disabled=
"item.disabled"
:size=
"btn_size"
:prefix-icon=
"item.prefixIcon"
:suffix-icon=
"item.suffixIcon"
:rows=
"item.rows"
:autosize=
"item.autosize"
:readonly=
"item.readonly"
@
change=
"item.change || defaultChange"
></el-input>
<el-select
v-if=
"item.type == 'select'"
v-model=
"formModel[item.model]"
:placeholder=
"item.placeholder || '请选择'"
:clearable=
"item.clearable"
:filterable=
"item.filterable"
:filter-method=
"item.filterMethod"
:disabled=
"item.disabled"
:multiple=
"item.multiple"
:allow-create=
"item.allowCreate"
:remote=
"item.remote"
:remote-method=
"item.remoteMethod"
:loading=
"item.loading"
:loading-text=
"item.loadingText"
@
change=
"item.change || defaultChange"
@
remove-tag=
"item.removeTag || defaultRemoveTag"
>
<el-option
v-for=
"i in item.options"
:key=
"i[item.value] || i.value"
:label=
"i[item.key] || i.label"
:value=
"i[item.value] || i.value"
:disabled=
"i.disabled"
>
</el-option>
</el-select>
<el-date-picker
v-if=
"item.type == 'datePicker'"
v-model=
"formModel[item.model]"
:type=
"item.dateType || 'date'"
:placeholder=
"item.placeholder || '选择日期'"
:readonly=
"item.readonly"
:disabled=
"item.disabled"
:editable=
"item.editable || false"
:clearable=
"item.clearable"
:size=
"btn_size"
:start-placeholder=
"item.startPlaceholder || ''"
:end-placeholder=
"item.endPlaceholder || ''"
:format=
"item.format"
:value-format=
"item.valueFormat"
:align=
"item.align"
:picker-options=
"item.pickerOptions"
:range-separator=
"item.rangeSeparator"
:default-value=
"item.defaultValue"
@
change=
"item.change || defaultChange"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<template
name=
"form-slot"
slot-scope=
"scope"
>
<slot
:scope=
"scope"
>
</slot>
</
template
>
</el-form-item>
</el-form>
</div>
</template>
<
script
>
export
default
{
name
:
'd2-form'
,
data
()
{
},
props
:
{
inline
:
{
type
:
Boolean
,
default
:
true
},
formModel
:
{
type
:
Object
,
default
:
()
=>
{
}
},
size
:
{
type
:
String
,
default
:
'small'
},
clearable
:
{
type
:
Boolean
,
default
:
false
},
formList
:
{
type
:
Array
,
default
:
()
=>
[]
}
},
methods
:
{
defaultChange
(
e
)
{
return
e
},
defaultRemoveTag
(
e
)
{
return
e
}
}
}
</
script
>
<
style
lang=
""
>
</
style
>
\ No newline at end of file
src/components/index.js
View file @
25e8e9a
import
Vue
from
'vue'
// 注意 有些组件使用异步加载会有影响
Vue
.
component
(
'd2-form'
,
()
=>
import
(
'./d2-form/index.vue'
))
Vue
.
component
(
'basic-table'
,
()
=>
import
(
'./basic-table/index.vue'
))
Vue
.
component
(
'search-form'
,
()
=>
import
(
'./search-form/index.vue'
))
Vue
.
component
(
'sticky-table'
,
()
=>
import
(
'./sticky-table/index.vue'
))
Vue
.
component
(
'basic-dialog'
,
()
=>
import
(
'./basic-dialog/index.vue'
))
Vue
.
component
(
'rule-form'
,
()
=>
import
(
'./rule-form/index.vue'
))
Vue
.
component
(
'table-tree-column'
,
()
=>
import
(
'./table-tree-column/index.vue'
))
src/components/rule-form/index.vue
View file @
25e8e9a
...
...
@@ -22,6 +22,9 @@
:type=
"item.inputText || 'text'"
:readonly=
"item.readonly || false"
:disabled=
"item.disabled || false"
:maxlength=
"item.maxlength"
:minlength=
"item.minlength"
show-word-limit
@
click
.
native=
"item.clickFunc"
:class=
"item.clickFunc ? 'pointer' : ''"
:ref=
"item.ref"
...
...
@@ -35,6 +38,9 @@
:readonly=
"item.readonly || false"
:disabled=
"item.disabled || false"
v-model=
"ruleForm[item.prop]"
:maxlength=
"item.maxlength"
:minlength=
"item.minlength"
show-word-limit
>
</el-input>
</
template
>
...
...
@@ -56,7 +62,11 @@
</el-select>
</
template
>
<
template
v-else-if=
"item.type === 'switch'"
>
<el-switch
v-model=
"ruleForm[item.prop]"
></el-switch>
<el-switch
v-model=
"ruleForm[item.prop]"
:active-text=
"item.activeText || '开'"
:inactive-text=
"item.inactiveText || '关'"
></el-switch>
</
template
>
<
template
v-else-if=
"item.type === 'radio'"
>
<el-radio-group
...
...
@@ -133,7 +143,7 @@ export default {
// 标签位置
labelPosition
:
{
type
:
String
,
default
:
'
lef
t'
default
:
'
righ
t'
},
size
:
{
type
:
String
,
...
...
@@ -148,11 +158,9 @@ export default {
},
methods
:
{
selectChange
(
val
)
{
// console.log(val ,'selectChange')
this
.
$emit
(
'selectChange'
,
val
)
},
radioChange
(
event
,
prop
)
{
// console.log(event,prop,'radioChange')
this
.
$emit
(
'radioChange'
,
event
,
prop
)
},
update
(
e
)
{
...
...
src/components/table-tree-column/index.vue
deleted
100644 → 0
View file @
648a4a1
<
template
>
<el-table-column
:prop=
"prop"
v-bind=
"$attrs"
>
<template
slot-scope=
"scope"
>
<span
@
click
.
prevent=
"toggleHandle(scope.$index, scope.row)"
:style=
"childStyles(scope.row)"
>
<i
:class=
"iconClasses(scope.row)"
:style=
"iconStyles(scope.row)"
></i>
{{
scope
.
row
[
prop
]
}}
</span>
</
template
>
</el-table-column>
</template>
<
script
>
import
isArray
from
'lodash/isArray'
export
default
{
name
:
'table-tree-column'
,
data
()
{
return
{
arr
:
[]
}
},
props
:
{
prop
:
{
type
:
String
},
treeKey
:
{
type
:
String
,
default
:
'id'
},
parentKey
:
{
type
:
String
,
default
:
'parentId'
},
levelKey
:
{
type
:
String
,
default
:
'level'
},
childKey
:
{
type
:
String
,
default
:
'children'
}
},
methods
:
{
childStyles
(
row
)
{
return
{
'padding-left'
:
(
row
[
this
.
levelKey
]
*
25
)
+
'px'
}
},
iconClasses
(
row
)
{
return
[
!
row
.
_expanded
?
'el-icon-caret-right'
:
'el-icon-caret-bottom'
]
},
iconStyles
(
row
)
{
return
{
'visibility'
:
row
.
hasChildren
?
'visible'
:
'hidden'
}
},
// 切换处理
toggleHandle
(
index
,
row
)
{
console
.
log
(
index
,
row
,
'this row '
)
if
(
row
.
hasChildren
)
{
var
data
=
this
.
$parent
.
store
.
states
.
data
.
slice
(
0
)
console
.
log
(
data
,
this
.
$parent
)
data
[
index
].
_expanded
=
!
data
[
index
].
_expanded
if
(
data
[
index
].
_expanded
)
{
data
=
data
.
splice
(
0
,
index
+
1
).
concat
(
this
.
addChildNode
(
row
[
this
.
childKey
])).
concat
(
data
)
// data = data.splice(0, index + 1).concat(row[this.childKey]).concat(data)
}
else
{
data
=
this
.
removeChildNode
(
data
,
row
[
this
.
treeKey
])
}
// console.log(data,'show data')
this
.
$parent
.
store
.
commit
(
'setData'
,
data
)
this
.
$nextTick
(()
=>
{
this
.
$parent
.
doLayout
()
})
}
},
addChildNode
(
row
)
{
console
.
log
(
row
)
// console.log(row,'点击当前项的产生的下级数据 row ')
// 遍历下一级项 如果下级数据中 存在展开项 继续操作
var
arr
=
[]
this
.
forE
(
row
,
arr
)
return
arr
},
forE
(
row
,
arr
)
{
var
_this
=
this
console
.
log
(
row
,
arr
)
row
.
forEach
(
item
=>
{
if
(
item
.
_expanded
)
{
arr
.
push
(
item
)
_this
.
forE
(
item
[
_this
.
childKey
],
arr
)
}
else
{
arr
.
push
(
item
)
}
})
},
// 移除子节点
removeChildNode
(
data
,
parentId
)
{
var
parentIds
=
isArray
(
parentId
)
?
parentId
:
[
parentId
]
if
(
parentId
.
length
<=
0
)
{
return
data
}
var
ids
=
[]
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
if
(
parentIds
.
indexOf
(
data
[
i
][
this
.
parentKey
])
!==
-
1
&&
parentIds
.
indexOf
(
data
[
i
][
this
.
treeKey
])
===
-
1
)
{
ids
.
push
(
data
.
splice
(
i
,
1
)[
0
][
this
.
treeKey
])
i
--
}
}
return
this
.
removeChildNode
(
data
,
ids
)
}
}
}
</
script
>
\ No newline at end of file
src/components/table-tree-column/index1.vue
deleted
100644 → 0
View file @
648a4a1
<
template
>
<el-table-column
:prop=
"prop"
v-bind=
"$attrs"
>
<template
slot-scope=
"scope"
>
<span
@
click
.
prevent=
"toggleHandle(scope.$index, scope.row)"
:style=
"childStyles(scope.row)"
>
<i
:class=
"iconClasses(scope.row)"
:style=
"iconStyles(scope.row)"
></i>
{{
scope
.
row
[
prop
]
}}
</span>
</
template
>
</el-table-column>
</template>
<
script
>
import
isArray
from
'lodash/isArray'
export
default
{
name
:
'table-tree-column'
,
props
:
{
prop
:
{
type
:
String
},
treeKey
:
{
type
:
String
,
default
:
'id'
},
parentKey
:
{
type
:
String
,
default
:
'parentId'
},
levelKey
:
{
type
:
String
,
default
:
'level'
},
childKey
:
{
type
:
String
,
default
:
'children'
}
},
methods
:
{
childStyles
(
row
)
{
return
{
'padding-left'
:
(
row
[
this
.
levelKey
]
*
25
)
+
'px'
}
},
iconClasses
(
row
)
{
return
[
!
row
.
_expanded
?
'el-icon-caret-right'
:
'el-icon-caret-bottom'
]
},
iconStyles
(
row
)
{
return
{
'visibility'
:
this
.
hasChild
(
row
)
?
'visible'
:
'hidden'
}
},
hasChild
(
row
)
{
return
(
isArray
(
row
[
this
.
childKey
])
&&
row
[
this
.
childKey
].
length
>=
1
)
||
false
},
// 切换处理
toggleHandle
(
index
,
row
)
{
if
(
this
.
hasChild
(
row
))
{
var
data
=
this
.
$parent
.
store
.
states
.
data
.
slice
(
0
)
data
[
index
].
_expanded
=
!
data
[
index
].
_expanded
if
(
data
[
index
].
_expanded
)
{
data
=
data
.
splice
(
0
,
index
+
1
).
concat
(
row
[
this
.
childKey
]).
concat
(
data
)
}
else
{
data
=
this
.
removeChildNode
(
data
,
row
[
this
.
treeKey
])
}
this
.
$parent
.
store
.
commit
(
'setData'
,
data
)
this
.
$nextTick
(()
=>
{
this
.
$parent
.
doLayout
()
})
}
},
// 移除子节点
removeChildNode
(
data
,
parentId
)
{
var
parentIds
=
isArray
(
parentId
)
?
parentId
:
[
parentId
]
if
(
parentId
.
length
<=
0
)
{
return
data
}
var
ids
=
[]
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
if
(
parentIds
.
indexOf
(
data
[
i
][
this
.
parentKey
])
!==
-
1
&&
parentIds
.
indexOf
(
data
[
i
][
this
.
treeKey
])
===
-
1
)
{
ids
.
push
(
data
.
splice
(
i
,
1
)[
0
][
this
.
treeKey
])
i
--
}
}
return
this
.
removeChildNode
(
data
,
ids
)
}
}
}
</
script
>
\ No newline at end of file
src/utils/common.js
View file @
25e8e9a
...
...
@@ -50,5 +50,16 @@ export const Common = {
(
options
.
errorFunc
)(
error
)
}
})
},
// 正整数
checkRegExpNumber
(
rule
,
value
,
callback
)
{
var
rxp
=
/^
\+?[
1-9
][
0-9
]
*$/
if
(
!
rule
.
required
)
{
if
(
!
value
)
{
callback
()
}
else
if
(
!
rxp
.
test
(
value
))
{
return
callback
(
new
Error
(
'只支持正整数'
))
}
}
}
}
src/views/dictionaryManage/dictionaryData/index.vue
View file @
25e8e9a
...
...
@@ -174,9 +174,9 @@ export default {
},
dictDataData
:
[
{
label
:
'字典类型:'
,
prop
:
'dictType'
,
type
:
'input'
,
readonly
:
true
},
{
label
:
'字典标签:'
,
prop
:
'dictLabel'
,
type
:
'input'
},
{
label
:
'字典标签:'
,
prop
:
'dictLabel'
,
type
:
'input'
,
maxlength
:
50
},
// { label: '字典编码:', prop: 'id', type: 'input', readonly: true },
{
label
:
'字典键值:'
,
prop
:
'dictValue'
,
type
:
'input'
},
{
label
:
'字典键值:'
,
prop
:
'dictValue'
,
type
:
'input'
,
maxlength
:
50
},
{
label
:
'字典顺序:'
,
prop
:
'dictSort'
,
type
:
'input'
},
{
label
:
'状态'
,
prop
:
'enableStatus'
,
type
:
'switch'
},
{
label
:
'备注'
,
prop
:
'remark'
,
type
:
'input'
,
inputText
:
'textarea'
}
...
...
@@ -186,13 +186,13 @@ export default {
dictLabel
:
[{
required
:
true
,
message
:
'请输入字典标签'
,
trigger
:
'blur'
}],
// id: [{ required: true }],
dictValue
:
[{
required
:
true
,
message
:
'请输入字典键值'
,
trigger
:
'blur'
}],
dictSort
:
[{
required
:
true
,
message
:
'请输入字典顺序'
,
trigger
:
'blur'
}],
dictSort
:
[{
required
:
true
,
message
:
'请输入字典顺序'
,
trigger
:
'blur'
},
{
validator
:
this
.
$Common
.
checkRegExpNumber
,
trigger
:
'blur'
}],
enableStatus
:
[{
required
:
true
}]
}
}
},
mounted
()
{
console
.
log
(
this
.
$route
.
params
)
this
.
searchForm
.
name
=
this
.
$route
.
params
.
row
.
dictName
this
.
dictDataForm
.
dictType
=
this
.
$route
.
params
.
row
.
dictType
},
...
...
@@ -206,7 +206,6 @@ export default {
beforeSearchFn
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
searchForm
.
type
=
this
.
$route
.
params
.
row
.
dictType
console
.
log
(
this
.
searchForm
)
resolve
()
})
},
...
...
@@ -216,7 +215,6 @@ export default {
if
(
valid
)
{
let
params
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
dictDataForm
))
params
.
enableStatus
=
this
.
dictDataForm
.
enableStatus
?
1
:
2
console
.
log
(
params
)
let
api
=
addDictData
if
(
params
.
id
)
{
api
=
editDictData
...
...
@@ -224,7 +222,6 @@ export default {
delete
params
.
disabled
}
api
(
params
).
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
.
code
==
200
)
{
this
.
$message
({
type
:
'success'
,
...
...
@@ -236,8 +233,6 @@ export default {
this
.
$message
(
res
.
message
)
}
})
}
else
{
console
.
log
(
'error'
)
}
})
},
...
...
@@ -250,7 +245,6 @@ export default {
},
// 按钮事件
btnClick
(
pType
,
scope
)
{
console
.
log
(
pType
,
scope
)
switch
(
pType
)
{
case
'create'
:
this
.
dictDataDialogTitle
=
'新增字典'
...
...
@@ -263,15 +257,11 @@ export default {
case
'delete'
:
this
.
deleteEvent
(
scope
.
id
)
break
case
'list'
:
console
.
log
(
'list'
)
break
}
},
// 编辑触发事件
editEvent
(
row
)
{
console
.
log
(
row
,
'------------'
)
this
.
dictDataForm
=
JSON
.
parse
(
JSON
.
stringify
(
row
))
this
.
dictDataForm
.
enableStatus
=
row
.
enableStatus
==
1
?
true
:
false
delete
this
.
dictDataForm
.
createdDate
...
...
@@ -300,7 +290,6 @@ export default {
}
else
{
this
.
$message
(
res
.
message
)
}
})
}
}
...
...
src/views/dictionaryManage/index.vue
View file @
25e8e9a
...
...
@@ -109,7 +109,7 @@ export default {
label
:
'启用'
,
value
:
1
},
{
label
:
'
禁
用'
,
label
:
'
停
用'
,
value
:
2
}
]
...
...
@@ -175,10 +175,10 @@ export default {
enableStatus
:
true
},
dictionaryData
:
[
{
label
:
'字典名称:'
,
prop
:
'dictName'
,
type
:
'input'
},
{
label
:
'字典类型'
,
prop
:
'dictType'
,
type
:
'input'
},
{
label
:
'字典名称:'
,
prop
:
'dictName'
,
type
:
'input'
,
maxlength
:
50
},
{
label
:
'字典类型'
,
prop
:
'dictType'
,
type
:
'input'
,
maxlength
:
50
},
{
label
:
'状态'
,
prop
:
'enableStatus'
,
type
:
'switch'
},
{
label
:
'备注'
,
prop
:
'remark'
,
type
:
'input'
,
inputText
:
'textarea'
}
{
label
:
'备注'
,
prop
:
'remark'
,
type
:
'input'
,
inputText
:
'textarea'
,
maxlength
:
200
}
],
dictionaryRules
:
{
dictName
:
[{
required
:
true
,
message
:
'请输入字典名称'
,
trigger
:
blur
}],
...
...
@@ -228,8 +228,6 @@ export default {
this
.
$message
(
res
.
message
)
}
})
}
else
{
console
.
log
(
'error'
)
}
})
},
...
...
src/views/menuManage/index.vue
View file @
25e8e9a
...
...
@@ -303,8 +303,6 @@ export default {
this
.
$message
(
res
.
message
)
}
})
}
else
{
console
.
log
(
'error'
)
}
})
},
...
...
@@ -317,7 +315,6 @@ export default {
},
// 按钮事件
btnClick
(
pType
,
scope
)
{
console
.
log
(
pType
,
scope
)
switch
(
pType
)
{
case
'create'
:
this
.
isOpen
=
true
...
...
@@ -428,7 +425,6 @@ export default {
this
.
getPermtree
()
this
.
closeFilter
()
}
},
closeFilter
()
{
this
.
filterVisible
=
!
this
.
filterVisible
...
...
@@ -450,7 +446,6 @@ export default {
}
else
{
this
.
menuTableData
=
[]
}
})
},
// 获取上级菜单
...
...
src/views/orginizaManage/index.vue
View file @
25e8e9a
...
...
@@ -252,10 +252,10 @@ export default {
})
}
this
.
handleClose
()
}
else
{
this
.
$message
(
res
.
message
)
}
})
}
else
{
console
.
log
(
'error'
)
}
})
},
...
...
src/views/role/index.vue
View file @
25e8e9a
...
...
@@ -111,7 +111,6 @@
<
script
>
import
{
getRoleList
,
roleInfo
,
getTenantList
,
addRole
,
editRole
,
deleteRole
,
getMenuTree
}
from
'services/role'
;
export
default
{
data
()
{
var
checkMenu
=
(
rule
,
value
,
callBack
)
=>
{
...
...
@@ -205,7 +204,6 @@ export default {
console
.
log
(
this
.
roleForm
)
this
.
$refs
.
roleForm
.
$children
[
0
].
validate
((
valid
)
=>
{
if
(
valid
)
{
// let params = JSON.parse(JSON.stringify(this.roleForm))
let
api
=
addRole
let
params
=
{
remark
:
this
.
roleForm
.
remark
,
...
...
@@ -215,14 +213,11 @@ export default {
params
.
enableStatus
=
this
.
roleForm
.
enableStatus
?
1
:
2
params
.
roleVisibility
=
Number
(
this
.
roleForm
.
roleVisibility
)
params
.
rolePermissionType
=
Number
(
this
.
roleForm
.
rolePermissionType
)
if
(
params
.
roleVisibility
==
2
)
{
params
.
roleTenants
=
this
.
roleForm
.
roleTenants
.
toString
()
}
if
(
params
.
roleVisibility
==
2
)
params
.
roleTenants
=
this
.
roleForm
.
roleTenants
.
toString
()
if
(
this
.
roleForm
.
id
)
{
api
=
editRole
params
.
roleId
=
this
.
roleForm
.
id
}
console
.
log
(
params
)
api
(
params
).
then
(
res
=>
{
if
(
res
.
code
==
'200'
)
{
this
.
$message
({
...
...
@@ -231,10 +226,10 @@ export default {
})
this
.
handleClose
()
this
.
$refs
.
roleTable
.
refreshTable
()
}
else
{
this
.
$message
(
res
.
message
)
}
})
}
else
{
console
.
log
(
'error'
)
}
})
},
...
...
@@ -309,7 +304,6 @@ export default {
// 获取菜单权限列表
getMenuTree
(
params
)
{
getMenuTree
(
params
).
then
(
res
=>
{
console
.
log
(
res
)
this
.
treedata
=
res
.
data
.
menuTree
setTimeout
(()
=>
{
this
.
$refs
.
tree
.
setCheckedKeys
(
res
.
data
.
checkedIds
)
...
...
@@ -319,7 +313,6 @@ export default {
// 获取选中菜单数组
getCheckedKeys
()
{
this
.
roleForm
.
menuIdList
=
this
.
$refs
.
tree
.
getCheckedKeys
()
console
.
log
(
this
.
$refs
.
tree
.
getCheckedKeys
())
},
// 获取租户列表
getTenantList
()
{
...
...
@@ -328,7 +321,6 @@ export default {
})
},
radioChange
(
e
)
{
console
.
log
(
e
,
this
.
roleForm
)
this
.
$set
(
this
.
roleForm
,
'roleVisibility'
,
e
)
}
}
...
...
src/views/user/index.vue
View file @
25e8e9a
...
...
@@ -6,9 +6,9 @@
</div>
<el-input
size=
"mini"
placeholder=
"
按回车
搜索"
placeholder=
"
输入内容
搜索"
v-model=
"orgName"
@
input
=
"treeInput"
@
change
=
"treeInput"
></el-input>
<el-tree
:data=
"treedata"
...
...
@@ -223,7 +223,7 @@ export default {
userData
:
[
{
label
:
'登录名称:'
,
prop
:
'account'
,
type
:
'input'
},
{
label
:
'部门名称:'
,
prop
:
'departmentName'
,
type
:
'input'
,
readonly
:
true
,
clickFunc
:
this
.
selectDepart
},
{
label
:
'直接上级:'
,
prop
:
'superiorName'
,
type
:
'input'
,
readonly
:
true
,
clickFunc
:
this
.
selectSuperior
},
{
label
:
'直接上级:'
,
prop
:
'superiorName'
,
type
:
'input'
,
readonly
:
true
,
clickFunc
:
this
.
selectSuperior
,
hidden
:
true
},
{
label
:
'用户名称:'
,
prop
:
'username'
,
type
:
'input'
},
{
label
:
'密码:'
,
prop
:
'password'
,
type
:
'input'
,
inputText
:
'password'
},
{
label
:
'角色:'
,
prop
:
'roleId'
,
type
:
'select'
,
options
:
[],
key
:
'roleName'
,
value
:
'roleId'
,
filterable
:
true
},
...
...
@@ -285,7 +285,7 @@ export default {
delete
params
.
departmentName
delete
params
.
superiorName
delete
params
.
createdDate
if
(
params
.
roleName
)
delete
params
.
roleName
delete
params
.
roleName
this
.
emptyData
(
params
)
let
api
=
addUser
if
(
params
.
id
)
api
=
editUser
...
...
@@ -297,10 +297,10 @@ export default {
type
:
'success'
,
message
:
'操作成功!'
})
}
else
{
this
.
$message
(
res
.
message
)
}
})
}
else
{
console
.
log
(
'error'
)
}
})
},
...
...
@@ -326,7 +326,6 @@ export default {
},
// 按钮事件
btnClick
(
pType
,
scope
)
{
console
.
log
(
pType
,
scope
)
switch
(
pType
)
{
case
'create'
:
this
.
userDialogTitle
=
'新增用户'
...
...
@@ -337,7 +336,11 @@ export default {
superiorName
:
''
,
enableStatus
:
true
}
this
.
userData
.
map
(
item
=>
{
if
(
item
.
prop
==
'superiorName'
)
{
item
.
hidden
=
true
}
})
this
.
handleClose
()
break
case
'edit'
:
...
...
@@ -360,10 +363,13 @@ export default {
this
.
userForm
=
JSON
.
parse
(
JSON
.
stringify
(
res
.
data
))
this
.
userForm
.
enableStatus
=
res
.
data
.
enableStatus
==
1
?
true
:
false
this
.
userForm
.
gender
=
this
.
userForm
.
gender
+
''
console
.
log
(
this
.
userForm
)
this
.
userData
.
map
(
item
=>
{
if
(
item
.
prop
==
'superiorName'
)
{
item
.
hidden
=
!
(
this
.
userForm
.
deptDepth
==
0
)
}
})
this
.
handleClose
(
res
.
data
)
})
},
// 删除触发事件
deleteEvent
(
id
)
{
...
...
@@ -400,22 +406,31 @@ export default {
selectSuperior
()
{
this
.
filterText
=
''
this
.
filterDialogTitle
=
'选择直接上级'
this
.
userForm
.
superiorName
=
''
this
.
getSuperUser
({
departmentId
:
this
.
userForm
.
departmentId
})
this
.
closeFilter
()
},
closeFilter
()
{
this
.
filterVisible
=
!
this
.
filterVisible
},
filterConfirm
()
{
console
.
log
(
this
.
$refs
.
tree
.
getCurrentNode
())
if
(
this
.
filterDialogTitle
==
'选择直接上级'
)
{
this
.
userForm
.
superiorId
=
this
.
$refs
.
tree
.
getCurrentNode
().
id
this
.
userForm
.
superiorName
=
this
.
$refs
.
tree
.
getCurrentNode
().
label
}
else
{
this
.
userForm
.
departmentId
=
this
.
$refs
.
tree
.
getCurrentNode
().
id
this
.
userForm
.
departmentName
=
this
.
$refs
.
tree
.
getCurrentNode
().
label
this
.
userData
.
map
(
item
=>
{
if
(
item
.
prop
==
'superiorName'
)
{
item
.
hidden
=
this
.
$refs
.
tree
.
getCurrentNode
().
depth
==
0
if
(
this
.
$refs
.
tree
.
getCurrentNode
().
depth
==
0
)
{
delete
this
.
userForm
.
superiorId
delete
this
.
userForm
.
superiorName
}
}
})
}
this
.
closeFilter
()
},
filterNode
(
value
,
data
)
{
...
...
@@ -437,7 +452,6 @@ export default {
// 获取组织架构
getTreeOrg
(
params
)
{
getTreeOrg
(
params
).
then
(
res
=>
{
// this.searchForm.departmentId = res.data.id
this
.
treedata
=
res
.
data
})
},
...
...
@@ -455,7 +469,6 @@ export default {
}
this
.
getTreeOrg
(
params
)
this
.
isExpand
=
true
// this.$refs.userTable.refreshTable()
},
// 岗位列表
getPosti
(
value
)
{
...
...
src/views/workLog/index.vue
View file @
25e8e9a
...
...
@@ -101,14 +101,12 @@ export default {
},
beforeSearchFn
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
console
.
log
(
this
.
searchForm
)
if
(
this
.
searchForm
.
daterange
)
{
this
.
searchDataForm
.
sDate
=
this
.
searchForm
.
daterange
[
0
]
this
.
searchDataForm
.
eDate
=
this
.
searchForm
.
daterange
[
1
]
}
else
{
if
(
this
.
searchDataForm
.
sDate
)
delete
this
.
searchDataForm
.
sDate
&&
delete
this
.
searchDataForm
.
eDate
}
resolve
()
})
},
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment