Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
platform
/
fanxing_new
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 87761259
authored
Feb 25, 2020
by
潘建波
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交兼容处理
1 parent
6c1061d5
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
449 additions
and
15 deletions
src/api/codes/index.js
src/api/codes/urls.js
src/router/index.js
src/views/resource/Author/author.vue
src/views/resource/Codes/trfficcodes.vue
src/views/taskManage/index.vue
src/api/codes/index.js
View file @
8776125
...
...
@@ -18,8 +18,8 @@ export default {
eventCates
(
params
)
{
return
api
.
get
(
urls
.
eventCates
,
params
);
},
eventType
(
params
,
event_
typ
e_unid
)
{
return
api
.
get
(
urls
.
eventType
(
event_
typ
e_unid
),
params
);
eventType
(
params
,
event_
cat
e_unid
)
{
return
api
.
get
(
urls
.
eventType
(
event_
cat
e_unid
),
params
);
},
eventTypes
(
params
,
id
)
{
return
api
.
get
(
urls
.
eventTypes
,
params
);
...
...
@@ -32,5 +32,14 @@ export default {
},
deleteEventType
(
params
,
event_unid
)
{
return
api
.
delete
(
urls
.
editEventType
(
event_unid
),
params
);
},
addTrafficCode
(
params
,
cate_unid
)
{
return
api
.
post
(
urls
.
addTrafficCode
(
cate_unid
),
params
);
},
editTrafficCode
(
params
,
cate_unid
,
code_unid
)
{
return
api
.
post
(
urls
.
editTrafficCode
(
cate_unid
,
code_unid
),
params
);
},
deleteTrafficCode
(
params
,
code_unid
)
{
return
api
.
delete
(
urls
.
editTrafficCode
(
cate_unid
,
code_unid
),
params
);
}
};
src/api/codes/urls.js
View file @
8776125
...
...
@@ -6,8 +6,8 @@ export default {
menus
:
baseUrl
+
"/api/v1/auth/apps/0d88c025fafc5ad1189670655597c183/menus"
,
eventCates
:
baseUrl
+
"/api/v1/codes/event_cates"
,
eventTypes
:
baseUrl
+
"/api/v1/codes/event_types"
,
eventType
(
event_
typ
e_unid
)
{
return
`
${
baseUrl
}
/api/v1/codes/event_types?event_cate=
${
event_
typ
e_unid
}
`
;
eventType
(
event_
cat
e_unid
)
{
return
`
${
baseUrl
}
/api/v1/codes/event_types?event_cate=
${
event_
cat
e_unid
}
`
;
},
editEventType
(
event_unid
)
{
return
`
${
baseUrl
}
/api/v1/codes/event_types/
${
event_unid
}
`
;
...
...
src/router/index.js
View file @
8776125
...
...
@@ -170,6 +170,13 @@ export const asyncRouterMap = [
component
:
resolve
=>
require
([
"../views/resource/store_confs.vue"
],
resolve
),
},
{
path
:
"/resource/author"
,
name
:
"授权管理"
,
meta
:
{
icon
:
"el-icon-location"
},
component
:
resolve
=>
require
([
"../views/resource/Author/author.vue"
],
resolve
),
},{
path
:
"/resource/codes"
,
name
:
"字典管理"
,
meta
:
{
...
...
src/views/resource/Author/author.vue
0 → 100644
View file @
8776125
<
template
>
<div
class=
"contentBox"
>
<div
class=
"content"
>
<div>
<span
class=
"selectBox"
>
<el-select
v-model=
"curCateUnid"
placeholder=
"请选择"
@
change=
"cateChange"
:popper-append-to-body=
"false"
>
<el-option
v-for=
"item in catesData"
:key=
"item"
:value=
"item.cate_unid"
:label=
"item.name"
></el-option>
</el-select>
</span>
<span
class=
"addbox"
>
<el-button
type=
"primary"
@
click=
"addcode"
>
添加code
</el-button>
</span>
</div>
<div
class=
"mt10"
>
<el-table
height=
"574"
:data=
"tableData"
stripe
border
style=
"width: 100%"
>
<el-table-column
type=
"index"
align=
"center"
label=
"#"
width=
"40"
></el-table-column>
<el-table-column
align=
"center"
prop=
"code_unid"
label=
"code_unid"
>
</el-table-column>
<el-table-column
prop=
"code"
align=
"center"
label=
"code"
>
</el-table-column>
<el-table-column
align=
"center"
prop=
"name"
label=
"名称"
>
</el-table-column>
<el-table-column
align=
"center"
prop=
"operation"
label=
"操作"
>
<template
slot-scope=
"scope"
>
<el-tooltip
content=
"编辑"
placement=
"bottom"
effect=
"light"
:visible-arrow=
"false"
>
<span
class=
"iconfont icon-xiugai editIcon"
@
click=
"editCode(scope.$index, scope.row)"
></span>
</el-tooltip>
<el-tooltip
content=
"删除"
placement=
"bottom"
effect=
"light"
:visible-arrow=
"false"
>
<span
class=
"iconfont icon-detail delIcon del-btn"
@
click=
"deleteCode(scope.$index, scope.row)"
></span>
</el-tooltip>
</
template
>
</el-table-column>
</el-table>
<div
style=
"margin-top: 28px;"
>
<el-pagination
style=
"float: right;"
background
prev-text=
"上一页"
next-text=
"下一页"
:page-sizes=
"[20, 30, 50, 100, 200]"
layout=
"prev, pager, next,sizes"
:current-page=
"page"
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:total=
"total"
>
</el-pagination>
<div
style=
"clear: both;"
></div>
</div>
</div>
</div>
<el-dialog
title=
"设置CODE"
:visible
.
sync=
"detailVisible"
width=
"400px"
>
<el-form
ref=
"trfficform"
:model=
"codeData"
label-position=
"left"
label-width=
"80px"
>
<el-form-item
label=
"类型"
prop=
"catename"
:rules=
"[
{ required: true, message: '类型不能为空!', trigger: 'blur' }
]"
>
<el-input
v-model=
"codeData.catename"
disabled
></el-input>
</el-form-item>
<el-form-item
label=
"CODE"
prop=
"code"
:rules=
"[
{ required: true, message: 'code不能为空!', trigger: 'blur' }
]"
>
<el-input
v-model=
"codeData.code"
></el-input>
</el-form-item>
<el-form-item
label=
"名称"
prop=
"name"
:rules=
"[
{ required: true, message: '名称不能为空!', trigger: 'blur' }
]"
>
<el-input
v-model=
"codeData.name"
></el-input>
</el-form-item>
<el-form-item
label=
"备注"
prop=
"note"
:rules=
"[
{ required: true, message: '备注名称不能为空!', trigger: 'blur' }
]"
>
<el-input
v-model=
"codeData.name"
></el-input>
</el-form-item>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
size=
"small"
@
click=
"detailVisible = false"
>
取 消
</el-button>
<el-button
size=
"small"
type=
"primary"
@
click=
"saveCode"
>
确 定
</el-button
>
</span>
</el-dialog>
</div>
</template>
<
script
>
export
default
{
data
()
{
return
{
detailData
:
[],
total
:
0
,
page
:
1
,
curCateUnid
:
""
,
pageSize
:
20
,
tableData
:
[],
catesData
:
[],
selectDevs
:
""
,
detailVisible
:
false
,
codeStatus
:
0
,
codeData
:
{}
};
},
components
:
{},
created
()
{
this
.
getCates
();
},
methods
:
{
cateChange
(
cateunid
)
{
let
offset
=
(
this
.
page
-
1
)
*
this
.
pageSize
;
let
obj
=
{
limit
:
this
.
pageSize
,
offset
:
offset
};
this
.
$api
.
codes
.
codes
(
obj
,
cateunid
)
.
then
(
res
=>
{
this
.
tableData
=
res
.
list_data
;
})
.
catch
(
err
=>
{});
},
addcode
()
{
this
.
codeStatus
=
0
;
this
.
detailVisible
=
true
;
this
.
codeData
.
catename
=
this
.
getCateName
(
this
.
curCateUnid
);
},
editCode
(
index
,
row
)
{
this
.
codeStatus
=
1
;
this
.
detailVisible
=
true
;
this
.
codeData
=
row
;
this
.
codeData
.
catename
=
this
.
getCateName
(
this
.
curCateUnid
);
},
getCateName
(
cateunid
)
{
let
name
=
""
;
this
.
catesData
.
forEach
(
ele
=>
{
if
(
ele
.
cate_unid
===
cateunid
)
{
name
=
ele
.
name
;
}
});
return
name
;
},
getCates
()
{
this
.
$api
.
codes
.
cates
().
then
(
res
=>
{
this
.
catesData
=
res
.
list_data
;
});
},
saveCode
()
{
this
.
$refs
[
"trfficform"
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
this
.
editStatus
===
0
)
{
this
.
saveAddCode
();
}
if
(
this
.
editStatus
===
1
)
{
this
.
saveEditCode
();
}
}
else
{
console
.
log
(
"error submit!!"
);
return
false
;
}
});
},
saveAddCode
()
{
this
.
$api
.
codes
.
addTrafficCode
(
this
.
codeData
,
this
.
curCateUnid
)
.
then
(
res
=>
{
console
.
log
(
res
);
});
},
saveEditCode
()
{
this
.
$api
.
codes
.
editTrafficCode
(
this
.
codeData
,
this
.
curCateUnid
,
this
.
codeData
.
code_unid
)
.
then
(
res
=>
{
console
.
log
(
res
);
});
},
deleteCode
(
index
,
row
)
{
this
.
$api
.
codes
.
editTrafficCode
(
row
,
this
.
curCateUnid
,
row
.
code_unid
)
.
then
(
res
=>
{
console
.
log
(
res
);
});
},
handleSizeChange
(
val
)
{
this
.
pageSize
=
val
;
},
handleCurrentChange
(
val
)
{
this
.
page
=
val
;
}
}
};
</
script
>
<
style
lang=
"scss"
scoped
>
.addbox
{
float
:
right
;
margin-right
:
10px
;
}
.code-btn
{
margin-bottom
:
10px
;
float
:
right
;
margin-right
:
10px
;
}
.del-btn
{
padding-left
:
20px
;
}
</
style
>
src/views/resource/Codes/trfficcodes.vue
View file @
8776125
...
...
@@ -4,7 +4,7 @@
<div>
<span
class=
"selectBox"
>
<el-select
v-model=
"
selectDevs
"
v-model=
"
curCateUnid
"
placeholder=
"请选择"
@
change=
"cateChange"
:popper-append-to-body=
"false"
...
...
@@ -18,7 +18,7 @@
</el-select>
</span>
<span
class=
"addbox"
>
<el-button
type=
"primary"
>
添加code
</el-button>
<el-button
type=
"primary"
@
click=
"addcode"
>
添加code
</el-button>
</span>
</div>
<div
class=
"mt10"
>
...
...
@@ -29,13 +29,44 @@
border
style=
"width: 100%"
>
<el-table-column
type=
"index"
align=
"center"
label=
"#"
width=
"40"
></el-table-column>
<el-table-column
type=
"index"
align=
"center"
label=
"#"
width=
"40"
></el-table-column>
<el-table-column
align=
"center"
prop=
"code_unid"
label=
"code_unid"
>
</el-table-column>
<el-table-column
prop=
"code"
align=
"center"
label=
"code"
>
</el-table-column>
<el-table-column
align=
"center"
prop=
"name"
label=
"名称"
>
</el-table-column>
<el-table-column
align=
"center"
prop=
"operation"
label=
"操作"
>
<template
slot-scope=
"scope"
>
<el-tooltip
content=
"编辑"
placement=
"bottom"
effect=
"light"
:visible-arrow=
"false"
>
<span
class=
"iconfont icon-xiugai editIcon"
@
click=
"editCode(scope.$index, scope.row)"
></span>
</el-tooltip>
<el-tooltip
content=
"删除"
placement=
"bottom"
effect=
"light"
:visible-arrow=
"false"
>
<span
class=
"iconfont icon-detail delIcon del-btn"
@
click=
"deleteCode(scope.$index, scope.row)"
></span>
</el-tooltip>
</
template
>
</el-table-column>
</el-table>
<div
style=
"margin-top: 28px;"
>
<el-pagination
...
...
@@ -55,7 +86,56 @@
</div>
</div>
</div>
<el-dialog
title=
"详情"
:visible
.
sync=
"detailVisible"
width=
"20%"
>
<el-dialog
title=
"设置CODE"
:visible
.
sync=
"detailVisible"
width=
"400px"
>
<el-form
ref=
"trfficform"
:model=
"codeData"
label-position=
"left"
label-width=
"80px"
>
<el-form-item
label=
"类型"
prop=
"catename"
:rules=
"[
{ required: true, message: '类型不能为空!', trigger: 'blur' }
]"
>
<el-input
v-model=
"codeData.catename"
disabled
></el-input>
</el-form-item>
<el-form-item
label=
"CODE"
prop=
"code"
:rules=
"[
{ required: true, message: 'code不能为空!', trigger: 'blur' }
]"
>
<el-input
v-model=
"codeData.code"
></el-input>
</el-form-item>
<el-form-item
label=
"名称"
prop=
"name"
:rules=
"[
{ required: true, message: '名称不能为空!', trigger: 'blur' }
]"
>
<el-input
v-model=
"codeData.name"
></el-input>
</el-form-item>
<el-form-item
label=
"备注"
prop=
"note"
:rules=
"[
{ required: true, message: '备注名称不能为空!', trigger: 'blur' }
]"
>
<el-input
v-model=
"codeData.name"
></el-input>
</el-form-item>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
size=
"small"
@
click=
"detailVisible = false"
>
取 消
</el-button>
<el-button
size=
"small"
type=
"primary"
@
click=
"saveCode"
>
确 定
</el-button
>
</span>
</el-dialog>
</div>
</template>
...
...
@@ -66,11 +146,14 @@ export default {
detailData
:
[],
total
:
0
,
page
:
1
,
curCateUnid
:
""
,
pageSize
:
20
,
tableData
:
[],
catesData
:
[],
selectDevs
:
""
,
detailVisible
:
false
detailVisible
:
false
,
codeStatus
:
0
,
codeData
:
{}
};
},
components
:
{},
...
...
@@ -83,7 +166,7 @@ export default {
let
obj
=
{
limit
:
this
.
pageSize
,
offset
:
offset
}
}
;
this
.
$api
.
codes
.
codes
(
obj
,
cateunid
)
.
then
(
res
=>
{
...
...
@@ -91,11 +174,71 @@ export default {
})
.
catch
(
err
=>
{});
},
addcode
()
{
this
.
codeStatus
=
0
;
this
.
detailVisible
=
true
;
this
.
codeData
.
catename
=
this
.
getCateName
(
this
.
curCateUnid
);
},
editCode
(
index
,
row
)
{
this
.
codeStatus
=
1
;
this
.
detailVisible
=
true
;
this
.
codeData
=
row
;
this
.
codeData
.
catename
=
this
.
getCateName
(
this
.
curCateUnid
);
},
getCateName
(
cateunid
)
{
let
name
=
""
;
this
.
catesData
.
forEach
(
ele
=>
{
if
(
ele
.
cate_unid
===
cateunid
)
{
name
=
ele
.
name
;
}
});
return
name
;
},
getCates
()
{
this
.
$api
.
codes
.
cates
().
then
(
res
=>
{
this
.
catesData
=
res
.
list_data
;
});
},
saveCode
()
{
this
.
$refs
[
"trfficform"
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
this
.
editStatus
===
0
)
{
this
.
saveAddCode
();
}
if
(
this
.
editStatus
===
1
)
{
this
.
saveEditCode
();
}
}
else
{
console
.
log
(
"error submit!!"
);
return
false
;
}
});
},
saveAddCode
()
{
this
.
$api
.
codes
.
addTrafficCode
(
this
.
codeData
,
this
.
curCateUnid
)
.
then
(
res
=>
{
console
.
log
(
res
);
});
},
saveEditCode
()
{
this
.
$api
.
codes
.
editTrafficCode
(
this
.
codeData
,
this
.
curCateUnid
,
this
.
codeData
.
code_unid
)
.
then
(
res
=>
{
console
.
log
(
res
);
});
},
deleteCode
(
index
,
row
)
{
this
.
$api
.
codes
.
editTrafficCode
(
row
,
this
.
curCateUnid
,
row
.
code_unid
)
.
then
(
res
=>
{
console
.
log
(
res
);
});
},
handleSizeChange
(
val
)
{
this
.
pageSize
=
val
;
},
...
...
@@ -106,8 +249,16 @@ export default {
};
</
script
>
<
style
lang=
"scss"
scoped
>
.addbox
{
.addbox
{
float
:
right
;
margin-right
:
10px
;
}
.code-btn
{
margin-bottom
:
10px
;
float
:
right
;
margin-right
:
10px
;
}
.del-btn
{
padding-left
:
20px
;
}
</
style
>
src/views/taskManage/index.vue
View file @
8776125
...
...
@@ -532,7 +532,7 @@ export default {
img
{
width
:
40px
;
height
:
40px
;
margin-left
:
1
02px
;
margin-left
:
1
vw
;
}
.textCon
{
margin-right
:
101px
;
...
...
@@ -542,7 +542,7 @@ export default {
img
{
width
:
34px
;
height
:
35px
;
margin-left
:
1
04px
;
margin-left
:
1
vw
;
}
.textCon
{
margin-right
:
184px
;
...
...
@@ -588,7 +588,7 @@ export default {
display
:
inline-block
;
}
.label
{
width
:
7
vw
;
width
:
6
vw
;
text-align
:
center
;
border-left
:
1px
solid
$
border-color
;
background
:
#f0f0f0
;
...
...
@@ -608,7 +608,10 @@ export default {
width
:
4.5vw
;
}
.subtask-info
:nth-child
(
8
)
{
width
:
4.5vw
;
width
:
4vw
;
}
.subtask-info
:nth-child
(
10
)
{
width
:
12vw
;
}
line-height
:
40px
;
border-bottom
:
1px
solid
#f0f0f0
;
...
...
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