新增属性

This commit is contained in:
jjLv 2024-12-10 17:13:39 +08:00
parent 21ea680a38
commit 3e6738de6e
1 changed files with 9 additions and 4 deletions

View File

@ -404,8 +404,11 @@ const dialogTypeChange = () => {
console.log('deviceTypeList',deviceTypeList[0].data.propertyNames) console.log('deviceTypeList',deviceTypeList[0].data.propertyNames)
if(deviceTypeList[0].data.propertyNames==null){ if(deviceTypeList[0].data.propertyNames==null){
propertyNames.value=[] propertyNames.value=[]
propertyNamesTwo.value=[]
}else{ }else{
propertyNames.value=[] propertyNames.value=[]
propertyNamesTwo.value=[]
propertyNamesTwo.value.push({'maType':null,'value':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({'maType':item,'value':null})
options.value.push({'label':item,'value':item}) options.value.push({'label':item,'value':item})
@ -988,6 +991,8 @@ const propertyNames = ref<any>([
// value: 4, // value: 4,
// }, // },
]) ])
const propertyNamesTwo = ref<any>([
])
const options = ref<any>([ const options = ref<any>([
// { // {
// label:'', // label:'',
@ -1005,12 +1010,12 @@ const options = ref<any>([
// //
const addPartItem = () => { const addPartItem = () => {
propertyNames.value.push({'maType':null,'value':null}); propertyNamesTwo.value.push({'maType':null,'value':null});
} }
const removePartItem = (index:any)=> { const removePartItem = (index:any)=> {
if (propertyNames.value.length > 1) { if (propertyNamesTwo.value.length > 1) {
propertyNames.value.splice(index, 1); propertyNamesTwo.value.splice(index, 1);
} }
} }
</script> </script>
@ -1429,7 +1434,7 @@ const options = ref<any>([
</el-row> --> </el-row> -->
<div <div
v-for="(item, index) in propertyNames" v-for="(item, index) in propertyNamesTwo"
:key="index" :key="index"
class="dynamic-item" class="dynamic-item"
> >