|
|
|
@ -18,16 +18,158 @@ const props = withDefaults(defineProps<FormProps>(), {
|
|
|
|
|
/** 状态 */
|
|
|
|
|
status: null,
|
|
|
|
|
/** 组织 */
|
|
|
|
|
dept: {
|
|
|
|
|
id: null,
|
|
|
|
|
name: ""
|
|
|
|
|
}
|
|
|
|
|
deptId: null
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const ruleFormRef = ref();
|
|
|
|
|
const newFormInline = ref(props.formInline);
|
|
|
|
|
// const deptList = reactive([
|
|
|
|
|
// {
|
|
|
|
|
// name: "杭州总公司",
|
|
|
|
|
// parentId: 0,
|
|
|
|
|
// id: 100,
|
|
|
|
|
// sort: 0,
|
|
|
|
|
// phone: "15888888888",
|
|
|
|
|
// principal: "@cname()",
|
|
|
|
|
// email: "@email",
|
|
|
|
|
// status: 1, // 状态 1 启用 0 停用
|
|
|
|
|
// type: 1, // 1 公司 2 分公司 3 部门
|
|
|
|
|
// createTime: 1605456000000,
|
|
|
|
|
// remark: "@cparagraph(1, 3)"
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// name: "郑州分公司",
|
|
|
|
|
// parentId: 100,
|
|
|
|
|
// id: 101,
|
|
|
|
|
// sort: 1,
|
|
|
|
|
// phone: "15888888888",
|
|
|
|
|
// principal: "@cname()",
|
|
|
|
|
// email: "@email",
|
|
|
|
|
// status: 1,
|
|
|
|
|
// type: 2,
|
|
|
|
|
// createTime: 1605456000000,
|
|
|
|
|
// remark: "@cparagraph(1, 3)"
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// name: "研发部门",
|
|
|
|
|
// parentId: 101,
|
|
|
|
|
// id: 103,
|
|
|
|
|
// sort: 1,
|
|
|
|
|
// phone: "15888888888",
|
|
|
|
|
// principal: "@cname()",
|
|
|
|
|
// email: "@email",
|
|
|
|
|
// status: 1,
|
|
|
|
|
// type: 3,
|
|
|
|
|
// createTime: 1605456000000,
|
|
|
|
|
// remark: "@cparagraph(1, 3)"
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// name: "市场部门",
|
|
|
|
|
// parentId: 102,
|
|
|
|
|
// id: 108,
|
|
|
|
|
// sort: 1,
|
|
|
|
|
// phone: "15888888888",
|
|
|
|
|
// principal: "@cname()",
|
|
|
|
|
// email: "@email",
|
|
|
|
|
// status: 1,
|
|
|
|
|
// type: 3,
|
|
|
|
|
// createTime: 1605456000000,
|
|
|
|
|
// remark: "@cparagraph(1, 3)"
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// name: "深圳分公司",
|
|
|
|
|
// parentId: 100,
|
|
|
|
|
// id: 102,
|
|
|
|
|
// sort: 2,
|
|
|
|
|
// phone: "15888888888",
|
|
|
|
|
// principal: "@cname()",
|
|
|
|
|
// email: "@email",
|
|
|
|
|
// status: 1,
|
|
|
|
|
// type: 2,
|
|
|
|
|
// createTime: 1605456000000,
|
|
|
|
|
// remark: "@cparagraph(1, 3)"
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// name: "市场部门",
|
|
|
|
|
// parentId: 101,
|
|
|
|
|
// id: 104,
|
|
|
|
|
// sort: 2,
|
|
|
|
|
// phone: "15888888888",
|
|
|
|
|
// principal: "@cname()",
|
|
|
|
|
// email: "@email",
|
|
|
|
|
// status: 1,
|
|
|
|
|
// type: 3,
|
|
|
|
|
// createTime: 1605456000000,
|
|
|
|
|
// remark: "@cparagraph(1, 3)"
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// name: "财务部门",
|
|
|
|
|
// parentId: 102,
|
|
|
|
|
// id: 109,
|
|
|
|
|
// sort: 2,
|
|
|
|
|
// phone: "15888888888",
|
|
|
|
|
// principal: "@cname()",
|
|
|
|
|
// email: "@email",
|
|
|
|
|
// status: 1,
|
|
|
|
|
// type: 3,
|
|
|
|
|
// createTime: 1605456000000,
|
|
|
|
|
// remark: "@cparagraph(1, 3)"
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// name: "测试部门",
|
|
|
|
|
// parentId: 101,
|
|
|
|
|
// id: 105,
|
|
|
|
|
// sort: 3,
|
|
|
|
|
// phone: "15888888888",
|
|
|
|
|
// principal: "@cname()",
|
|
|
|
|
// email: "@email",
|
|
|
|
|
// status: 0,
|
|
|
|
|
// type: 3,
|
|
|
|
|
// createTime: 1605456000000,
|
|
|
|
|
// remark: "@cparagraph(1, 3)"
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// name: "财务部门",
|
|
|
|
|
// parentId: 101,
|
|
|
|
|
// id: 106,
|
|
|
|
|
// sort: 4,
|
|
|
|
|
// phone: "15888888888",
|
|
|
|
|
// principal: "@cname()",
|
|
|
|
|
// email: "@email",
|
|
|
|
|
// status: 1,
|
|
|
|
|
// type: 3,
|
|
|
|
|
// createTime: 1605456000000,
|
|
|
|
|
// remark: "@cparagraph(1, 3)"
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// name: "运维部门",
|
|
|
|
|
// parentId: 101,
|
|
|
|
|
// id: 107,
|
|
|
|
|
// sort: 5,
|
|
|
|
|
// phone: "15888888888",
|
|
|
|
|
// principal: "@cname()",
|
|
|
|
|
// email: "@email",
|
|
|
|
|
// status: 0,
|
|
|
|
|
// type: 3,
|
|
|
|
|
// createTime: 1605456000000,
|
|
|
|
|
// remark: "@cparagraph(1, 3)"
|
|
|
|
|
// }
|
|
|
|
|
// ]);
|
|
|
|
|
|
|
|
|
|
// const buildTree = (data: any, parentId: number) => {
|
|
|
|
|
// const children = data.filter(
|
|
|
|
|
// (node: { parentId: number }) => node.parentId === parentId
|
|
|
|
|
// );
|
|
|
|
|
// return children.map((node: { id: any; name: any }) => {
|
|
|
|
|
// const { id, name } = node;
|
|
|
|
|
// return {
|
|
|
|
|
// value: id,
|
|
|
|
|
// label: name,
|
|
|
|
|
// children: buildTree(data, id)
|
|
|
|
|
// };
|
|
|
|
|
// });
|
|
|
|
|
// };
|
|
|
|
|
function getRef() {
|
|
|
|
|
return ruleFormRef.value;
|
|
|
|
|
}
|
|
|
|
@ -67,5 +209,22 @@ defineExpose({ getRef });
|
|
|
|
|
inactive-text="已关闭"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="性别" prop="sex">
|
|
|
|
|
<el-select v-model="newFormInline.sex" placeholder="请选择">
|
|
|
|
|
<el-option label="未知" :value="2" />
|
|
|
|
|
<el-option label="男" :value="0" />
|
|
|
|
|
<el-option label="女" :value="1" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<!-- <el-form-item label="所属部门" prop="deptId">
|
|
|
|
|
<el-tree-select
|
|
|
|
|
v-model="newFormInline.deptId"
|
|
|
|
|
placeholder="请选择所属部门"
|
|
|
|
|
:data="buildTree(deptList, 0)"
|
|
|
|
|
filterable
|
|
|
|
|
check-strictly
|
|
|
|
|
:render-after-expand="false"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item> -->
|
|
|
|
|
</el-form>
|
|
|
|
|
</template>
|
|
|
|
|