fix: 修复 app 部分问题

This commit is contained in:
@changcode
2022-07-22 18:10:42 +08:00
parent c64adbdd8d
commit 479ccb71ea
3 changed files with 24 additions and 27 deletions

View File

@@ -155,6 +155,9 @@
font-size: 12px; font-size: 12px;
color: #353636; color: #353636;
font-weight: 400; font-weight: 400;
div:nth-of-type(1) {
margin-right: 5px;
}
} }
.chart__drawing { .chart__drawing {
flex: 1; flex: 1;
@@ -249,7 +252,7 @@
overflow: auto; overflow: auto;
display: grid; display: grid;
grid-template-rows: repeat(auto-fill, 120px); grid-template-rows: repeat(auto-fill, 120px);
grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
grid-gap: 20px; grid-gap: 20px;
&::-webkit-scrollbar-thumb { &::-webkit-scrollbar-thumb {

View File

@@ -609,36 +609,49 @@ export default {
}, },
addApp () { addApp () {
this.showAddApp = true this.showAddApp = true
this.searcherApp = ''
const letter = 'abcdefghijklmnopqrstuvwxyz' const letter = 'abcdefghijklmnopqrstuvwxyz'
const appOptions = []
const providerOptions = []
for (let i = 0; i < 100; i++) { for (let i = 0; i < 100; i++) {
this.appOptions.push({ appOptions.push({
name: letter[i % 26] + i, name: letter[i % 26] + i,
desc: 'this is a really nice app', desc: 'this is a really nice app',
appShow: false appShow: false
}) })
this.providerOptions.push({ providerOptions.push({
name: letter[i % 26] + i, name: letter[i % 26] + i,
desc: 'this is a really nice provider', desc: 'this is a really nice provider',
provideShow: false provideShow: false
}) })
} }
this.appOptions = appOptions
this.providerOptions = providerOptions
this.initialAppOptionsData = this.appOptions this.initialAppOptionsData = this.appOptions
this.initialProviderOptionsData = this.providerOptions this.initialProviderOptionsData = this.providerOptions
}, },
cancelApp () { cancelApp () {
this.showAddApp = false this.showAddApp = false
}, },
appTypeTabChange () { appTypeTabChange (val) {
this.appShowTypeTab = val.index
this.searcherApp = '' this.searcherApp = ''
this.searcherAppChange(this.searcherApp)
}, },
searcherAppChange (val) { searcherAppChange (val) {
if (val) { if (val) {
if (this.appShowTypeTab == 0) {
this.providerOptions = this.initialProviderOptionsData.filter(t => t.name.indexOf(val) > -1) this.providerOptions = this.initialProviderOptionsData.filter(t => t.name.indexOf(val) > -1)
} else if (this.appShowTypeTab == 1) {
this.appOptions = this.initialAppOptionsData.filter(t => t.name.indexOf(val) > -1) this.appOptions = this.initialAppOptionsData.filter(t => t.name.indexOf(val) > -1)
}
} else { } else {
if (this.appShowTypeTab == 0) {
this.providerOptions = this.initialProviderOptionsData this.providerOptions = this.initialProviderOptionsData
} else if (this.appShowTypeTab == 1) {
this.appOptions = this.initialAppOptionsData this.appOptions = this.initialAppOptionsData
} }
}
}, },
appCheckedChange (app, num) { appCheckedChange (app, num) {
if (num === 0) { if (num === 0) {

View File

@@ -203,22 +203,3 @@ export const appListChartOption = {
} }
] ]
} }
function symbolSizeSortChange (index, time) {
const totalData = stackedLineChartOption.series[0].data.find(t => t[0] === time) // [time, value]
const inboundData = stackedLineChartOption.series[1].data.find(t => t[0] === time)
const outboundData = stackedLineChartOption.series[2].data.find(t => t[0] === time)
const internalData = stackedLineChartOption.series[3].data.find(t => t[0] === time)
const throughData = stackedLineChartOption.series[4].data.find(t => t[0] === time)
const otherData = stackedLineChartOption.series[5].data.find(t => t[0] === time)
totalData[2] = 0
inboundData[2] = 1
outboundData[2] = 2
internalData[2] = 3
throughData[2] = 4
otherData[2] = 5
const dataIntegrationArray = [totalData, inboundData, outboundData, internalData, throughData, otherData]
dataIntegrationArray.sort((a, b) => { return a[1] - b[1] })
const sortIndex = dataIntegrationArray.findIndex(a => a[2] === index)
return sizes[sortIndex]
}