Parcourir la source

app-企业所属行业组件

liao-sea il y a 11 mois
Parent
commit
2c85fd1dcd

+ 13 - 0
h5app/src/api/recommendmgt/index.ts

@@ -103,4 +103,17 @@ export function getOccupationCategoryList() {
             isNew: true,
         },
     );
+}
+
+export function getAllIndustryList() {
+    return request<object>(
+        {
+            url: "jobusermgr/recommendmgt/getAllIndustryList",
+            method: 'get',
+            params: null,
+        },
+        {
+            isNew: true,
+        },
+    );
 }

+ 303 - 0
h5app/src/components/industrySelection.vue

@@ -0,0 +1,303 @@
+<style>
+ion-modal {
+  --height: 50%;
+  --border-radius: 16px;
+  --box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
+}
+
+ion-modal::part(backdrop) {
+  background: rgba(209, 213, 219);
+  opacity: 1;
+}
+
+ion-modal ion-toolbar {
+  --background: white;
+  --color: white;
+}
+
+ion-toolbar {
+  padding-left: 0 !important;
+  padding-right: 0 !important;
+  --padding-start: 0;
+  --padding-end: 0;
+}
+
+ion-toolbar ion-item:first-child {
+  --inner-border-width: 0 0 0 0;
+  text-align: center;
+}
+
+ion-toolbar ion-item:last-child {
+  --padding-start: 0;
+  --inner-padding-end: 0;
+}
+
+ion-segment {
+  width: 100%;
+  --background: #ffffff;
+}
+
+ion-segment-button {
+  --indicator-color: rgba(254, 255, 255, 0.97);
+  --color: #000000;
+  --color-checked: #1a65eb;
+  --background-hover: rgba(47, 107, 215, 0.98);
+  --border-width: 0 0 0 0;
+  --indicator-box-shadow: 0 0 0 0;
+}
+
+/*!* Material Design styles *!*/
+/*ion-segment-button.md {*/
+/*  --color: #000;*/
+/*  --color-checked: #1a65eb;*/
+/*  --border-radius: 0px;*/
+/*  --border-width: 0 0 0 0;*/
+/*}*/
+
+/*!* iOS styles *!*/
+/*ion-segment-button.ios {*/
+/*  --color: #000;*/
+/*  --color-checked: #1a65eb;*/
+/*  --border-radius: 0px;*/
+/*  --border-width: 0 0 0 0;*/
+/*}*/
+
+.custom-scroll {
+  overflow-y: auto; /* 显示垂直滚动条 */
+  max-height: 200px; /* 设置最大高度,超出部分会出现滚动条 */
+}
+
+/* 可以根据需要自定义滚动条的样式 */
+.custom-scroll::-webkit-scrollbar {
+  width: 8px;
+}
+
+.custom-scroll::-webkit-scrollbar-thumb {
+  background-color: #888;
+  border-radius: 4px;
+}
+
+.custom-scroll::-webkit-scrollbar-thumb:hover {
+  background-color: #555;
+}
+
+</style>
+
+<template>
+  <ion-button id="open-modal" style="color: #02a6f1;font-size: 15px;" fill="clear" @click="loadIndustryID">选择
+  </ion-button>
+  <ion-page>
+    <ion-content class="ion-padding">
+      <ion-modal trigger="open-modal" :backdrop-dismiss="false" :is-open="isOpen" :initial-breakpoint="1"
+                 :breakpoints="[0, 1]">
+        <ion-toolbar>
+          <ion-item>
+            <ion-buttons slot="start">
+              <ion-button fill="clear" @click="onCancel">取消</ion-button>
+            </ion-buttons>
+            <ion-label style="font-size: 12px;white-space: pre-wrap; word-wrap: break-word;">
+              {{ selectIndustryInfo.text }}
+            </ion-label>
+            <ion-buttons slot="end">
+              <ion-button fill="clear" :disabled="selectIndustryInfo.value==''" @click="onConfirm">确定</ion-button>
+            </ion-buttons>
+          </ion-item>
+          <ion-item>
+            <ion-segment value="0">
+              <ion-segment-button v-for="(item,key) in selectModelList" :key="key" @click="onSelectType(item.index)"
+                                  :disabled="item.disabled" :value="item.index">
+                <ion-label :style="{color:item.isSelect?'#1a65eb':'#000000'}">{{ item.name }}</ion-label>
+              </ion-segment-button>
+            </ion-segment>
+          </ion-item>
+        </ion-toolbar>
+        <div class="bw-vue-list">
+          <div class="list-content">
+            <ion-list class="custom-scroll" v-show="selectModelList[selectType.one].isSelect">
+              <ion-item v-for="(item, index) in selectModelList[selectType.one].industryList" :key="index">
+                <ion-label :style="{color:item.isSelect?'#1a65eb':'#000000'}"
+                           @click="onSelect(item,selectType.one)">
+                  {{ item.industryName }}
+                </ion-label>
+              </ion-item>
+            </ion-list>
+            <ion-list class="custom-scroll" v-show="selectModelList[selectType.two].isSelect">
+              <ion-item v-for="(item, index) in selectModelList[selectType.two].industryList" :key="index">
+                <ion-label :style="{color:item.isSelect?'#1a65eb':'#000000'}"
+                           @click="onSelect(item,selectType.two)">
+                  {{ item.industryName }}
+                </ion-label>
+              </ion-item>
+            </ion-list>
+          </div>
+        </div>
+      </ion-modal>
+    </ion-content>
+  </ion-page>
+</template>
+
+<script lang="ts">
+import {defineComponent, reactive, ref} from 'vue';
+import {getAllIndustryList} from "@/api/recommendmgt";
+
+export default defineComponent({
+  name: "industrySelection",
+  props: {
+    CurIndustryID: {type: String, default: ''},
+  },
+  setup(props, context) {
+    const selectType = {
+      one: 0,
+      two: 1,
+    }
+    const isOpen = ref(false);
+    const selectModelList = reactive([
+      {
+        index: 0,
+        name: '行业类别',
+        isSelect: false,
+        disabled: true,
+        industryName: '',
+        industryId: '',
+        industryList: [] as any
+      },
+      {
+        index: 1,
+        name: '行业名称',
+        isSelect: false,
+        disabled: true,
+        industryName: '',
+        industryId: '',
+        industryList: [] as any
+      }]);
+    const selectIndustryInfo = reactive({value: '', text: ''})
+    const allIndustryList = ref();
+
+    const loadIndustryID = () => {
+      getAllIndustryList().then(data => {
+        allIndustryList.value = data;
+        console.log(allIndustryList.value);
+        if (!props.CurIndustryID) {
+          selectModelList[selectType.one].isSelect = true;
+          selectModelList[selectType.one].disabled = false;
+          selectModelList[selectType.one].industryName = ''
+          selectModelList[selectType.one].industryId = ''
+          selectModelList[selectType.one].industryList = allIndustryList.value.filter((x: any) => x.industryLevel == "1")
+              .map((x: any) => ({
+                ...x,
+                isSelect: false
+              }));
+        }
+        else {
+          const twoInfo = allIndustryList.value.find((x: any) => x.industryLevel == "2" && x.industryId == props.CurIndustryID);
+          const oneInfo = allIndustryList.value.find((x: any) => x.industryLevel == "1" && x.industryId == twoInfo.parentID);
+
+          selectModelList[selectType.one].isSelect = false;
+          selectModelList[selectType.one].disabled = false;
+          selectModelList[selectType.one].industryName = oneInfo.industryName;
+          selectModelList[selectType.one].industryId = oneInfo.industryId;
+          selectModelList[selectType.one].industryList = allIndustryList.value.filter((x: any) => x.industryLevel == "1")
+              .map((x: any) => ({
+                ...x,
+                isSelect: false
+              }));
+          selectModelList[selectType.one].industryList.find((x: any) => x.industryId == oneInfo.industryId).isSelect = true;
+
+          selectModelList[selectType.two].isSelect = true;
+          selectModelList[selectType.two].disabled = false;
+          selectModelList[selectType.two].industryName = twoInfo.industryName;
+          selectModelList[selectType.two].industryId = twoInfo.industryId;
+          selectModelList[selectType.two].industryList = allIndustryList.value.filter((x: any) => x.industryLevel == "2"
+              && x.parentId == oneInfo.industryId).map((x: any) => ({
+            ...x,
+            isSelect: false
+          }));
+          selectModelList[selectType.two].industryList.find((x: any) => x.industryId == twoInfo.industryId).isSelect = true;
+
+          getSelectIndustry();
+        }
+      });
+      isOpen.value = true;
+    }
+
+    const onSelectType = (type: number) => {
+      if (selectType.one == type) {
+        selectModelList.map(x => {
+          x.isSelect = false
+          x.disabled = true
+          x.industryName = ''
+          x.industryId = ''
+          x.industryList = []
+        });
+
+        selectModelList[selectType.one].isSelect = true;
+        selectModelList[selectType.one].disabled = false;
+        selectModelList[selectType.one].industryList = allIndustryList.value.filter((x: any) => x.industryLevel == "1")
+            .map((x: any) => ({
+              ...x,
+              isSelect: false
+            }));
+      }
+
+
+      if (selectType.two == type) {
+        selectModelList[selectType.one].isSelect = false;
+
+        selectModelList[selectType.two].isSelect = true;
+        selectModelList[selectType.two].disabled = false;
+        selectModelList[selectType.two].industryName = '';
+        selectModelList[selectType.two].industryId = '';
+        selectModelList[selectType.two].industryList = allIndustryList.value.filter((x: any) => x.industryLevel == "2"
+            && x.parentId == selectModelList[selectType.one].industryId).map((x: any) => ({
+          ...x,
+          isSelect: false
+        }));
+
+      }
+
+      getSelectIndustry();
+    }
+
+    const onSelect = (item: any, type: any) => {
+
+      console.log('item',item);
+      selectModelList[type].industryList.forEach((x: any) => {
+        x.isSelect = x.industryId == item.industryId;
+      });
+      selectModelList[type].industryName = item.industryName;
+      selectModelList[type].industryId = item.industryId;
+
+      if (type == selectType.one) {
+        onSelectType(selectType.two);
+      }
+
+      getSelectIndustry();
+    }
+
+    const getSelectIndustry = () => {
+      selectIndustryInfo.text = selectModelList.filter(x => x.industryName != '').map(x => x.industryName).join("-");
+      selectIndustryInfo.value = selectModelList[selectType.two].industryId;
+    }
+
+    const onCancel = () => {
+      isOpen.value = false;
+    }
+
+    const onConfirm = () => {
+      isOpen.value = false;
+      context.emit("SetIndustryID", selectIndustryInfo);
+    }
+    return {
+      isOpen,
+      selectType,
+      selectModelList,
+      selectIndustryInfo,
+      loadIndustryID,
+      onSelectType,
+      onSelect,
+      onCancel,
+      onConfirm,
+    };
+  }
+})
+</script>

