大屏页面初始化
This commit is contained in:
@@ -72,7 +72,7 @@ const handleLogin = async () => {
|
||||
ElMessage.success('登录成功!');
|
||||
setTimeout(() => {
|
||||
router.push('/dashboard');
|
||||
}, 3000);
|
||||
}, 300);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}finally{
|
||||
|
||||
@@ -72,9 +72,12 @@
|
||||
placeholder="请选择用户角色"
|
||||
clearable
|
||||
>
|
||||
<el-option label="管理员" value="0" />
|
||||
<el-option label="普通用户" value="1" />
|
||||
<el-option label="访客" value="2" />
|
||||
<el-option
|
||||
v-for="item in roleData"
|
||||
:key="item.roleId"
|
||||
:label="item.roleName"
|
||||
:value="item.roleId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
@@ -112,7 +115,19 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { getHomeRoleList } from '@/api/bizRole'
|
||||
|
||||
const roleData = ref([]);
|
||||
|
||||
const getListRole = async () => {
|
||||
try {
|
||||
const res = await getHomeRoleList();
|
||||
roleData.value = res || []
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
const props = defineProps({
|
||||
formData: {
|
||||
@@ -162,6 +177,10 @@ const resetForm = () => {
|
||||
}
|
||||
|
||||
defineExpose({ validate, resetForm })
|
||||
|
||||
onMounted(() => {
|
||||
getListRole();
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
Reference in New Issue
Block a user