forked from kongfp/Tp_Web2.0
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
72 lines
1.5 KiB
Vue
72 lines
1.5 KiB
Vue
<script setup lang="ts">
|
|
import { ref } from "vue";
|
|
import { formRules } from "./utils/rule";
|
|
import { FormProps } from "./utils/types";
|
|
|
|
const props = withDefaults(defineProps<FormProps>(), {
|
|
formInline: () => ({
|
|
/** 角色名称 */
|
|
username: "",
|
|
/** 角色编号 */
|
|
code: "",
|
|
/** 备注 */
|
|
remark: "",
|
|
/** 手机号 */
|
|
mobile: "",
|
|
/** 性别 */
|
|
sex: null,
|
|
/** 状态 */
|
|
status: null,
|
|
/** 组织 */
|
|
dept: {
|
|
id: null,
|
|
name: ""
|
|
}
|
|
})
|
|
});
|
|
|
|
const ruleFormRef = ref();
|
|
const newFormInline = ref(props.formInline);
|
|
|
|
function getRef() {
|
|
return ruleFormRef.value;
|
|
}
|
|
|
|
defineExpose({ getRef });
|
|
</script>
|
|
|
|
<template>
|
|
<el-form
|
|
ref="ruleFormRef"
|
|
:model="newFormInline"
|
|
:rules="formRules"
|
|
label-width="82px"
|
|
>
|
|
<el-form-item label="用户名称" prop="username">
|
|
<el-input
|
|
v-model="newFormInline.username"
|
|
clearable
|
|
placeholder="请输入用户名称"
|
|
/>
|
|
</el-form-item>
|
|
<el-form-item label="手机号">
|
|
<el-input
|
|
v-model="newFormInline.mobile"
|
|
clearable
|
|
placeholder="请输入手机号"
|
|
/>
|
|
</el-form-item>
|
|
<el-form-item label="状态">
|
|
<el-switch
|
|
v-model="newFormInline.status"
|
|
class="ml-2"
|
|
inline-prompt
|
|
:active-value="1"
|
|
:inactive-value="0"
|
|
active-text="已开启"
|
|
inactive-text="已关闭"
|
|
/>
|
|
</el-form-item>
|
|
</el-form>
|
|
</template>
|