yanghao 1 miesiąc temu
rodzic
commit
1fbfda4205
2 zmienionych plików z 17 dodań i 157 usunięć
  1. 0 144
      src/views/expert/list/data.js
  2. 17 13
      src/views/expert/list/index.vue

+ 0 - 144
src/views/expert/list/data.js

@@ -1,144 +0,0 @@
-;[
-  {
-    echelonLabel: '第一梯队',
-    num: 2,
-    sort: 1,
-    experts: [
-      {
-        createTime: 1786524848000,
-        updateTime: 1786524848000,
-        creator: '1',
-        updater: '1',
-        deleted: false,
-        id: 60197,
-        deptId: 383,
-        expertName: '李四',
-        echelon: '1',
-        expertRank: [2, 3],
-        professionalTitle: '经理',
-        jobTitle: '经理',
-        formerPost: '经理',
-        teamIds: [1, 2],
-        avatar: 'https://rdm.deepoil.cc/admin-api/infra/file/29/get/20260812165347561icon3.png',
-        birthday: 1628524800000,
-        school: '燕京大学',
-        education: '3',
-        specialDirection: [4, 6],
-        achievement: '啊啊啊啊啊啊啊',
-        softwareSkills: [3, 5],
-        sort: 0,
-        remark: '',
-        status: 0,
-        processInstanceId: '',
-        auditStatus: 0,
-        opinion: ''
-      },
-      {
-        createTime: 1786440219000,
-        updateTime: 1786440219000,
-        creator: '1',
-        updater: '1',
-        deleted: false,
-        id: 60195,
-        deptId: 158,
-        expertName: '罗显尧',
-        echelon: '1',
-        expertRank: [1, 3],
-        professionalTitle: '高级工程师',
-        jobTitle: '瑞鹰国际执行总经理,负责海外增产分油业务及技术相关管理工作',
-        formerPost: '胜利油田沙特项目部平台经理、安东石油井下作业公司总经理等职',
-        teamIds: [1, 2],
-        avatar:
-          'https://aims.deepoil.cc/admin-api/infra/file/29/get/fdca68e633375435dbf8988c677a426e995258fb6f8cb74a6ee8e46bd05e4e3c.png',
-        birthday: 491990860000,
-        school: '中国石油大学(华东)',
-        education: '7',
-        specialDirection: [16, 15],
-        achievement: '拥有发明专利3项\n胜利油田技术专家库成员',
-        softwareSkills: [1, 13],
-        sort: 0,
-        remark: '',
-        status: 0,
-        processInstanceId: '',
-        auditStatus: 0,
-        opinion: ''
-      }
-    ]
-  },
-  {
-    echelonLabel: '第二梯队',
-    num: 1,
-    sort: 2,
-    experts: [
-      {
-        createTime: 1786436885000,
-        updateTime: 1786501259000,
-        creator: '1',
-        updater: '1',
-        deleted: false,
-        id: 60194,
-        deptId: 157,
-        expertName: '钟永林',
-        echelon: '2',
-        expertRank: [1, 3],
-        professionalTitle: '高级工程师',
-        jobTitle: '恒兴域公司副总经理',
-        formerPost: '瑞恒兴域公司采油工程所所长、副总工程师',
-        teamIds: [1, 2],
-        avatar:
-          'https://aims.deepoil.cc/admin-api/infra/file/29/get/fdca68e633375435dbf8988c677a426e995258fb6f8cb74a6ee8e46bd05e4e3c.png',
-        birthday: 491990860000,
-        school: '中国石油大学(华东)',
-        education: '7',
-        specialDirection: [16, 15],
-        achievement:
-          '长期从事采油工程与油田化学技术研究。主持省部级课题7项;拥有专利20余项;发表论文6篇',
-        softwareSkills: [1, 13],
-        sort: 0,
-        remark: '',
-        status: 0,
-        processInstanceId: '',
-        auditStatus: 0,
-        opinion: ''
-      }
-    ]
-  },
-  {
-    echelonLabel: '第三梯队',
-    num: 1,
-    sort: 3,
-    experts: [
-      {
-        createTime: 1786441026000,
-        updateTime: 1786501261000,
-        creator: '1',
-        updater: '1',
-        deleted: false,
-        id: 60196,
-        deptId: 163,
-        expertName: '林其勇',
-        echelon: '3',
-        expertRank: [1, 3],
-        professionalTitle: '高级工程师',
-        jobTitle: '四川瑞都公司副总工程师',
-        formerPost: '吉林油田项目长等职',
-        teamIds: [1, 2],
-        avatar:
-          'https://aims.deepoil.cc/admin-api/infra/file/29/get/fdca68e633375435dbf8988c677a426e995258fb6f8cb74a6ee8e46bd05e4e3c.png',
-        birthday: 491990860000,
-        school: '中国石油大学&东北石油大学',
-        education: '5',
-        specialDirection: [16, 15],
-        achievement:
-          '主要负责储层改造、油气田开发相关技术研发和应用工作\n获中石油科技进步奖1项,省部级、油田级科技进步奖7项;发表论文10余篇;拥有专利6项\n吉林油田学术带头人、吉林省专家库成员、吉林油田特殊津贴专家',
-        softwareSkills: [1, 13],
-        sort: 0,
-        remark: '',
-        status: 0,
-        processInstanceId: '',
-        auditStatus: 0,
-        opinion: ''
-      }
-    ]
-  }
-]