+ 0 - 1
h5app/src/components/ocCategorySelection.vue

@@ -176,7 +176,6 @@ export default defineComponent({
     const loadOccupationalID = () => {
       getOccupationCategoryList().then(data => {
         occupationalCategoryList.value = data;
-        debugger;
         if (!props.OccupationalID) {
           selectModelList[selectType.one].isSelect = true;
           selectModelList[selectType.one].disabled = false;

+ 1 - 1
h5app/src/views/pages/company/detail.vue

@@ -93,7 +93,7 @@
           </div>
           <div class="form-detail">
             <ion-label>所属行业</ion-label>
-            <ion-text>{{ dataModel.professionName}}</ion-text>
+            <ion-text>{{ dataModel.industryName}}</ion-text>
           </div>
           <div class="form-detail">
             <ion-label>所属产业分类</ion-label>

+ 27 - 13
h5app/src/views/pages/company/edit.vue

@@ -180,15 +180,24 @@
                 </ion-select-option>
               </ion-select>
             </div>
-            <div class="form-select">
+            <div class="form-input">
               <ion-label>所属行业</ion-label>
-              <ion-select interface="action-sheet" placeholder="请选择所属行业" cancel-text="取消"
-                          id="professionID" v-model="dataModel.professionID"  style="width: 100%;text-align: left;">
-                <ion-select-option v-for="(record,key) in professionList" :key="key"
-                                   v-model:value="record.value">
-                  {{ record.name }}
-                </ion-select-option>
-              </ion-select>
+              <div>
+                <ion-input placeholder="请选择所属行业" label-placement="stacked" style="float: left;width:78%;"
+                           v-model="dataModel.industryName" class="custom" readonly >
+                </ion-input>
+                <ion-item style="width:22%;float: right;padding:0px;margin: 0px;">
+                  <industry-selection  :CurIndustryID="dataModel.industryID" @SetIndustryID="onSetIndustryID"></industry-selection>
+                </ion-item>
+              </div>
+
+<!--              <ion-select interface="action-sheet" placeholder="请选择所属行业" cancel-text="取消"-->
+<!--                          id="professionID" v-model="dataModel.professionID"  style="width: 100%;text-align: left;">-->
+<!--                <ion-select-option v-for="(record,key) in professionList" :key="key"-->
+<!--                                   v-model:value="record.value">-->
+<!--                  {{ record.name }}-->
+<!--                </ion-select-option>-->
+<!--              </ion-select>-->
             </div>
             <div class="form-select">
               <ion-label>所属产业分类</ion-label>
@@ -278,7 +287,7 @@ import {getCompanyById,saveCompanyInfo} from "@/api/company";
 import {required} from "@vuelidate/validators";
 import {getSysDictionaryList} from "@/api/system/dictionary";
 import dayjs from "dayjs";
-// import {MultiPickerModule} from 'ion-multi-picker';
+import IndustrySelection from "@/components/industrySelection.vue";
 
 interface StepParams{
   name: string,
@@ -288,7 +297,7 @@ interface StepParams{
 
 export default defineComponent({
   name: 'CompanyEdit',
-  // components: {MultiPickerModule},
+  components:{IndustrySelection},
   setup() {
     const route = useRoute();
     const router = useRouter();
@@ -317,7 +326,8 @@ export default defineComponent({
         signInPoliticalArea:null,
         companyEmail: '',
         companyType: null,
-        professionID:null,
+        industryID:null,
+        industryName:null,
         estateCategoryID:null,
         tagID:null,
         website:null,
@@ -334,7 +344,6 @@ export default defineComponent({
         {title: '岗位信息', desc: '企业岗位信息', val: 2}
     ]);
 
-    const professionList = ref<any>([]);
     const companyStatusList = ref([]);
     const companyModelList = ref<any>([]);
     const companyTypeList = ref<any>([]);
@@ -491,6 +500,11 @@ export default defineComponent({
       }
     };
 
+    const onSetIndustryID = (data: any)=>{
+      formState.dataModel.industryID = data.value;
+      formState.dataModel.industryName = data.text;
+    }
+
     const onNext = async () => {
       const isFormCorrect = await v$.value.$validate();
       if (!isFormCorrect) {
@@ -583,7 +597,6 @@ export default defineComponent({
       curStepData,
       stepList,
       companyTypeList,
-      professionList,
       siteList,
       regionList,
       streetList,
@@ -592,6 +605,7 @@ export default defineComponent({
       companyModelList,
       companyTagList,
       estateCategoryList,
+      onSetIndustryID,
       onNext,
       onBack,
       getCompanyStatusList,

+ 22 - 8
h5app/src/views/pages/jobUserInfo/companyEdit.vue

@@ -181,13 +181,21 @@
             </div>
             <div class="form-select">
               <ion-label>所属行业</ion-label>
-              <ion-select interface="action-sheet" placeholder="请选择所属行业" cancel-text="取消"
-                          id="professionID" v-model="dataModel.professionID"  style="width: 100%;text-align: left;">
-                <ion-select-option v-for="(record,key) in professionList" :key="key"
-                                   v-model:value="record.value">
-                  {{ record.name }}
-                </ion-select-option>
-              </ion-select>
+              <div>
+                <ion-input placeholder="请选择所属行业" label-placement="stacked" style="float: left;width:78%;"
+                           v-model="dataModel.industryName" class="custom" readonly >
+                </ion-input>
+                <ion-item style="width:22%;float: right;padding:0px;margin: 0px;">
+                  <industry-selection  :CurIndustryID="dataModel.industryID" @SetIndustryID="onSetIndustryID"></industry-selection>
+                </ion-item>
+              </div>
+<!--              <ion-select interface="action-sheet" placeholder="请选择所属行业" cancel-text="取消"-->
+<!--                          id="professionID" v-model="dataModel.professionID"  style="width: 100%;text-align: left;">-->
+<!--                <ion-select-option v-for="(record,key) in professionList" :key="key"-->
+<!--                                   v-model:value="record.value">-->
+<!--                  {{ record.name }}-->
+<!--                </ion-select-option>-->
+<!--              </ion-select>-->
             </div>
             <div class="form-select">
               <ion-label>所属产业分类</ion-label>
@@ -314,7 +322,8 @@ export default defineComponent({
         signInPoliticalArea:null,
         companyEmail: '',
         companyType: null,
-        professionID:null,
+        industryID:null,
+        industryName:null,
         estateCategoryID:null,
         tagID:null,
         website:null,
@@ -514,6 +523,11 @@ export default defineComponent({
       router.push({path:'/jobUserInfo/index', query: {userId: curStepData.value.loginUserID,openId: curStepData.value.openID}});
     }
 
+    const onSetIndustryID = (data: any)=>{
+      formState.dataModel.industryID = data.value;
+      formState.dataModel.industryName = data.text;
+    }
+
     const onNext = async () => {
       const isFormCorrect = await v$.value.$validate();
       if (!isFormCorrect) {

+ 1 - 0
src/main/java/com/hz/employmentsite/config/WebConfiguration.java

@@ -84,6 +84,7 @@ public class WebConfiguration implements WebMvcConfigurer {
         excludePath.add("/api/system/area/getAreaList");//查询相关街道信息
         excludePath.add("/api/jobusermgr/recommendmgt/getProfessionLevelList");//查询所有求职岗位信息
         excludePath.add("/api/jobusermgr/recommendmgt/getOccupationCategoryList");//查询所有职业资格类别
+        excludePath.add("/api/jobusermgr/recommendmgt/getAllIndustryList");//查询所有企业所属行业信息
         excludePath.add("/api/siteInfo/getDataList");
         excludePath.add("/api/companyService/company/getSiteList");
         excludePath.add("/api/companyService/company/save");

+ 7 - 0
src/main/java/com/hz/employmentsite/controller/jobUserManager/RecommendMgtController.java

@@ -87,4 +87,11 @@ public class RecommendMgtController {
         List<OccupationCategory> result = recommendMgtService.getOccupationCategoryList();
         return RespGenerstor.success(result);
     }
+
+    @ResponseBody
+    @GetMapping("/getAllIndustryList")
+    public BaseResponse getAllIndustryList() {
+        List<IndustryLevel> result = recommendMgtService.getAllIndustryList();
+        return RespGenerstor.success(result);
+    }
 }

+ 2 - 0
src/main/java/com/hz/employmentsite/mapper/cquery/RecommendMgtCQuery.java

@@ -54,6 +54,8 @@ public interface RecommendMgtCQuery {
 
    List<OccupationCategory> getOccupationCategoryList();
 
+   List<IndustryLevel> getAllIndustryList();
+
 
     List<HashMap<String, Object>> getCompanypostToUsermessageList();
     List<HashMap<String, Object>> getUserhuntpostToCompanymessageList();

+ 3 - 3
src/main/java/com/hz/employmentsite/services/impl/jobUserManager/RecommendMgtServiceImpl.java

@@ -123,9 +123,9 @@ public class RecommendMgtServiceImpl implements RecommendMgtService {
         return recommendMgtCQuery.getProfessionLevelList();
     }
 
-    public List<OccupationCategory> getOccupationCategoryList() {
-        return recommendMgtCQuery.getOccupationCategoryList();
-    }
+    public List<OccupationCategory> getOccupationCategoryList() {return recommendMgtCQuery.getOccupationCategoryList();}
+
+    public List<IndustryLevel> getAllIndustryList() {return recommendMgtCQuery.getAllIndustryList();}
 
     @Override
     public void sendWxMessage() {

+ 2 - 0
src/main/java/com/hz/employmentsite/services/service/jobUserManager/RecommendMgtService.java

@@ -63,5 +63,7 @@ public interface RecommendMgtService {
 
     List<OccupationCategory> getOccupationCategoryList();
 
+    List<IndustryLevel> getAllIndustryList();
+
     void sendWxMessage();
 }

+ 8 - 0
src/main/java/com/hz/employmentsite/vo/jobUserManager/IndustryLevel.java

@@ -0,0 +1,8 @@
+package com.hz.employmentsite.vo.jobUserManager;
+
+
+import com.hz.employmentsite.model.PcIndustry;
+
+public class IndustryLevel extends PcIndustry {
+    public String industryLevel;
+}

+ 10 - 0
src/main/resources/mapping/cquery/RecommendMgtCQuery.xml

@@ -210,6 +210,16 @@
                  inner join (select OccupationalID from pc_occupational where ParentOccupationalID = '0') b
                             on a.ParentOccupationalID = b.OccupationalID
     </select>
+    <select id="getAllIndustryList" resultType="com.hz.employmentsite.vo.jobUserManager.IndustryLevel">
+        select IndustryID, ParentID, IndustryName, '1' as IndustryLevel
+        from pc_industry
+        where ParentID = ''
+        union all
+        select a.IndustryID, a.ParentID, a.IndustryName, '2' as IndustryLevel
+        from pc_industry a
+                 inner join (select IndustryID from pc_industry where ParentID = '') b
+                            on a.ParentID = b.IndustryID
+    </select>
     <select id="getCompanypostToUsermessageList" resultType="java.util.HashMap">
         select a.recommendmgtid,
                e.openId     as userOpenId,