全局添加输入框空格校验

This commit is contained in:
GGJ
2024-12-25 10:53:07 +08:00
parent 90efcc4ad2
commit aed771578a
98 changed files with 703 additions and 904 deletions

View File

@@ -4,7 +4,7 @@
<div class="harmonic_select" v-if="!loading">
<el-form :model="searchForm" id="history_select">
<el-form-item label="稳态指标">
<el-select multiple collapse-tags collapse-tags-tooltip v-model="searchForm.index"
<el-select multiple collapse-tags collapse-tags-tooltip v-model.trim="searchForm.index"
placeholder="请选择统计指标" :multiple-limit="3" value-key="id">
<el-option v-for="(item, index) in indexOptions" :label="item.name" :key="index"
:value="item"></el-option>

View File

@@ -3,11 +3,11 @@
<div class="realtrend" v-loading="loading">
<div class="select" v-if="!loading">
<div class="mr10">谐波次数 </div>
<el-select v-model="selectValue" style="width: 100px" @change="selectChange">
<el-select v-model.trim="selectValue" style="width: 100px" @change="selectChange">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</div>
<el-tabs type="border-card" v-if="tabsList.length != 0" v-model="activeName" @tab-click="handleClick">
<el-tabs type="border-card" v-if="tabsList.length != 0" v-model.trim="activeName" @tab-click="handleClick">
<el-tab-pane v-for="(item, index) in tabsList" :label="item.groupName" :name="index" :key="index">
<div>
<div class="realtrend_top">
@@ -31,7 +31,7 @@
<div class="thead_left">
<p style=" font-weight: 700; background-color: #F3F6F9;">次数()</p>
<p>{{ item.groupName }}{{ item.unit ? '(' + item.unit + ')' : '' }}</p>
<p>国标限值{{ item.unit ? '(' + item.unit + ')' : '' }}</p>
<!-- <p>国标限值{{ item.unit ? '(' + item.unit + ')' : '' }}</p> -->
</div>
<div class="thead_right">
<div class="right_cell" v-for="(value, key, index) in tableData" :key="index">
@@ -50,7 +50,7 @@
{{ value }}
</span>
</p>
<p>
<!-- <p>
<span v-if="
String(key).includes('data') &&
String(key) != 'dataLevel' &&
@@ -58,7 +58,7 @@
">
{{ gbData[index]?.value || '/' }}
</span>
</p>
</p> -->
</div>
</div>
@@ -223,12 +223,13 @@ const init = () => {
trendData.map((item: any) => {
return item.value
}),
gbData.value.map((item: any) => {
return item.value
}),
// gbData.value.map((item: any) => {
// return item.value
// }),
]
let legendList = [tabsList.value[activeName.value]?.groupName, '国标限值',]
let legendList = [tabsList.value[activeName.value]?.groupName, ]
// let legendList = [tabsList.value[activeName.value]?.groupName, '国标限值',]
// echartsData.value.legend.data = legendList
list.map((item: any, index: any) => {
echartsData.value.series.push({
@@ -312,8 +313,8 @@ const setRealTrendData = (val: any) => {
emit('changeTrendType', activeName.value)
}
}
const selectChange=(val:any)=>{
loading.value=true
const selectChange = (val: any) => {
loading.value = true
// setTimeout(() => {
// loading.value=false
// },3000)
@@ -417,7 +418,8 @@ defineExpose({ open, setRealTrendData, setOverLimitData })
display: flex;
border: 2px solid #eee;
cursor: pointer;
font-size: 13px;
font-size: 13px;
.thead_left {
width: 150px;
height: 100%;
@@ -426,7 +428,7 @@ font-size: 13px;
justify-content: space-between;
align-items: center;
line-height: 50px;
padding-bottom: 5px;
p {
@@ -497,7 +499,7 @@ font-size: 13px;
.charts {
width: 100%;
margin-top: 10px;
height: calc(100vh - 560px);
height: calc(100vh - 535px);
}
}

View File

@@ -3,7 +3,7 @@
<div class="home">
<div class="home_header">
<!-- <el-form-item label="值类型选择">
<el-select @change="changeView" v-model="value" placeholder="请选择值类型">
<el-select @change="changeView" v-model.trim="value" placeholder="请选择值类型">
<el-option
v-for="(item, index) in options"
:key="index"
@@ -12,16 +12,18 @@
></el-option>
</el-select>
</el-form-item> -->
<el-radio-group v-model="value" @change="changeView">
<el-radio-group v-model.trim="theTypeOfValue" @change="changeView">
<el-radio-button label="一次值" :value="1" />
<el-radio-button label="二次值" :value="2" />
</el-radio-group>
<el-form-item label="">
<el-button @click="handleBack" :icon="Back">返回</el-button>
</el-form-item>
<el-button @click="handleBack" :icon="Back">返回</el-button>
</div>
<el-tabs class="home_body" type="border-card" v-model="activeName" @tab-click="handleClick">
<el-tabs class="home_body" type="border-card" v-model.trim="activeName1" @tab-click="handleClick"
v-loading="loading">
<el-tab-pane label="瞬时波形" name="ssbx" :style="'height:' + bxecharts + ';overflow-y: scroll;'">
<shushiboxi v-if="isWp && wp && activeName == 'ssbx' && showBoxi" :value="value" :boxoList="boxoList"
@@ -51,6 +53,7 @@ const searchForm = ref({
})
const emit = defineEmits(['handleHideCharts'])
const parentHeight = ref(0)
const loading = ref(false)
const tableList: any = ref([])
for (let i = 0; i < 300; i++) {
tableList.value.push({
@@ -87,19 +90,12 @@ const echartsData1: any = ref([]),
const view = ref(true)
const view2 = ref(false)
const showBoxi = ref(true)
const activeName1 = ref('ssbx')
const activeName = ref('ssbx')
const wp = ref({})
const theTypeOfValue = ref(1)
const value = ref(1)
const options = ref([
{
value: 1,
label: '一次值'
},
{
value: 2,
label: '二次值'
}
])
const isWp = ref(false)
const boxoList: any = ref([])
@@ -112,29 +108,35 @@ const getWpData = (val: any, list: any) => {
}
const changeView = () => {
showBoxi.value = false
loading.value = true
setTimeout(() => {
value.value = theTypeOfValue.value
showBoxi.value = true
}, 0)
}, 500)
setTimeout(() => {
loading.value = false
}, 1500)
}
const bxecharts: any = ref(mainHeight(190).height as any)
const handleClick = (tab: any, event: any) => {
// activeName.value = tab.index
if (tab.name == 'ssbx') {
activeName.value = 'ssbx'
} else if (tab.name == 'rmsbx') {
activeName.value = 'rmsbx'
}
loading.value = true
setTimeout(() => {
activeName.value = tab.paneName
}, 500)
setTimeout(() => {
loading.value = false
}, 1500)
}
const handleBack = () => {
emit('handleHideCharts')
}
const setHeight = (h: any,vh: any) => {
const setHeight = (h: any, vh: any) => {
parentHeight.value = h
setTimeout(() => {
bxecharts.value = mainHeight(vh).height
},100)
setTimeout(() => {
bxecharts.value = mainHeight(vh).height
}, 100)
}
onMounted(() => { })
defineExpose({ getWpData, setHeight })