Commit d0d62fa9 authored by 程卓's avatar 程卓

热词更新

parent f63552e9
......@@ -115,7 +115,7 @@ export interface GlobalStateProps {
todayCase: { [key: string]: number }
stageCase: { [key: string]: number }
workstationKind: any[]
workstationKindPiEData: { [key: string]: any }
workstationKindPiEData: { [key: string]: number }
trackEvent: any[]
analysisRank: Partial<DutyDataProp>
moreHappenAddr: Partial<DutyDataProp>
......
......@@ -227,7 +227,7 @@ export default {
},
SET_WORKSTATION_PIEDATA(
state: GlobalStateProps,
data: { [key: string]: any }
data: { [key: string]: number }
): void {
state.workstationKindPiEData = data
},
......
......@@ -85,9 +85,6 @@ export default defineComponent({
const workstationKind = computed(() => store.state.workstationKind)
const pieDatamodel = computed(() => store.state.workstationKindPiEData)
const trackEvent = computed(() => store.state.trackEvent)
// console.log(moment(new Date()).format('YYYY-MM-DD'))
const fontSize = computed(() => Math.floor((screen.height * 1.6) / 100))
const showChart = computed(() => store.state.curTheme === 'manage')
const summary = computed(() => {
......@@ -206,24 +203,35 @@ export default defineComponent({
})),
})
const pieData = computed(() => {
console.log(pieDatamodel.value)
return [
{
name: '第一工作站',
value: 8,
value:
parseInt(
(pieDatamodel.value.oneDisposalNum / pieDatamodel.value.oneNum) *
100
) || 0,
num: pieDatamodel.value.oneNum,
color: '#47B3FF',
},
{
name: '第二工作站',
value: 9,
value:
parseInt(
(pieDatamodel.value.twoDisposalNum / pieDatamodel.value.twoNum) *
100
) || 0,
num: pieDatamodel.value.twoNum,
color: '#FF9D27',
},
{
name: '第三工作站',
value: 8,
value:
parseInt(
(pieDatamodel.value.threeDisposalNum /
pieDatamodel.value.threeNum) *
100
) || 0,
num: pieDatamodel.value.threeNum,
color: '#6EB629',
},
......@@ -273,50 +281,7 @@ export default defineComponent({
const searchCase = (key: string) => {
console.log('searck key: ', key)
}
// watch(
// [() => workstationKind.value, () => showChart.value],
// ([arr, show]) => {
// if (!show) return
// if (arr[0]) {
// pieData.value = [
// {
// name: '第一工作站',
// value:
// (
// (arr[0].statistical.oneDisposalNum /
// arr[0].statistical.oneNum) *
// 100
// ).toFixed(0) || 0,
// num: arr[0].statistical.oneDisposalNum,
// color: '#47B3FF',
// },
// {
// name: '第二工作站',
// value:
// (
// (arr[0].statistical.twoDisposalNum /
// arr[0].statistical.twoNum) *
// 100
// ).toFixed(0) || 0,
// num: arr[0].statistical.twoNum,
// color: '#FF9D27',
// },
// {
// name: '第三工作站',
// value:
// (
// (arr[0].statistical.threeDisposalNum /
// arr[0].statistical.threeNum) *
// 100
// ).toFixed(0) || 0,
// num: arr[0].statistical.threeDisposalNum,
// color: '#6EB629',
// },
// ]
// }
// },
// { immediate: true }
// )
return {
summary,
showChart,
......
......@@ -76,7 +76,7 @@ export default defineComponent({
const maskImage = new Image()
maskImage.src = symbolUrl
const option = {
backgroundColor: 'rgba(0,0,0,0.1)',
backgroundColor: '#000',
tooltip: {
show: true,
},
......@@ -101,14 +101,13 @@ export default defineComponent({
name: 'pictorial',
silent: true,
symbol: 'image://' + symbolUrl, //按背景渲染云词
symbolSize: ['165%', '180%'],
symbolSize: ['100%', '100%'],
symbolPosition: 'center',
barWidth: '100%',
barMaxWidth: '100%',
itemStyle: {
normal: {
opacity: 0.2, //自己项目中这里可以设置0全透明,然后可以写一个div背景加载一个美化过的云图片,重合放在这个图表下面。
},
border: '1px solid red',
},
data: [
{
......@@ -118,30 +117,28 @@ export default defineComponent({
},
{
type: 'wordCloud',
sizeRange: [19, 23],
rotationRange: [0, 10],
sizeRange: [20, 22],
rotationRange: [0, 0],
maskImage: maskImage,
textPadding: 30,
gridSize: 20, //用于标记画布可用性的网格大小(以像素为单位)//字距越大,字距越大。
width: '90%',
height: '90%',
left: 'center',
top: 'center',
textPadding: 0,
gridSize: 39, //用于标记画布可用性的网格大小(以像素为单位)//字距越大,字距越大。
width: '100%',
height: '100%',
left: '0',
top: '0',
drawOutOfBound: false,
textStyle: {
normal: {
fontFamily: 'sans-serif',
// fontFamily: 'sans-serif',
fontWeight: 600,
color: function () {
const index = Math.floor(Math.random() * colorList.length)
return colorList[index]
},
},
},
data: data,
},
],
}
cloudCharts.setOption(option)
}
......@@ -151,7 +148,7 @@ export default defineComponent({
if (!type) return
setTimeout(() => {
init()
}, 1000)
}, 1900)
},
{ immediate: true }
)
......@@ -168,5 +165,7 @@ export default defineComponent({
width 100%
box-sizing border-box
overflow hidden
// background #000
#cloud
height 2rem
width 100%
</style>
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