index.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <template>
  2. <div id="index">
  3. <el-row>
  4. <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
  5. <el-col :span="24" class="one">
  6. <div class="loginform">
  7. <el-col :span="24" class="content_1">
  8. <div class="type-list">
  9. <el-tooltip
  10. v-for="(item, index) in typeList"
  11. :key="index"
  12. effect="dark"
  13. :content="item.remark"
  14. placement="top"
  15. >
  16. <span
  17. class="span"
  18. :class="[item.value === type ? 'active' : '']"
  19. @click="toSelect(item.value)"
  20. >{{ item.label }}</span
  21. >
  22. </el-tooltip>
  23. </div>
  24. </el-col>
  25. <el-col :span="24" class="content_2">
  26. <user v-if="type == '0'"></user>
  27. <expert v-if="type == '1'"></expert>
  28. <company v-if="type == '2'"></company>
  29. <Incubator v-if="type == '3'"></Incubator>
  30. <competition v-if="type == '4'"></competition>
  31. <Investment v-if="type == '5'"></Investment>
  32. <association v-if="type == '6'"></association>
  33. <state v-if="type == '7'"></state>
  34. <unit v-if="type == '8'"></unit>
  35. </el-col>
  36. </div>
  37. </el-col>
  38. </el-col>
  39. </el-row>
  40. <el-dialog v-model="dialog" title="使用协议">
  41. <div v-html="configInfo.agreement"></div>
  42. </el-dialog>
  43. </div>
  44. </template>
  45. <script setup>
  46. // API 引用
  47. import { getCity } from '@/utils/city'
  48. import { siteInfo } from '@/layout/site'
  49. const $checkRes = inject('$checkRes')
  50. import { cloneDeep } from 'lodash-es'
  51. // 接口
  52. import { DictDataStore } from '@/store/api/system/dictData'
  53. import { DesignStore } from '@/store/api/platform/design'
  54. const dictDataStore = DictDataStore()
  55. const designStore = DesignStore()
  56. // 组件
  57. import user from './parts/user.vue'
  58. import association from './parts/association.vue'
  59. import company from './parts/company.vue'
  60. import competition from './parts/competition.vue'
  61. import expert from './parts/expert.vue'
  62. import Incubator from './parts/Incubator.vue'
  63. import state from './parts/state.vue'
  64. import unit from './parts/unit.vue'
  65. import Investment from './parts/Investment.vue'
  66. // 路由
  67. const router = useRouter()
  68. // 加载中
  69. const loading = ref(false)
  70. // 表单验证
  71. const ruleFormRef = ref()
  72. // 弹框
  73. const dialog = ref(false)
  74. // 基本设置
  75. const configInfo = ref({})
  76. // 字典
  77. const typeList = ref([])
  78. const genderList = ref([])
  79. const fieldList = ref([])
  80. const educationList = ref([])
  81. const cityList = ref([])
  82. const isUseList = ref([])
  83. const patternList = ref([])
  84. const scaleList = ref([])
  85. const IndustryList = ref([])
  86. const cardTypeList = ref([])
  87. const contributionList = ref([])
  88. // 用户类型
  89. const type = ref('0')
  90. // 用户协议
  91. const isAgree = ref(false)
  92. // 请求
  93. onMounted(async () => {
  94. loading.value = true
  95. await searchOther()
  96. loading.value = false
  97. })
  98. const searchOther = async () => {
  99. let result
  100. // 性别
  101. result = await dictDataStore.query({ code: 'gender', is_use: '0' })
  102. if ($checkRes(result)) genderList.value = result.data
  103. // 用户类型
  104. result = await dictDataStore.query({ code: 'userType', is_use: '0' })
  105. if ($checkRes(result)) typeList.value = result.data
  106. // 专家领域
  107. result = await dictDataStore.query({ code: 'field', is_use: '0' })
  108. if ($checkRes(result)) fieldList.value = result.data
  109. // 企业类型
  110. result = await dictDataStore.query({ code: 'companyType', is_use: '0' })
  111. if ($checkRes(result)) patternList.value = result.data
  112. // 企业规模
  113. result = await dictDataStore.query({ code: 'companyScale', is_use: '0' })
  114. if ($checkRes(result)) scaleList.value = result.data
  115. // 企业所属行业
  116. result = await dictDataStore.query({ code: 'companyIndustry', is_use: '0' })
  117. if ($checkRes(result)) IndustryList.value = result.data
  118. // 学历
  119. result = await dictDataStore.query({ code: 'education', is_use: '0' })
  120. if ($checkRes(result)) educationList.value = result.data
  121. // 证件类型
  122. result = await dictDataStore.query({ code: 'cardType', is_use: '0' })
  123. if ($checkRes(result)) cardTypeList.value = result.data
  124. // 出资方式
  125. result = await dictDataStore.query({ code: 'contribution', is_use: '0' })
  126. if ($checkRes(result)) contributionList.value = result.data
  127. // 是否使用
  128. result = await dictDataStore.query({ code: 'isUse', is_use: '0' })
  129. if ($checkRes(result)) isUseList.value = result.data
  130. // 基础设置
  131. result = await designStore.query({})
  132. if ($checkRes(result)) configInfo.value = result.data[0] || {}
  133. // 城市
  134. getCity().then((response) => (cityList.value = response.address))
  135. }
  136. // 选择用户类型
  137. const toSelect = async (data) => {
  138. type.value = data
  139. }
  140. // 去登录
  141. const toLogin = () => {
  142. router.push({ path: '/login' })
  143. }
  144. // 返回
  145. const toBack = () => {
  146. router.push({ path: '/home' })
  147. }
  148. // provide
  149. provide('$checkRes', $checkRes)
  150. provide('cloneDeep', cloneDeep)
  151. provide('siteInfo', siteInfo)
  152. provide('dialog', dialog)
  153. provide('isAgree', isAgree)
  154. provide('ruleFormRef ', ruleFormRef)
  155. provide('router', router)
  156. // 字典
  157. provide('genderList', genderList)
  158. provide('fieldList', fieldList)
  159. provide('educationList', educationList)
  160. provide('cityList', cityList)
  161. provide('isUseList', isUseList)
  162. provide('patternList', patternList)
  163. provide('scaleList', scaleList)
  164. provide('IndustryList', IndustryList)
  165. provide('cardTypeList', cardTypeList)
  166. provide('contributionList', contributionList)
  167. // 方法
  168. provide('toLogin', toLogin)
  169. provide('toBack', toBack)
  170. </script>
  171. <style scoped lang="scss">
  172. .main {
  173. .one {
  174. background-image: url(@/assets/loginbg.jpeg);
  175. background-position: center center;
  176. background-repeat: no-repeat;
  177. height: calc(100vh - 23vh);
  178. width: 100%;
  179. background-size: cover;
  180. display: flex;
  181. justify-content: space-evenly;
  182. .loginform {
  183. width: 800px;
  184. position: absolute;
  185. top: 50%;
  186. left: 50%;
  187. min-height: 400px;
  188. background: hsla(0, 0%, 100%, 0.6);
  189. box-shadow: 0 0 30px 0 rgba(51, 51, 51, 0.2);
  190. -webkit-transform: translate(-50%, -50%);
  191. transform: translate(-50%, -50%);
  192. border-top: 10px solid #1492ff;
  193. .content_1 {
  194. text-align: center;
  195. padding: 10px;
  196. .type-list {
  197. margin: 10px 0 0 0;
  198. .span {
  199. padding: 0 10px;
  200. margin-left: 5px;
  201. height: 26px;
  202. line-height: 24px;
  203. border: 1px solid #ddd;
  204. border-radius: 3px;
  205. background-color: #f4f4f4;
  206. }
  207. .span:hover {
  208. border-color: #3497fc;
  209. background-color: #d2f1fe;
  210. }
  211. .active {
  212. border-color: #3497fc;
  213. background-color: #d2f1fe;
  214. background-image: url(@/assets/icon_2.png);
  215. background-position: top right;
  216. background-repeat: no-repeat;
  217. }
  218. }
  219. }
  220. .content_2 {
  221. margin: 0 20px;
  222. overflow-y: auto;
  223. }
  224. .content_2::-webkit-scrollbar {
  225. display: none;
  226. }
  227. }
  228. }
  229. }
  230. </style>