- 新增
-
+
+ 新增
+
删除
-
- 编辑
+
+ 编辑
@@ -52,18 +70,36 @@ import {
loadParamList,
loadParamDelete,
shockList,
- shockDelete
+ shockDelete,
+ loadList
} from '@/api/advance-boot/assess'
import { defaultAttribute } from '@/components/table/defaultAttribute'
import { ElMessage, ElMessageBox, ElDatePicker } from 'element-plus'
const props = defineProps({
- assessId: { type: String, required: true }
+ assessId: {
+ type: String,
+ required: true
+ },
+ isWindfarm: {
+ type: String,
+ default: ''
+ },
+ isWithCapacitor:{
+ type: String,
+ default: ''
+ },
+ disabled: { // 定义 disabled prop
+ type: Boolean,
+ required: false,
+ default: false
+ }
})
const dictData = useDictData()
//字典获取电压等级
const voltageleveloption = dictData.getBasicData('Dev_Voltage_Stand')
const transformer: any = ref([])
const characteristic: any = ref([])
+const shockRef: any = ref([])
const addformRef = ref()
const xTableRef = ref()
@@ -75,6 +111,7 @@ const column: any = ref([
key: 'transformerList',
child: [
{
+
title: '用户变压器名称',
field: 'transName'
},
@@ -90,7 +127,6 @@ const column: any = ref([
},
{
loading: false,
-
name: '电容器组参数维护',
key: 'capacitorList',
child: [
@@ -186,6 +222,11 @@ const column: any = ref([
title: '冲击负荷类型',
field: 'inpactloadtypeId'
},
+ {
+ title: '启动方式',
+ field: 'inpactloadStartup',
+
+ },
{
title: '数量',
@@ -214,7 +255,8 @@ const column: any = ref([
},
{
title: '负荷频度',
- field: 'inpactloadFreq'
+ field: 'inpactloadFreq',
+
},
{
title: '闪变叠加系数',
@@ -223,6 +265,18 @@ const column: any = ref([
]
}
])
+
+const filteredColumn = computed(() => {
+ // const windfarmValue = props.isWindfarm;
+ // if (windfarmValue === '01') {
+ // // 如果是风电场,显示除冲击负荷外的所有项
+ // return column.value.filter((item: any) => item.key !== 'impactList')
+ // } else {
+ // // 如果不是风电场,显示除风电参数外的所有项
+ // return column.value.filter((item: any) => item.key !== 'windPowerList')
+ // }
+})
+
const dataList = ref({
transformerList: [], //变压器参数维护
capacitorList: [], //电容器
@@ -232,6 +286,16 @@ const dataList = ref({
})
// 新增
const addFform = (item: any) => {
+
+ if (item.key === 'transformerList' && dataList.value.transformerList.length > 0) {
+ ElMessage.warning('变压器参数已存在,不允许重复新增!');
+ return;
+ }
+ if (item.key === 'capacitorList' && dataList.value.capacitorList.length > 0) {
+ ElMessage.warning('电容器组参数已存在,不允许重复新增!');
+ return;
+ }
+
addformRef.value.open({
title: '新增',
item: item,
@@ -304,8 +368,7 @@ const edit = (item: any, row: any) => {
}
const info = async (i: number) => {
- column.value[i].loading = true
-
+ //column.value[i].loading = true
if (i == 0) {
// 变压器参数维护
await assessTransformerParamList({ assessId: props.assessId }).then(res => {
@@ -328,18 +391,44 @@ const info = async (i: number) => {
})
} else if (i == 4) {
// 冲击性负荷
- await shockList({ assessId: props.assessId }).then(res => {
+ await shockList({ assessId: props.assessId }).then((res: { data: never[] }) => {
dataList.value.impactList = res.data
})
}
column.value[i].loading = false
+
}
+
+const typeId = ref(null)
// 过滤数据
const formatter = (row: any) => {
if (row.column.field == 'transtypeId') {
- const found = transformer.value.find((item: any) => item.transtypeId == row.cellValue)
- return found.transtypeName || '' // 使用可选链并提供默认值
- } else if (row.column.field == 'harmId') {
+ if (row.cellValue) {
+ const found = transformer.value.find((item: any) => item.transtypeId == row.cellValue)
+ return found?.transtypeName || ''
+ } else {
+ return '' // 或者返回默认值
+ }
+ }else if(row.column.field =='inpactloadtypeId'){
+ const found = shockRef.value.find((item: any) => item.inpactloadtypeId == row.cellValue)
+ typeId.value = found.inpactloadtypeId
+ return found.inpactloadtypeName|| '' // 使用可选链并提供默认值
+ }else if(row.column.field =='inpactloadStartup'){
+ const found = shockRef.value.find((item: any) => item.inpactloadtypeId == typeId.value)
+ return found.inpactloadStartup
+ }
+ else if(row.column.field == 'isIsolationtrans'){
+ return row.cellValue == '01' ? '是' : '否'
+ }else if(row.column.field =='inpactloadFreq'){
+ if(row.cellValue == '01'){
+ return 'N≤4次/d'
+ }else if(row.cellValue == '02'){
+ return 'N>4次/d且N≤2次/h'
+ }else{
+ return '2次/h item.harmId == row.cellValue)
return found.harmName || '' // 使用可选链并提供默认值
} else if (
@@ -364,6 +453,11 @@ const dictionary = () => {
characteristicList({}).then((res: any) => {
characteristic.value = res.data
})
+ //冲击负荷类型
+ loadList({}).then((res: any) => {
+ shockRef.value = res.data
+ })
+
}
onMounted(async () => {
await dictionary()
diff --git a/src/views/setting/dictionary/list/popupEdit.vue b/src/views/setting/dictionary/list/popupEdit.vue
index 40ff7c13..a8e36cbc 100644
--- a/src/views/setting/dictionary/list/popupEdit.vue
+++ b/src/views/setting/dictionary/list/popupEdit.vue
@@ -113,7 +113,9 @@ const submit = async () => {
}
const handleInput = (value: string) => {
- form.name = value.replace(/[^\d]/g, '')
+ form.name = value.replace(/\s/g, '')
+ //form.name = value.replace(/[^\d]/g, '')
+
}
defineExpose({ open })