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

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

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