Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
罗鑫霖
/
vion-tools
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 70a5719f
authored
Jan 26, 2022
by
李金轩
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
完成版
1 parent
21755519
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
134 additions
and
160 deletions
.gitignore
README.md
package-lock.json
package.json
src/App.vue
src/Request/PublicAxiosInstance.js
src/views/DataRepair/DataRepair.vue
src/views/DataRerun/DataRerun.vue
src/views/Main/Main.vue
src/views/Test/Test.vue
.gitignore
View file @
70a5719
...
...
@@ -2,7 +2,7 @@
node_modules
/dist
dist.zip
label-cloud
.zip
vion-tools
.zip
# local env files
.env.local
...
...
README.md
View file @
70a5719
#
label-cloud
#
vion-tools
## Project setup
```
...
...
package-lock.json
View file @
70a5719
{
"name"
:
"
label-cloud
"
,
"name"
:
"
vion-tools
"
,
"version"
:
"0.1.0"
,
"lockfileVersion"
:
2
,
"requires"
:
true
,
"packages"
:
{
""
:
{
"name"
:
"
label-cloud
"
,
"name"
:
"
vion-tools
"
,
"version"
:
"0.1.0"
,
"dependencies"
:
{
"ant-design-vue"
:
"^2.2.8"
,
package.json
View file @
70a5719
{
"name"
:
"
label-cloud
"
,
"name"
:
"
vion-tools
"
,
"version"
:
"0.1.0"
,
"private"
:
true
,
"scripts"
:
{
...
...
src/App.vue
View file @
70a5719
...
...
@@ -55,5 +55,9 @@ html, body, #app, .el-container {
justify-content
:
center
;
}
.flex-horizontal-right
{
display
:
flex
;
justify-content
:
flex-end
;
}
</
style
>
src/Request/PublicAxiosInstance.js
View file @
70a5719
...
...
@@ -15,7 +15,7 @@ axiosInstance.interceptors.request.use(
config
=>
{
if
([
'localhost'
,
'192.168.1.104'
].
includes
(
window
.
location
.
hostname
))
{
config
.
headers
.
Authorization
=
'
6196e80b-a10d-4318-b669-50e96b52b042
'
config
.
headers
.
Authorization
=
'
5607a210-f2fc-414f-bb21-a469da68530a
'
}
else
{
...
...
src/views/DataRepair/DataRepair.vue
View file @
70a5719
...
...
@@ -81,6 +81,9 @@
</a-form-item>
</a-form>
<div
style=
"display:flex; justify-content: flex-end;padding: 3px"
>
<a-button
@
click=
"suspendRepair"
type=
"primary"
>
暂停修复
</a-button>
</div>
<a-table
:dataSource=
"dataList"
v-loading=
"isLoading"
:columns=
"columns"
:pagination=
"false"
>
<template
#
status=
"
{ text }">
<span
:class=
"getClass(text)"
>
{{
text
}}
</span>
...
...
@@ -158,9 +161,11 @@ const columns = [
export
default
{
setup
()
{
// scalar
const
isLoading
=
ref
(
false
)
const
resultList
=
ref
([]
)
const
isSuspended
=
ref
(
false
)
// sequence
const
resultList
=
ref
([])
const
accountList
=
ref
([])
const
plazaList
=
ref
([])
const
zoneList
=
ref
([])
...
...
@@ -289,62 +294,18 @@ export default {
return
formatNum
>=
100
?
100
:
formatNum
}
const
dealMessage
=
function
(
message
)
{
// scheduleType
const
{
dates
,
mallIds
,
mallNames
,
status
,
stepCount
,
scheduleType
,
counter
}
=
message
let
resObj
=
{}
resObj
.
dates
=
dates
resObj
.
mallIds
=
mallIds
resObj
.
mallNames
=
mallNames
resObj
.
status
=
status
resObj
.
progress
=
floatToPercent
(
stepCount
)
resObj
.
totalNum
=
0
resObj
.
totalPage
=
0
resObj
.
current
=
0
resObj
.
curPageSize
=
0
resObj
.
currentPage
=
0
resObj
.
scheduleType
=
scheduleType
if
(
counter
)
{
// dataNum dateMallNum step totalData totalDate totalMall totalMallDateProduct allDataCount
resObj
.
totalNum
=
counter
.
allDataCount
resObj
.
totalPage
=
counter
.
totalMallDateProduct
resObj
.
current
=
counter
.
dataNum
resObj
.
curPageSize
=
counter
.
totalData
resObj
.
currentPage
=
counter
.
dateMallNum
}
if
(
resultList
.
value
.
length
)
{
const
isSameScheduleType
=
resultList
.
value
.
some
(
item
=>
item
.
scheduleType
===
scheduleType
)
isSameScheduleType
?
resultList
.
value
.
forEach
(
item
=>
{
//
item
.
progress
=
floatToPercent
(
stepCount
)
if
(
counter
)
{
item
.
totalNum
=
counter
.
allDataCount
item
.
totalPage
=
counter
.
totalMallDateProduct
item
.
current
=
counter
.
dataNum
item
.
curPageSize
=
counter
.
totalData
item
.
currentPage
=
counter
.
dateMallNum
}
})
:
resultList
.
value
.
push
(
resObj
)
resObj
=
{}
}
else
{
resultList
.
value
.
push
(
resObj
)
resObj
=
{}
}
}
const
preview
=
async
function
()
{
isLoading
.
value
=
true
isSuspended
.
value
=
false
dataList
.
value
=
[]
const
rawData
=
toRaw
(
queryForm
)
for
(
const
channelId
of
rawData
.
channel_id
)
{
if
(
isSuspended
.
value
===
true
)
{
isLoading
.
value
=
false
return
}
const
data
=
filterEmptyValueInObject
(
{
channelSerialnum
:
channelId
,
...
...
@@ -358,6 +319,7 @@ export default {
)
const
r
=
await
dataRepairApi
.
preview
(
data
)
if
(
r
.
msg_code
===
200
)
{
r
.
data
.
status
=
'已修复'
...
...
@@ -369,14 +331,21 @@ export default {
dataList
.
value
.
push
(
r
.
data
)
}
isLoading
.
value
=
false
isSuspended
.
value
=
false
}
const
repair
=
async
function
()
{
isLoading
.
value
=
true
isSuspended
.
value
=
true
dataList
.
value
=
[]
const
rawData
=
toRaw
(
queryForm
)
for
(
const
channelId
of
rawData
.
channel_id
)
{
if
(
isSuspended
.
value
===
true
)
{
isLoading
.
value
=
false
return
}
const
data
=
filterEmptyValueInObject
(
{
channelSerialnum
:
channelId
,
...
...
@@ -401,6 +370,7 @@ export default {
dataList
.
value
.
push
(
r
.
data
)
}
isLoading
.
value
=
false
isSuspended
.
value
=
false
}
const
getClass
=
function
(
text
)
{
...
...
@@ -431,6 +401,13 @@ export default {
)
}
const
suspendRepair
=
function
()
{
if
(
isLoading
.
value
===
true
)
{
isSuspended
.
value
=
true
}
}
const
__main
=
function
()
{
getAccountList
()
}
...
...
@@ -458,6 +435,7 @@ export default {
repair
,
getClass
,
deleteRecord
,
suspendRepair
,
}
}
}
...
...
src/views/DataRerun/DataRerun.vue
View file @
70a5719
...
...
@@ -28,7 +28,7 @@
</a-select-option>
</a-select>
</a-form-item>
<a-form-item
label=
"数据:"
>
<a-form-item
label=
"数据
类型
:"
>
<a-select
v-model:value=
"queryForm.scheduleTypeList"
style=
"width: 200px"
mode=
"multiple"
...
...
src/views/Main/Main.vue
View file @
70a5719
...
...
@@ -18,7 +18,7 @@
<el-main
style=
"padding: 0"
>
<el-container>
<el-aside
style=
"background: black"
width=
"190px"
>
<a-menu
mode=
"inline"
theme=
"dark"
@
click=
"onClick"
>
<a-menu
mode=
"inline"
theme=
"dark"
v-model:selectedKeys=
"selectedKeys"
@
click=
"onClick"
>
<a-menu-item
:key=
"'/Main/DataRerun'"
>
<span>
数据重跑
</span>
</a-menu-item>
...
...
@@ -50,15 +50,17 @@
</el-container>
</
template
>
<
script
>
import
{
defineComponent
,
ref
}
from
'vue'
import
{
defineComponent
,
getCurrentInstance
,
ref
}
from
'vue'
import
{
useRouter
}
from
'vue-router'
import
moment
from
"moment"
export
default
defineComponent
({
setup
()
{
const
{
proxy
}
=
getCurrentInstance
()
const
selectedKeys
=
ref
([
proxy
.
$root
.
$route
.
path
])
const
router
=
useRouter
()
const
currentTime
=
ref
(
moment
().
format
(
"YYYY-MM-DD HH:mm:ss"
))
const
goto
=
function
(
path
)
{
router
.
push
(
path
)
}
...
...
@@ -110,6 +112,7 @@ export default defineComponent({
return
{
// scalar
currentTime
,
selectedKeys
,
// sequence
// mapping
// function
...
...
src/views/Test/Test.vue
View file @
70a5719
<
template
>
<a-table
:columns=
"columns"
:data-source=
"data"
>
<template
#
name=
"
{ text }">
<a>
{{
text
}}
</a>
</
template
>
<
template
#
customTitle
>
<span>
<smile-outlined/>
Name
</span>
</
template
>
<
template
#
tags=
"{ text: tags }"
>
<span>
<a-tag
v-for=
"tag in tags"
:key=
"tag"
:color=
"tag === 'loser' ? 'volcano' : tag.length > 5 ? 'geekblue' : 'green'"
>
{{
tag
.
toUpperCase
()
}}
</a-tag>
</span>
</
template
>
<
template
#
action=
"{ record }"
>
<span>
<a>
Invite 一
{{
record
.
name
}}
</a>
<a-divider
type=
"vertical"
/>
<a>
Delete
</a>
<a-divider
type=
"vertical"
/>
<a
class=
"ant-dropdown-link"
>
More actions
<down-outlined/>
</a>
</span>
</
template
>
</a-table>
<div
style=
"width: 256px"
>
<a-button
type=
"primary"
@
click=
"toggleCollapsed"
style=
"margin-bottom: 16px"
>
<MenuUnfoldOutlined
v-if=
"collapsed"
/>
<MenuFoldOutlined
v-else
/>
</a-button>
<a-menu
mode=
"inline"
theme=
"dark"
:inline-collapsed=
"collapsed"
v-model:selectedKeys=
"selectedKeys"
>
<a-menu-item
key=
"1"
>
<template
#
icon
>
<PieChartOutlined/>
</
template
>
<span>
Option 1
</span>
</a-menu-item>
<a-menu-item
key=
"2"
>
<
template
#
icon
>
<DesktopOutlined/>
</
template
>
<span>
Option 2
</span>
</a-menu-item>
<a-menu-item
key=
"3"
>
<
template
#
icon
>
<InboxOutlined/>
</
template
>
<span>
Option 3
</span>
</a-menu-item>
<a-sub-menu
key=
"sub1"
>
<
template
#
icon
>
<MailOutlined/>
</
template
>
<
template
#
title
>
Navigation One
</
template
>
<a-menu-item
key=
"5"
>
Option 5
</a-menu-item>
<a-menu-item
key=
"6"
>
Option 6
</a-menu-item>
<a-menu-item
key=
"7"
>
Option 7
</a-menu-item>
<a-menu-item
key=
"8"
>
Option 8
</a-menu-item>
</a-sub-menu>
<a-sub-menu
key=
"sub2"
>
<
template
#
icon
>
<AppstoreOutlined/>
</
template
>
<
template
#
title
>
Navigation Two
</
template
>
<a-menu-item
key=
"9"
>
Option 9
</a-menu-item>
<a-menu-item
key=
"10"
>
Option 10
</a-menu-item>
<a-sub-menu
key=
"sub3"
title=
"Submenu"
>
<a-menu-item
key=
"11"
>
Option 11
</a-menu-item>
<a-menu-item
key=
"12"
>
Option 12
</a-menu-item>
</a-sub-menu>
</a-sub-menu>
</a-menu>
</div>
</template>
<
script
>
import
{
SmileOutlined
,
DownOutlined
}
from
'@ant-design/icons-vue'
import
{
defineComponent
}
from
'vue'
import
{
defineComponent
,
reactive
,
toRefs
,
watch
}
from
'vue'
import
{
MenuFoldOutlined
,
MenuUnfoldOutlined
,
PieChartOutlined
,
MailOutlined
,
DesktopOutlined
,
InboxOutlined
,
AppstoreOutlined
,
}
from
'@ant-design/icons-vue'
const
columns
=
[
{
dataIndex
:
'name'
,
key
:
'name'
,
slots
:
{
title
:
'customTitle'
,
customRender
:
'name'
,
},
},
{
title
:
'Age'
,
dataIndex
:
'age'
,
key
:
'age'
,
},
{
title
:
'Address'
,
dataIndex
:
'address'
,
key
:
'address'
,
},
{
title
:
'Tags'
,
key
:
'tags'
,
dataIndex
:
'tags'
,
slots
:
{
customRender
:
'tags'
,
},
},
{
title
:
'Action'
,
key
:
'action'
,
slots
:
{
customRender
:
'action'
,
},
},
]
const
data
=
[
{
key
:
'1'
,
name
:
'John Brown'
,
age
:
32
,
address
:
'New York No. 1 Lake Park'
,
tags
:
[
'nice'
,
'developer'
],
},
{
key
:
'2'
,
name
:
'Jim Green'
,
age
:
42
,
address
:
'London No. 1 Lake Park'
,
tags
:
[
'loser'
],
},
{
key
:
'3'
,
name
:
'Joe Black'
,
age
:
32
,
address
:
'Sidney No. 1 Lake Park'
,
tags
:
[
'cool'
,
'teacher'
],
},
]
export
default
defineComponent
({
setup
()
{
return
{
data
,
columns
,
const
state
=
reactive
({
collapsed
:
false
,
selectedKeys
:
[
'1'
],
openKeys
:
[
'sub1'
],
preOpenKeys
:
[
'sub1'
],
})
watch
(
()
=>
state
.
openKeys
,
(
val
,
oldVal
)
=>
{
state
.
preOpenKeys
=
oldVal
},
)
const
toggleCollapsed
=
()
=>
{
state
.
collapsed
=
!
state
.
collapsed
state
.
openKeys
=
state
.
collapsed
?
[]
:
state
.
preOpenKeys
}
return
{...
toRefs
(
state
),
toggleCollapsed
}
},
components
:
{
SmileOutlined
,
DownOutlined
,
MenuFoldOutlined
,
MenuUnfoldOutlined
,
PieChartOutlined
,
MailOutlined
,
DesktopOutlined
,
InboxOutlined
,
AppstoreOutlined
,
},
})
</
script
>
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