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

格式化

上级 995c21fc
...@@ -57,13 +57,6 @@ export default class AppSpan extends Vue { ...@@ -57,13 +57,6 @@ export default class AppSpan extends Vue {
*/ */
public queryParam: any; public queryParam: any;
/**
* 当前选中值
* @memberof AppSpan
*/
public curValue:any = this.value
/** /**
* 代码表 * 代码表
* *
...@@ -77,23 +70,7 @@ export default class AppSpan extends Vue { ...@@ -77,23 +70,7 @@ export default class AppSpan extends Vue {
* @type {*} * @type {*}
* @memberof AppSpan * @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();
}
}
/** /**
* 是否缓存 * 是否缓存
...@@ -125,7 +102,7 @@ export default class AppSpan extends Vue { ...@@ -125,7 +102,7 @@ export default class AppSpan extends Vue {
* @type {*} * @type {*}
* @memberof AppSpan * @memberof AppSpan
*/ */
public currentItem :any = {}; public currentItem: any = {};
/** /**
...@@ -134,10 +111,10 @@ export default class AppSpan extends Vue { ...@@ -134,10 +111,10 @@ export default class AppSpan extends Vue {
* @memberof AppSpan * @memberof AppSpan
*/ */
@Watch('value') @Watch('value')
public itemChange(){ public itemChange() {
if(this.tag && Object.is(this.codeListType,"DYNAMIC")){ if (this.tag && Object.is(this.codeListType, "DYNAMIC")) {
this.load(); this.load();
}else{ } else {
this.setText(); this.setText();
} }
} }
...@@ -147,7 +124,7 @@ export default class AppSpan extends Vue { ...@@ -147,7 +124,7 @@ export default class AppSpan extends Vue {
* *
* @memberof AppSpan * @memberof AppSpan
*/ */
public async load(): Promise<any>{ public async load(): Promise<any> {
if (Object.is(this.codeListType, "STATIC")) { if (Object.is(this.codeListType, "STATIC")) {
return; return;
} }
...@@ -173,7 +150,7 @@ export default class AppSpan extends Vue { ...@@ -173,7 +150,7 @@ export default class AppSpan extends Vue {
* 设置显示值 * 设置显示值
* @memberof AppSpan * @memberof AppSpan
*/ */
public setText(){ public setText() {
if (!this.value) { // 新建等没有值的情况 if (!this.value) { // 新建等没有值的情况
this.text = ""; this.text = "";
} }
...@@ -206,6 +183,21 @@ export default class AppSpan extends Vue { ...@@ -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> </script>
<style lang="less"> <style lang="less">
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册