fix: 修复禅道bug

This commit is contained in:
huanghao1412 2024-03-04 18:25:47 +08:00
parent 69003012ae
commit 33a36f3aad
12 changed files with 99 additions and 19 deletions

View File

@ -95,8 +95,13 @@ export const option = {
const { name, value, unit, showValue } = param.data
let str = ''
if(showPercent) str += `${showValue * 100}%`
else str += showUnit ? `${showValue}${unit}` : showValue
if(typeof showValue === 'number') {
if(showPercent) str += `${showValue * 100}%`
else str += showUnit ? `${showValue}${unit}` : showValue
}
else {
str += '--'
}
str += '\n'
if(showSubText) str += name

View File

@ -29,7 +29,11 @@ const option = {
type: 'ring',
tooltip: {
show: true,
trigger: 'item'
trigger: 'item',
formatter: (params: any) => {
let str = `${params.seriesName}<br/>${params.marker}${params.name}`
return str
}
},
legend: {
show: true

View File

@ -94,6 +94,7 @@ const fontWeightOptions = [
const labelFormatterOptions = [
{ label: '数据名', value: '{b}' },
{ label: '百分比', value: '{d}' },
{ label: '列名:百分比', value: '{b}:{d}%' }
{ label: '列名:百分比', value: '{b}:{d}%' },
{ label: '列名:数值', value: '{b}:{@[1]}' },
]
</script>

View File

@ -152,6 +152,26 @@ watch(
// })
const { vChartRef } = useChartCommonData(props.chartConfig, useChartEditStore)
watch(
() => props.chartConfig.option.dataset,
(v) => {
v.source.forEach((item: {[k: string]: any}) => {
let k = v.dimensions[0]
let k1 = v.dimensions[1]
if(item[k].split(' ').length < 2) {
item[k] += ` ${item[k1]}`
}
})
if(vChartRef.value) {
vChartRef.value.setOption({
dataset: v
})
}
},
{
deep: true
}
)
onMounted(() => {
seriesDataMaxLength = dataJson.source.length

View File

@ -36,7 +36,7 @@ export const option = {
// align: [],
rowNum: 5,
waitTime: 2,
headerHeight: 35,
headerHeight: null,
carousel: 'single',
headerBGC: '#00BAFF',
oddRowBGC: '#003B51',

View File

@ -68,7 +68,7 @@
</n-space>
</SettingItem>
<SettingItem name="字段">
<n-text style="height: 28px;line-height: 28px">{{item.key ? item.key : '--'}}</n-text>
<n-text style="height: 28px;line-height: 28px;white-space: nowrap;text-overflow: ellipsis;overflow: hidden" :title="item.key ? item.key : '--'">{{item.key ? item.key : '--'}}</n-text>
</SettingItem>
<SettingItem name="标题">
<n-input v-model:value="item.header" size="small" clearable/>

View File

@ -5,16 +5,17 @@
v-if="status.header.length && status.mergedConfig"
:style="`background-color: ${status.mergedConfig.headerBGC};`"
>
<!-- line-height: ${status.mergedConfig.headerHeight}px;-->
<div
class="header-item"
v-for="(headerItem, i) in status.header"
:key="`${headerItem}${i}`"
:style="`
height: ${status.mergedConfig.headerHeight}px;
line-height: ${status.mergedConfig.headerHeight}px;
width: ${status.widths[i]}px;
`"
:align="status.aligns[i]"
:title="headerItem"
v-html="headerItem"
/>
</div>
@ -390,11 +391,13 @@ onUnmounted(() => {
.header {
display: flex;
align-items: center;
flex-direction: row;
font-size: 15px;
.header-item {
transition: all 0.3s;
overflow: hidden;
}
}
@ -406,6 +409,11 @@ onUnmounted(() => {
font-size: 14px;
transition: all 0.3s;
overflow: hidden;
.ceil{
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
}
}
}

View File

@ -39,6 +39,7 @@ import { CreateComponentType } from '@/packages/index.d'
import { icon } from '@/plugins'
import {useChartCommonData} from "@/hooks";
import {useChartEditStore} from "@/store/modules/chartEditStore/chartEditStore";
import { isPreview } from '@/utils'
import { cloneDeep } from 'lodash'
const props = defineProps({
@ -79,7 +80,7 @@ watch(
() => props.chartConfig.option.dataset,
(newData: any) => {
option.dataset = newData
option.header.value = newData.dimensions
if(!isPreview()) option.header.value = newData.dimensions
option.header.options = newData.dimensions
newData.dimensions.forEach((key: string) => {
if(!Object.prototype.hasOwnProperty.call(option.header.map, key)) option.header.map[key] = key

View File

@ -6,7 +6,7 @@ import designColor from './designColor.json'
export const lang = LangEnum.ZH
// 水印文字
export const watermarkText = "GoView 低代码平台"
export const watermarkText = ""
// 分组名称
export const groupTitle = "分组"

View File

@ -9,7 +9,7 @@
<n-input
v-model:value="currentObj.space_complete_id"
size="small"
placeholder="请输入测点ID"
placeholder="请输入空间ID"
clearable
/>
</n-space>

View File

@ -5,7 +5,7 @@
</n-space>
</setting-item-box>
<setting-item-box name="告警确认" :alone="true">
<n-select multiple v-model:value="target.confirm_statuses" :options="options1" size="small"/>
<n-select multiple v-model:value="target.confirm_statuses" :options="options0" size="small"/>
</setting-item-box>
<setting-item-box name="告警恢复" :alone="true">
<n-select multiple v-model:value="target.recovery_statuses" :options="options1" size="small"/>
@ -26,6 +26,7 @@ import {useTargetData} from '../../hooks/useTargetData.hook'
import {DateOptions, PolicyOptions} from './ComponentsType.d'
import {icon} from '@/plugins/icon'
import {commonDataType, MonthAlarmClassType} from '@/store/modules/chartEditStore/chartEditStore.d'
import { useOriginStore } from '@/store/modules/originStore/originStore'
const {CloseIcon, AddIcon} = icon.ionicons5
@ -42,18 +43,59 @@ type computeIdsItemType = {
value: number | null
}
const originStore = useOriginStore()
const systemConstant = originStore.getOriginStore?.user?.systemConstant
let options2
if(systemConstant.warn_levels) {
type ItemType = {
label: string,
value: string,
remark: string
}
options2 = systemConstant['warn_levels'].filter((item: ItemType) => item.value !== '').map((item: any) => {
return { label: item.label, value: Number(item.value), remark: item.remark }
})
}
const systemConfig = originStore.getOriginStore?.user?.systemConfig
target.value.levels = []
for (let i = 1; i <= Number(systemConfig.history_alarm_level); i++) {
target.value.levels.push(i)
}
const options1 = [
{label: 'ok', value: 'ok'},
{label: 'not', value: 'not'},
{label: '已恢复', value: 'ok'},
{label: '未回复', value: 'not'},
]
const options2 = [
{label: 1, value: 1},
{label: 2, value: 2},
{label: 3, value: 3},
{label: 4, value: 4},
target.value.recovery_statuses = []
if (typeof (systemConfig.history_alarm_recovery_status) !== 'undefined') {
for (const item of JSON.parse(systemConfig.history_alarm_recovery_status)) {
target.value.recovery_statuses.push(item)
}
}
const options0 = [
{label: '已确认', value: 'ok'},
{label: '未确认', value: 'not'},
]
target.value.confirm_statuses = []
if (typeof (systemConfig.history_alarm_confirm_status) !== 'undefined') {
for (const item of JSON.parse(systemConfig.history_alarm_confirm_status)) {
target.value.confirm_statuses.push(item)
}
}
// const options2 = [
// {label: 1, value: 1},
// {label: 2, value: 2},
// {label: 3, value: 3},
// {label: 4, value: 4},
// ]
</script>
<style lang="scss" scoped>

View File

@ -236,7 +236,6 @@ const handleContextMenu = (
targetInstance
)
}
console.log(menuOptions.value)
nextTick().then(() => {
chartEditStore.setMousePosition(e.clientX, e.clientY)
chartEditStore.setRightMenuShow(true)