main
ihzero 2024-05-09 22:17:37 +08:00
parent c666fc707a
commit b55d4403e3
8 changed files with 85 additions and 33 deletions

File diff suppressed because one or more lines are too long

View File

@ -7,13 +7,23 @@
<div class="text-center"> <div class="text-center">
<div class="text-2xl font-medium">门店总数</div> <div class="text-2xl font-medium">门店总数</div>
<div class="my-5"> <div class="my-5">
<CountTo class="text-2xl" :endVal="deta?.stores_count || 0" /> <!-- <CountTo class="text-2xl" :endVal="deta?.stores_count || 0" /> -->
<div class="flex justify-center space-x-1">
<div class="w-8 h-15 text-4xl font-600 bg-[#0E7CE2] text-white flex justify-center items-center" v-for="(item, i) in arrNum(deta?.stores_count)" :key="i">
{{ item }}
</div>
</div>
</div> </div>
</div> </div>
<div class="text-center"> <div class="text-center">
<div class="text-2xl font-medium">员工总数</div> <div class="text-2xl font-medium">员工总数</div>
<div class="my-5"> <div class="my-5">
<CountTo class="text-2xl" :endVal="deta?.employees_count || 0" /> <!-- <CountTo class="text-2xl" :endVal="deta?.employees_count || 0" /> -->
<div class="flex justify-center space-x-1">
<div class="w-8 h-15 text-4xl font-600 bg-[#0E7CE2] text-white flex justify-center items-center" v-for="(item, i) in arrNum(deta?.employees_count)" :key="i">
{{ item }}
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -22,13 +32,18 @@
<script setup> <script setup>
import CountTo from '@/components/CountTo/index.vue' import CountTo from '@/components/CountTo/index.vue'
import http from '@/utils/request' import http from '@/utils/request'
import { onMounted, ref } from 'vue' import { onMounted, ref, computed } from 'vue'
const deta = ref({}) const deta = ref({})
onMounted(() => { onMounted(() => {
getData() getData()
}) })
const arrNum = (e) => {
return e?.toString()?.split('') ?? []
}
const getData = async () => { const getData = async () => {
const resData = await http.get('/admin-api/api/cockpit/basic') const resData = await http.get('/admin-api/api/cockpit/basic')
deta.value = resData deta.value = resData

View File

@ -35,7 +35,7 @@ const dayList = [
}, },
{ {
value: '180days', value: '180days',
label: '半年', label: '半年',
}, },
{ {
value: '365days', value: '365days',

View File

@ -29,7 +29,8 @@ const getData = async () => {
const convertData = (data) => { const convertData = (data) => {
var geoCoordMap = [] var geoCoordMap = []
chinaMap.features.forEach((item) => { chinaMap.features.forEach((item) => {
geoCoordMap[item.properties.name] = item.properties.center geoCoordMap[item.properties.name] = item.properties.centroid ?? item.properties.center
if(item.properties.name=='河北省' ) console.log(item.properties.centroid)
}) })
var res = [] var res = []
for (var i = 0; i < data.length; i++) { for (var i = 0; i < data.length; i++) {
@ -72,6 +73,20 @@ const chatInit = () => {
show: true, show: true,
color: 'rgb(249, 249, 249)', // color: 'rgb(249, 249, 249)', //
}, },
regions: [
{
name: "南海诸岛",
itemStyle: {
//
normal: {
opacity: 0, // 0
}
},
label: {
show: false //
}
}
],
itemStyle: { itemStyle: {
areaColor: '#24CFF4', areaColor: '#24CFF4',
borderColor: '#53D9FF', borderColor: '#53D9FF',

View File

@ -39,7 +39,7 @@ const dayList = [
}, },
{ {
value: '180days', value: '180days',
label: '半年', label: '半年',
}, },
{ {
value: '365days', value: '365days',
@ -68,7 +68,7 @@ const getData = async () => {
const arr = resData.map((e, i) => { const arr = resData.map((e, i) => {
return [i + 1, e.store.title, e.sales] return [i + 1, e.store.title, e.sales]
}) })
dataList.value = arr.filter((e) => e[2] > 0) dataList.value = arr.splice(0, 15)
chatInit() chatInit()
} }
@ -76,13 +76,10 @@ const chatInit = () => {
__SetOption(dataList.value) __SetOption(dataList.value)
} }
let barWidth = 15 let barWidth = 20
let nameFontColor = '#000' let nameFontColor = '#000'
let nameFontSize = 12 let nameFontSize = 12
let namePosition = [0, -15] let namePosition = [0, -15]
let valueFontColor = '#FFFFFF'
let valueFontSize = 12
let indexNum = 0
function __getColorValue(name, val, index) { function __getColorValue(name, val, index) {
return { return {
@ -109,9 +106,9 @@ function __SetOption(data) {
let option = { let option = {
grid: { grid: {
top: 0, top: '10px',
left: '20px', left: '20px',
right: '3%', right: '30px',
bottom: 0, bottom: 0,
}, },
yAxis: [ yAxis: [
@ -169,6 +166,16 @@ function __SetOption(data) {
}, },
}, },
}, },
{
name: '排行数字',
type: 'bar',
barWidth: barWidth,
data: values,
barGap: '-100%',
animationDuration: 1500,
zlevel: 2,
label:{normal:{show:true, position:"right"}},
},
], ],
} }

View File

@ -40,7 +40,7 @@ const dayList = [
}, },
{ {
value: '180days', value: '180days',
label: '半年', label: '半年',
}, },
{ {
value: '365days', value: '365days',
@ -97,6 +97,7 @@ const chatInit = () => {
color: '#F1F1F3', color: '#F1F1F3',
}, },
left: '6%', left: '6%',
right: '20px',
}, },
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
@ -128,7 +129,18 @@ const chatInit = () => {
{ {
type: 'category', type: 'category',
boundaryGap: false, boundaryGap: false,
axisLabel:{
// interval: 3,
// formatter: function (value,i) {
// const xAxisDataLeg= xAxisData.length
// //32
// if(i===xAxisDataLeg-2){
// return value
// }
// }
},
axisLine: { axisLine: {
lineStyle: { lineStyle: {
color: '#999', color: '#999',
}, },

View File

@ -6,7 +6,7 @@
<div class="h-150 box-shadow"> <div class="h-150 box-shadow">
<Map /> <Map />
</div> </div>
<div class="h-75 box-shadow"> <div class="h-82 box-shadow">
<LotteryTrends /> <LotteryTrends />
</div> </div>
</div> </div>

View File

@ -3,23 +3,26 @@ import vue from '@vitejs/plugin-vue'
import UnoCSS from 'unocss/vite' import UnoCSS from 'unocss/vite'
import { fileURLToPath, URL } from 'node:url' import { fileURLToPath, URL } from 'node:url'
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig({ export default defineConfig(({ mode }) => {
base: '/cockpit/', const base = mode === 'production' ? '/cockpit/' : '/'
plugins: [vue(), UnoCSS()], return {
server:{ base: base,
host: '0.0.0.0', plugins: [vue(), UnoCSS()],
proxy: { server: {
'/api': { host: '0.0.0.0',
target: 'http://store-manage.hmily.club', proxy: {
changeOrigin: true, '/api': {
ws: true, target: 'http://store-manage.hmily.club',
rewrite: (path) => path.replace(/^\/api/, ''), changeOrigin: true,
ws: true,
rewrite: (path) => path.replace(/^\/api/, ''),
}
} }
}
},
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}, },
}, resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
},
},
}
}) })