From 592c1750b148874737cdfba4b22b6229f9805fe6 Mon Sep 17 00:00:00 2001 From: zhouwx <1175765986@qq.com> Date: 星期三, 02 七月 2025 14:55:27 +0800 Subject: [PATCH] 新增 --- src/views/build/conpanyFunctionConsult/staffManage/staffPortfolio/components/editorDialog.vue | 31 +++++++++++++++++++++++++------ 1 files changed, 25 insertions(+), 6 deletions(-) diff --git a/src/views/build/conpanyFunctionConsult/staffManage/staffPortfolio/components/editorDialog.vue b/src/views/build/conpanyFunctionConsult/staffManage/staffPortfolio/components/editorDialog.vue index 050d4bc..7d6dc96 100644 --- a/src/views/build/conpanyFunctionConsult/staffManage/staffPortfolio/components/editorDialog.vue +++ b/src/views/build/conpanyFunctionConsult/staffManage/staffPortfolio/components/editorDialog.vue @@ -3,14 +3,25 @@ <el-dialog v-model="dialogVisible" :title="state.title" - width="700px" + width="800px" :before-close="handleClose" :close-on-press-escape="false" :close-on-click-modal="false" > <el-form :model="state.form" size="default" ref="superRef" :rules="state.formRules" label-width="150px" > + <el-form-item v-if="state.isAdmin" label="企业:" prop="companyId"> + <el-select v-model="state.form.companyId" placeholder="请选择" clearable> + <el-option + v-for="item in state.companyList" + :key="item.id" + :label="item.name" + :value="item.id"> + </el-option> + </el-select> + </el-form-item> <el-form-item label="员工情况介绍:" prop="companyRoster"> - <editor v-model="state.form.companyRoster" :min-height="300"/> +<!-- <editor v-model="state.form.companyRoster" :min-height="300"/>--> + <t-editor style="width: 800px" ref="myEditor" :value="state.form.companyRoster" ></t-editor> </el-form-item> </el-form> <template #footer v-if="state.title !='查看'"> @@ -29,10 +40,11 @@ import {Base64} from "js-base64" import {getCompany} from "@/api/onlineEducation/company"; import {saveRoster, updateRoster} from "@/api/staffManage/staff"; - +import TEditor from "@/components/Tinymce/Tinymce.vue" const emit = defineEmits(["getList"]); const dialogVisible = ref(false) const superRef = ref() +const myEditor = ref(); const state = reactive({ title: '', form: { @@ -40,9 +52,11 @@ companyId: null, companyRoster: '', }, + companyList: [], isView: false, formRules:{ - companyRoster: [{ required: true, message: '员工情况介绍', trigger: 'blur' }], + companyId: [{ required: true, message: '请选择企业', trigger: 'blur' }], + companyRoster: [{ required: true, message: '员工情况介绍', trigger: 'blur' }] }, isAdmin: false, }) @@ -53,7 +67,11 @@ const disabled = ref(false); const userInfo = ref() -const openDialog = async (type, value, companyId) => { +const openDialog = async (type, value, companyId, isAdmin, companyList) => { + state.isAdmin = isAdmin + if(isAdmin){ + state.companyList = companyList + } state.title = type === 'add' ? '新增' : type ==='edit' ? '编辑' : '查看' state.form.companyId = companyId if(type == 'view'){ @@ -73,9 +91,9 @@ const loading = ref(false) const onSubmit = async () => { + state.form.companyRoster = tinyMCE.activeEditor.getContent(); const valid = await superRef.value.validate(); if(valid){ - if(state.title == '新增'){ const {id,...data} = state.form const res = await saveRoster(data) @@ -107,6 +125,7 @@ companyId: null, companyRoster: '', } + myEditor.value.clear(); superRef.value.clearValidate(); superRef.value.resetFields() dialogVisible.value = false; -- Gitblit v1.9.2