提交 1fa8434f 编写于 作者: WodahsOrez's avatar WodahsOrez

lxm--动态代码表编辑器参数--fix1

上级 d4e80be9
......@@ -7,7 +7,7 @@
</template>
<script lang="ts">
import { Component, Vue, Prop, Model } from 'vue-property-decorator';
import { Component, Vue, Prop, Model, Watch } from 'vue-property-decorator';
import CodeListService from "@service/app/codelist-service";
@Component({
......@@ -250,6 +250,30 @@ export default class AppCheckBox extends Vue {
}
}
/**
* 监听表单数据变化
*
* @memberof AppOrgSelect
*/
@Watch('data',{immediate:true,deep:true})
onDataChange(newVal: any, oldVal: any) {
if(newVal){
if(this.tag && this.codelistType == 'DYNAMIC'){
// 公共参数处理
let data: any = {};
this.handlePublicParams(data);
// 参数处理
let _context = data.context;
let _param = data.param;
console.log("app-check-group")
this.codeListService.getItems(this.tag,_context,_param).then((res:any) => {
this.items = res;
}).catch((error:any)=>{
console.log(`----${this.tag}----代码表不存在!`);
})
}
}
}
}
</script>
......
......@@ -6,7 +6,7 @@
</radio-group>
</template>
<script lang = 'ts'>
import { Component, Vue, Prop, Model } from 'vue-property-decorator';
import { Component, Vue, Prop, Model,Watch } from 'vue-property-decorator';
import CodeListService from "@service/app/codelist-service";
@Component({})
......@@ -69,6 +69,31 @@ export default class AppRadioGroup extends Vue {
*/
@Prop() public data?: any;
/**
* 监听表单数据变化
*
* @memberof AppOrgSelect
*/
@Watch('data',{immediate:true,deep:true})
onDataChange(newVal: any, oldVal: any) {
if(newVal){
if(this.tag && this.codelistType == 'DYNAMIC'){
// 公共参数处理
let data: any = {};
this.handlePublicParams(data);
// 参数处理
let _context = data.context;
let _param = data.param;
console.log("app-radio-group")
this.codeListService.getItems(this.tag,_context,_param).then((res:any) => {
this.items = res;
}).catch((error:any)=>{
console.log(`----${this.tag}----代码表不存在!`);
})
}
}
}
/**
* 是否禁用
*
......@@ -169,8 +194,8 @@ export default class AppRadioGroup extends Vue {
let _context = data.context;
let _param = data.param;
this.codeListService.getItems(this.tag,_context,_param).then((res:any) => {
this.items = data;
}).catch((data:any)=>{
this.items = res;
}).catch((error:any)=>{
console.log(`----${this.tag}----代码表不存在!`);
})
}
......
......@@ -133,7 +133,7 @@ export default class CodeList extends Vue {
*/
public isUseLangres:boolean = false;
/**
/**
* 数据值变化
*
* @param {*} newval
......@@ -144,7 +144,18 @@ export default class CodeList extends Vue {
@Watch('value')
public onValueChange(newVal: any, oldVal: any) {
this.dataHandle();
}
/**
* 监听表单数据变化
*
* @memberof CodeList
*/
@Watch('data',{immediate:true,deep:true})
onDataChange(newVal: any, oldVal: any) {
if(newVal){
this.dataHandle();
}
}
/**
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册