添加调色盘

This commit is contained in:
aa
2022-10-11 19:18:56 +08:00
parent f867ebfb33
commit 7752d9465d
2 changed files with 25 additions and 1 deletions

View File

@@ -3,7 +3,18 @@
<q-header elevated height-hint="98">
<q-toolbar class="text-white" style="background-color: rgb(210,61,42)">
<q-toolbar-title> RmEye测试版v1.0.1.3 </q-toolbar-title>
<q-btn flat round dense icon="lightbulb"></q-btn>
<q-btn flat round dense icon="lightbulb">
<q-popup-proxy>
<q-banner>
<div class="q-pa-md row items-start q-gutter-md">
<q-color v-model="color1" @change="updateCookie" class="my-picker" />
<q-color v-model="color2" @change="updateCookie" class="my-picker" />
<q-color v-model="color3" @change="updateCookie" class="my-picker" />
<q-color v-model="color4" @change="updateCookie" class="my-picker" />
</div>
</q-banner>
</q-popup-proxy>
</q-btn>
</q-toolbar>
<q-toolbar style="font-size: 16px;background-color:rgb(47,43,48);">
<q-breadcrumbs active-color="white">
@@ -34,6 +45,7 @@ import {
} from 'vue'
import HtmlPanel from '../components/Html.vue' // 根据实际路径导入
import axios from 'axios'
import { Cookies } from 'quasar'
export default defineComponent({
components: {
HtmlPanel
@@ -53,6 +65,9 @@ export default defineComponent({
}
},
methods: {
updateCookie (value) {
Cookies.set('color', { color: [this.color1, this.color2, this.color3, this.color4] })
},
routerToWhiteList () {
this.isInPlugin = false
this.$router.push({

View File

@@ -54,6 +54,7 @@ import {
defineComponent
} from 'vue'
import axios from 'axios'
import { Cookies } from 'quasar'
import * as echarts from 'echarts'
export default defineComponent({
name: 'Dashboard',
@@ -190,6 +191,14 @@ export default defineComponent({
setInterval(() => {
this.get_threatStatistics()
}, 10000)
const colors = Cookies.get('color')
if (colors.color) {
this.Threatitems.map((item, index) => {
item.color1 = colors.color[index]
item.color2 = colors.color[index]
return item
})
}
}
})
</script>