2024-08-07 08:57:56 +08:00
|
|
|
<script setup lang="ts">
|
2024-08-08 08:53:05 +08:00
|
|
|
import { onBeforeUnmount, onMounted, ref } from 'vue';
|
2024-08-07 08:57:56 +08:00
|
|
|
|
2024-08-08 15:50:37 +08:00
|
|
|
import {
|
|
|
|
Tag as ATag,
|
|
|
|
Button,
|
|
|
|
Card,
|
|
|
|
RadioButton,
|
|
|
|
RadioGroup,
|
|
|
|
Select,
|
|
|
|
} from 'ant-design-vue';
|
2024-08-08 14:05:08 +08:00
|
|
|
|
|
|
|
import { DictTag } from '#/components/Dict';
|
|
|
|
import { getDict, getDictOptions } from '#/utils/dict';
|
2024-08-07 08:57:56 +08:00
|
|
|
|
2024-08-08 16:28:23 +08:00
|
|
|
import TableTest from './table';
|
|
|
|
|
2024-08-08 08:53:05 +08:00
|
|
|
const count = ref(0);
|
|
|
|
let intervalId: number = 0;
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
intervalId = setInterval(() => {
|
|
|
|
count.value++;
|
|
|
|
}, 1000);
|
|
|
|
});
|
|
|
|
|
|
|
|
onBeforeUnmount(() => intervalId && clearInterval(intervalId));
|
2024-08-08 14:05:08 +08:00
|
|
|
|
|
|
|
const sexOptions = getDictOptions('sys_user_sex');
|
|
|
|
const disabledDict = getDict('sys_normal_disable');
|
2024-08-08 15:50:37 +08:00
|
|
|
const select = ref('pc');
|
|
|
|
const deviceOptions = getDictOptions('sys_device_type');
|
2024-08-07 08:57:56 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2024-08-08 14:05:08 +08:00
|
|
|
<div class="m-[16px] flex flex-col gap-[16px]">
|
2024-08-08 08:53:05 +08:00
|
|
|
<Card title="测试keepAlive">
|
|
|
|
<template #extra>
|
|
|
|
<Button type="primary" v-access:code="['system:user:list']">
|
|
|
|
测试按钮权限system:user:list
|
|
|
|
</Button>
|
|
|
|
</template>
|
|
|
|
<p>当前计数: {{ count }}</p>
|
|
|
|
</Card>
|
2024-08-08 14:05:08 +08:00
|
|
|
<Card title="字典测试">
|
|
|
|
<div class="flex items-center gap-[16px]">
|
|
|
|
<Select
|
|
|
|
:options="sexOptions"
|
|
|
|
class="w-[200px]"
|
|
|
|
placeholder="请选择性别"
|
|
|
|
/>
|
2024-08-08 15:50:37 +08:00
|
|
|
<div class="flex gap-[6px]">
|
|
|
|
<DictTag :dicts="disabledDict" value="0" />
|
|
|
|
<DictTag :dicts="disabledDict" value="1" />
|
|
|
|
</div>
|
|
|
|
<RadioGroup v-model:value="select" button-style="solid">
|
|
|
|
<RadioButton
|
|
|
|
v-for="item in deviceOptions"
|
|
|
|
:key="item.value"
|
|
|
|
:value="item.value"
|
|
|
|
>
|
|
|
|
{{ item.label }}
|
|
|
|
</RadioButton>
|
|
|
|
</RadioGroup>
|
2024-08-08 14:05:08 +08:00
|
|
|
</div>
|
|
|
|
</Card>
|
2024-08-09 14:00:07 +08:00
|
|
|
<Card title="tag测试">
|
2024-08-08 15:37:07 +08:00
|
|
|
<ATag :bordered="false" color="processing">processing</ATag>
|
|
|
|
<ATag :bordered="false" color="success">success</ATag>
|
|
|
|
<ATag :bordered="false" color="error">error</ATag>
|
|
|
|
<ATag :bordered="false" color="warning">warning</ATag>
|
|
|
|
<ATag :bordered="false" color="magenta">magenta</ATag>
|
|
|
|
<ATag :bordered="false" color="red">red</ATag>
|
|
|
|
<ATag :bordered="false" color="volcano">volcano</ATag>
|
|
|
|
<ATag :bordered="false" color="orange">orange</ATag>
|
|
|
|
<ATag :bordered="false" color="gold">gold</ATag>
|
|
|
|
<ATag :bordered="false" color="lime">lime</ATag>
|
|
|
|
<ATag :bordered="false" color="green">green</ATag>
|
|
|
|
<ATag :bordered="false" color="cyan">cyan</ATag>
|
|
|
|
<ATag :bordered="false" color="blue">blue</ATag>
|
|
|
|
<ATag :bordered="false" color="geekblue">geekblue</ATag>
|
|
|
|
<ATag :bordered="false" color="purple">purple</ATag>
|
|
|
|
</Card>
|
2024-08-08 16:28:23 +08:00
|
|
|
<Card title="table测试">
|
|
|
|
<TableTest />
|
|
|
|
</Card>
|
2024-08-07 08:57:56 +08:00
|
|
|
</div>
|
|
|
|
</template>
|