Commit becf1302 authored by 郭铭瑶's avatar 郭铭瑶 🤘

使用cdn修复组件展示环境,调整页面

parent 92a6b586
...@@ -13,7 +13,6 @@ import typescript from '@rollup/plugin-typescript' ...@@ -13,7 +13,6 @@ import typescript from '@rollup/plugin-typescript'
import minimist from 'minimist' import minimist from 'minimist'
import image from '@rollup/plugin-image' import image from '@rollup/plugin-image'
// Get browserslist config and remove ie from es build targets
const esbrowserslist = fs const esbrowserslist = fs
.readFileSync('./.browserslistrc') .readFileSync('./.browserslistrc')
.toString() .toString()
...@@ -51,37 +50,6 @@ const baseConfig = { ...@@ -51,37 +50,6 @@ const baseConfig = {
extensions: ['.js', '.jsx', '.ts', '.tsx', '.vue'], extensions: ['.js', '.jsx', '.ts', '.tsx', '.vue'],
}), }),
PostCSS(), PostCSS(),
// Process only `<style module>` blocks.
// PostCSS({
// modules: {
// generateScopedName: '[local]___[hash:base64:5]',
// },
// include: /&module=.*\.stylus$/,
// }),
// Process all `<style>` blocks except `<style module>`.
// PostCSS({
// include: /(?<!&module=.*)\.stylus$/,
// plugins: [
// postcssImport({
// resolve(id, basedir) {
// // // resolve alias @css, @import '@css/style.css'
// // // because @css/ has 5 chars
// // if (id.startsWith("@css")) {
// // return path.resolve("./src/assets/styles/css", id.slice(5));
// // }
// // // resolve node_modules, @import '~normalize.css/normalize.css'
// // // similar to how css-loader's handling of node_modules
// // if (id.startsWith("~")) {
// // return path.resolve("./node_modules", id.slice(1));
// // }
// // resolve relative path, @import './components/style.css'
// return path.resolve(basedir, id)
// },
// }),
// ],
// }),
commonjs(), commonjs(),
], ],
babel: { babel: {
...@@ -112,36 +80,7 @@ const globals = { ...@@ -112,36 +80,7 @@ const globals = {
// Customize configs for individual targets // Customize configs for individual targets
const buildFormats = [] const buildFormats = []
const webConfig = { if (argv.format && argv.format === 'es') {
...baseConfig,
input: 'dev/serve.ts',
output: {
file: 'dist/component-lib.web.js',
},
plugins: [
image(),
replace(baseConfig.plugins.replace),
...baseConfig.plugins.preVue,
vue(baseConfig.plugins.vue),
...baseConfig.plugins.postVue,
typescript(),
babel({
...baseConfig.plugins.babel,
presets: [
[
'@babel/preset-env',
{
...babelPresetEnvConfig,
targets: esbrowserslist,
},
],
],
}),
],
}
buildFormats.push(webConfig)
if (!argv.format || argv.format === 'es') {
const esConfig = { const esConfig = {
...baseConfig, ...baseConfig,
input: 'src/entry.esm.ts', input: 'src/entry.esm.ts',
...@@ -182,14 +121,14 @@ if (!argv.format || argv.format === 'es') { ...@@ -182,14 +121,14 @@ if (!argv.format || argv.format === 'es') {
buildFormats.push(esConfig) buildFormats.push(esConfig)
} }
if (!argv.format || argv.format === 'cjs') { if (argv.format && argv.format === 'iife') {
const umdConfig = { const unpkgConfig = {
...baseConfig, ...baseConfig,
external, external,
output: { output: {
compact: true, compact: true,
file: 'dist/component-lib.ssr.js', file: 'dist/component-lib.min.js',
format: 'cjs', format: 'iife',
name: 'ComponentLib', name: 'ComponentLib',
exports: 'auto', exports: 'auto',
globals, globals,
...@@ -201,22 +140,27 @@ if (!argv.format || argv.format === 'cjs') { ...@@ -201,22 +140,27 @@ if (!argv.format || argv.format === 'cjs') {
vue(baseConfig.plugins.vue), vue(baseConfig.plugins.vue),
...baseConfig.plugins.postVue, ...baseConfig.plugins.postVue,
babel(baseConfig.plugins.babel), babel(baseConfig.plugins.babel),
terser({
output: {
ecma: 5,
},
}),
], ],
} }
buildFormats.push(umdConfig) buildFormats.push(unpkgConfig)
addWebConfig()
} }
if (!argv.format || argv.format === 'iife') { function addWebConfig() {
const unpkgConfig = { const webConfig = {
...baseConfig, input: 'dev/serve.ts',
external, external: ['axios', 'qs'],
output: { output: {
compact: true, file: 'dist/component-lib.web.js',
file: 'dist/component-lib.min.js', globals: {
format: 'iife', axios: 'axios',
name: 'ComponentLib', qs: 'Qs',
exports: 'auto', },
globals,
}, },
plugins: [ plugins: [
image(), image(),
...@@ -224,16 +168,24 @@ if (!argv.format || argv.format === 'iife') { ...@@ -224,16 +168,24 @@ if (!argv.format || argv.format === 'iife') {
...baseConfig.plugins.preVue, ...baseConfig.plugins.preVue,
vue(baseConfig.plugins.vue), vue(baseConfig.plugins.vue),
...baseConfig.plugins.postVue, ...baseConfig.plugins.postVue,
babel(baseConfig.plugins.babel), typescript(),
terser({ babel({
output: { ...baseConfig.plugins.babel,
ecma: 5, extensions: ['.js', '.jsx', '.ts', '.tsx', '.vue'],
babelHelpers: 'bundled',
presets: [
[
'@babel/preset-env',
{
...babelPresetEnvConfig,
targets: esbrowserslist,
}, },
],
],
}), }),
], ],
} }
buildFormats.push(unpkgConfig) buildFormats.push(webConfig)
} }
// Export config
export default buildFormats export default buildFormats
...@@ -10,9 +10,10 @@ const html = ` ...@@ -10,9 +10,10 @@ const html = `
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<link rel="icon" href="./favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>组件列表</title> <title>组件列表</title>
<script src="http://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js"></script>
<script src="http://cdn.bootcdn.net/ajax/libs/qs/6.10.1/qs.min.js"></script>
<script type="module" crossorigin src="./component-lib.web.js"></script> <script type="module" crossorigin src="./component-lib.web.js"></script>
</head> </head>
......
...@@ -16,10 +16,9 @@ ...@@ -16,10 +16,9 @@
"start": "npm run serve", "start": "npm run serve",
"serve": "vue-cli-service serve dev/serve.ts", "serve": "vue-cli-service serve dev/serve.ts",
"prebuild": "rimraf ./dist", "prebuild": "rimraf ./dist",
"build": "cross-env NODE_ENV=production rollup --config build/rollup.config.js && node ./html.js && node ./repair.js", "build": "npm run build:es && npm run build:web && node ./repair.js && node ./html.js",
"build:ssr": "cross-env NODE_ENV=production rollup --config build/rollup.config.js --format cjs && node ./html.js ", "build:es": "cross-env NODE_ENV=production rollup --config build/rollup.config.js --format es",
"build:es": "cross-env NODE_ENV=production rollup --config build/rollup.config.js --format es && node ./html.js ", "build:web": "cross-env NODE_ENV=production rollup --config build/rollup.config.js --format iife && node ./repair.js && node ./html.js",
"build:unpkg": "cross-env NODE_ENV=production rollup --config build/rollup.config.js --format iife && node ./html.js && node ./repair.js",
"postbuild": "rimraf ./dist/types/dev ./dist/types/src/entry.d.ts" "postbuild": "rimraf ./dist/types/dev ./dist/types/src/entry.d.ts"
}, },
"devDependencies": { "devDependencies": {
......
let BASE_URL: string = '' let BASE_URL: string = ''
switch (process.env.NODE_ENV) { switch (process.env.NODE_ENV) {
case 'production': case 'production':
BASE_URL = window._base_url BASE_URL = 'http://ja-hm.omniview.pro/api/v2'
break break
default: default:
BASE_URL = 'http://ja-hm.omniview.pro/api/v2' BASE_URL = 'http://ja-hm.omniview.pro/api/v2'
......
<template> <template>
<div class="brief-container" :class="{ vertical: align === 'vertical' }"> <div class="brief-container" :class="{ vertical: align === 'vertical' }">
<div v-for="item in list" :key="item.name"> <div
v-for="(item, i) in list"
:key="item.name"
:class="{ 'click-able': clickAble }"
@click="onClick(i)"
>
<img <img
v-if="item.icon" v-if="item.icon"
:src="item.icon" :src="item.icon"
...@@ -33,6 +38,7 @@ export interface BriefProp { ...@@ -33,6 +38,7 @@ export interface BriefProp {
name: string name: string
value: number | number[] value: number | number[]
icon?: any icon?: any
data?: any
} }
export default defineComponent({ export default defineComponent({
name: 'Brief', name: 'Brief',
...@@ -53,6 +59,19 @@ export default defineComponent({ ...@@ -53,6 +59,19 @@ export default defineComponent({
type: String as PropType<'vertical' | 'horizontal'>, type: String as PropType<'vertical' | 'horizontal'>,
default: 'horizontal', default: 'horizontal',
}, },
clickAble: {
type: Boolean as PropType<boolean>,
default: false,
},
},
emits: ['touch'],
setup(props, ctx) {
function onClick(index: number) {
if (props.clickAble) {
ctx.emit('touch', index)
}
}
return { onClick }
}, },
}) })
</script> </script>
...@@ -73,6 +92,16 @@ export default defineComponent({ ...@@ -73,6 +92,16 @@ export default defineComponent({
display flex display flex
align-items center align-items center
width 33% width 33%
&.click-able
cursor pointer
&:hover
.count
background-clip text
-webkit-background-clip text
-webkit-text-fill-color transparent
background-image linear-gradient(to bottom, #FFD1B2, #FF8635)
p
color $yellow
>img >img
margin-right .05rem margin-right .05rem
>div >div
......
...@@ -13,8 +13,18 @@ ...@@ -13,8 +13,18 @@
</p> </p>
</n-space> </n-space>
<n-space> <n-space>
<n-select v-model:value="year" size="small" :options="yearOptions" /> <n-select
<n-select v-model:value="area" size="small" :options="areaOptions" /> v-model:value="year"
class="my-select"
size="small"
:options="yearOptions"
/>
<n-select
v-model:value="area"
class="my-select"
size="small"
:options="areaOptions"
/>
</n-space> </n-space>
</div> </div>
<div class="content"> <div class="content">
...@@ -111,7 +121,7 @@ const list = [ ...@@ -111,7 +121,7 @@ const list = [
<style lang="stylus"> <style lang="stylus">
@import '../../components/MyComponent/main.styl' @import '../../components/MyComponent/main.styl'
.n-select .n-select.my-select
height .2rem height .2rem
.n-base-selection .n-base-selection
height inherit height inherit
......
<template> <template>
<m-card title="体征指标"> <m-card title="体征指标">
<m-sub :addition="{ value: 1674, unit: '个小区' }"> 住宅房屋 </m-sub> <m-sub :addition="{ value: totalCommunityCount, unit: '个小区' }">
<Brief :list="summary" /> 住宅房屋
<m-sub :addition="{ value: 351, unit: '幢' }"> 非居建筑 </m-sub> </m-sub>
<Brief :list="summary" click-able @touch="onTouch" />
<m-sub
:addition="{ value: nonResident?.length || 0, unit: '幢' }"
click-able
@selct="onSelect"
>
非居建筑
</m-sub>
<m-sub> 服务主体 </m-sub> <m-sub> 服务主体 </m-sub>
<Brief :list="list" /> <Brief :list="list" />
<p /> <p />
...@@ -10,11 +18,20 @@ ...@@ -10,11 +18,20 @@
</template> </template>
<script lang="ts"> <script lang="ts">
export default { const _config = {
name: 'A015', name: 'A015',
title: '体征指标', title: '体征指标',
row: 1, row: 1,
baseUrl: window._base_url,
apis: {
community: '/service-basicdatasync-ddd/public/communities',
nonResident: '/service-basicdatasync-ddd/public/nonResi/buildings',
api1: '/service-basicdatasync-ddd/public/indCous',
api2: '/service-basicdatasync-ddd/public/residentsCommitteesV2',
api3: '/service-basicdatasync-ddd/public/propCompanies',
},
} }
export default _config
</script> </script>
<script lang="ts" setup> <script lang="ts" setup>
import icon4 from '@/assets/images/icon4.png' import icon4 from '@/assets/images/icon4.png'
...@@ -26,20 +43,110 @@ import icon8 from '@/assets/images/icon8.png' ...@@ -26,20 +43,110 @@ import icon8 from '@/assets/images/icon8.png'
import icon9 from '@/assets/images/icon9.png' import icon9 from '@/assets/images/icon9.png'
import Brief from '@/components/brief.vue' import Brief from '@/components/brief.vue'
import { ref } from 'vue' import { ref } from 'vue'
import { ajax } from '@/ajax'
import bus from '@/util/event-bus'
const totalCommunityCount = ref(0)
const summary = ref([
{ icon: icon4, name: '商品房', value: 0, data: [] },
{ icon: icon5, name: '公房', value: 0, data: [] },
{ icon: icon1, name: '公租房', value: 0, data: [] },
{ icon: icon6, name: '混合', value: 0, data: [] },
{ icon: icon7, name: '军产', value: 0, data: [] },
{ icon: icon8, name: '售后房', value: 0, data: [] },
])
ajax
.get({
url: _config.apis.community,
params: { sectType: '1', pageSize: 9000 },
})
.then((res) => {
const data = res?.data?.content || []
totalCommunityCount.value = data.length
const list = {
type1: data.filter((item) => item?.stKind == '01'),
type2: data.filter(
(item) => item?.stKind == '07' || item?.stKind == '05',
),
type3: data.filter((item) => item?.stKind == '11'),
type4: data.filter((item) => item?.stKind == '06'),
type5: data.filter((item) => item?.stKind == '09'),
type6: data.filter((item) => item?.stKind == '04'),
}
summary.value = [
{
icon: icon4,
name: '商品房',
value: list.type1?.length || 0,
data: list.type1,
},
{
icon: icon5,
name: '公房',
value: list.type2?.length || 0,
data: list.type2,
},
{
icon: icon1,
name: '公租房',
value: list.type3?.length || 0,
data: list.type3,
},
{
icon: icon6,
name: '混合',
value: list.type4?.length || 0,
data: list.type4,
},
{
icon: icon7,
name: '军产',
value: list.type5?.length || 0,
data: list.type5,
},
{
icon: icon8,
name: '售后房',
value: list.type6?.length || 0,
data: list.type6,
},
]
})
const onTouch = (i: number) => {
bus.emit('addPoints', summary.value[i].data)
}
const nonResident = ref([])
ajax
.get({ url: _config.apis.nonResident, params: { pageSize: 9000 } })
.then((res) => {
nonResident.value = res?.data?.content || []
})
const onSelect = () => {
bus.emit('addPoints', nonResident.value)
}
const summary = [
{ icon: icon4, name: '商品房', value: 904 },
{ icon: icon5, name: '公房', value: 400 },
{ icon: icon1, name: '私房/农房', value: 130 },
{ icon: icon6, name: '商住混合', value: 82 },
{ icon: icon7, name: '军产', value: 12 },
{ icon: icon8, name: '保障房', value: 46 },
]
const list = ref([ const list = ref([
{ icon: icon9, name: '业委会', value: 47520 }, { icon: icon9, name: '业委会', value: 0 },
{ icon: icon9, name: '居委会', value: 3960 }, { icon: icon9, name: '居委会', value: 0 },
{ icon: icon9, name: '物业汽油桶', value: 45 }, { icon: icon9, name: '物业企业', value: 0 },
]) ])
Promise.all([
ajax.get({ url: _config.apis.api1, params: { sectType_in: '1' } }),
ajax.get({ url: _config.apis.api2, params: { sectType_in: '1' } }),
ajax.get({
url: _config.apis.api3,
params: { sectType_in: '1', managedNum_desc: '1' },
}),
]).then(([data1, data2, data3]) => {
list.value = [
{ icon: icon9, name: '业委会', value: data1?.data?.totalRows || 0 },
{ icon: icon9, name: '居委会', value: data2?.data?.totalRows || 0 },
{ icon: icon9, name: '物业企业', value: data3?.data?.totalRows || 0 },
]
})
</script> </script>
<style lang="stylus" scoped> <style lang="stylus" scoped>
......
...@@ -31,7 +31,18 @@ ...@@ -31,7 +31,18 @@
</div> </div>
</div> </div>
<m-sub :addition="{ value: 1684, unit: '万元' }"> 维修资金 </m-sub> <m-sub :addition="{ value: 1684, unit: '万元' }"> 维修资金 </m-sub>
<Summary title="续筹分布" :list="list" :avatar="avatar1" /> <!-- <Summary title="续筹分布" :list="list" :avatar="avatar1" /> -->
<div class="warn">
<div>
<p>{{ list[0].name }}</p>
<m-count class="orange-count" :value="list[0].value" />
<span></span>
</div>
<div v-for="item in list.slice(1)" :key="item.name">
<m-count :value="item.value" />
<p>{{ item.name }}</p>
</div>
</div>
<div class="chart"> <div class="chart">
<m-bar <m-bar
v-if="barData.source.length > 0" v-if="barData.source.length > 0"
...@@ -68,9 +79,9 @@ const summary = [ ...@@ -68,9 +79,9 @@ const summary = [
{ name: '物业日查', value: 100 }, { name: '物业日查', value: 100 },
] ]
const list = ref([ const list = ref([
{ name: '分户', value: 47520 }, { name: '续筹预警', value: 47520 },
{ name: '门牌', value: 3960 }, { name: '涉及门牌', value: 3960 },
{ name: '小区', value: 45 }, { name: '涉及小区', value: 45 },
]) ])
const partys = [ const partys = [
...@@ -100,12 +111,13 @@ const barOption = { ...@@ -100,12 +111,13 @@ const barOption = {
yAxis: { yAxis: {
minInterval: 1, minInterval: 1,
}, },
grid: {
bottom: 0,
},
xAxis: [ xAxis: [
{ {
type: 'category', type: 'category',
axisLabel: { show: false,
interval: 0,
},
}, },
], ],
series: [ series: [
...@@ -143,6 +155,34 @@ const barOption = { ...@@ -143,6 +155,34 @@ const barOption = {
font-weight bold font-weight bold
>p >p
color #ccc color #ccc
.warn
$box()
padding .05rem .1rem
display flex
justify-content space-between
align-items center
>div
text-align center
flex 1
position relative
p
color #ccc
span
font-size .08rem
margin-left .05rem
color #ccc
&:first-child
flex 1.5
p
font-size .12rem
color #fff
&:last-child
&:before
content '|'
position absolute
top 50%
transform translateY(-50%)
left 0
.chart .chart
width 100% width 100%
height .8rem height .8rem
......
<template> <template>
<m-card title="安全排查"> <m-card title="安全排查">
<div class="summary"> <div class="summary">
<div v-for="item in list" :key="item.name"> <div v-for="item in list" :key="item.name" @click="onClick(item)">
<m-count class="orange-count" :value="item.value" :decimal="2" />% <m-count class="orange-count" :value="item.value" :decimal="2" /> %
<p>{{ item.name }}</p> <p>{{ item.name }}</p>
</div> </div>
</div> </div>
...@@ -45,6 +45,7 @@ export default _config ...@@ -45,6 +45,7 @@ export default _config
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from 'vue' import { ref } from 'vue'
import { ajax } from '@/ajax' import { ajax } from '@/ajax'
import bus from '@/util/event-bus'
ajax.get({ url: _config.apis.main }).then((res) => { ajax.get({ url: _config.apis.main }).then((res) => {
const { checkRate, riskTypeStatistical = [] } = res?.data?.content || {} const { checkRate, riskTypeStatistical = [] } = res?.data?.content || {}
...@@ -62,7 +63,7 @@ ajax.get({ url: _config.apis.main }).then((res) => { ...@@ -62,7 +63,7 @@ ajax.get({ url: _config.apis.main }).then((res) => {
}) })
const pieData = { const pieData = {
dimensions: [ dimensions: [
{ name: 'type', displayName: '类型' }, { name: 'type', displayName: '安全排查类型' },
{ name: 'value', displayName: '占比' }, { name: 'value', displayName: '占比' },
], ],
source: [], source: [],
...@@ -107,6 +108,10 @@ const list = ref([ ...@@ -107,6 +108,10 @@ const list = ref([
{ name: '需应急排险', value: 0 }, { name: '需应急排险', value: 0 },
{ name: '小梁薄板', value: 0 }, { name: '小梁薄板', value: 0 },
]) ])
function onClick({ name }) {
bus.emit('addPoints', name)
}
</script> </script>
<style lang="stylus" scoped> <style lang="stylus" scoped>
...@@ -146,4 +151,7 @@ const list = ref([ ...@@ -146,4 +151,7 @@ const list = ref([
margin-bottom .04rem margin-bottom .04rem
>div >div
text-align center text-align center
cursor pointer
&:hover
color $yellow
</style> </style>
<template> <template>
<m-card title="电梯加装"> <m-card title="电梯加装">
<div class="sum"> <div class="sum">
<div v-for="item in list" :key="item.name"> <div v-for="item in list" :key="item.name" @click="onClick(item.state)">
<span>{{ item.name }}</span> <span>{{ item.name }}</span>
<m-count class="orange-count" :value="item.value" /> <m-count class="orange-count" :value="item.value" />
<span>{{ item.unit }}</span> <span>{{ item.unit }}</span>
...@@ -26,6 +26,7 @@ const _config = { ...@@ -26,6 +26,7 @@ const _config = {
baseUrl: window._base_url, baseUrl: window._base_url,
apis: { apis: {
main: '/service-special-ja-ddd/public/elevator/statistical', main: '/service-special-ja-ddd/public/elevator/statistical',
elevator: '/service-special-ja-ddd/public/elevatorInstallationInfos',
}, },
} }
export default _config export default _config
...@@ -33,14 +34,27 @@ export default _config ...@@ -33,14 +34,27 @@ export default _config
<script lang="ts" setup> <script lang="ts" setup>
import { computed, ref } from 'vue' import { computed, ref } from 'vue'
import { ajax } from '@/ajax' import { ajax } from '@/ajax'
import bus from '@/util/event-bus'
import ele1 from '@/assets/images/ele1.png'
import ele2 from '@/assets/images/ele2.png'
ajax.get({ url: _config.apis.main }).then((res) => { ajax.get({ url: _config.apis.main }).then((res) => {
const { statistical, streetData = [] } = res?.data?.content || {} const { statistical, streetData = [] } = res?.data?.content || {}
list.value = [ list.value = [
// { name: '多层住宅房屋', value: +statistical.totalNum || 0, unit: '幢' }, // { name: '多层住宅房屋', value: +statistical.totalNum || 0, unit: '幢' },
// { name: '可加梯门牌数', value: +statistical.caddNum || 0, unit: '幢' }, // { name: '可加梯门牌数', value: +statistical.caddNum || 0, unit: '幢' },
{ name: '完成加梯征询', value: +statistical.passNum || 0, unit: '幢' }, {
{ name: '加梯完工', value: +statistical.finishNum || 0, unit: '幢' }, name: '完成加梯征询',
value: +statistical.passNum || 0,
unit: '幢',
state: '2',
},
{
name: '加梯完工',
value: +statistical.finishNum || 0,
unit: '幢',
state: '7',
},
] ]
charData.value.source = streetData charData.value.source = streetData
}) })
...@@ -48,14 +62,27 @@ const fontSize = computed(() => Math.floor((screen.height * 1.6) / 100)) ...@@ -48,14 +62,27 @@ const fontSize = computed(() => Math.floor((screen.height * 1.6) / 100))
const charData = ref({ const charData = ref({
dimensions: [ dimensions: [
{ name: 'streetName', displayName: '街道' }, { name: 'streetName', displayName: '街道' },
{ name: 'passNum', displayName: '已完成加梯征询' }, { name: 'passNum', displayName: '已完成征询' },
{ name: 'shouldPassNum', displayName: '应完成加梯征询' }, { name: 'shouldPassNum', displayName: '应完成征询' },
{ name: 'finishNum', displayName: '加梯已完工' }, { name: 'startNum', displayName: '已开工' },
{ name: 'shouldFinishNum', displayName: '加梯应完工' }, { name: 'shouldStartNum', displayName: '应开工' },
{ name: 'finishNum', displayName: '已完工' },
{ name: 'shouldFinishNum', displayName: '应完工' },
], ],
source: [], source: [],
}) })
const option = { const option = {
color: [
'#0076FF',
'#00BFFF',
'#9FC444',
'#FFCE34',
'#FF9D27',
'#FF6161',
'#BABABA',
'#ff0000',
'#00ff00',
],
grid: { grid: {
left: '2%', left: '2%',
right: '1%', right: '1%',
...@@ -85,14 +112,21 @@ const option = { ...@@ -85,14 +112,21 @@ const option = {
series: [ series: [
{ {
type: 'bar', type: 'bar',
barWidth: '30%', barWidth: '20%',
}, },
{ {
type: 'line', type: 'line',
}, },
{ {
type: 'bar', type: 'bar',
barWidth: '30%', barWidth: '20%',
},
{
type: 'line',
},
{
type: 'bar',
barWidth: '20%',
}, },
{ {
type: 'line', type: 'line',
...@@ -102,23 +136,40 @@ const option = { ...@@ -102,23 +136,40 @@ const option = {
const list = ref([ const list = ref([
// { name: '多层住宅房屋', value: 0, unit: '幢' }, // { name: '多层住宅房屋', value: 0, unit: '幢' },
// { name: '可加梯门牌数', value: 0, unit: '幢' }, // { name: '可加梯门牌数', value: 0, unit: '幢' },
{ name: '完成加梯征询', value: 0, unit: '幢' }, { name: '完成加梯征询', value: 0, unit: '幢', state: '2' },
{ name: '加梯完工', value: 0, unit: '幢' }, { name: '加梯完工', value: 0, unit: '幢', state: '7' },
]) ])
const onClick = (state) => {
console.log('---', state)
const icon = state === '2' ? ele1 : ele2
ajax
.get({
url: _config.apis.elevator,
params: { state, createTime_desc: 'desc', pageSize: 9000 },
})
.then((res) => {
const data = res?.data?.content || []
bus.emit('addPoints', { data, icon })
})
}
</script> </script>
<style lang="stylus" scoped> <style lang="stylus" scoped>
@import '../../components/MyComponent/main.styl' @import '../../components/MyComponent/main.styl'
.sum .sum
display flex display flex
justify-content space-between justify-content space-around
>div >div
display flex display flex
align-items center align-items center
font-size .09rem font-size .09rem
color #ccc color #ccc
cursor pointer
.orange-count .orange-count
margin 0 .04rem .02rem margin 0 .04rem .02rem
&:hover
color $yellow
.chart .chart
width 100% width 100%
height 1.5rem height 1.5rem
......
...@@ -8,7 +8,12 @@ ...@@ -8,7 +8,12 @@
万元 万元
</span> </span>
</p> </p>
<n-select v-model:value="year" size="small" :options="yearOptions" /> <n-select
v-model:value="year"
class="my-select"
size="small"
:options="yearOptions"
/>
</n-space> </n-space>
<div class="bar"> <div class="bar">
<div <div
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment