全局添加输入框空格校验

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

@@ -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 })