Commit 70a5719f by 李金轩

完成版

1 parent 21755519
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
node_modules node_modules
/dist /dist
dist.zip dist.zip
label-cloud.zip vion-tools.zip
# local env files # local env files
.env.local .env.local
......
# label-cloud # vion-tools
## Project setup ## Project setup
``` ```
......
{ {
"name": "label-cloud", "name": "vion-tools",
"version": "0.1.0", "version": "0.1.0",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "label-cloud", "name": "vion-tools",
"version": "0.1.0", "version": "0.1.0",
"dependencies": { "dependencies": {
"ant-design-vue": "^2.2.8", "ant-design-vue": "^2.2.8",
{ {
"name": "label-cloud", "name": "vion-tools",
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
......
...@@ -55,5 +55,9 @@ html, body, #app, .el-container { ...@@ -55,5 +55,9 @@ html, body, #app, .el-container {
justify-content: center; justify-content: center;
} }
.flex-horizontal-right {
display: flex;
justify-content: flex-end;
}
</style> </style>
...@@ -15,7 +15,7 @@ axiosInstance.interceptors.request.use( ...@@ -15,7 +15,7 @@ axiosInstance.interceptors.request.use(
config => { config => {
if (['localhost', '192.168.1.104'].includes(window.location.hostname)) 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 else
{ {
......
...@@ -81,6 +81,9 @@ ...@@ -81,6 +81,9 @@
</a-form-item> </a-form-item>
</a-form> </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"> <a-table :dataSource="dataList" v-loading="isLoading" :columns="columns" :pagination="false">
<template #status="{ text }"> <template #status="{ text }">
<span :class="getClass(text)">{{ text }}</span> <span :class="getClass(text)">{{ text }}</span>
...@@ -158,9 +161,11 @@ const columns = [ ...@@ -158,9 +161,11 @@ const columns = [
export default { export default {
setup() { setup() {
// scalar
const isLoading = ref(false) const isLoading = ref(false)
const resultList = ref([]) const isSuspended = ref(false)
// sequence // sequence
const resultList = ref([])
const accountList = ref([]) const accountList = ref([])
const plazaList = ref([]) const plazaList = ref([])
const zoneList = ref([]) const zoneList = ref([])
...@@ -289,62 +294,18 @@ export default { ...@@ -289,62 +294,18 @@ export default {
return formatNum >= 100 ? 100 : formatNum 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() { const preview = async function() {
isLoading.value = true isLoading.value = true
isSuspended.value = false
dataList.value = [] dataList.value = []
const rawData = toRaw(queryForm) const rawData = toRaw(queryForm)
for (const channelId of rawData.channel_id) for (const channelId of rawData.channel_id)
{ {
if (isSuspended.value === true)
{
isLoading.value = false
return
}
const data = filterEmptyValueInObject( const data = filterEmptyValueInObject(
{ {
channelSerialnum: channelId, channelSerialnum: channelId,
...@@ -358,6 +319,7 @@ export default { ...@@ -358,6 +319,7 @@ export default {
) )
const r = await dataRepairApi.preview(data) const r = await dataRepairApi.preview(data)
if (r.msg_code === 200) if (r.msg_code === 200)
{ {
r.data.status = '已修复' r.data.status = '已修复'
...@@ -369,14 +331,21 @@ export default { ...@@ -369,14 +331,21 @@ export default {
dataList.value.push(r.data) dataList.value.push(r.data)
} }
isLoading.value = false isLoading.value = false
isSuspended.value = false
} }
const repair = async function() { const repair = async function() {
isLoading.value = true isLoading.value = true
isSuspended.value = true
dataList.value = [] dataList.value = []
const rawData = toRaw(queryForm) const rawData = toRaw(queryForm)
for (const channelId of rawData.channel_id) for (const channelId of rawData.channel_id)
{ {
if (isSuspended.value === true)
{
isLoading.value = false
return
}
const data = filterEmptyValueInObject( const data = filterEmptyValueInObject(
{ {
channelSerialnum: channelId, channelSerialnum: channelId,
...@@ -401,6 +370,7 @@ export default { ...@@ -401,6 +370,7 @@ export default {
dataList.value.push(r.data) dataList.value.push(r.data)
} }
isLoading.value = false isLoading.value = false
isSuspended.value = false
} }
const getClass = function(text) { const getClass = function(text) {
...@@ -431,6 +401,13 @@ export default { ...@@ -431,6 +401,13 @@ export default {
) )
} }
const suspendRepair = function() {
if (isLoading.value === true)
{
isSuspended.value = true
}
}
const __main = function() { const __main = function() {
getAccountList() getAccountList()
} }
...@@ -458,6 +435,7 @@ export default { ...@@ -458,6 +435,7 @@ export default {
repair, repair,
getClass, getClass,
deleteRecord, deleteRecord,
suspendRepair,
} }
} }
} }
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item label="数据:"> <a-form-item label="数据类型:">
<a-select v-model:value="queryForm.scheduleTypeList" <a-select v-model:value="queryForm.scheduleTypeList"
style="width: 200px" style="width: 200px"
mode="multiple" mode="multiple"
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<el-main style="padding: 0"> <el-main style="padding: 0">
<el-container> <el-container>
<el-aside style="background: black" width="190px"> <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'"> <a-menu-item :key="'/Main/DataRerun'">
<span>数据重跑</span> <span>数据重跑</span>
</a-menu-item> </a-menu-item>
...@@ -50,15 +50,17 @@ ...@@ -50,15 +50,17 @@
</el-container> </el-container>
</template> </template>
<script> <script>
import {defineComponent, ref} from 'vue' import {defineComponent, getCurrentInstance, ref} from 'vue'
import {useRouter} from 'vue-router' import {useRouter} from 'vue-router'
import moment from "moment" import moment from "moment"
export default defineComponent({ export default defineComponent({
setup() { setup() {
const {proxy} = getCurrentInstance()
const selectedKeys = ref([proxy.$root.$route.path])
const router = useRouter() const router = useRouter()
const currentTime = ref(moment().format("YYYY-MM-DD HH:mm:ss")) const currentTime = ref(moment().format("YYYY-MM-DD HH:mm:ss"))
const goto = function(path) { const goto = function(path) {
router.push(path) router.push(path)
} }
...@@ -110,6 +112,7 @@ export default defineComponent({ ...@@ -110,6 +112,7 @@ export default defineComponent({
return { return {
// scalar // scalar
currentTime, currentTime,
selectedKeys,
// sequence // sequence
// mapping // mapping
// function // function
......
<template> <template>
<a-table :columns="columns" :data-source="data"> <div style="width: 256px">
<template #name="{ text }"> <a-button type="primary" @click="toggleCollapsed" style="margin-bottom: 16px">
<a>{{ text }}</a> <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> </template>
<template #customTitle> <span>Option 1</span>
<span> </a-menu-item>
<smile-outlined/> <a-menu-item key="2">
Name <template #icon>
</span> <DesktopOutlined/>
</template> </template>
<template #tags="{ text: tags }"> <span>Option 2</span>
<span> </a-menu-item>
<a-tag <a-menu-item key="3">
v-for="tag in tags" <template #icon>
:key="tag" <InboxOutlined/>
:color="tag === 'loser' ? 'volcano' : tag.length > 5 ? 'geekblue' : 'green'" </template>
> <span>Option 3</span>
{{ tag.toUpperCase() }} </a-menu-item>
</a-tag> <a-sub-menu key="sub1">
</span> <template #icon>
<MailOutlined/>
</template> </template>
<template #action="{ record }"> <template #title>Navigation One</template>
<span> <a-menu-item key="5">Option 5</a-menu-item>
<a>Invite 一 {{ record.name }}</a> <a-menu-item key="6">Option 6</a-menu-item>
<a-divider type="vertical"/> <a-menu-item key="7">Option 7</a-menu-item>
<a>Delete</a> <a-menu-item key="8">Option 8</a-menu-item>
<a-divider type="vertical"/> </a-sub-menu>
<a class="ant-dropdown-link"> <a-sub-menu key="sub2">
More actions <template #icon>
<down-outlined/> <AppstoreOutlined/>
</a>
</span>
</template> </template>
</a-table> <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> </template>
<script> <script>
import {SmileOutlined, DownOutlined} from '@ant-design/icons-vue' import {defineComponent, reactive, toRefs, watch} from 'vue'
import {defineComponent} 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({ export default defineComponent({
setup() { setup() {
return { const state = reactive({
data, collapsed: false,
columns, 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: { components: {
SmileOutlined, MenuFoldOutlined,
DownOutlined, MenuUnfoldOutlined,
PieChartOutlined,
MailOutlined,
DesktopOutlined,
InboxOutlined,
AppstoreOutlined,
}, },
}) })
</script> </script>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!