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 c224df34
authored
Oct 23, 2020
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交部分接口
1 parent
ccf27b8d
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
319 additions
and
149 deletions
src/components/basic-table/index.vue
src/components/search-form/index.vue
src/config/config.js
src/services/dictionary.js
src/services/request.js
src/services/user.js
src/services/worklog.js
src/styles/common.scss
src/utils/constants.js
src/views/dictionaryManage/dictionaryData/index.vue
src/views/dictionaryManage/index.vue
src/views/user/index.vue
src/views/workLog/index.vue
src/components/basic-table/index.vue
View file @
c224df3
...
@@ -161,6 +161,15 @@ export default {
...
@@ -161,6 +161,15 @@ export default {
type
:
Function
,
type
:
Function
,
default
:
null
default
:
null
},
},
// 搜索前操作
beforeSearchFn
:
{
type
:
Function
,
default
:
()
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
resolve
()
})
}
},
// 分页,默认有
// 分页,默认有
hasPage
:
{
hasPage
:
{
type
:
Boolean
,
type
:
Boolean
,
...
@@ -260,6 +269,7 @@ export default {
...
@@ -260,6 +269,7 @@ export default {
},
},
refreshTable
(
clearMuti
=
true
)
{
refreshTable
(
clearMuti
=
true
)
{
this
.
beforeSearchFn
().
then
(
res
=>
{
// 清空多选
// 清空多选
clearMuti
&&
this
.
clearMutiSelect
()
clearMuti
&&
this
.
clearMutiSelect
()
this
.
loading
=
true
this
.
loading
=
true
...
@@ -280,6 +290,7 @@ export default {
...
@@ -280,6 +290,7 @@ export default {
}).
catch
(()
=>
{
}).
catch
(()
=>
{
this
.
loading
=
false
this
.
loading
=
false
})
})
})
},
},
// 页码
// 页码
...
...
src/components/search-form/index.vue
View file @
c224df3
...
@@ -33,6 +33,17 @@
...
@@ -33,6 +33,17 @@
</el-option>
</el-option>
</el-select>
</el-select>
</
template
>
</
template
>
<
template
v-else-if=
"item.type === 'daterange'"
>
<el-date-picker
v-model=
"formModel[item.prop]"
type=
"daterange"
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
value-format=
"yyyy-MM-dd hh:mm:ss"
>
</el-date-picker>
</
template
>
</template>
</template>
</el-form-item>
</el-form-item>
<el-form-item>
<el-form-item>
...
...
src/config/config.js
View file @
c224df3
...
@@ -34,9 +34,18 @@ const ORGINIZA_API = {
...
@@ -34,9 +34,18 @@ const ORGINIZA_API = {
ORGINIZA_TREEORY
:
BASE_URL
+
'/usercenter/organization/treeOrg'
ORGINIZA_TREEORY
:
BASE_URL
+
'/usercenter/organization/treeOrg'
}
}
const
DICT_API
=
{
const
DICT_API
=
{
DICT_SEARCH
:
{
DICT_SEARCH
:
BASE_URL
+
'/publiccenter/dict/type/search'
,
apiUrl
:
BASE_URL
+
'/publiccenter/dict/type/search'
DICT_ADD
:
BASE_URL
+
'/publiccenter/dict/type/add'
,
},
DICT_EDIT
:
BASE_URL
+
'/publiccenter/dict/type/edit'
,
DICT_ADD
:
BASE_URL
+
'/publiccenter/dict/type/add'
DICT_DELETE
:
BASE_URL
+
'/publiccenter/dict/type/delete'
,
DICTDATA_SEARCH
:
BASE_URL
+
'/publiccenter/dict/data/search'
,
DICTDATA_EXPORT
:
BASE_URL
+
'/publiccenter/dict/data/export'
,
DICTDATA_ADD
:
BASE_URL
+
'/publiccenter/dict/data/add'
,
DICTDATA_EDIT
:
BASE_URL
+
'/publiccenter/dict/data/edit'
,
DICTDATA_DELETE
:
BASE_URL
+
'/publiccenter/dict/data/delete'
}
const
WORKLOG_API
=
{
WORKLOG_SEARCH
:
BASE_URL
+
'/loggincenter/loggin/search'
,
WORKLOG_EXPORT
:
BASE_URL
+
'/loggincenter/loggin/export'
}
}
export
{
API
,
USER_API
,
ROLE_API
,
ORGINIZA_API
,
DICT_API
}
export
{
API
,
USER_API
,
ROLE_API
,
ORGINIZA_API
,
DICT_API
,
WORKLOG_API
}
src/services/dictionary.js
View file @
c224df3
import
HTTP
from
'@/utils/http'
import
{
DICT_API
}
from
'@/config/config'
import
{
DICT_API
}
from
'@/config/config'
import
request
from
'@/services/request'
// 字典列表
function
getDictList
(
params
)
{
const
url
=
DICT_API
.
DICT_SEARCH
return
request
(
params
,
url
)
}
// 新增字典
function
addDict
(
params
)
{
const
url
=
DICT_API
.
DICT_ADD
return
request
(
params
,
url
,
'post'
)
}
// 编辑字典
function
editDict
(
params
)
{
const
url
=
DICT_API
.
DICT_EDIT
return
request
(
params
,
url
,
'post'
)
}
// 删除字典
function
deleteDict
(
params
)
{
const
url
=
DICT_API
.
DICT_DELETE
return
request
(
params
,
url
)
}
export
default
class
DictService
extends
HTTP
{
// 字典数据列表
addDict
(
params
)
{
function
getDictDataList
(
params
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
url
=
DICT_API
.
DICTDATA_SEARCH
this
.
axiosPost
({
return
request
(
params
,
url
)
url
:
DICT_API
.
DICT_ADD
,
}
data
:
{
params
},
// 新增字典数据类型
success
(
data
)
{
function
addDictData
(
params
)
{
resolve
(
data
)
const
url
=
DICT_API
.
DICTDATA_ADD
},
return
request
(
params
,
url
,
'post'
)
error
(
error
)
{
}
// 网络请求失败
// 编辑字典数据类型
console
.
log
(
'网络请求失败'
)
function
editDictData
(
params
)
{
}
const
url
=
DICT_API
.
DICTDATA_EDIT
})
return
request
(
params
,
url
,
'post'
)
})
}
}
// 删除字典数据类型
function
deleteDictData
(
params
)
{
const
url
=
DICT_API
.
DICTDATA_DELETE
return
request
(
params
,
url
)
}
// 导出字典数据
function
exportDictData
(
params
)
{
const
url
=
DICT_API
.
DICTDATA_EXPORT
return
request
(
params
,
url
)
}
}
export
{
getDictList
,
addDict
,
editDict
,
deleteDict
,
getDictDataList
,
addDictData
,
editDictData
,
deleteDictData
,
exportDictData
}
src/services/request.js
View file @
c224df3
...
@@ -2,11 +2,11 @@ import HTTP from '@/utils/http'
...
@@ -2,11 +2,11 @@ import HTTP from '@/utils/http'
const
axiosHttp
=
new
HTTP
()
const
axiosHttp
=
new
HTTP
()
function
request
(
data
=
{}
,
method
=
'GET'
)
{
function
request
(
data
=
{}
,
url
,
method
=
'GET'
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
var
reqMethod
=
method
.
toLocaleLowerCase
()
===
'get'
?
'axiosGet'
:
'axiosPost'
var
reqMethod
=
method
.
toLocaleLowerCase
()
===
'get'
?
'axiosGet'
:
'axiosPost'
axiosHttp
[
reqMethod
]({
axiosHttp
[
reqMethod
]({
url
:
data
.
url
,
url
:
url
,
data
:
data
,
data
:
data
,
success
(
data
)
{
success
(
data
)
{
resolve
(
data
)
resolve
(
data
)
...
...
src/services/user.js
View file @
c224df3
import
{
import
{
USER_API
}
from
'@/config/config'
USER_API
}
from
'@/config/config'
import
request
from
'@/services/request'
import
request
from
'@/services/request'
// 获取用户列表
// 获取用户列表
function
getUserList
(
params
)
{
function
getUserList
(
params
)
{
params
.
url
=
USER_API
.
USER_SEARCH
const
url
=
USER_API
.
USER_SEARCH
return
request
(
params
)
return
request
(
params
,
url
)
}
}
// 获取上级树
// 获取上级树
function
getSuperUser
(
params
)
{
function
getSuperUser
(
params
)
{
params
.
url
=
USER_API
.
USER_SUPER
const
url
=
USER_API
.
USER_SUPER
return
request
(
params
)
return
request
(
params
,
url
)
}
}
// 新增用户
// 新增用户
function
addUser
(
params
)
{
function
addUser
(
params
)
{
params
.
url
=
USER_API
.
USER_ADD
const
url
=
USER_API
.
USER_ADD
return
request
(
params
)
return
request
(
params
,
url
)
}
}
export
{
getUserList
,
getSuperUser
,
addUser
}
\ No newline at end of file
\ No newline at end of file
export
{
getUserList
,
getSuperUser
,
addUser
}
src/services/worklog.js
0 → 100644
View file @
c224df3
import
{
WORKLOG_API
}
from
'@/config/config'
import
request
from
'@/services/request'
// 获取用户列表
function
getWorkLogList
(
params
)
{
const
url
=
WORKLOG_API
.
WORKLOG_SEARCH
return
request
(
params
,
url
)
}
// 导出日志
function
exportWorkLog
(
params
)
{
const
url
=
WORKLOG_API
.
WORKLOG_EXPORT
return
request
(
params
,
url
)
}
export
{
getWorkLogList
,
exportWorkLog
}
src/styles/common.scss
View file @
c224df3
...
@@ -11,7 +11,8 @@
...
@@ -11,7 +11,8 @@
border-image
:
initial
;
border-image
:
initial
;
border-radius
:
3px
;
border-radius
:
3px
;
transition
:
all
0
.2s
ease
0s
;
transition
:
all
0
.2s
ease
0s
;
}
}
.border-shadow
:hover
{
.border-shadow
:hover
{
box-shadow
:
rgba
(
232
,
237
,
250
,
0
.6
)
0px
0px
8px
0px
,
box-shadow
:
rgba
(
232
,
237
,
250
,
0
.6
)
0px
0px
8px
0px
,
rgba
(
232
,
237
,
250
,
0
.5
)
0px
2px
4px
0px
;
rgba
(
232
,
237
,
250
,
0
.5
)
0px
2px
4px
0px
;
...
@@ -22,15 +23,18 @@
...
@@ -22,15 +23,18 @@
margin
:
20px
24px
;
margin
:
20px
24px
;
background-color
:
#ffffff
;
background-color
:
#ffffff
;
overflow
:
hidden
;
overflow
:
hidden
;
.user-tree
{
.user-tree
{
margin-top
:
20px
;
margin-top
:
20px
;
padding
:
20px
;
padding
:
20px
;
float
:
left
;
float
:
left
;
width
:
18%
;
width
:
18%
;
.user-tree-top
{
.user-tree-top
{
height
:
30px
;
height
:
30px
;
}
}
}
}
.user-container
{
.user-container
{
padding
:
20px
10px
0px
20px
;
padding
:
20px
10px
0px
20px
;
float
:
left
;
float
:
left
;
...
@@ -52,6 +56,14 @@
...
@@ -52,6 +56,14 @@
margin-right
:
2px
;
margin-right
:
2px
;
}
}
.green-text
{
color
:
#00A854
;
}
.red-text
{
color
:
rgb
(
255
,
0
,
0
);
}
.green
{
.green
{
background-color
:
#00A854
;
background-color
:
#00A854
;
}
}
...
@@ -79,4 +91,3 @@
...
@@ -79,4 +91,3 @@
.statusText
{
.statusText
{
vertical-align
:
middle
;
vertical-align
:
middle
;
}
}
\ No newline at end of file
\ No newline at end of file
src/utils/constants.js
View file @
c224df3
...
@@ -28,6 +28,11 @@ const Constants = {
...
@@ -28,6 +28,11 @@ const Constants = {
'1'
:
'启用, green'
,
'1'
:
'启用, green'
,
'2'
:
'停用, red'
'2'
:
'停用, red'
},
},
// 日志操作状态
WORKLOG_STATUS
:
{
'0'
:
'成功, green-text'
,
'-1'
:
'失败, red-text'
},
// (0:系统管理员,1:服务商,2:门店,3:技工)
// (0:系统管理员,1:服务商,2:门店,3:技工)
USERTYPE
:
{
USERTYPE
:
{
'0'
:
'超级管理员'
,
'0'
:
'超级管理员'
,
...
...
src/views/dictionaryManage/dictionaryData/index.vue
View file @
c224df3
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<search-form
<search-form
class=
"searchTop border-shadow"
class=
"searchTop border-shadow"
:formModel=
"searchForm"
:formModel=
"searchForm"
:formList=
"dict
ionary
FormList"
:formList=
"dict
Data
FormList"
>
>
<slot
name=
"form-slot"
>
<slot
name=
"form-slot"
>
<el-button
<el-button
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
type=
"primary"
type=
"primary"
:size=
"btn_size"
:size=
"btn_size"
icon=
"el-icon-refresh"
icon=
"el-icon-refresh"
@
click=
"refresh"
>
重置
</el-button>
>
重置
</el-button>
</slot>
</slot>
</search-form>
</search-form>
...
@@ -25,7 +26,7 @@
...
@@ -25,7 +26,7 @@
type=
"primary"
type=
"primary"
:size=
"btn_size"
:size=
"btn_size"
icon=
"el-icon-plus"
icon=
"el-icon-plus"
@
click=
"
handleClose
"
@
click=
"
btnClick('create')
"
>
新增
</el-button>
>
新增
</el-button>
</div>
</div>
<basic-table
<basic-table
...
@@ -33,12 +34,16 @@
...
@@ -33,12 +34,16 @@
:getListApi=
"getListApi"
:getListApi=
"getListApi"
:searchForm=
"searchForm"
:searchForm=
"searchForm"
:hasNum=
"false"
:hasNum=
"false"
ref=
"dictDataTable"
>
>
<span
<span
slot=
"status"
slot=
"status"
slot-scope=
"scope"
slot-scope=
"scope"
>
>
<span
class=
"dot green"
></span><span
class=
"statusText"
>
正常
</span>
<span
class=
"dot"
:class=
"scope.scope.enableStatus ? DICTSTATUS[scope.scope.enableStatus].split(',')[1] : ''"
></span><span
class=
"statusText"
>
{{
scope
.
scope
.
enableStatus
?
DICTSTATUS
[
scope
.
scope
.
enableStatus
].
split
(
','
)[
0
]
:
'--'
}}
</span>
</span>
</span>
<span
<span
slot=
"table-button"
slot=
"table-button"
...
@@ -55,17 +60,17 @@
...
@@ -55,17 +60,17 @@
</span>
</span>
</basic-table>
</basic-table>
<basic-dialog
<basic-dialog
:title=
"dict
ionary
DialogTitle"
:title=
"dict
Data
DialogTitle"
:isVisible=
"dict
ionary
Visible"
:isVisible=
"dict
Data
Visible"
@
confirmDialog=
"handleConfirm"
@
confirmDialog=
"handleConfirm"
@
closeDialog=
"handleClose"
@
closeDialog=
"handleClose"
>
>
<slot>
<slot>
<rule-form
<rule-form
:ruleForm=
"dict
ionary
Form"
:ruleForm=
"dict
Data
Form"
:rules=
"dict
ionary
Rules"
:rules=
"dict
Data
Rules"
:ruleData=
"dict
ionary
Data"
:ruleData=
"dict
Data
Data"
ref=
'dict
ionary
Form'
ref=
'dict
Data
Form'
></rule-form>
></rule-form>
</slot>
</slot>
</basic-dialog>
</basic-dialog>
...
@@ -74,11 +79,14 @@
...
@@ -74,11 +79,14 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
getDictDataList
,
addDictData
,
editDictData
,
deleteDictData
,
exportDictData
}
from
'services/dictionary'
;
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
DICTSTATUS
:
this
.
$Constants
.
DICT_STATUS
,
searchForm
:
{},
searchForm
:
{},
dict
ionary
FormList
:
[
dict
Data
FormList
:
[
{
{
type
:
'input'
,
type
:
'input'
,
inputType
:
'text'
,
inputType
:
'text'
,
...
@@ -107,7 +115,7 @@ export default {
...
@@ -107,7 +115,7 @@ export default {
}
}
],
],
tableParams
:
{
tableParams
:
{
mutiSelectName
:
'dict
ionary
Data'
,
mutiSelectName
:
'dict
Data
Data'
,
mutiSelectUniqueKey
:
'id'
,
mutiSelectUniqueKey
:
'id'
,
btnId
:
new
Date
().
getTime
()
+
parseInt
(
Math
.
random
()
*
1000
),
btnId
:
new
Date
().
getTime
()
+
parseInt
(
Math
.
random
()
*
1000
),
listName
:
'list'
,
listName
:
'list'
,
...
@@ -117,7 +125,7 @@ export default {
...
@@ -117,7 +125,7 @@ export default {
prop
:
'id'
prop
:
'id'
},
{
},
{
label
:
'字典标签'
,
label
:
'字典标签'
,
prop
:
'dict
Name
'
prop
:
'dict
Label
'
},
{
},
{
label
:
'字典键值'
,
label
:
'字典键值'
,
prop
:
'dictType'
prop
:
'dictType'
...
@@ -152,30 +160,71 @@ export default {
...
@@ -152,30 +160,71 @@ export default {
]
]
}
}
},
},
getListApi
:
null
,
getListApi
:
getDictDataList
,
// 弹窗
// 弹窗
dictionaryDialogTitle
:
'新增字典'
,
dictDataDialogTitle
:
'新增字典'
,
dictionaryVisible
:
false
,
dictDataVisible
:
false
,
dictionaryForm
:
{},
dictDataForm
:
{
dictionaryData
:
[
enableStatus
:
true
},
dictDataData
:
[
{
label
:
'字典类型:'
,
prop
:
'dictType'
,
type
:
'input'
},
{
label
:
'字典类型:'
,
prop
:
'dictType'
,
type
:
'input'
},
{
label
:
'字典标签:'
,
prop
:
'dict
Name
'
,
type
:
'input'
},
{
label
:
'字典标签:'
,
prop
:
'dict
Label
'
,
type
:
'input'
},
{
label
:
'字典编码:'
,
prop
:
'dict
Name
'
,
type
:
'input'
},
{
label
:
'字典编码:'
,
prop
:
'dict
Sort
'
,
type
:
'input'
},
{
label
:
'字典键值:'
,
prop
:
'dict
Nam
e'
,
type
:
'input'
},
{
label
:
'字典键值:'
,
prop
:
'dict
Valu
e'
,
type
:
'input'
},
{
label
:
'字典顺序:'
,
prop
:
'dict
Name
'
,
type
:
'input'
},
{
label
:
'字典顺序:'
,
prop
:
'dict
Sort
'
,
type
:
'input'
},
{
label
:
'状态'
,
prop
:
'enableStatus'
,
type
:
'switch'
},
{
label
:
'状态'
,
prop
:
'enableStatus'
,
type
:
'switch'
},
{
label
:
'备注'
,
prop
:
'remark'
,
type
:
'input'
,
inputText
:
'textarea'
}
{
label
:
'备注'
,
prop
:
'remark'
,
type
:
'input'
,
inputText
:
'textarea'
}
],
],
dictionaryRules
:
{}
dictDataRules
:
{
dictType
:
[{
required
:
true
,
message
:
'请输入字典类型'
,
trigger
:
blur
}],
dictLabel
:
[{
required
:
true
,
message
:
'请输入字典标签'
,
trigger
:
blur
}],
dictSort
:
[{
required
:
true
,
message
:
'请输入字典编码'
,
trigger
:
blur
}],
dictValue
:
[{
required
:
true
,
message
:
'请输入字典键值'
,
trigger
:
blur
}],
dictSort
:
[{
required
:
true
,
message
:
'请输入字典顺序'
,
trigger
:
blur
}],
enableStatus
:
[{
required
:
true
}]
}
}
}
},
},
methods
:
{
methods
:
{
// 重置搜索条件
refresh
()
{
this
.
searchForm
=
{}
},
// 确定
handleConfirm
()
{
this
.
$refs
.
dictDataForm
.
$children
[
0
].
validate
((
valid
)
=>
{
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
api
(
params
).
then
(
res
=>
{
console
.
log
(
res
)
this
.
handleClose
()
this
.
$refs
.
dictDataTable
.
refreshTable
()
})
}
else
{
console
.
log
(
'error'
)
}
})
},
// 取消
handleClose
()
{
if
(
!
this
.
dictDataVisible
&&
this
.
$refs
.
dictDataForm
)
{
this
.
$refs
.
dictDataForm
.
$children
[
0
].
resetFields
()
}
this
.
dictDataVisible
=
!
this
.
dictDataVisible
},
// 按钮事件
// 按钮事件
btnClick
(
pType
,
scope
)
{
btnClick
(
pType
,
scope
)
{
console
.
log
(
pType
,
scope
)
console
.
log
(
pType
,
scope
)
switch
(
pType
)
{
switch
(
pType
)
{
case
'create'
:
this
.
handleClose
()
case
'edit'
:
case
'edit'
:
this
.
handleClose
(
scope
)
this
.
editEvent
(
scope
)
break
break
case
'delete'
:
case
'delete'
:
this
.
deleteEvent
(
scope
.
id
)
this
.
deleteEvent
(
scope
.
id
)
...
@@ -185,24 +234,12 @@ export default {
...
@@ -185,24 +234,12 @@ export default {
break
break
}
}
},
},
// 确定
handleConfirm
()
{
// 编辑触发事件
console
.
log
(
this
.
$refs
.
dictionaryForm
)
editEvent
(
row
)
{
this
.
$refs
.
dictionaryForm
.
$children
[
0
].
validate
((
valid
)
=>
{
this
.
dictDataForm
=
JSON
.
parse
(
JSON
.
stringify
(
row
))
if
(
valid
)
{
this
.
dictDataForm
.
enableStatus
=
row
.
enableStatus
==
1
?
true
:
false
this
.
handleClose
()
this
.
handleClose
()
}
else
{
console
.
log
(
'error'
)
}
})
},
// 取消
handleClose
(
row
)
{
console
.
log
(
row
)
if
(
!
this
.
dictionaryVisible
&&
this
.
$refs
.
dictionaryForm
)
{
this
.
$refs
.
dictionaryForm
.
$children
[
0
].
resetFields
()
}
this
.
dictionaryVisible
=
!
this
.
dictionaryVisible
},
},
// 删除触发事件
// 删除触发事件
deleteEvent
(
id
)
{
deleteEvent
(
id
)
{
...
@@ -213,10 +250,16 @@ export default {
...
@@ -213,10 +250,16 @@ export default {
tipTitle
:
'提示'
,
tipTitle
:
'提示'
,
type
:
'error'
,
type
:
'error'
,
callBack
:
()
=>
{
callBack
:
()
=>
{
const
params
=
{
id
:
id
}
deleteDictData
(
params
).
then
(
res
=>
{
this
.
$message
({
this
.
$message
({
type
:
'success'
,
type
:
'success'
,
message
:
'删除成功!'
message
:
'删除成功!'
})
})
this
.
$refs
.
dictDataTable
.
refreshTable
()
})
}
}
}
}
this
.
$Common
.
confirmDialog
(
tipData
)
this
.
$Common
.
confirmDialog
(
tipData
)
...
...
src/views/dictionaryManage/index.vue
View file @
c224df3
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
type=
"primary"
type=
"primary"
:size=
"btn_size"
:size=
"btn_size"
icon=
"el-icon-refresh"
icon=
"el-icon-refresh"
@
click=
"refresh "
>
重置
</el-button>
>
重置
</el-button>
</slot>
</slot>
</search-form>
</search-form>
...
@@ -25,12 +26,12 @@
...
@@ -25,12 +26,12 @@
type=
"primary"
type=
"primary"
:size=
"btn_size"
:size=
"btn_size"
icon=
"el-icon-plus"
icon=
"el-icon-plus"
@
click=
"
handleClose
"
@
click=
"
btnClick('create')
"
>
新增
</el-button>
>
新增
</el-button>
</div>
</div>
<basic-table
<basic-table
:tableParams=
"tableParams"
:tableParams=
"tableParams"
:
apiParame=
"apiParame
"
:
getListApi=
"getListApi
"
:searchForm=
"searchForm"
:searchForm=
"searchForm"
:hasNum=
"false"
:hasNum=
"false"
>
>
...
@@ -77,11 +78,7 @@
...
@@ -77,11 +78,7 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
import
{
getDictList
,
addDict
,
editDict
,
deleteDict
}
from
'services/dictionary'
;
DICT_API
}
from
'@/config/config'
import
Service
from
'services/dictionary'
;
const
dictService
=
new
Service
()
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
...
@@ -163,7 +160,7 @@ export default {
...
@@ -163,7 +160,7 @@ export default {
]
]
}
}
},
},
apiParame
:
DICT_API
.
DICT_SEARCH
,
getListApi
:
getDictList
,
// 弹窗
// 弹窗
dictionaryDialogTitle
:
'新增字典'
,
dictionaryDialogTitle
:
'新增字典'
,
dictionaryVisible
:
false
,
dictionaryVisible
:
false
,
...
@@ -184,27 +181,22 @@ export default {
...
@@ -184,27 +181,22 @@ export default {
}
}
},
},
methods
:
{
methods
:
{
// 按钮事件
// 重置搜索条件
btnClick
(
pType
,
scope
)
{
refresh
()
{
console
.
log
(
pType
,
scope
)
this
.
searchForm
=
{}
switch
(
pType
)
{
case
'edit'
:
this
.
handleClose
(
scope
)
break
case
'delete'
:
this
.
deleteEvent
(
scope
.
id
)
break
case
'list'
:
console
.
log
(
'list'
)
break
}
},
},
// 确定
// 确定
handleConfirm
()
{
handleConfirm
()
{
console
.
log
(
this
.
dictionaryForm
)
console
.
log
(
this
.
dictionaryForm
)
this
.
$refs
.
dictionaryForm
.
$children
[
0
].
validate
((
valid
)
=>
{
this
.
$refs
.
dictionaryForm
.
$children
[
0
].
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
valid
)
{
dictService
.
addDict
(
this
.
dictionaryForm
).
then
(
res
=>
{
let
params
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
dictionaryForm
))
params
.
enableStatus
=
this
.
dictionaryForm
.
enableStatus
?
1
:
2
console
.
log
(
params
)
let
api
=
addDict
if
(
params
.
id
)
api
=
editDict
api
(
params
).
then
(
res
=>
{
console
.
log
(
res
)
this
.
handleClose
()
this
.
handleClose
()
})
})
}
else
{
}
else
{
...
@@ -213,17 +205,37 @@ export default {
...
@@ -213,17 +205,37 @@ export default {
})
})
},
},
// 取消
// 取消
handleClose
(
row
)
{
handleClose
()
{
console
.
log
(
row
)
if
(
row
)
{
this
.
dictionaryForm
=
row
// this.dictionaryForm.enableStatus
}
if
(
!
this
.
dictionaryVisible
&&
this
.
$refs
.
dictionaryForm
)
{
if
(
!
this
.
dictionaryVisible
&&
this
.
$refs
.
dictionaryForm
)
{
this
.
$refs
.
dictionaryForm
.
$children
[
0
].
resetFields
()
this
.
$refs
.
dictionaryForm
.
$children
[
0
].
resetFields
()
}
}
this
.
dictionaryVisible
=
!
this
.
dictionaryVisible
this
.
dictionaryVisible
=
!
this
.
dictionaryVisible
},
},
// 按钮事件
btnClick
(
pType
,
scope
)
{
console
.
log
(
pType
,
scope
)
switch
(
pType
)
{
case
'create'
:
this
.
handleClose
()
break
case
'edit'
:
this
.
editEvent
(
scope
)
break
case
'delete'
:
this
.
deleteEvent
(
scope
.
id
)
break
case
'list'
:
console
.
log
(
'list'
)
break
}
},
// 编辑触发时间
editEvent
(
row
)
{
this
.
dictionaryForm
=
JSON
.
parse
(
JSON
.
stringify
(
row
))
this
.
dictionaryForm
.
enableStatus
=
row
.
enableStatus
==
1
?
true
:
false
this
.
handleClose
()
},
// 删除触发事件
// 删除触发事件
deleteEvent
(
id
)
{
deleteEvent
(
id
)
{
const
that
=
this
const
that
=
this
...
@@ -233,10 +245,16 @@ export default {
...
@@ -233,10 +245,16 @@ export default {
tipTitle
:
'提示'
,
tipTitle
:
'提示'
,
type
:
'error'
,
type
:
'error'
,
callBack
:
()
=>
{
callBack
:
()
=>
{
const
params
=
{
id
:
id
}
deleteDict
(
params
).
then
(
res
=>
{
this
.
$message
({
this
.
$message
({
type
:
'success'
,
type
:
'success'
,
message
:
'删除成功!'
message
:
'删除成功!'
})
})
})
}
}
}
}
this
.
$Common
.
confirmDialog
(
tipData
)
this
.
$Common
.
confirmDialog
(
tipData
)
...
...
src/views/user/index.vue
View file @
c224df3
...
@@ -119,7 +119,7 @@
...
@@ -119,7 +119,7 @@
<
script
>
<
script
>
// import UserService from 'services/user';
// import UserService from 'services/user';
import
{
getUserList
,
getSuperUser
,
addUser
}
from
'services/user'
;
import
{
getUserList
,
getSuperUser
,
addUser
}
from
'services/user'
;
import
OrginizaService
from
'services/orginizaManage'
;
import
OrginizaService
from
'services/orginizaManage'
;
const
orginizaService
=
new
OrginizaService
();
const
orginizaService
=
new
OrginizaService
();
export
default
{
export
default
{
...
@@ -309,7 +309,6 @@ export default {
...
@@ -309,7 +309,6 @@ export default {
methods
:
{
methods
:
{
// 重置搜索条件
// 重置搜索条件
refresh
()
{
refresh
()
{
console
.
log
(
'chognzhi '
)
this
.
searchForm
=
{}
this
.
searchForm
=
{}
},
},
// 确定,新增用户、编辑用户
// 确定,新增用户、编辑用户
...
...
src/views/workLog/index.vue
View file @
c224df3
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<search-form
<search-form
class=
"searchTop border-shadow"
class=
"searchTop border-shadow"
:formModel=
"searchForm"
:formModel=
"searchForm"
:formList=
"
dictionary
FormList"
:formList=
"
worklog
FormList"
>
>
<slot
name=
"form-slot"
>
<slot
name=
"form-slot"
>
<el-button
<el-button
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
type=
"primary"
type=
"primary"
:size=
"btn_size"
:size=
"btn_size"
icon=
"el-icon-refresh"
icon=
"el-icon-refresh"
@
click=
"refresh"
>
重置
</el-button>
>
重置
</el-button>
</slot>
</slot>
</search-form>
</search-form>
...
@@ -24,35 +25,40 @@
...
@@ -24,35 +25,40 @@
<el-button
<el-button
type=
"primary"
type=
"primary"
:size=
"btn_size"
:size=
"btn_size"
icon=
"el-icon-plus"
@
click=
"exportTable"
@
click=
"handleClose"
>
导出
</el-button>
>
新增
</el-button>
</div>
</div>
<basic-table
<basic-table
:tableParams=
"tableParams"
:tableParams=
"tableParams"
:getListApi=
"getListApi"
:getListApi=
"getListApi"
:searchForm=
"searchForm"
:beforeSearchFn=
"beforeSearchFn"
:searchForm=
"searchDataForm"
:hasNum=
"false"
:hasNum=
"false"
>
>
<span
<span
slot=
"status"
slot=
"status"
slot-scope=
"scope"
slot-scope=
"scope"
>
>
<span
class=
"dot green"
></span><span
class=
"statusText"
>
正常
</span>
<span
class=
"statusText"
:class=
"scope.scope.operStatus ? WORKLOGSTATUS[scope.scope.operStatus].split(',')[1] : ''"
>
{{
scope
.
scope
.
operStatus
?
WORKLOGSTATUS
[
scope
.
scope
.
operStatus
].
split
(
','
)[
0
]
:
'--'
}}
</span>
</span>
</span>
</basic-table>
</basic-table>
<basic-dialog
<basic-dialog
:title=
"
dictionary
DialogTitle"
:title=
"
worklog
DialogTitle"
:isVisible=
"
dictionary
Visible"
:isVisible=
"
worklog
Visible"
@
confirmDialog=
"handleConfirm"
@
confirmDialog=
"handleConfirm"
@
closeDialog=
"handleClose"
@
closeDialog=
"handleClose"
>
>
<slot>
<slot>
<rule-form
<rule-form
:ruleForm=
"
dictionary
Form"
:ruleForm=
"
worklog
Form"
:rules=
"
dictionary
Rules"
:rules=
"
worklog
Rules"
:ruleData=
"
dictionary
Data"
:ruleData=
"
worklog
Data"
ref=
'
dictionary
Form'
ref=
'
worklog
Form'
></rule-form>
></rule-form>
</slot>
</slot>
</basic-dialog>
</basic-dialog>
...
@@ -61,15 +67,17 @@
...
@@ -61,15 +67,17 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
getWorkLogList
,
exportWorkLog
}
from
'services/worklog'
;
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
WORKLOGSTATUS
:
this
.
$Constants
.
WORKLOG_STATUS
,
searchForm
:
{},
searchForm
:
{},
dictionaryFormList
:
[
searchDataForm
:
{},
worklogFormList
:
[
{
{
type
:
'input'
,
type
:
'daterange'
,
inputType
:
'text'
,
prop
:
'daterange'
,
prop
:
'name'
,
placeholder
:
'请输入字典名称'
placeholder
:
'请输入字典名称'
}
}
],
],
...
@@ -84,24 +92,22 @@ export default {
...
@@ -84,24 +92,22 @@ export default {
prop
:
'id'
prop
:
'id'
},
{
},
{
label
:
'系统菜单'
,
label
:
'系统菜单'
,
prop
:
'
dictNam
e'
prop
:
'
modul
e'
},
{
},
{
label
:
'操作类型'
,
label
:
'操作类型'
,
prop
:
'
dictType
'
prop
:
'
action
'
},
{
},
{
label
:
'操作账号'
,
label
:
'操作账号'
,
prop
:
'
remark
'
prop
:
'
operatorName
'
},
{
},
{
label
:
'所属组织'
,
label
:
'所属组织'
,
prop
:
'enableStatus'
,
prop
:
'belongOrg'
addHtml
:
'status'
},
{
},
{
label
:
'主机IP'
,
label
:
'主机IP'
,
prop
:
'enableStatus'
,
prop
:
'ip'
,
addHtml
:
'status'
},
{
},
{
label
:
'操作状态'
,
label
:
'操作状态'
,
prop
:
'
enable
Status'
,
prop
:
'
oper
Status'
,
addHtml
:
'status'
addHtml
:
'status'
},
{
},
{
label
:
'创建时间'
,
label
:
'创建时间'
,
...
@@ -109,21 +115,25 @@ export default {
...
@@ -109,21 +115,25 @@ export default {
}
}
]
]
},
},
getListApi
:
null
,
getListApi
:
getWorkLogList
,
// 弹窗
// 弹窗
dictionary
DialogTitle
:
'新增字典'
,
worklog
DialogTitle
:
'新增字典'
,
dictionary
Visible
:
false
,
worklog
Visible
:
false
,
dictionary
Form
:
{},
worklog
Form
:
{},
dictionary
Data
:
[
worklog
Data
:
[
{
label
:
'字典名称:'
,
prop
:
'dictName'
,
type
:
'input'
},
{
label
:
'字典名称:'
,
prop
:
'dictName'
,
type
:
'input'
},
{
label
:
'字典类型'
,
prop
:
'dictType'
,
type
:
'input'
},
{
label
:
'字典类型'
,
prop
:
'dictType'
,
type
:
'input'
},
{
label
:
'状态'
,
prop
:
'enableStatus'
,
type
:
'switch'
},
{
label
:
'状态'
,
prop
:
'enableStatus'
,
type
:
'switch'
},
{
label
:
'备注'
,
prop
:
'remark'
,
type
:
'input'
,
inputText
:
'textarea'
}
{
label
:
'备注'
,
prop
:
'remark'
,
type
:
'input'
,
inputText
:
'textarea'
}
],
],
dictionary
Rules
:
{}
worklog
Rules
:
{}
}
}
},
},
methods
:
{
methods
:
{
refresh
()
{
this
.
searchForm
=
{}
this
.
searchDataForm
=
{}
},
// 按钮事件
// 按钮事件
btnClick
(
pType
,
scope
)
{
btnClick
(
pType
,
scope
)
{
console
.
log
(
pType
,
scope
)
console
.
log
(
pType
,
scope
)
...
@@ -139,10 +149,19 @@ export default {
...
@@ -139,10 +149,19 @@ export default {
break
break
}
}
},
},
beforeSearchFn
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
console
.
log
(
this
.
searchForm
)
if
(
this
.
searchForm
.
daterange
)
this
.
searchDataForm
.
sDate
=
this
.
searchForm
.
daterange
[
0
]
if
(
this
.
searchForm
.
daterange
)
this
.
searchDataForm
.
eDate
=
this
.
searchForm
.
daterange
[
1
]
resolve
()
})
},
// 确定
// 确定
handleConfirm
()
{
handleConfirm
()
{
console
.
log
(
this
.
$refs
.
dictionary
Form
)
console
.
log
(
this
.
$refs
.
worklog
Form
)
this
.
$refs
.
dictionary
Form
.
$children
[
0
].
validate
((
valid
)
=>
{
this
.
$refs
.
worklog
Form
.
$children
[
0
].
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
valid
)
{
this
.
handleClose
()
this
.
handleClose
()
}
else
{
}
else
{
...
@@ -153,10 +172,10 @@ export default {
...
@@ -153,10 +172,10 @@ export default {
// 取消
// 取消
handleClose
(
row
)
{
handleClose
(
row
)
{
console
.
log
(
row
)
console
.
log
(
row
)
if
(
!
this
.
dictionaryVisible
&&
this
.
$refs
.
dictionary
Form
)
{
if
(
!
this
.
worklogVisible
&&
this
.
$refs
.
worklog
Form
)
{
this
.
$refs
.
dictionary
Form
.
$children
[
0
].
resetFields
()
this
.
$refs
.
worklog
Form
.
$children
[
0
].
resetFields
()
}
}
this
.
dictionaryVisible
=
!
this
.
dictionary
Visible
this
.
worklogVisible
=
!
this
.
worklog
Visible
},
},
// 删除触发事件
// 删除触发事件
deleteEvent
(
id
)
{
deleteEvent
(
id
)
{
...
@@ -174,6 +193,12 @@ export default {
...
@@ -174,6 +193,12 @@ export default {
}
}
}
}
this
.
$Common
.
confirmDialog
(
tipData
)
this
.
$Common
.
confirmDialog
(
tipData
)
},
// 导出列表
exportTable
()
{
exportWorkLog
().
then
(
res
=>
{
})
}
}
}
}
}
}
...
...
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