This commit is contained in:
孟帅
2023-07-20 18:01:10 +08:00
parent 9113fc5297
commit 373d9627fb
492 changed files with 12170 additions and 6982 deletions

View File

@@ -228,7 +228,7 @@
</template>
<script lang="ts" setup>
import { h, reactive, ref } from 'vue';
import { h, reactive, ref, onMounted } from 'vue';
import { useDialog, useMessage } from 'naive-ui';
import { ActionItem, BasicTable, TableAction } from '@/components/Table';
import { BasicForm } from '@/components/Form/index';
@@ -243,7 +243,7 @@
import QrcodeVue from 'qrcode.vue';
import AddBalance from './addBalance.vue';
import AddIntegral from './addIntegral.vue';
import { addNewState, addState, options, register, defaultState } from './model';
import { addNewState, addState, options, register, defaultState, loadOptions } from './model';
import { usePermission } from '@/hooks/web/usePermission';
import { useUserStore } from '@/store/modules/user';
import { LoginRoute } from '@/router';
@@ -518,11 +518,15 @@
formParams.value = addNewState(record as addState);
}
function handleInviteQR(code: string) {
function handleInviteQR(code: any) {
const domain = getNowUrl() + '#';
qrParams.value.qrUrl = domain + LoginRoute.path + '?scope=register&inviteCode=' + code;
showQrModal.value = true;
}
onMounted(async () => {
await loadOptions();
});
</script>
<style lang="less" scoped></style>

View File

@@ -178,7 +178,7 @@ export const options = ref<any>({
post: [],
});
async function loadOptions() {
export async function loadOptions() {
const dept = await getDeptOption();
if (dept.list !== undefined) {
options.value.dept = dept.list;
@@ -187,6 +187,7 @@ async function loadOptions() {
const role = await getRoleOption();
if (role.list !== undefined) {
options.value.role = role.list;
options.value.roleTabs = [{ id: -1, name: '全部' }];
treeDataToCompressed(role.list);
}
@@ -207,8 +208,5 @@ function treeDataToCompressed(source) {
? treeDataToCompressed(source[i].children)
: ''; // 子级递归
}
return options.value.roleTabs;
}
await loadOptions();

View File

@@ -39,7 +39,8 @@
}
});
function handleBeforeLeave(tabName: string) {
function handleBeforeLeave(tabName: string): boolean | Promise<boolean> {
defaultTab.value = tabName;
return true;
}
</script>