修改代码

This commit is contained in:
ival 2021-04-09 17:12:35 +08:00
commit 2c69d7e145
2 changed files with 99 additions and 2 deletions

View File

@ -47,14 +47,14 @@ export default {
handler: this.doCopy,
disabledCb: selected => {
const storage = this.$iscs.getController().getStorage();
return storage.values().length <= 0;
return !storage.values().length;
}
},
{
label: '粘贴',
handler: this.doParse,
disabledCb: selected => {
return this.clipboardList.length;
return !this.clipboardList.length;
}
}
]

View File

@ -0,0 +1,97 @@
<template>
<div>
<el-button type="primary" size="small" class="addStatus" @click="addStatus">添加</el-button>
<el-form ref="form" class="tableForm" :model="formModel">
<!-- label-width="110px" -->
<el-table :data="formModel.stateList" stripe class="eachStatusTable" size="mini">
<el-table-column type="expand">
<template slot-scope="props">
<el-form label-position="left" inline class="demo-table-expand">
{{ 111 }}
</el-form>
</template>
</el-table-column>
<el-table-column label="状态" width="168">
<!-- align="center" -->
<template slot-scope="scope">
<el-form-item
:prop="'stateList.'+scope.$index+'.status'"
:rules="[{required: true, message:'请输入状态', trigger: 'blur'}]"
>
<el-input v-model="scope.row.status" size="mini" type="text" style="width:148px" :maxlength="100" />
</el-form-item>
</template>
</el-table-column>
<el-table-column label="描述" width="210">
<template slot-scope="scope">
<el-form-item
:prop="'stateList.'+scope.$index+'.description'"
:rules="[{required: true, message:'请输入描述', trigger: 'blur'}]"
>
<el-input v-model="scope.row.description" size="mini" type="text" style="width:190px" :maxlength="100" />
</el-form-item>
</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template slot-scope="scope">
<el-button type="danger" size="mini" @click="deleteStatus(scope.$index,scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- :model="formModel" -->
</el-form>
</div>
</template>
<script>
export default {
name:'TableForm',
props: {
stateList: {
type: Array,
required: true
}
},
data() {
return {
formModel:{stateList:this.stateList}
};
},
mounted() {
},
methods:{
addStatus() {
this.formModel.stateList.push({status:'', description:''});
},
deleteStatus(index, row) {
this.formModel.stateList.splice(index, 1);
}
}
};
</script>
<style lang="scss" scoped>
.eachStatusTable{
width: 530px;
margin-left: 10px;
margin-top: 10px;
border: 1px #dedede solid;
}
.addStatus{
float: right;
display: inline-block;
margin-bottom: 10px;
margin-right: 10px;
}
.demo-table-expand {
// font-size: 0;
}
.demo-table-expand label {
width: 90px;
color: #99a9bf;
}
.demo-table-expand .el-form-item {
margin-right: 0;
margin-bottom: 0;
width: 50%;
}
</style>