Browse Source

addEditFromApi优化

noToken
安虹睿 1 year ago
parent
commit
b211a9e6cc
  1. 44
      PC/InterFace.Dash/src/components/addEditFromApiPop/index.vue
  2. 44
      PC/UI.WinIn.FasterZ.Store/src/components/addEditFromApiPop/index.vue

44
PC/InterFace.Dash/src/components/addEditFromApiPop/index.vue

@ -13,7 +13,7 @@
> >
<!-- 数据填写 --> <!-- 数据填写 -->
<div v-if="active === 0" style="height: 100%;"> <div v-if="active === 0" style="height: 100%;">
<div class="centerInnerContent"> <div class="centerInnerContent" :class="{'hasDetails' : flexTableData}">
<!-- 左侧主表 --> <!-- 左侧主表 -->
<div class="leftMainForm"> <div class="leftMainForm">
<div class="dialogOuterTitle">{{formTitle}} 主表信息</div> <div class="dialogOuterTitle">{{formTitle}} 主表信息</div>
@ -98,16 +98,14 @@
</el-form> </el-form>
</div> </div>
<!-- 右侧子表 --> <!-- 右侧子表 -->
<div class="rightDetailTable"> <div class="rightDetailTable" v-if="flexTableData">
<div class="dialogOuterTitle">{{formTitle}} 子表信息</div> <div class="dialogOuterTitle">{{formTitle}} 子表信息</div>
<!-- 子表 -->
<currenTableFlex <currenTableFlex
ref="currenTableFlex_Ref" ref="currenTableFlex_Ref"
:isShowIndex="true" :isShowIndex="true"
:isEditable="true" :isEditable="true"
:setUTableHeight="230" :setUTableHeight="230"
class="currenTableFlex" class="currenTableFlex"
v-if="flexTableData"
:flexTableData="flexTableData" :flexTableData="flexTableData"
:flexTableColumns="flexTableColumns" :flexTableColumns="flexTableColumns"
></currenTableFlex> ></currenTableFlex>
@ -214,7 +212,11 @@ export default {
initFormItems(){ initFormItems(){
let _dtoList_type = this.handleType == 'add' ? 'C' : 'U' let _dtoList_type = this.handleType == 'add' ? 'C' : 'U'
let _dtoList = this.currentDtos[_dtoList_type].dtoList let _dtoList = this.currentDtos[_dtoList_type].dtoList
this.formItemData = JSON.parse(JSON.stringify(_dtoList)) //
let _formItems = _dtoList.filter(item=>{
return item.prop.toUpperCase() != 'DETAILS'
})
if(_formItems)this.formItemData = _formItems
// //
if(this.handleType == 'edit' && this.editRowData){ if(this.handleType == 'edit' && this.editRowData){
this.formData = JSON.parse(JSON.stringify(this.editRowData)) this.formData = JSON.parse(JSON.stringify(this.editRowData))
@ -222,7 +224,7 @@ export default {
this.formData = {} this.formData = {}
} }
// //
let _list = this.formItemData.filter(item=>{ let _list = _dtoList.filter(item=>{
return item.prop.toUpperCase() == 'DETAILS' return item.prop.toUpperCase() == 'DETAILS'
}) })
if(_list && _list.length > 0){ if(_list && _list.length > 0){
@ -233,9 +235,11 @@ export default {
} }
} }
// //
let _detailApi = this.URLOption_detailList.slice(0,this.URLOption_detailList.lastIndexOf('/')) if(this.URLOption_detailList){
let _detailDtos = this.$store.getters.dtoColumnTypes[_detailApi].S.dtoList let _detailApi = this.URLOption_detailList.slice(0,this.URLOption_detailList.lastIndexOf('/'))
this.flexTableColumns = _detailDtos let _detailDtos = this.$store.getters.dtoColumnTypes[_detailApi].S.dtoList
this.flexTableColumns = _detailDtos
}
// //
this.formRules={} this.formRules={}
@ -359,19 +363,25 @@ export default {
.centerInnerContent{ .centerInnerContent{
height: calc(100% - 60px); height: calc(100% - 60px);
overflow: auto; overflow: auto;
display: flex;
.leftMainForm{ .leftMainForm{
width: 50%;
flex-shrink: 0;
height: calc(100% - 60px); height: calc(100% - 60px);
} }
.rightDetailTable{ &.hasDetails{
height: calc(100% - 60px); display: flex;
width: calc(50%);
padding-left:40px; .leftMainForm{
border-left: #ddd solid 1px; width: 50%;
flex-shrink: 0;
}
.rightDetailTable{
height: calc(100% - 60px);
width: calc(50%);
padding-left:40px;
border-left: #ddd solid 1px;
}
} }
} }
</style> </style>

44
PC/UI.WinIn.FasterZ.Store/src/components/addEditFromApiPop/index.vue

@ -13,7 +13,7 @@
> >
<!-- 数据填写 --> <!-- 数据填写 -->
<div v-if="active === 0" style="height: 100%;"> <div v-if="active === 0" style="height: 100%;">
<div class="centerInnerContent"> <div class="centerInnerContent" :class="{'hasDetails' : flexTableData}">
<!-- 左侧主表 --> <!-- 左侧主表 -->
<div class="leftMainForm"> <div class="leftMainForm">
<div class="dialogOuterTitle">{{formTitle}} 主表信息</div> <div class="dialogOuterTitle">{{formTitle}} 主表信息</div>
@ -98,16 +98,14 @@
</el-form> </el-form>
</div> </div>
<!-- 右侧子表 --> <!-- 右侧子表 -->
<div class="rightDetailTable"> <div class="rightDetailTable" v-if="flexTableData">
<div class="dialogOuterTitle">{{formTitle}} 子表信息</div> <div class="dialogOuterTitle">{{formTitle}} 子表信息</div>
<!-- 子表 -->
<currenTableFlex <currenTableFlex
ref="currenTableFlex_Ref" ref="currenTableFlex_Ref"
:isShowIndex="true" :isShowIndex="true"
:isEditable="true" :isEditable="true"
:setUTableHeight="230" :setUTableHeight="230"
class="currenTableFlex" class="currenTableFlex"
v-if="flexTableData"
:flexTableData="flexTableData" :flexTableData="flexTableData"
:flexTableColumns="flexTableColumns" :flexTableColumns="flexTableColumns"
></currenTableFlex> ></currenTableFlex>
@ -214,7 +212,11 @@ export default {
initFormItems(){ initFormItems(){
let _dtoList_type = this.handleType == 'add' ? 'C' : 'U' let _dtoList_type = this.handleType == 'add' ? 'C' : 'U'
let _dtoList = this.currentDtos[_dtoList_type].dtoList let _dtoList = this.currentDtos[_dtoList_type].dtoList
this.formItemData = JSON.parse(JSON.stringify(_dtoList)) //
let _formItems = _dtoList.filter(item=>{
return item.prop.toUpperCase() != 'DETAILS'
})
if(_formItems)this.formItemData = _formItems
// //
if(this.handleType == 'edit' && this.editRowData){ if(this.handleType == 'edit' && this.editRowData){
this.formData = JSON.parse(JSON.stringify(this.editRowData)) this.formData = JSON.parse(JSON.stringify(this.editRowData))
@ -222,7 +224,7 @@ export default {
this.formData = {} this.formData = {}
} }
// //
let _list = this.formItemData.filter(item=>{ let _list = _dtoList.filter(item=>{
return item.prop.toUpperCase() == 'DETAILS' return item.prop.toUpperCase() == 'DETAILS'
}) })
if(_list && _list.length > 0){ if(_list && _list.length > 0){
@ -233,9 +235,11 @@ export default {
} }
} }
// //
let _detailApi = this.URLOption_detailList.slice(0,this.URLOption_detailList.lastIndexOf('/')) if(this.URLOption_detailList){
let _detailDtos = this.$store.getters.dtoColumnTypes[_detailApi].S.dtoList let _detailApi = this.URLOption_detailList.slice(0,this.URLOption_detailList.lastIndexOf('/'))
this.flexTableColumns = _detailDtos let _detailDtos = this.$store.getters.dtoColumnTypes[_detailApi].S.dtoList
this.flexTableColumns = _detailDtos
}
// //
this.formRules={} this.formRules={}
@ -359,19 +363,25 @@ export default {
.centerInnerContent{ .centerInnerContent{
height: calc(100% - 60px); height: calc(100% - 60px);
overflow: auto; overflow: auto;
display: flex;
.leftMainForm{ .leftMainForm{
width: 50%;
flex-shrink: 0;
height: calc(100% - 60px); height: calc(100% - 60px);
} }
.rightDetailTable{ &.hasDetails{
height: calc(100% - 60px); display: flex;
width: calc(50%);
padding-left:40px; .leftMainForm{
border-left: #ddd solid 1px; width: 50%;
flex-shrink: 0;
}
.rightDetailTable{
height: calc(100% - 60px);
width: calc(50%);
padding-left:40px;
border-left: #ddd solid 1px;
}
} }
} }
</style> </style>
Loading…
Cancel
Save