提交 2097e06b 编写于 作者: KK's avatar KK

格式化

上级 995c21fc
......@@ -12,7 +12,7 @@ import { Vue, Component, Prop, Provide, Emit, Watch, } from "vue-property-decora
import { CodeListService } from "@/ibiz-core";
import { Loading } from '@/ibiz-core/utils';
@Component({
components: {}
components: {}
})
export default class AppSpan extends Vue {
......@@ -57,13 +57,6 @@ export default class AppSpan extends Vue {
*/
public queryParam: any;
/**
* 当前选中值
* @memberof AppSpan
*/
public curValue:any = this.value
/**
* 代码表
*
......@@ -77,30 +70,14 @@ export default class AppSpan extends Vue {
* @type {*}
* @memberof AppSpan
*/
public text:any = '';
public text: any = '';
/**
* vue 生命周期
*
* @memberof AppSpan
*/
public created() {
if (Object.is(this.codeListType, "STATIC")) {
this.items = this.$store.getters.getCodeListItems(this.tag);
this.setText();
} else if(Object.is(this.codeListType, "DYNAMIC")) {
this.load();
}else{
this.setText();
}
}
/**
* 是否缓存
*
* @type {*}
* @memberof AppSelect
*/
* 是否缓存
*
* @type {*}
* @memberof AppSelect
*/
@Prop({ default: true }) protected isCache?: boolean;
/**
......@@ -111,21 +88,21 @@ export default class AppSpan extends Vue {
*/
public isCached: boolean = false;
/**
* 应用上下文
*
* @type {*}
* @memberof AppSpan
*/
/**
* 应用上下文
*
* @type {*}
* @memberof AppSpan
*/
@Prop({ default: {} }) protected context?: any;
/**
* 当前值项
*
* @type {*}
* @memberof AppSpan
*/
public currentItem :any = {};
/**
* 当前值项
*
* @type {*}
* @memberof AppSpan
*/
public currentItem: any = {};
/**
......@@ -134,10 +111,10 @@ export default class AppSpan extends Vue {
* @memberof AppSpan
*/
@Watch('value')
public itemChange(){
if(this.tag && Object.is(this.codeListType,"DYNAMIC")){
public itemChange() {
if (this.tag && Object.is(this.codeListType, "DYNAMIC")) {
this.load();
}else{
} else {
this.setText();
}
}
......@@ -147,14 +124,14 @@ export default class AppSpan extends Vue {
*
* @memberof AppSpan
*/
public async load(): Promise<any>{
public async load(): Promise<any> {
if (Object.is(this.codeListType, "STATIC")) {
return;
}
if (!this.isCached) {
// Loading.show(this.$t('app.loadding'));
}
let response: any = await this.codeListService.getItems(this.tag, { ...this.context }, this.queryParam);
let response: any = await this.codeListService.getItems(this.tag, { ...this.context }, this.queryParam);
if (!this.isCached) {
// Loading.hidden();
}
......@@ -173,7 +150,7 @@ export default class AppSpan extends Vue {
* 设置显示值
* @memberof AppSpan
*/
public setText(){
public setText() {
if (!this.value) { // 新建等没有值的情况
this.text = "";
}
......@@ -206,6 +183,21 @@ export default class AppSpan extends Vue {
}
}
/**
* vue 生命周期
*
* @memberof AppSpan
*/
public created() {
if (Object.is(this.codeListType, "STATIC")) {
this.items = this.$store.getters.getCodeListItems(this.tag);
this.setText();
} else if (Object.is(this.codeListType, "DYNAMIC")) {
this.load();
} else {
this.setText();
}
}
}
</script>
<style lang="less">
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册