瀏覽代碼

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

Xiao_123 8 月之前
父節點
當前提交
bf34ffe37b

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

@@ -7,7 +7,8 @@
       <Toolbar
         :editor="editorRef"
         :editorId="editorId"
-        class="border-0 b-b-1 border-solid border-[var(--tags-view-border-color)]"
+        :defaultConfig="toolbarConfig"
+        class="toolBox border-0 b-b-1 border-solid border-[var(--tags-view-border-color)]"
       />
       <!-- 编辑器 -->
       <Editor
@@ -26,7 +27,7 @@
 <script setup>
 defineOptions({ name: 'wangEditor-index' })
 import '@wangeditor/editor/dist/css/style.css' // 引入 css
-import { onBeforeUnmount, ref, shallowRef, unref, computed, nextTick, watch } from 'vue'
+import { onBeforeUnmount, ref, shallowRef, unref, computed, nextTick, watch, reactive } from 'vue'
 import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
 import { i18nChangeLanguage } from '@wangeditor/editor'
 import { isNumber } from '@/utils/is'
@@ -90,7 +91,10 @@ watch(
 )
 
 const handleCreated = (editor) => {
-  editorRef.value = editor
+  editorRef.value = editor // 记录 editor 实例,重要!
+  // 打印内容
+  // console.log('editor->', editor)
+  // console.log('所有菜单 key->', editor.getAllMenuKeys()) // 所有菜单 key (可能有的不在工具栏上)
 }
 
 const onMaxLengthFun = (editor) => {
@@ -103,6 +107,10 @@ const onBlurFun = (editor) => {
   if (!text) valueHtml.value = ''
 }
 
+// 编辑器配置
+import { getExcludeKeys } from './util/toolbarConfig'
+const toolbarConfig = reactive({ excludeKeys: getExcludeKeys() })
+
 // 编辑器配置
 const editorConfig = computed(() => {
   return Object.assign(
@@ -229,8 +237,9 @@ defineExpose({
   border: 1px solid #a2a2a2;
   border-radius: 5px;
   padding: 1px;
+  .toolBox { border-bottom: 1px solid #a2a2a2 !important; }
   &:hover {
-    border: 1px solid #2b2b2b;
+    border-color: #2b2b2b;
   }
 }
 .color959595 {

+ 43 - 0
src/components/FormUI/wangEditor/util/toolbarConfig.js

@@ -0,0 +1,43 @@
+// 排除掉某些菜单 // getAllMenuKeys查看所有菜单
+export const getExcludeKeys = () => {
+  // 排除
+  const excludeKeys = [
+    'fontFamily',
+    'emotion',
+    'insertLink',
+    'editLink',
+    'unLink',
+    'viewLink',
+    'fullScreen',
+    'todo',
+    // 表格
+    'insertTable',
+    'deleteTable',
+    'insertTableRow',
+    'deleteTableRow',
+    'insertTableCol',
+    'deleteTableCol',
+    'tableHeader',
+    'tableFullWidth',
+    // 图片
+    'group-image',
+    'insertImage',
+    'deleteImage',
+    'editImage',
+    'viewImageLink',
+    'imageWidth30',
+    'imageWidth50',
+    'imageWidth100',
+    'uploadImage',
+    // 视频
+    'group-video',
+    'insertVideo',
+    'uploadVideo',
+    'editVideoSize',
+    // 代码
+    'code',
+    'codeBlock',
+    'codeSelectLang',
+  ]
+  return excludeKeys
+}

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

@@ -342,8 +342,6 @@ const getQuery = async () => {
     // obj.hirePoint = 0
     obj.hirePrice = 0
   }
-  console.log('obj.content', obj.content)
-  console.log('obj.requirement', obj.requirement)
   if (!obj.content) {
     Snackbar.warning('请填写岗位职责')
     return 'failed'

+ 1 - 1
src/views/recruit/enterprise/register/inReview.vue

@@ -1,6 +1,6 @@
 <!-- 注册企业进度 -->
 <template>
-  <div class="pt-5">
+  <div class="my-5">
     <div :class="isMobile? 'mobileBox' : 'default-width'">
       <v-btn class="my-2" color="primary" variant="text" size="large" @click="router.push('/recruitHome')">{{ `<< 回到首页` }}</v-btn>
     </div>

+ 57 - 9
src/views/recruit/enterprise/register/register.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="pt-5">
+  <div class="my-5">
     <div :class="isMobile? 'mobileBox' : 'default-width'">
       <v-btn class="my-2" color="primary" variant="text" size="large" @click="router.push('/recruitHome')">{{ `<< 回到首页` }}</v-btn>
     </div>
@@ -10,10 +10,21 @@
       </div>
       <!-- 表单 -->
       <div class="CtFormClass" :style="{width: isMobile ? '' : '600px'}">
-        <CtForm ref="CtFormRef" :items="formItems" style="width: 100%;"></CtForm>
+        <CtForm ref="CtFormRef" :items="formItems" style="width: 100%;">
+          <template #prepare>
+            <v-checkbox
+              v-model="isPrepare"
+              label="筹建中"
+              color="primary"
+              class="ml-1"
+              style="width: 150px; max-height: 38px;"
+              @change="isPrepareChange"
+            ></v-checkbox>
+          </template>
+        </CtForm>
         <!-- 上传照片 -->
         <div style="color: var(--color-999);">
-          <span class="mr-1" style="color: var(--v-error-base);">*</span>
+          <span v-if="!isPrepare" class="mr-1" style="color: var(--v-error-base);">*</span>
           <span>上传营业执照</span>
           <!-- <span class="mx-3 defaultLink">查看示例</span> -->
           <span>支持jpg、jpeg、png格式,图片大小不得超过10M</span>
@@ -21,8 +32,7 @@
         <div class="file-box">
           <Img class="mt-3" :value="licenseUrl" tips="上传图片" @imgClick="showPreview = !showPreview" :showCursor="true" @success="val => licenseUrl = val" @delete="licenseUrl = ''"></Img>
         </div>
-        <!-- 注意事项 -->
-        <div class="note mt-15">
+        <div class="note mt-10">
           <h4>注意事项:</h4>
           <span>企业名称为对外展示的企业名称,建议填写公司营业执照上的名称,请区分总公司和分公司</span>
           <!-- <div>
@@ -74,6 +84,16 @@ onMounted(() => {
   isMobile.value = /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i.test(userAgent)
 })
 
+// 是否筹建中
+const isPrepare = ref(false)
+const isPrepareChange = () => {
+  const code = formItems.value.options.find(e => e.key === 'code')
+  if (code) {
+    code.label = isPrepare.value ? '企业统一社会信用代码' : '企业统一社会信用代码 *'
+    code.rules = isPrepare.value ? [] : [v => !!v || '请输入企业统一社会信用代码']
+  }
+}
+
 const formItems = ref({
   options: [
     {
@@ -85,6 +105,7 @@ const formItems = ref({
       rules: [v => !!v || '请输入企业名称']
     },
     {
+      slotName: 'prepare',
       type: 'text',
       key: 'code',
       value: '',
@@ -92,11 +113,20 @@ const formItems = ref({
       label: '企业统一社会信用代码 *',
       rules: [v => !!v || '请输入企业统一社会信用代码']
     },
+    {
+      type: 'text',
+      key: 'contactName',
+      value: '',
+      label: '联系人姓名 *',
+      rules: [v => !!v || '请输入联系人姓名']
+    },
     {
       type: 'phoneNumber',
       key: 'phone',
       value: '',
       label: '联系电话 *',
+      // flexStyle: 'mr-3',
+      // col: 6,
       rules: [v => !!v || '请输入联系电话']
     },
     {
@@ -104,8 +134,19 @@ const formItems = ref({
       key: 'email',
       value: '',
       label: '联系邮箱 *',
+      // col: 6,
       rules: [v => !!v || '请输入联系邮箱']
     },
+    {
+      type: 'textarea',
+      key: 'description',
+      value: '',
+      clearable: true,
+      resize: true,
+      counter: 500,
+      rows: 2,
+      label: '备注/说明 *',
+    },
   ]
 })
 
@@ -117,10 +158,13 @@ const handleCommit = async () => {
   const { valid } = await CtFormRef.value.formRef.validate()
   if (!valid) return
   const businessLicenseUrl = licenseUrl.value;
-  if (!businessLicenseUrl) return Snackbar.warning('请上传营业执照图片')
-  const baseInfo = {}
-  formItems.value.options.forEach(e => { baseInfo[e.key] = e.value })
-  await enterpriseRegisterApply({ ...baseInfo, businessLicenseUrl })
+  if (!isPrepare.value && !businessLicenseUrl) return Snackbar.warning('请上传营业执照图片')
+  const params = {
+    businessLicenseUrl,
+    prepare: isPrepare.value,
+  }
+  formItems.value.options.forEach(e => { params[e.key] = e.value })
+  await enterpriseRegisterApply(params)
   Snackbar.success(t('common.submittedSuccessfully'))
   router.push({ path: '/recruit/enterprise/register/inReview' })
 }
@@ -174,6 +218,10 @@ if (info && Object.keys(info).length) {
     .icon { color: var(--v-error-base); }
   }
 }
+.PrepareBox {
+  margin-top: 74px;
+  margin-left: 32px;
+}
 .mobileBox {
   width: 100vw;
   .resume-header {