feat: 添加交流/直流标识支持
在参数模型中添加ac_or_dc字段,支持从配置文件中读取交流或直流标识,并在前端界面根据电压等级自动判断显示
This commit is contained in:
@@ -32,6 +32,15 @@
|
||||
label="额定电压等级 (kV)"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
<q-input
|
||||
:model-value="currentType"
|
||||
label="电流类型"
|
||||
readonly
|
||||
>
|
||||
<q-tooltip>交流(AC)或直流(DC),由电压等级自动判断</q-tooltip>
|
||||
</q-input>
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
<q-input
|
||||
v-model="params.parameter.h_c_sag"
|
||||
@@ -308,7 +317,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from 'vue'
|
||||
import { ref, reactive, computed } from 'vue'
|
||||
import type { AllParameters } from '@/types'
|
||||
import LogComponent from './Log.vue'
|
||||
|
||||
@@ -316,6 +325,7 @@ import LogComponent from './Log.vue'
|
||||
const defaultParams: AllParameters = {
|
||||
parameter: {
|
||||
rated_voltage: '500kV',
|
||||
ac_or_dc: 'AC',
|
||||
h_c_sag: 14.43,
|
||||
h_g_sag: 11.67,
|
||||
insulator_c_len: 7.02,
|
||||
@@ -349,6 +359,11 @@ const voltageOptions = [
|
||||
'±500kV', '±660kV', '±800kV', '±1100kV'
|
||||
]
|
||||
|
||||
// 根据电压等级自动判断交流/直流
|
||||
const currentType = computed(() => {
|
||||
return params.parameter.rated_voltage.includes('±') ? 'DC' : 'AC'
|
||||
})
|
||||
|
||||
// 数组操作函数(最多3条导线,即数组最多4个元素:1地线+3导线)
|
||||
// 两个数组同步增减
|
||||
const addHArm = () => {
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
export interface Parameter {
|
||||
// 基本参数
|
||||
rated_voltage: string // 额定电压等级 (kV)
|
||||
ac_or_dc: string // 交流或直流标识,"AC" 或 "DC"
|
||||
h_c_sag: number // 导线弧垂 (m)
|
||||
h_g_sag: number // 地线弧垂 (m)
|
||||
insulator_c_len: number // 导线串子绝缘长度 (m)
|
||||
|
||||
Reference in New Issue
Block a user