提交 deae22ca 编写于 作者: Neuromancer255's avatar Neuromancer255

数据选择编辑器(请求数据)代码顺序调整

上级 5c934853
......@@ -172,6 +172,14 @@ export default class AppUpicker extends Vue {
*/
public inputState: boolean = false;
/**
* vue 生命周期
*
* @memberof AppUpicker
*/
public created() {
this.analysis(this.itemParams);
}
/**
* 获取关联数据项值
*
......@@ -185,6 +193,77 @@ export default class AppUpicker extends Vue {
return this.curvalue;
}
/**
* 展开下拉
*
* @memberof AppUpicker
*/
public openDropdown() {
const appUpicker: any = this.$refs.appUpicker;
if(appUpicker) {
appUpicker.focus();
}
}
/**
* 收起下拉
*
* @memberof AppUpicker
*/
public closeDropdown() {
const appUpicker: any = this.$refs.appUpicker;
if(appUpicker) {
appUpicker.blur();
}
}
/**
* 下拉切换回调
* @param flag
*
* @memberof AppUpicker
*/
public onSelectOpen(flag: boolean): void {
this.open = flag;
if (this.open) {
this.fectchItemList(this.url);
}
}
/**
* 下拉选中
*
* @param {string} val
* @memberof AppUpicker
*/
public onSelect(val: string) {
let index = this.items.findIndex((item) => Object.is(item.value, val));
if (index >= 0) {
let item:any = this.items[index];
if (this.valueitem) {
this.$emit('formitemvaluechange', { name: this.valueitem, value: item.value });
}
if (this.name) {
this.$emit('formitemvaluechange', { name: this.name, value: item.label });
}
}
}
/**
* 清除
*
* @memberof AppUpicker
*/
public onClear($event: any): void {
if (this.valueitem) {
this.$emit('formitemvaluechange', { name: this.valueitem, value: '' });
}
if (this.name) {
this.$emit('formitemvaluechange', { name: this.name, value: '' });
}
this.$forceUpdate();
}
/**
* 值变化
*
......@@ -208,16 +287,6 @@ export default class AppUpicker extends Vue {
}
}
}
/**
* vue 生命周期
*
* @memberof AppUpicker
*/
public created() {
// 解析编辑器参数
this.analysis(this.itemParams);
}
/**
* 解析编辑器参数
......@@ -281,53 +350,6 @@ export default class AppUpicker extends Vue {
});
}
/**
* 下拉切换回调
* @param flag
*
* @memberof AppUpicker
*/
public onSelectOpen(flag: boolean): void {
this.open = flag;
if (this.open) {
this.fectchItemList(this.url);
}
}
/**
* 下拉选中
*
* @param {string} val
* @memberof AppUpicker
*/
public onSelect(val: string) {
let index = this.items.findIndex((item) => Object.is(item.value, val));
if (index >= 0) {
let item:any = this.items[index];
if (this.valueitem) {
this.$emit('formitemvaluechange', { name: this.valueitem, value: item.value });
}
if (this.name) {
this.$emit('formitemvaluechange', { name: this.name, value: item.label });
}
}
}
/**
* 清除
*
* @memberof AppUpicker
*/
public onClear($event: any): void {
if (this.valueitem) {
this.$emit('formitemvaluechange', { name: this.valueitem, value: '' });
}
if (this.name) {
this.$emit('formitemvaluechange', { name: this.name, value: '' });
}
this.$forceUpdate();
}
/**
* 公共参数处理
*
......@@ -354,32 +376,6 @@ export default class AppUpicker extends Vue {
}
return true;
}
/**
* 展开下拉
*
* @memberof AppUpicker
*/
public openDropdown() {
const appUpicker: any = this.$refs.appUpicker;
if(appUpicker) {
appUpicker.focus();
}
}
/**
* 收起下拉
*
* @memberof AppUpicker
*/
public closeDropdown() {
const appUpicker: any = this.$refs.appUpicker;
if(appUpicker) {
appUpicker.blur();
}
}
}
</script>
<style lang="less">
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册