|
@@ -16,6 +16,7 @@
|
|
|
<tab
|
|
|
class="tab"
|
|
|
:titles="$t(`page.views.account.user.index.titles`)"
|
|
|
+ v-if="currIndex !== null"
|
|
|
:currIndex.sync="currIndex"
|
|
|
/>
|
|
|
|
|
@@ -115,10 +116,9 @@
|
|
|
</template>
|
|
|
<script lang="ts">
|
|
|
import { Component, Vue, Watch, Prop } from "vue-property-decorator";
|
|
|
-@Component
|
|
|
+@Component({ name: "user" })
|
|
|
export default class extends Vue {
|
|
|
- @Prop(String) private index!: string;
|
|
|
- private currIndex: number = 0;
|
|
|
+ private currIndex: number | null = null;
|
|
|
private arr: Array<{
|
|
|
url: string;
|
|
|
params: IAny | null;
|
|
@@ -130,21 +130,19 @@ export default class extends Vue {
|
|
|
params: null,
|
|
|
items: []
|
|
|
}));
|
|
|
- activated() {
|
|
|
- this.currIndex = Number(this.index) || 0;
|
|
|
- this.reload();
|
|
|
+ created() {
|
|
|
+ const { index = 0 } = this.$route.query;
|
|
|
+ this.currIndex = Number(index) | 0;
|
|
|
}
|
|
|
@Watch("currIndex")
|
|
|
currIndexChange() {
|
|
|
+ if (this.currIndex === null) return;
|
|
|
this.arr[this.currIndex].params = this.arr[this.currIndex].params || {};
|
|
|
}
|
|
|
setItems(items: any[], index: number) {
|
|
|
this.$set(this.arr[index], "items", items.length ? items : null);
|
|
|
}
|
|
|
|
|
|
- reload() {
|
|
|
- this.arr[this.currIndex].params = {};
|
|
|
- }
|
|
|
async cancelGz(companyId: number) {
|
|
|
if (
|
|
|
!(await this.$confirm(
|
|
@@ -157,7 +155,7 @@ export default class extends Vue {
|
|
|
});
|
|
|
if (err) return;
|
|
|
this.$message.success(`${this.$i18n.t("message.success.cancelGz")}`);
|
|
|
- this.reload();
|
|
|
+ this.arr[0].params = {};
|
|
|
}
|
|
|
async revocation(id: number) {
|
|
|
if (
|
|
@@ -171,7 +169,7 @@ export default class extends Vue {
|
|
|
});
|
|
|
if (err) return;
|
|
|
this.$message.success(`${this.$i18n.t("message.success.revocation")}`);
|
|
|
- this.reload();
|
|
|
+ this.arr[1].params = {};
|
|
|
}
|
|
|
}
|
|
|
</script>
|