info.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <template>
  2. <div id="info">
  3. <el-row>
  4. <el-col :span="24" class="main animate__animated animate__backInRight">
  5. <component :is="CForm" :fields="field" :rules="{}" :form="form" labelWidth="auto" :isSave="false">
  6. <template #phone>
  7. <el-input v-model="form.phone.phone" readonly></el-input>
  8. </template>
  9. <template #email>
  10. <el-input v-model="form.email.email" readonly></el-input>
  11. </template>
  12. <template #education>
  13. <el-option v-for="i in educationList" :key="i.dict_value" :label="i.dict_label" :value="i.dict_value"></el-option>
  14. </template>
  15. <template #degree>
  16. <el-option v-for="i in degreeList" :key="i.dict_value" :label="i.dict_label" :value="i.dict_value"></el-option>
  17. </template>
  18. <template #card="{ item }">
  19. <el-link class="link" :href="i.url" :underline="false" v-for="(i, index) in form[item.model]" :key="index" target="_blank">
  20. <i class="el-icon-view el-icon--right"></i><span>{{ index + 1 }}.{{ i.name }}</span>
  21. </el-link>
  22. </template>
  23. <template #team_phone>
  24. <el-input v-model="form.team_phone.phone" readonly></el-input>
  25. </template>
  26. <template #zc_file="{ item }">
  27. <el-link class="link" :href="i.url" :underline="false" v-for="(i, index) in form[item.model]" :key="index" target="_blank">
  28. <i class="el-icon-view el-icon--right"></i><span>{{ index + 1 }}.{{ i.name }}</span>
  29. </el-link>
  30. </template>
  31. <template #direction="{ item }">
  32. <span v-for="(i, index) in form[item.model]" :key="index" class="direction">
  33. <span>{{ index + 1 }}.</span>{{ i.name }}
  34. </span>
  35. </template>
  36. <template #case="{ item }">
  37. <el-link class="link" :href="i.url" :underline="false" v-for="(i, index) in form[item.model]" :key="index" target="_blank">
  38. <i class="el-icon-view el-icon--right"></i><span>{{ index + 1 }}.{{ i.name }}</span>
  39. </el-link>
  40. </template>
  41. <template #case_file="{ item }">
  42. <el-link class="link" :href="i.url" :underline="false" v-for="(i, index) in form[item.model]" :key="index" target="_blank">
  43. <i class="el-icon-view el-icon--right"></i><span>{{ index + 1 }}.{{ i.name }}</span>
  44. </el-link>
  45. </template>
  46. <template #settle_file="{ item }">
  47. <el-link class="link" :href="i.url" :underline="false" v-for="(i, index) in form[item.model]" :key="index" target="_blank">
  48. <i class="el-icon-view el-icon--right"></i><span>{{ index + 1 }}.{{ i.name }}</span>
  49. </el-link>
  50. </template>
  51. <template #job_zc_file="{ item }">
  52. <el-link class="link" :href="i.url" :underline="false" v-for="(i, index) in form[item.model]" :key="index" target="_blank">
  53. <i class="el-icon-view el-icon--right"></i><span>{{ index + 1 }}.{{ i.name }}</span>
  54. </el-link>
  55. </template>
  56. </component>
  57. </el-col>
  58. </el-row>
  59. </div>
  60. </template>
  61. <script lang="ts" setup>
  62. import CForm from '@common/src/components/frame/c-form.vue';
  63. import { ref, toRefs, watch } from 'vue';
  64. import store from '@/stores/counter';
  65. import type { Ref } from 'vue';
  66. interface opItem {
  67. dict_value: string;
  68. dict_label: string;
  69. }
  70. const props = defineProps({
  71. info: { type: Object, default: () => {} },
  72. type: { type: String },
  73. educationList: { type: Array<opItem> },
  74. degreeList: { type: Array<opItem> },
  75. });
  76. const { info } = toRefs(props);
  77. const { type } = toRefs(props);
  78. const { educationList } = toRefs(props);
  79. const { degreeList } = toRefs(props);
  80. let field: Ref<any[]> = ref([]);
  81. let form: Ref<{ phone: { phone: string }; email: { email: string }; team_phone: { phone: string } }> = ref({
  82. phone: { phone: '' },
  83. email: { email: '' },
  84. team_phone: { phone: '' },
  85. });
  86. let user = store.state.user as { _id: string; role_type: string };
  87. // 查询
  88. const search = async (e) => {
  89. if (user && user.role_type != '1') {
  90. if (e.phone && e.phone.is_show == false) e.phone.phone = '暂未公开';
  91. if (e.email && e.email.is_show == false) e.email.email = '暂未公开';
  92. if (e.team_phone && e.team_phone.is_show == false) e.team_phone.phone = '暂未公开';
  93. }
  94. form.value = e;
  95. // 整理依托单位显示内容
  96. let fields: Ref<any[]> = ref([
  97. { label: '姓名', model: 'name', options: { readonly: true } },
  98. { label: '出生年月', model: 'brith', options: { readonly: true } },
  99. { label: '居住地', model: 'live_place', options: { readonly: true } },
  100. { label: '手机号', model: 'phone', custom: true },
  101. { label: '电子邮箱', model: 'email', custom: true },
  102. { label: '学历', model: 'education', type: 'select' },
  103. { label: '学位', model: 'degree', type: 'select' },
  104. { label: '身份证', model: 'card', custom: true },
  105. { label: '团队联系人', model: 'team_name', options: { readonly: true } },
  106. { label: '团队联系电话', model: 'team_phone', custom: true },
  107. { label: '所在单位全称', model: 'company', options: { readonly: true } },
  108. { label: '所在单位地址', model: 'address', options: { readonly: true } },
  109. { label: '专业技术职称', model: 'zc', options: { readonly: true } },
  110. { label: '职称证明', model: 'zc_file', custom: true },
  111. { label: '社会兼职', model: 'part_job', options: { readonly: true } },
  112. { label: '研究领域', model: 'fields', options: { readonly: true } },
  113. { label: '研究方向', model: 'direction', custom: true },
  114. { label: '服务企业代表性案例', model: 'case', custom: true },
  115. { label: '案例证明材料', model: 'case_file', custom: true },
  116. { label: '是否为在职人员', model: 'is_job' },
  117. ]);
  118. if (type.value == 'web') {
  119. fields.value = fields.value.filter((i) => i.model != 'card' && i.model != 'zc_file' && i.model != 'settle_file' && i.model != 'job_zc_file');
  120. }
  121. field.value = fields.value;
  122. };
  123. watch(info, (newVal) => {
  124. if (newVal && newVal._id) {
  125. search(newVal);
  126. }
  127. });
  128. </script>
  129. <style lang="scss" scoped>
  130. .direction {
  131. display: inline-block;
  132. background-color: #409eff;
  133. border-radius: 5px;
  134. padding: 0 5px;
  135. margin: 0 5px 5px 0;
  136. color: #ffffff;
  137. line-height: 2.5;
  138. span {
  139. padding: 0 5px 0 0;
  140. }
  141. }
  142. </style>