Browse Source

Merge branch 'dev' of https://git.citupro.com/zhengnaiwen_citu/menduner into dev

Xiao_123 8 tháng trước cách đây
mục cha
commit
44698e5e13

+ 9 - 4
src/components/FormUI/wangEditor/index.vue

@@ -1,8 +1,8 @@
 <!-- 富文本编辑器 -->
 <template>
-  <div>
+  <div class="mb-2">
     <div v-if="props.item?.label" class="ml-2 mb-2 color959595">{{ props.item.label  }}</div>
-    <div class="z-10 box mb-5">
+    <div class="z-10 box">
       <!-- 工具栏 -->
       <Toolbar
         :editor="editorRef"
@@ -22,6 +22,7 @@
         @on-created="handleCreated"
       />
     </div>
+    <div v-show="ruleTxt" class="ml-4" style="font-size: 13px; color: #FF5252; padding-top: 6px;">{{ ruleTxt }}</div>
   </div>
 </template>
 <script setup>
@@ -86,7 +87,8 @@ watch(
 watch(
   () => valueHtml.value,
   (val) => {
-    emit('update:modelValue', val === '<p><br></p>' ? '' : val)
+    const newVal = val === '<p><br></p>' ? '' : val
+    emit('update:modelValue', newVal)
   }
 )
 
@@ -102,9 +104,12 @@ const onMaxLengthFun = (editor) => {
   if (maxLength) Snackbar.info(`最多可输入${maxLength}个字符`)
 }
 
+const ruleTxt = ref('')
+
 const onBlurFun = (editor) => {
-  const text = editor.getText()?.replace(/\s+/g, '')
+  const text = editor.getText()?.replace(/\s+/g, '') || ''
   if (!text) valueHtml.value = ''
+  ruleTxt.value = text ? '' : props.item.rules
 }
 
 // 编辑器配置

+ 2 - 0
src/views/recruit/enterprise/positionManagement/components/baseInfo.vue

@@ -194,6 +194,7 @@ const items = ref({
       value: '',
       label: '岗位职责 *',
       maxLength: 5000,
+      rules: '请填写岗位职责'
     },
     {
       type: 'wangEditor',
@@ -201,6 +202,7 @@ const items = ref({
       value: '',
       label: '岗位要求 *',
       maxLength: 5000,
+      rules: '请填写岗位要求'
     },
     // {
     //   type: 'textarea',