|
|
@@ -66,6 +66,16 @@
|
|
|
<span v-else>-</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column label="定向" prop="directedStudy" align="center" width="140">
|
|
|
+ <template #default="scope">
|
|
|
+ <div v-if="getFirstDirectedStudy(scope.row)" class="cursor-pointer text-blue-500 hover:text-blue-700" @click="handleShowDirectedStudy(scope.row)">
|
|
|
+ <el-tooltip :content="getFirstDirectedStudy(scope.row)" placement="top" :disabled="!getFirstDirectedStudy(scope.row)">
|
|
|
+ <div class="truncate">{{ getFirstDirectedStudy(scope.row) }}</div>
|
|
|
+ </el-tooltip>
|
|
|
+ </div>
|
|
|
+ <span v-else>-</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="卡类型" prop="type" align="center" min-width="120">
|
|
|
<template #default="scope">
|
|
|
<dict-tag :options="card_type" :value="scope.row.type" />
|
|
|
@@ -123,11 +133,30 @@
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
+
|
|
|
+ <!-- 定向信息弹窗 -->
|
|
|
+ <el-dialog v-model="directedStudyDialogVisible" title="定向信息" width="900px">
|
|
|
+ <el-table :data="directedStudyList" class="w-full" style="width: 100%">
|
|
|
+ <el-table-column label="序号" type="index" width="60" align="center"></el-table-column>
|
|
|
+ <el-table-column label="编码" prop="code" min-width="120" align="center"></el-table-column>
|
|
|
+ <el-table-column label="学校" prop="universityName" min-width="200" align="center">
|
|
|
+ <template #default="scope">
|
|
|
+ <span>{{ scope.row.universityName }}{{ scope.row.universityId ? `(${scope.row.universityId})` : '' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="专业" prop="majorName" min-width="200" align="center">
|
|
|
+ <template #default="scope">
|
|
|
+ <span>{{ scope.row.majorName }}{{ scope.row.majorId ? `(${scope.row.majorId})` : '' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="专业类" prop="majorAncestors" min-width="200" align="center"></el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script setup>
|
|
|
import DictTag from '@/components/DictTag/index.vue';
|
|
|
-import { getCurrentInstance } from 'vue';
|
|
|
+import { getCurrentInstance, ref } from 'vue';
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
const { card_type, exam_type, card_distribute_status, card_status, card_settlement_status, card_time_status, card_pay_status } =
|
|
|
proxy.useDict("card_type", "exam_type", "card_distribute_status", "card_status", "card_settlement_status", "card_time_status", "card_pay_status");
|
|
|
@@ -161,6 +190,69 @@ const handleDelete = (row) => {
|
|
|
const getAssignExamType = (row) => {
|
|
|
return row && row.assignExamType ? row.assignExamType : null;
|
|
|
};
|
|
|
+
|
|
|
+// 解析directedStudy JSON并获取第一个的显示文本
|
|
|
+const getFirstDirectedStudy = (row) => {
|
|
|
+ if (!row || !row.directedStudy) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ const directedStudy = typeof row.directedStudy === 'string'
|
|
|
+ ? JSON.parse(row.directedStudy)
|
|
|
+ : row.directedStudy;
|
|
|
+
|
|
|
+ if (Array.isArray(directedStudy) && directedStudy.length > 0) {
|
|
|
+ const first = directedStudy[0];
|
|
|
+ const universityName = first?.universityName || '';
|
|
|
+ const majorName = first?.majorName || '';
|
|
|
+ if (universityName || majorName) {
|
|
|
+ const parts = [];
|
|
|
+ if (universityName) parts.push(universityName);
|
|
|
+ if (majorName) parts.push(majorName);
|
|
|
+ return parts.join(' - ');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ console.error('解析directedStudy失败:', e);
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+};
|
|
|
+
|
|
|
+// 获取完整的directedStudy列表
|
|
|
+const getDirectedStudyList = (row) => {
|
|
|
+ if (!row || !row.directedStudy) {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ const directedStudy = typeof row.directedStudy === 'string'
|
|
|
+ ? JSON.parse(row.directedStudy)
|
|
|
+ : row.directedStudy;
|
|
|
+
|
|
|
+ if (Array.isArray(directedStudy)) {
|
|
|
+ return directedStudy.map(item => ({
|
|
|
+ code: item?.code || '-',
|
|
|
+ majorName: item?.majorName || '-',
|
|
|
+ majorId: item?.majorId || null,
|
|
|
+ universityName: item?.universityName || '-',
|
|
|
+ universityId: item?.universityId || null,
|
|
|
+ majorAncestors: item?.majorAncestors || '-'
|
|
|
+ }));
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ console.error('解析directedStudy失败:', e);
|
|
|
+ }
|
|
|
+ return [];
|
|
|
+};
|
|
|
+
|
|
|
+// 弹窗相关
|
|
|
+const directedStudyDialogVisible = ref(false);
|
|
|
+const directedStudyList = ref([]);
|
|
|
+
|
|
|
+// 显示定向信息弹窗
|
|
|
+const handleShowDirectedStudy = (row) => {
|
|
|
+ directedStudyList.value = getDirectedStudyList(row);
|
|
|
+ directedStudyDialogVisible.value = true;
|
|
|
+};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
/* 在弹窗中使用时的样式 */
|