查看,编辑属性

This commit is contained in:
jjLv 2024-12-10 17:40:07 +08:00
parent 3e6738de6e
commit 5cdcd2f9bf
1 changed files with 17 additions and 18 deletions

View File

@ -174,6 +174,11 @@ const maId: any = ref('')
const editRowInfo = (row: any) => { const editRowInfo = (row: any) => {
settleinTitle.value = '装备编辑' settleinTitle.value = '装备编辑'
getDetailData(row) getDetailData(row)
if(row.devInfoProperties!=null){
row.devInfoProperties.forEach((item:any)=>{
propertyNamesTwo.value.push({'propertyName':item.propertyName,'propertyValue':item.propertyValue})
})
}
disabledForm.value = false disabledForm.value = false
isEditDisabled.value = true isEditDisabled.value = true
isViewForm.value = false isViewForm.value = false
@ -183,6 +188,11 @@ const editRowInfo = (row: any) => {
const previewRowInfo = (row: any) => { const previewRowInfo = (row: any) => {
settleinTitle.value = '装备详情' settleinTitle.value = '装备详情'
getDetailData(row) getDetailData(row)
if(row.devInfoProperties!=null){
row.devInfoProperties.forEach((item:any)=>{
propertyNamesTwo.value.push({'propertyName':item.propertyName,'propertyValue':item.propertyValue})
})
}
disabledForm.value = true disabledForm.value = true
isEditDisabled.value = false isEditDisabled.value = false
isViewForm.value = true isViewForm.value = true
@ -408,9 +418,9 @@ const dialogTypeChange = () => {
}else{ }else{
propertyNames.value=[] propertyNames.value=[]
propertyNamesTwo.value=[] propertyNamesTwo.value=[]
propertyNamesTwo.value.push({'maType':null,'value':null}) propertyNamesTwo.value.push({'propertyName':null,'propertyValue':null})
deviceTypeList[0].data.propertyNames.forEach((item:any) =>{ deviceTypeList[0].data.propertyNames.forEach((item:any) =>{
propertyNames.value.push({'maType':item,'value':null}) propertyNames.value.push({'propertyName':item,'propertyValue':null})
options.value.push({'label':item,'value':item}) options.value.push({'label':item,'value':item})
}) })
console.log(propertyNames.value) console.log(propertyNames.value)
@ -620,7 +630,7 @@ const submitFun = (type: any) => {
addAndEditForm.typeId = addAndEditForm.typeId =
addAndEditForm.deviceTypeList[addAndEditForm.deviceTypeList.length - 1] addAndEditForm.deviceTypeList[addAndEditForm.deviceTypeList.length - 1]
addAndEditForm.devInfoProperties = propertyNamesTwo.value;
let SEND_FUN_API: any = null let SEND_FUN_API: any = null
if (type == 1) { if (type == 1) {
SEND_FUN_API = equipmentAddApi SEND_FUN_API = equipmentAddApi
@ -639,6 +649,7 @@ const submitFun = (type: any) => {
message: '保存成功', message: '保存成功',
duration: 1000, duration: 1000,
}) })
propertyNamesTwo.value = []
dialogFormVisibleSettlein.value = false dialogFormVisibleSettlein.value = false
getList() getList()
} }
@ -978,18 +989,6 @@ const onDialogClose = () => {
addAndEditFormRef.value.resetFields() addAndEditFormRef.value.resetFields()
} }
const propertyNames = ref<any>([ const propertyNames = ref<any>([
// {
// maType: 1,
// value: 2,
// },
// {
// maType: 2,
// value: 3,
// },
// {
// maType: 3,
// value: 4,
// },
]) ])
const propertyNamesTwo = ref<any>([ const propertyNamesTwo = ref<any>([
]) ])
@ -1010,7 +1009,7 @@ const options = ref<any>([
// //
const addPartItem = () => { const addPartItem = () => {
propertyNamesTwo.value.push({'maType':null,'value':null}); propertyNamesTwo.value.push({'propertyName':null,'propertyValue':null});
} }
const removePartItem = (index:any)=> { const removePartItem = (index:any)=> {
@ -1442,7 +1441,7 @@ const options = ref<any>([
<el-col :span="14" > <el-col :span="14" >
<el-form-item > <el-form-item >
<el-col :span="7" style="justify-content: left;"> <el-col :span="7" style="justify-content: left;">
<el-select v-model="item.maType" placeholder="请选择" style="width: 100%"> <el-select v-model="item.propertyName" placeholder="请选择" style="width: 100%">
<el-option <el-option
v-for="item in options" v-for="item in options"
:key="item.value" :key="item.value"
@ -1454,7 +1453,7 @@ const options = ref<any>([
</el-col> </el-col>
<el-col :span="7" > <el-col :span="7" >
<el-input <el-input
v-model="item.value" v-model="item.propertyValue"
placeholder="请输入" placeholder="请输入"
maxlength="20" maxlength="20"
style="width: 350px;" style="width: 350px;"