添加系统码

This commit is contained in:
浅念
2025-07-21 18:12:16 +08:00
parent 31cd18fade
commit c7d890809c
7 changed files with 150 additions and 103 deletions
+46 -2
View File
@@ -72,6 +72,18 @@
</ElOption>
</ElSelect>
</ElFormItem>
<ElFormItem prop="company" label="系统">
<ElSelect v-model="formData.systems" class="account-select" @change="changesystems">
<ElOption
v-for="account in systemsList"
:key="account.id"
:label="account.name"
:value="account.id"
>
<span>{{ account.name }}</span>
</ElOption>
</ElSelect>
</ElFormItem>
<div class="drag-verify">
<div class="drag-verify-content" :class="{ error: !isPassing && isClickPass }">
<ArtDragVerify
@@ -127,6 +139,18 @@
</ElOption>
</ElSelect>
</ElFormItem>
<ElFormItem prop="company" label="系统">
<ElSelect v-model="formData.systems" class="account-select" @change="changesystems">
<ElOption
v-for="account in systemsList"
:key="account.id"
:label="account.name"
:value="account.id"
>
<span>{{ account.name }}</span>
</ElOption>
</ElSelect>
</ElFormItem>
</ElForm>
<div class="qrcode-login" v-if="!isInFeishu">
<div id="login_container"></div>
@@ -175,13 +199,18 @@
const formRef = ref<FormInstance>()
const companyid = ref('')
companyid.value = useUserStore().companyid
const systemsid = ref('')
systemsid.value = useUserStore().systemsid
const iscompany = ref(false)
const { companyabbr } = useUserStore()
//获取公司 getCompanyList
const companyList = ref<any>()
//系统
const systemsList = ref<any>()
const feishuresponse=ref()
const formData = reactive({
account: '',
systems: useUserStore().companyid?Number(useUserStore().companyid):'',
company: useUserStore().companyid?Number(useUserStore().companyid):'',
username: '',
password: '',
@@ -198,11 +227,19 @@
const { width } = useWindowSize()
const getcompanyList = async () => {
try {
// 这里调用获取品牌列表的接口
// 这里调用公司列表的接口
const response = await UserService.getCompanyList()
companyList.value = response || []
} catch (error) { }
}
const getsystemsList = async () => {
try {
// 这里调用公司列表的接口
const response = await UserService.getsystemsList()
systemsList.value = response || []
} catch (error) { }
}
// 切换语言
const { locale } = useI18n()
@@ -214,7 +251,7 @@
const getfeishuAppList = async () => {
try {
// 这里调用获取品牌列表的接口
// 这里调用飞书
feishuresponse.value = await UserService.getfeishuAppList({ corp_id: companyid.value })
if(activeLoginType.value=='qrcode'){
feishulogin()
@@ -222,6 +259,12 @@
console.log(feishuresponse)
} catch (error) { }
}
//切换系统
const changesystems = (systems: any) => {
const systemsdata = systemsList.value.find((c: any) => c.id === systems)
systemsid.value = systems
userStore.setSystems(systems,systemsdata?.code)
}
//切换公司
const changeCompany = (company: any) => {
@@ -383,6 +426,7 @@
onMounted(() => {
getcompanyList()
getsystemsList()
// 自动读取 query 参数并存入 userStore
const companyid = Array.isArray(route.query.corp_id) ? route.query.corp_id[0] : route.query.corp_id
const companyabbr = Array.isArray(route.query.corp_abbr) ? route.query.corp_abbr[0] : route.query.corp_abbr