|
@@ -9,54 +9,144 @@
|
|
|
@click-left="handleClickLeft"
|
|
|
></wd-navbar>
|
|
|
<view class="py20rpx">
|
|
|
- <view class="bg-white px32rpx py28rpx">
|
|
|
- <customFormItem label="用户名称" required>
|
|
|
- <wd-input
|
|
|
- type="text"
|
|
|
- placeholder="请输入用户名称"
|
|
|
- no-border
|
|
|
- custom-class="inputClass"
|
|
|
- />
|
|
|
- </customFormItem>
|
|
|
- <customFormItem label="归属部门" required>
|
|
|
- <view @click="handleShow">
|
|
|
+ <wd-form ref="form" :model="formData">
|
|
|
+ <view class="bg-white px32rpx py28rpx">
|
|
|
+ <customFormItem label="用户名称" required>
|
|
|
<wd-input
|
|
|
type="text"
|
|
|
- placeholder="请选择归属部门"
|
|
|
+ placeholder="请输入用户名称"
|
|
|
no-border
|
|
|
custom-class="inputClass"
|
|
|
- readonly
|
|
|
+ v-model:model-value="formData.username"
|
|
|
+ :rules="[{ required: true, message: '请输入用户名称' }]"
|
|
|
+ />
|
|
|
+ </customFormItem>
|
|
|
+ <customFormItem label="归属部门" required>
|
|
|
+ <view @click="handleShow">
|
|
|
+ <wd-input
|
|
|
+ type="text"
|
|
|
+ placeholder="请选择归属部门"
|
|
|
+ no-border
|
|
|
+ custom-class="inputClass"
|
|
|
+ readonly
|
|
|
+ :rules="[{ required: true, message: '请选择归属部门' }]"
|
|
|
+ >
|
|
|
+ <template #suffix>
|
|
|
+ <wd-icon
|
|
|
+ name="arrow-down"
|
|
|
+ size="22px"
|
|
|
+ color="rgba(0,0,0,0.3)"
|
|
|
+ ></wd-icon>
|
|
|
+ </template>
|
|
|
+ </wd-input>
|
|
|
+ </view>
|
|
|
+ </customFormItem>
|
|
|
+ <customFormItem label="登录账号" required>
|
|
|
+ <wd-input
|
|
|
+ type="text"
|
|
|
+ placeholder="请输入登录账号"
|
|
|
+ no-border
|
|
|
+ custom-class="inputClass"
|
|
|
+ :rules="[{ required: true, message: '请输入登录账号' }]"
|
|
|
+ />
|
|
|
+ </customFormItem>
|
|
|
+ <customFormItem label="登录密码" required>
|
|
|
+ <wd-input
|
|
|
+ show-password
|
|
|
+ placeholder="请输入登录密码"
|
|
|
+ no-border
|
|
|
+ :rules="[{ required: true, message: '请输入登录密码' }]"
|
|
|
+ custom-class="inputClass"
|
|
|
+ />
|
|
|
+ </customFormItem>
|
|
|
+ <customFormItem label="角色" required bg="#fff" v-if="rolelist">
|
|
|
+ <wd-radio-group
|
|
|
+ inline
|
|
|
+ v-model:model-value="formData.roleId"
|
|
|
+ shape="dot"
|
|
|
+ :rules="[{ required: true, message: '请选择角色' }]"
|
|
|
>
|
|
|
- <template #suffix>
|
|
|
- <wd-icon
|
|
|
- name="arrow-down"
|
|
|
- size="22px"
|
|
|
- color="rgba(0,0,0,0.3)"
|
|
|
- ></wd-icon>
|
|
|
- </template>
|
|
|
- </wd-input>
|
|
|
- </view>
|
|
|
- </customFormItem>
|
|
|
- <customFormItem label="登录账号" required>
|
|
|
- <wd-input
|
|
|
- type="text"
|
|
|
- placeholder="请输入登录账号"
|
|
|
- no-border
|
|
|
- custom-class="inputClass"
|
|
|
- />
|
|
|
- </customFormItem>
|
|
|
- <customFormItem label="登录密码" required>
|
|
|
- <wd-input
|
|
|
- show-password
|
|
|
- placeholder="请输入登录密码"
|
|
|
- no-border
|
|
|
- custom-class="inputClass"
|
|
|
- />
|
|
|
- </customFormItem>
|
|
|
- </view>
|
|
|
+ <wd-radio
|
|
|
+ :value="item.id"
|
|
|
+ v-for="item in rolelist.records"
|
|
|
+ :key="item.id"
|
|
|
+ >{{ item.roleName }}</wd-radio
|
|
|
+ >
|
|
|
+ </wd-radio-group>
|
|
|
+ </customFormItem>
|
|
|
+ <customFormItem label="状态" required bg="#fff">
|
|
|
+ <wd-switch
|
|
|
+ v-model="formData.status"
|
|
|
+ :active-value="1"
|
|
|
+ :inactive-value="0"
|
|
|
+ />
|
|
|
+ </customFormItem>
|
|
|
+ </view>
|
|
|
+ <view class="bg-white mt3 px32rpx py28rpx">
|
|
|
+ <customFormItem label="培训项目" required bg="#fff" v-if="categoryList">
|
|
|
+ <wd-checkbox-group
|
|
|
+ inline
|
|
|
+ v-model:model-value="formData.trainingPrograms"
|
|
|
+ :rules="[{ required: true, message: '请选择培训项目' }]"
|
|
|
+ >
|
|
|
+ <wd-checkbox
|
|
|
+ v-model:model-value="item.id"
|
|
|
+ true-value="sting"
|
|
|
+ false-value="string"
|
|
|
+ v-for="item in categoryList.records"
|
|
|
+ :key="item.id"
|
|
|
+ >{{ item.name }}</wd-checkbox
|
|
|
+ >
|
|
|
+ </wd-checkbox-group>
|
|
|
+ </customFormItem>
|
|
|
+ <customFormItem
|
|
|
+ label="无犯罪记录"
|
|
|
+ required
|
|
|
+ bg="#fff"
|
|
|
+ v-if="categoryList"
|
|
|
+ >
|
|
|
+ <upload
|
|
|
+ tip="单张照片,不超过5MB"
|
|
|
+ :max-size="5242880"
|
|
|
+ :sourceType="['camera']"
|
|
|
+ accept="image"
|
|
|
+ :limit="1"
|
|
|
+ ></upload>
|
|
|
+ </customFormItem>
|
|
|
+ <customFormItem label="教学理念" required>
|
|
|
+ <wd-input
|
|
|
+ type="text"
|
|
|
+ placeholder="请输入教学理念"
|
|
|
+ no-border
|
|
|
+ custom-class="inputClass"
|
|
|
+ v-model:model-value="formData.teachingPhilosophy"
|
|
|
+ :rules="[{ required: true, message: '请输入教学理念' }]"
|
|
|
+ />
|
|
|
+ </customFormItem>
|
|
|
+ <customFormItem label="擅长描述" required>
|
|
|
+ <wd-input
|
|
|
+ type="text"
|
|
|
+ placeholder="请输入擅长描述"
|
|
|
+ no-border
|
|
|
+ custom-class="inputClass"
|
|
|
+ v-model:model-value="formData.excelMsg"
|
|
|
+ :rules="[{ required: true, message: '请输入擅长描述' }]"
|
|
|
+ />
|
|
|
+ </customFormItem>
|
|
|
+ <customFormItem label="荣誉证书" required bg="#fff">
|
|
|
+ <upload
|
|
|
+ tip="最多支持2张图片,单张照片不超过5MB"
|
|
|
+ :max-size="5242880"
|
|
|
+ :sourceType="['camera']"
|
|
|
+ accept="image"
|
|
|
+ :limit="2"
|
|
|
+ ></upload>
|
|
|
+ </customFormItem>
|
|
|
+ </view>
|
|
|
+ </wd-form>
|
|
|
</view>
|
|
|
-
|
|
|
- <fixdbtn block size="large">确认</fixdbtn>
|
|
|
+ <view class="h-180rpx"></view>
|
|
|
+ <fixdbtn block size="large" @click="handleSubmit">确认</fixdbtn>
|
|
|
<view class="customPopup">
|
|
|
<wd-popup
|
|
|
v-model="treeFlage"
|
|
@@ -70,20 +160,26 @@
|
|
|
<view class="mt28rpx bg-white h-700rpx rounded-32rpx overflow-y-scroll">
|
|
|
<scroll-view scroll-y>
|
|
|
<tree
|
|
|
- :localdata="data"
|
|
|
+ :localdata="deptList"
|
|
|
valueKey="id"
|
|
|
- textKey="name"
|
|
|
+ textKey="departName"
|
|
|
childrenKey="children"
|
|
|
ref="treePicker"
|
|
|
+ v-model="deptId"
|
|
|
+ @select-change="handleChangeDept"
|
|
|
></tree>
|
|
|
</scroll-view>
|
|
|
</view>
|
|
|
<view class="mt24rpx flex items-center justify-between">
|
|
|
<view class="w332rpx">
|
|
|
- <wd-button type="info" size="large" block>重置</wd-button>
|
|
|
+ <wd-button type="info" size="large" block @click="handleRect"
|
|
|
+ >重置</wd-button
|
|
|
+ >
|
|
|
</view>
|
|
|
<view class="w332rpx">
|
|
|
- <wd-button size="large" block>确认</wd-button>
|
|
|
+ <wd-button size="large" block @click="handleSubmitDept"
|
|
|
+ >确认</wd-button
|
|
|
+ >
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -92,11 +188,31 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
+import { BASE_UPLOADURL } from "@/config";
|
|
|
import tree from "./components/tree/index.vue";
|
|
|
+import upload from "./components/upload/index.vue";
|
|
|
+import { type FormInstance } from "wot-design-uni/components/wd-form/types";
|
|
|
const titleArr = ["新增员工", "编辑员工"];
|
|
|
const treePicker = ref();
|
|
|
+const form = ref<FormInstance>();
|
|
|
+const formData = ref({
|
|
|
+ roleId: "",
|
|
|
+ status: 1,
|
|
|
+ password: "",
|
|
|
+ trainingPrograms: [],
|
|
|
+ certificateInnocence:
|
|
|
+ "https://b0.bdstatic.com/920d3e4f7d5d8aeb8680137b987fa262.jpg",
|
|
|
+ teachingPhilosophy: "",
|
|
|
+ excelMsg: "",
|
|
|
+ username: "",
|
|
|
+});
|
|
|
+const deptId = ref([]);
|
|
|
const type = ref(0);
|
|
|
const treeFlage = ref(false);
|
|
|
+const { data: deptList } = useRequest(() => Apis.sys.findByDeptTree(), {});
|
|
|
+const { data: rolelist } = useRequest(() => Apis.sys.rolelist(), {});
|
|
|
+const { data: categoryList } = useRequest(() => Apis.app.appCategory(), {});
|
|
|
+
|
|
|
onLoad((query: any) => {
|
|
|
type.value = query.type;
|
|
|
});
|
|
@@ -108,64 +224,18 @@ function handleShow() {
|
|
|
function handleClickLeft() {
|
|
|
uni.navigateBack();
|
|
|
}
|
|
|
-const data = [
|
|
|
- {
|
|
|
- id: 1,
|
|
|
- name: "公司1",
|
|
|
- children: [
|
|
|
- {
|
|
|
- id: 11,
|
|
|
- name: "研发部",
|
|
|
- children: [
|
|
|
- {
|
|
|
- id: 111,
|
|
|
- name: "张三",
|
|
|
- },
|
|
|
- {
|
|
|
- id: 112,
|
|
|
- name: "李四",
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- {
|
|
|
- id: 12,
|
|
|
- name: "综合部",
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- {
|
|
|
- id: 2,
|
|
|
- name: "公司2",
|
|
|
- children: [
|
|
|
- {
|
|
|
- id: 21,
|
|
|
- name: "研发部",
|
|
|
- },
|
|
|
- {
|
|
|
- id: 22,
|
|
|
- name: "综合部",
|
|
|
- },
|
|
|
- {
|
|
|
- id: 23,
|
|
|
- name: "财务部",
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- {
|
|
|
- id: 3,
|
|
|
- name: "公司3",
|
|
|
- },
|
|
|
- {
|
|
|
- id: 4,
|
|
|
- name: "公司4",
|
|
|
- children: [
|
|
|
- {
|
|
|
- id: 41,
|
|
|
- name: "研发部",
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
-];
|
|
|
+function handleSubmit() {
|
|
|
+ console.log(deptId.value, "asd");
|
|
|
+
|
|
|
+ form.value?.validate();
|
|
|
+}
|
|
|
+function handleChangeDept(e) {
|
|
|
+ console.log(e);
|
|
|
+}
|
|
|
+function handleSubmitDept() {
|
|
|
+ console.log(treePicker.value);
|
|
|
+}
|
|
|
+function handleRect() {}
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|