+ 17 - 13
src/views/expert/list/index.vue

@@ -95,7 +95,7 @@
                 :key="index"
                 :class="['step-cell', cell.tone === 'danger' ? 'notice-cell' : '']"
               >
-                <span class="cell-bookmark">{{ cellBookmarks[index] }}</span>
+                <span class="cell-bookmark">{{ row.bookmarks[index] }}</span>
 
                 <template v-if="cell.type === 'members'">
                   <button
@@ -548,6 +548,7 @@ type TableRow = {
   teamName: string
   education: string
   searchText: string
+  bookmarks: string[]
   tableWidth: string
   backgroundColor: string
   columnWidths: number[]
@@ -621,7 +622,6 @@ const wordCloudWords = [
   { text: '研究生', size: 16, rotate: -5, color: '#7f85b5', left: '79%', top: '28%' }
 ]
 
-const cellBookmarks = ['技术', '经营', '商务', '安全', '法务']
 const selectedTeamNames = computed(() =>
   selectedTeams.value.map((team) => team.teamName).join('、')
 )
@@ -637,6 +637,7 @@ const rowStylePresets = [
   { tableWidth: '75%', backgroundColor: '#f2faef', columnWidths: [1.8, 1.8, 1.8, 1.8, 1.8] },
   { tableWidth: '100%', backgroundColor: '#fff8e8', columnWidths: [2, 2, 2, 2, 2] }
 ]
+const rankOptions = computed(() => getStrDictOptions(DICT_TYPE.RD_EXPERT_RANK))
 
 const getDictLabel = (type: string, value: string | number | undefined | null) => {
   if (value === undefined || value === null || value === '') return ''
@@ -709,6 +710,11 @@ const getColumnPercent = (row: TableRow, index: number) => {
 const tableData = computed<TableRow[]>(() => {
   return (list.value as ExpertGroup[]).map((group, index) => {
     const preset = rowStylePresets[index] || rowStylePresets[rowStylePresets.length - 1]
+    const bookmarks = rankOptions.value.map((item) => item.label)
+    const columnWidths =
+      preset.columnWidths.length === rankOptions.value.length
+        ? preset.columnWidths
+        : Array(rankOptions.value.length).fill(1)
     const educationLabels = Array.from(
       new Set(
         group.experts.map((expert) => getDictLabel(DICT_TYPE.RD_EXPERT_EDUCATION, expert.education))
@@ -726,24 +732,22 @@ const tableData = computed<TableRow[]>(() => {
       )
       .join(' ')
       .toLowerCase()
+    const cells: CellItem[] = rankOptions.value.map((option) => ({
+      type: 'members',
+      members: group.experts.filter((expert) =>
+        (expert.expertRank || []).some((rank) => String(rank) === String(option.value))
+      )
+    }))
 
     return {
       teamName: group.echelonLabel,
       education: educationLabels.join('、') || '-',
       searchText,
+      bookmarks,
       tableWidth: preset.tableWidth,
       backgroundColor: preset.backgroundColor,
-      columnWidths: preset.columnWidths,
-      cells: [
-        {
-          type: 'members',
-          members: group.experts
-        },
-        { type: 'text', text: '' },
-        { type: 'text', text: '' },
-        { type: 'text', text: '', tone: 'danger' },
-        { type: 'text', text: '' }
-      ]
+      columnWidths,
+      cells
     }
   })
 })