问题修改

This commit is contained in:
zhujiyan
2024-05-23 16:36:32 +08:00
parent 5985a3c153
commit 42109a1478
3 changed files with 40 additions and 28 deletions

View File

@@ -49,13 +49,25 @@ const tableStore = new TableStore({
{ field: 'complaintText', title: '投诉内容' },
{ field: 'steadyIndicator', title: '稳态指标' },
{ field: 'transientIndicators', title: '暂态指标' },
{ field: 'monitorName', title: '监测点名称' },
{ field: 'monitorNumber', title: '监测点编号' },
{
field: 'monitorName',
title: '监测点名称',
formatter: (row: any) => {
return row.cellValue ? row.cellValue : '/'
}
},
{
field: 'monitorNumber',
title: '监测点编号',
formatter: (row: any) => {
return row.cellValue ? row.cellValue : '/'
}
},
{
field: 'detectionFlag',
title: '是否实现监测',
formatter: (row: any) => {
return row.cellvalue == '0' ? '否' : '是'
return row.cellValue == '0' ? '否' : '是'
}
},
{

View File

@@ -126,7 +126,7 @@
</el-dialog>
</template>
<script setup lang="ts">
import { ref,defineEmits } from 'vue'
import { ref, defineEmits } from 'vue'
import { useDictData } from '@/stores/dictData'
import { addComplaintsData } from '@/api/process-boot/electricitymanagement'
const emits = defineEmits(['onSubmit'])
@@ -135,17 +135,21 @@ const dialogVisible = ref(false)
const title: any = ref('')
const steadyStateList = dictData.getBasicData('Steady_Indicator')
const transientIndicatorsList = dictData.getBasicData('Transient_Indicators')
const form = ref({
complaintText: '', //投诉内容
detectionFlag: '0', //是否实现监测
steadyIndicator: [], //稳态指标
transientIndicators: [], //暂态指标
userName: '', //用户名称
userNumber: '', //用户编号
userCategory: '', //用户类别
monitorName: '', //监测点名称
monitorNumber: '' //监测点编号
})
const form: any = ref({})
const resetForm = () => {
form.value = {
complaintText: '', //投诉内容
detectionFlag: '0', //是否实现监测
steadyIndicator: [], //稳态指标
transientIndicators: [], //暂态指标
userName: '', //用户名称
userNumber: '', //用户编号
userCategory: '', //用户类别
monitorName: '', //监测点名称
monitorNumber: '' //监测点编号
}
}
resetForm()
const rules = {
userName: [{ required: true, message: '请输入用户名称', trigger: 'blur' }],
userNumber: [{ required: true, message: '请输入用户编号', trigger: 'blur' }],
@@ -155,7 +159,7 @@ const rules = {
transientIndicators: [{ required: true, message: '请选择暂态指标', trigger: 'change' }],
steadyIndicator: [{ required: true, message: '请选择稳态指标', trigger: 'change' }],
monitorName: [{ required: true, message: '请输入监测点名称', trigger: 'blur' }],
monitorNumber: [{ required: true, message: '请输入监测点编号', trigger: 'blur' }],
monitorNumber: [{ required: true, message: '请输入监测点编号', trigger: 'blur' }]
}
const formRef = ref(null)
const submit = () => {
@@ -168,6 +172,8 @@ const submit = () => {
}
addComplaintsData(form.value).then(res => {
emits('onSubmit')
formRef.value && formRef.value.resetFields()
resetForm()
handleClose()
})
} else {

View File

@@ -145,7 +145,7 @@
<el-option
v-for="(item, index) in userNameList"
:key="index"
:label="item.name"
:label="item.projectName"
:value="item.id"
></el-option>
</el-select>
@@ -544,12 +544,7 @@ const getSelectableList = () => {
let obj = {}
getList(obj).then(res => {
projectList.value = res.data
res.data.map(item => {
userNameList.value.push({
name:item?.projectName,
id:item?.id
})
})
userNameList.value= res.data;
//初始化
let obj = res.data[0]
form.value = {
@@ -600,7 +595,7 @@ const resetForm = () => {
userStatus: userStateList[1].id, //用户状态
monitoringTerminalCode: monitoringTerminalList.value[0]?.monitoringTerminalCode, //关联设备
monitoringTerminalName: monitoringTerminalList.value[0]?.monitoringTerminalName,
userName: '', //工程名称
userName: projectList.value[0]?.id, //工程名称
userId: '', //工程id
//监测点信息实体
@@ -662,7 +657,7 @@ const changeLoadType = async () => {
//选择关联干扰源回显数据
const changeUserName = () => {
let obj = projectList.value.find(item => {
return form.value.reporter == item.reporter
return form.value.userName == item.id
})
form.value = {
...form.value,
@@ -676,7 +671,6 @@ const changeUserName = () => {
userId: obj?.id,
expectedProductionDate: obj?.expectedProductionDate
}
console.log(obj, '选择关联干扰源回显数据')
}
//定义校验规则
@@ -996,10 +990,10 @@ defineExpose({ open })
</script>
<style lang="scss" scoped>
.el-form {
// width: 96%;
width: 96%;
height: 400px;
margin: 0 auto;
// overflow-y: auto;
overflow-y: auto;
padding-top: 20px;
}
.dialog-footer {