demand.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. <template>
  2. <div class="demand">
  3. <div class="demandOne">
  4. <div class="demandSeacher">
  5. <div class="demandOneLeft">
  6. <span>行业</span>
  7. </div>
  8. <div v-if="!oneShow" class="demandOneRight">
  9. <div class="label" v-for="(item, index) in plateList.slice(0, 6)" :key="index">
  10. {{ item.title }}
  11. </div>
  12. </div>
  13. <div v-else class="demandOneRight">
  14. <div class="label" v-for="(item, index) in plateList" :key="index">
  15. {{ item.title }}
  16. </div>
  17. </div>
  18. <div class="button">
  19. <span v-if="!oneShow" @click="oneShow = true">
  20. <el-icon><ArrowDown /></el-icon>
  21. </span>
  22. <span v-else @click="oneShow = false">
  23. <el-icon><ArrowUp /></el-icon>
  24. </span>
  25. </div>
  26. </div>
  27. <div class="demandSeacher">
  28. <div class="demandOneLeft">
  29. <span>技术领域</span>
  30. </div>
  31. <div v-if="!twoShow" class="demandOneRight">
  32. <div class="label" v-for="(item, index) in typeList.slice(0, 10)" :key="index">
  33. {{ item.label }}
  34. </div>
  35. </div>
  36. <div v-else class="demandOneRight">
  37. <div class="label" v-for="(item, index) in typeList" :key="index">
  38. {{ item.label }}
  39. </div>
  40. </div>
  41. <div class="button">
  42. <span v-if="!twoShow" @click="twoShow = true">
  43. <el-icon><ArrowDown /></el-icon>
  44. </span>
  45. <span v-else @click="twoShow = false">
  46. <el-icon><ArrowUp /></el-icon>
  47. </span>
  48. </div>
  49. </div>
  50. <div class="demandSeacher">
  51. <div class="demandOneLeft">
  52. <span>所在地</span>
  53. </div>
  54. <div class="demandOneRight">
  55. <div class="label" v-for="(item, index) in cityList" :key="index">
  56. {{ item.name }}
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. <div class="demandIpunt">
  62. <a-input class="input" size="large" v-model:value="searchForm.name" placeholder="需求名称" />
  63. <a-input class="input" size="large" v-model:value="searchForm.tags" placeholder="标签名称" />
  64. <a-input class="input" size="large" v-model:value="searchForm.industry" placeholder="所属产业" />
  65. <a-input class="input" size="large" v-model:value="searchForm.company" placeholder="所属企业" />
  66. <a-button class="button" size="large" type="primary">检索</a-button>
  67. </div>
  68. <div class="demandTwo">
  69. <div class="demandTable">
  70. <div class="label" v-for="(item, index) in column" :key="index" :style="item.style">
  71. {{ item.name }}
  72. </div>
  73. </div>
  74. <div class="demandValue">
  75. <div class="value" v-for="(item, index) in list" :key="index">
  76. <div class="table-colunm table-colunm1 textOne">{{ index + 1 }}</div>
  77. <div class="table-colunm table-colunm2 textOne">{{ item.name || '暂无' }}</div>
  78. <div class="table-colunm textOne">{{ item.field || '暂无' }}</div>
  79. <div class="table-colunm table-colunm3 textOne">{{ getArea(item.area) }}</div>
  80. <div class="table-colunm table-colunm1 textOne">{{ item.money || '面议' }}</div>
  81. <div class="table-colunm table-colunm1 textOne">{{ item.status || '未解决' }}</div>
  82. <div class="table-colunm button" @click="toView(item)">查看详情</div>
  83. </div>
  84. </div>
  85. <div class="demandTotal">
  86. <el-pagination background layout="prev, pager, next" :total="total" :page-size="limit" v-model:current-page="currentPage" @current-change="changePage" @size-change="sizeChange" />
  87. </div>
  88. </div>
  89. </div>
  90. </template>
  91. <script setup>
  92. const router = useRouter()
  93. const list = inject('list')
  94. const total = inject('total')
  95. const sizeChange = inject('sizeChange')
  96. const changePage = inject('changePage')
  97. const plateList = inject('plateList')
  98. const typeList = inject('typeList')
  99. const cityList = inject('cityList')
  100. const searchForm = ref({})
  101. // 是否展开
  102. const oneShow = ref(false)
  103. const twoShow = ref(false)
  104. const column = ref([
  105. { name: '序号', style: { width: '100px' }, key: 'num' },
  106. { name: '需方名称', style: { width: '250px' }, key: 'name' },
  107. { name: '技术领域', style: { width: '185px' }, key: 'time' },
  108. { name: '所在地', style: { width: '360px' }, key: 'area' },
  109. { name: '投入预算', style: { width: '100px' }, key: 'money' },
  110. { name: '状态', style: { width: '100px' }, key: 'status' },
  111. { name: '操作', style: { width: '185px' }, key: 'operation' }
  112. ])
  113. // 查看详情
  114. const toView = (item) => {
  115. router.push({ path: '/demand/detail', query: { id: item.id || item._id } })
  116. }
  117. // 转换地区
  118. const getArea = (data) => {
  119. if (data) return data.join('-')
  120. else return '暂无'
  121. }
  122. </script>
  123. <style scoped lang="scss">
  124. .demand {
  125. padding: 10px 0;
  126. .demandOne {
  127. background-color: $global-color-fff;
  128. .demandSeacher {
  129. display: flex;
  130. justify-content: center;
  131. align-items: stretch;
  132. position: relative;
  133. border: solid 1px #e5e5e5;
  134. border-bottom: 0;
  135. font-size: $global-font-size-18;
  136. color: #666;
  137. min-height: 60px;
  138. overflow: hidden;
  139. .demandOneLeft {
  140. display: flex;
  141. justify-content: center;
  142. align-items: center;
  143. flex-shrink: 0;
  144. width: 110px;
  145. text-align: center;
  146. color: #000;
  147. font-weight: bold;
  148. background-color: #fafafa;
  149. }
  150. .demandOneRight {
  151. display: flex;
  152. flex-wrap: wrap;
  153. align-items: center;
  154. padding: 12px;
  155. flex: 1;
  156. border-left: solid 1px #e5e5e5;
  157. background-color: #fff;
  158. .label {
  159. color: #313131;
  160. margin-bottom: 10px;
  161. padding: 8px 10px;
  162. border-radius: 3px;
  163. background-color: #fff;
  164. border: solid 1px transparent;
  165. cursor: pointer;
  166. }
  167. .label:first-child {
  168. color: #0a58c2;
  169. border: solid 1px #006dd2;
  170. }
  171. .label:hover {
  172. color: $global-color-107;
  173. }
  174. }
  175. .button {
  176. display: flex;
  177. align-items: center;
  178. margin: 0 5px 0 0;
  179. }
  180. }
  181. }
  182. .demandIpunt {
  183. display: flex;
  184. align-items: center;
  185. justify-content: space-between;
  186. margin: 10px 0;
  187. .input {
  188. margin: 0 5px 0 0;
  189. }
  190. .button {
  191. margin: 0 0 0 5px;
  192. }
  193. }
  194. .demandTwo {
  195. margin: 10px 0;
  196. .demandTable {
  197. display: flex;
  198. justify-content: space-between;
  199. color: $global-color-fff;
  200. font-size: $global-font-size-20;
  201. background-color: rgba(255, 255, 255, 0.1);
  202. padding: 12px 0;
  203. .label {
  204. text-align: center;
  205. }
  206. }
  207. .demandValue {
  208. color: $global-color-fff;
  209. font-size: $global-font-size-20;
  210. .value {
  211. display: flex;
  212. justify-content: space-between;
  213. padding: 12px 0;
  214. .table-colunm {
  215. width: 185px;
  216. text-align: center;
  217. }
  218. .table-colunm1 {
  219. width: 100px !important;
  220. }
  221. .table-colunm2 {
  222. width: 250px !important;
  223. }
  224. .table-colunm3 {
  225. width: 360px !important;
  226. }
  227. .button {
  228. cursor: pointer; /* 改变鼠标样式为手形 */
  229. }
  230. .button:hover {
  231. color: $global-color-107;
  232. }
  233. }
  234. .value:nth-child(2n) {
  235. background-color: rgba(255, 255, 255, 0.1);
  236. }
  237. }
  238. .demandTotal {
  239. display: flex;
  240. justify-content: center;
  241. margin: 20px 0;
  242. }
  243. }
  244. }
  245. </style>