提交 12c8ec96 编写于 作者: KK's avatar KK

修复快速分组异常

上级 e6bdee4b
......@@ -29,14 +29,7 @@
</template>
<script lang="ts">
import {
Vue,
Component,
Prop,
Provide,
Emit,
Watch,
} from "vue-property-decorator";
import { Vue, Component, Prop, Provide, Emit, Watch, } from "vue-property-decorator";
@Component({
components: {},
})
......@@ -55,7 +48,7 @@ export default class AppQuickGroupTab extends Vue {
* @type {any[]}
* @memberof ViewQuickGroupTab
*/
@Prop({ default:0 }) public pageTotal!: number;
@Prop({ default: 0 }) public pageTotal!: number;
/**
* 渲染列表
......@@ -84,7 +77,7 @@ export default class AppQuickGroupTab extends Vue {
this.items.every((item: any) => {
if (item.default) {
this.$nextTick(() => {
this.handleClick(item, true);
this.handleClick(item, true, true);
})
}
return !item.default;
......@@ -144,11 +137,7 @@ export default class AppQuickGroupTab extends Vue {
* @param codeItem 代码项
* @memberof AppQuickGroup
*/
public setChildCodeItems(
pValue: string,
result: Array<any>,
codeItem: any
): void {
public setChildCodeItems(pValue: string, result: Array<any>, codeItem: any): void {
result.forEach((item: any) => {
if (item.pvalue == pValue) {
let valueField: string = item.value;
......@@ -168,7 +157,7 @@ export default class AppQuickGroupTab extends Vue {
* @param isswitch 是否切换UI选中项
* @memberof AppQuickGroup
*/
public handleClick($event: any, isswitch: boolean = true): void {
public handleClick($event: any, isswitch: boolean = true, isDefalut: boolean = false): void {
if (isswitch) {
this.selectedUiItem = $event;
}
......@@ -180,22 +169,25 @@ export default class AppQuickGroupTab extends Vue {
}
} else {
this.subItems.length = 0;
this.items.forEach((item:any) => {
this.items.forEach((item: any) => {
item.selected = false;
item.childSelected = false;
item.selectChildLabel = "";
})
$event.selected = true;
if ($event.pvalue) {
this.items.forEach((item:any) => {
this.items.forEach((item: any) => {
if (item.value === $event.pvalue) {
item.childSelected = true;
item.selectChildLabel = $event.label;
}
})
}
if (!isDefalut) {
this.$emit("valuechange", $event);
}
}
this.$forceUpdate();
}
......@@ -205,7 +197,7 @@ export default class AppQuickGroupTab extends Vue {
* @type {any[]}
* @memberof AppQuickGroup
*/
public closeBackdrop () {
public closeBackdrop() {
this.subItems.length = 0;
this.$forceUpdate();
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册