提交 04744c85 authored 作者: 刘旭's avatar 刘旭

更新代码

上级 5fe1a53b
......@@ -33,7 +33,7 @@ const route = useRoute()
const tabsList = [
{ name: '首页', link: '/home' },
{ name: '专题招聘', link: '' },
{ name: '专题招聘', link: '/home1' },
{ name: '灵活就业', link: '' },
{ name: '在线培训', link: '' },
{ name: '军人专区', link: '' },
......
export default [
{
url: '/api/getUsers',
url: '/api2/getUsers',
method: 'get',
response: () => {
return {
......
......@@ -46,7 +46,7 @@ const randomJobList = () => {
export default [
{
url: '/api/jobList',
url: '/api2/jobList',
methods: 'get',
response: () => {
return {
......
......@@ -12,8 +12,16 @@ const routes = [
component: () => import('@/views/home/index.vue')
},
{
path: '/home1',
component: () => import('@/views/home/index1.vue')
},
{
path: '/job',
component: () => import('@/views/job/index.vue')
},
{
path: '/details',
component: () => import('@/views/home/details.vue')
}
]
}
......
import request from '@/services'
export const getUsers = () => {
return request.get('/getUsers')
return request.get('/api2/getUsers')
}
export const getJobList = () => {
return request.get('/jobList')
return request.get('/api2/jobList')
}
export const getPositionList = (data: any) => {
return request.post('/api/4Government/rpoPost/selectByParameter', data)
}
......@@ -22,7 +22,7 @@ interface ResultData<T = any> extends Result {
data?: T
}
let URL: string = '/api'
let URL: string = ''
enum RequestEnums {
TIMEOUT = 20000, // 请求超时
......@@ -37,8 +37,9 @@ const config = {
// 设置超时时间
timeout: RequestEnums.TIMEOUT as number,
// 跨域时候允许携带凭证
withCredentials: true,
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
withCredentials: true
// headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
// headers: { 'Content-Type': 'application/json' }
}
class RequestHttp {
......@@ -59,9 +60,9 @@ class RequestHttp {
// * 如果当前请求不需要显示 loading,在 api 服务中通过指定的第三个参数: { headers: { noLoading: true } }来控制不显示loading,参见getMenuList()
// config.headers!.noLoading || showFullScreenLoading();
const token = globalStore.token
if (config.headers && typeof config.headers?.set === 'function')
config.headers.set('x-access-token', globalStore.token)
// const token = globalStore.token
// if (config.headers && typeof config.headers?.set === 'function')
// config.headers.set('x-access-token', globalStore.token)
return config
},
......
import { defineStore, createPinia } from 'pinia'
import piniaPersistConfig from '../utils/piniaPersist'
import piniaPluginPersist from 'pinia-plugin-persist'
import piniaPersist from 'pinia-plugin-persist'
// defineStore('global',{..}) 在devtools 就使用 global 这个名
export const useGlobalStore = defineStore('globalStore', {
// 相当于data
state: () => {
return {
// 所有这些属性都将自动推断其类型,如果推断失败可以试下 as xxx
token: ''
token: '',
jobDetail: null as any
}
},
// 相当于计算属性
getters: {},
// 相当于vuex的 mutation + action,可以同时写同步和异步的代码
getters: {
getJobDtail: state => state.jobDetail
},
actions: {
setToken(token: string) {
this.token = token
},
persist: piniaPersistConfig('globalStore')
setJobDetail(jobDetail: any) {
this.jobDetail = jobDetail
}
},
persist: {
enabled: true,
strategies: [{ storage: localStorage, paths: ['jobDetail'] }]
}
})
const pinia = createPinia()
pinia.use(piniaPluginPersist)
pinia.use(piniaPersist)
export default pinia
import { defineStore } from 'pinia'
export const usejobStore = defineStore('jobStore', {
// 相当于data
state: () => {
return {
jobDetail: null
}
},
// 相当于计算属性
getters: {
getJobDtail: state => state.jobDetail
},
actions: {
setJobDetail(jobDetail: any) {
this.jobDetail = jobDetail
}
}
})
export const LOGIN_URL = 'login'
export const locationIcon =
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAKXSURBVHgB5VddbtNAEP52bZ6xT0A4QdMTkN4AK0VCYKntCVJOkOQEDScgSElViZaEEzQ9QcwJMCdIoOIJe5dZN0Kt7f1xmrd+kiVrZ3bmW+/8GXjqYE2UV7O3LR/+kRToSLAWIFsb0ZoMJZJjLuB/C6Nx6mjSjcBqdtzyRPZJAh0XfQY5zvmzoQsRblO4ncU9LrKlq3MF+jrHtOfH6ur9qU3XSOD2Ku4LgRG9BtgCH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5A5/7V3Xm2sTKSEIufSnpC5ue5yqQCRKR5K6/3DFE4KgvarRQlAYBAyDgGEQMAwChkHAMAgYBgHDIGAYBAyDgGEQMAwChkHAMAgYBgHDIGAYBAyDgGEQMBAfcFCjl054w1PzVulpUapf/lWt8iD4/Dpr1x6/l5iJPIiLYUamH9lOhGjS/tX678wEIpfjFiXyKUsPn70tnYzRpNRAfdTNScxEHkRp/4ockMYUGDP/96J+ECPvgPFdFhgGAcMgYGA/aJ2Yub7rfvnJvbYejyuOEDAMAoZBwMCuIfutCe2vGUrURGbMP3pmTrSpbxhb7FHqZ2D2y5tsZfVpZMctXXL1lItxccwfOfewZYim+hmYGpnK+PUzsKiidMeUpbTyh05l/xrj9w8PKDeKItIVQaz79wimjTOzxpQWDe5DWoruDIzvssB07SXRXubWrvvVZ3cEAUcImC7ah8QDRwiYrl1DUNaMvThCwHAfAoYjBAz3Ib9wH0ItcR8ChiOkwQoK7kPAcISAYRAwDAKGQcAwCBgGAcMgYBgETOgbQ6uNkhA1nk97bT9n83WqWhDqNl5tzY8flxCp89c+SHxY++L+qISIUxYYBgETxeEiztHq/kJ/reEv6iHPyXHDKQsMg4BhEDAMAoZBwDAIGAYBwyBgGAQMg4BhEDAMAoZBwDAIGAYBwyBgGAQMg4BhEDAMAkbXql4gBCEIyhVd7tkoCkFIVQ9VdDp3jEFQPH9b0Cr7qlw0/pZQpFwDtSRBY1FfyK0Uvm2XqkKRCGqVSnp2Je9uG/dleVlsaqZQvNA7rDxbSwiFxo2MwRvvNpX6+bHVP66bsIv1SBsn+/L5774xCV+oo9wfvMeUqpvSV0rnEkW3ZOx8/AeuseK4CcGZoQAAAABJRU5ErkJggg=='
......@@ -6,9 +6,8 @@ import { PersistStrategy } from 'pinia-plugin-persist'
* @param {Array} paths 需要持久化的 state name
* @return persist
* */
const piniaPersistConfig = (key: string, paths?: any[]) => {
const piniaPersistConfig = (paths?: any[]) => {
const persist: PersistStrategy = {
key,
storage: localStorage,
// storage: sessionStorage,
paths
......
<template>
<div class="container">
<div class="details-header">
<div class="content">
<div>
<div class="details-header-top">
<div>装卸</div>
<div class="salary-range">{{ detailData?.salaryRange }}</div>
</div>
<div class="details-header-center">
{{ detailData?.cityName }}/{{
detailData?.workingLife ? detailData?.workingLife : '经验不限'
}}/{{ detailData?.academicRequirement ? detailData?.academicRequirement : '学历不限' }}
</div>
<div class="details-header-bottom">
<img src="https://rms.junrunrenli.com/static/img/money02.df9ff2d6.png" class="icon" />
推荐金额
<div>{{ detailData?.rewards }}</div>
</div>
</div>
<div class="submit">
<el-button @click="show = !show">立即投递</el-button>
<div v-if="show" class="popupbox">
<img src="https://rms.junrunrenli.com/static/img/popup02.691d38c2.png" />
</div>
</div>
</div>
</div>
<div class="details-content">
<div class="content">
<div class="title">职位描述:</div>
<div class="text">
{{ detailData?.positionDescribe }}
</div>
<div class="title">工作地点</div>
<div class="text">
<img :src="locationIcon" class="address" />
{{ detailData?.workingplaceAddress }}
</div>
<div class="title">公司信息</div>
<div class="text">
<img :src="companyIcon" class="comp" />
{{ detailData?.customerName }}
</div>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { companyIcon, locationIcon } from '@/utils/index'
import { useGlobalStore } from '@/stores/index'
const globalStore = useGlobalStore()
const detailData = computed(() => globalStore.getJobDtail)
const show = ref(false)
</script>
<style lang="scss" scoped>
.container {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
box-sizing: border-box;
.details-header {
background-color: #f5f5f5;
width: 100%;
height: 238px;
display: flex;
justify-content: center;
.content {
padding-top: 40px;
width: 1200px;
display: flex;
justify-content: space-between;
.details-header-top {
display: flex;
font-size: 18px;
color: #242424;
margin-bottom: 25px;
align-items: flex-end;
.salary-range {
font-size: 16px;
color: #f3911d;
margin-left: 20px;
}
}
.details-header-center {
color: #666;
font-size: 15px;
display: inline-block;
margin-bottom: 25px;
}
.details-header-bottom {
font-size: 16px;
display: flex;
align-items: flex-end;
.icon {
width: 18px;
height: 18px;
margin-right: 10px;
}
div {
margin-left: 10px;
color: #f3911d;
}
}
.submit {
position: relative;
.el-button {
width: 140px;
height: 48px;
line-height: 48px;
background-color: #f3911d;
border-radius: 4px;
color: #fff;
padding: 0;
font-size: 20px;
}
.popupbox {
position: absolute;
z-index: 20;
right: -5px;
top: 50px;
img {
height: 171px;
width: 170px;
}
}
}
}
}
.details-content {
width: 100%;
background-color: #ffffff;
padding-top: 40px;
display: flex;
justify-content: center;
.content {
width: 1200px;
.title {
font-size: 18px;
margin-bottom: 16px;
color: #242424;
font-weight: 700;
}
.text {
font-size: 13px;
color: #666;
margin-bottom: 30px;
vertical-align: middle;
display: flex;
align-items: center;
.address {
width: 18px;
height: 20px;
display: inline-block;
margin-right: 10px;
vertical-align: middle;
padding-bottom: 2px;
}
.comp {
width: 50px;
height: 50px;
margin-right: 20px;
display: inline-block;
vertical-align: middle;
}
}
}
}
}
</style>
<template>
<div class="container">
<div class="top">
<el-carousel height="400px">
<el-carousel-item v-for="item in urls" :key="item">
<el-image
style="width: 100%; height: 100%; border-radius: 10px"
:src="item"
fit="cover"
/>
</el-carousel-item>
</el-carousel>
</div>
<div class="content">
<div v-for="item in 3" :key="item" :span="7" class="content-box">
<div class="header">公告</div>
<el-card shadow="never">
<template #default>
<el-scrollbar max-height="400px">
<div v-for="item1 in 13" :key="item1" class="link">
<el-link class="text" title="深圳市创业场租补贴办事指南"
>深圳市创业场租补贴办事指南</el-link
>
<el-icon><i-ep-search /></el-icon>
</div>
</el-scrollbar>
<div class="card-footer">
<el-link type="primary" :underline="false" href="">查看更多>>></el-link>
</div>
</template>
</el-card>
</div>
</div>
<div class="bottom">
<div style="text-align: center; margin-bottom: 20px">
<el-input
v-model="listQuery.obj.postName"
placeholder="搜索职位、公司"
:suffix-icon="Search"
size="large"
style="width: 70%"
@change="inputChange"
/>
</div>
<el-row class="job-item">
<el-col v-for="item in positionList" :key="item.id" :span="8" @click="toDetails(item)">
<el-card shadow="never">
<template #header>
<div class="card-header">
<div class="card-header-top">
<div class="card-header-top-left">{{ item.postName }}</div>
<div class="card-header-top-right">
<div>
{{
item.salaryRange?.substring(0, item.salaryRange.indexOf('元'))
? item.salaryRange?.substring(0, item.salaryRange.indexOf('元'))
: item.salaryRange
}}
</div>
<text v-show="item.salaryRange?.substring(0, item.salaryRange.indexOf('元'))"
>元/月</text
>
</div>
</div>
<div class="card-header-bottom">
{{ item.academicRequirement }} | {{ item.workingLife }} | 招聘{{
item.recruitingNumbers
}}
</div>
</div>
</template>
<div class="card-content">
<div>{{ item.customerName }}</div>
<div class="card-content-bottom">
{{ item.recruitingType }} | {{ item.ageRequirement }} 人 | 餐饮
</div>
</div>
</el-card>
</el-col>
</el-row>
</div>
</div>
</template>
<script setup lang="ts">
import { Search } from '@element-plus/icons-vue'
import { getPositionList } from '@/services/api/home'
import { useGlobalStore } from '@/stores/index'
const globalStore = useGlobalStore()
const urls = [
'https://fuss10.elemecdn.com/a/3f/3302e58f9a181d2509f3dc0fa68b0jpeg.jpeg',
'https://fuss10.elemecdn.com/1/34/19aa98b1fcb2781c4fba33d850549jpeg.jpeg',
'https://fuss10.elemecdn.com/0/6f/e35ff375812e6b0020b6b4e8f9583jpeg.jpeg',
'https://fuss10.elemecdn.com/9/bb/e27858e973f5d7d3904835f46abbdjpeg.jpeg',
'https://fuss10.elemecdn.com/d/e6/c4d93a3805b3ce3f323f7974e6f78jpeg.jpeg',
'https://fuss10.elemecdn.com/3/28/bbf893f792f03a54408b3b7a7ebf0jpeg.jpeg',
'https://fuss10.elemecdn.com/2/11/6535bcfb26e4c79b48ddde44f4b6fjpeg.jpeg'
]
const router = useRouter()
const listQuery = reactive({
obj: {
postName: ''
},
currentPage: 1,
pageSize: 6
})
const positionList = ref([] as any)
const inputChange = (val: string) => {
init()
}
const toDetails = (row: any) => {
globalStore.setJobDetail(row)
router.push('/details')
}
const init = async () => {
const res: any = await getPositionList(listQuery)
if (res.code === 200) {
positionList.value = res.data.obj
}
}
init()
</script>
<style lang="scss" scoped>
// :deep(.el-tabs__item) {
// border: 1px solid #ccc;
// }
:deep(.el-tabs__nav-wrap::after) {
height: 0;
}
:deep(.el-tabs__active-bar) {
height: 0;
}
:deep(.is-active) {
color: #303133;
}
.container {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
box-sizing: border-box;
.top {
width: 1200px;
border-radius: 10px;
margin: 30px;
}
.content {
width: 1200px;
// height: 410px;
display: flex;
margin-bottom: 40px;
.content-box {
width: calc((100% - 30px) / 3);
display: flex;
flex-direction: column;
.header {
width: 100%;
height: 40px;
color: #ffffff;
background-color: #409eff;
display: flex;
justify-content: center;
align-items: center;
}
.el-card {
width: 100%;
flex: 1;
box-sizing: border-box;
:deep(.el-card__body) {
padding: 0;
}
:deep(.el-scrollbar) {
padding: 10px;
box-sizing: border-box;
}
.card-footer {
height: 30px;
line-height: 30px;
text-align: right;
margin-right: 10px;
padding-bottom: 10px;
.el-link {
font-size: 12px;
}
}
.link {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 12px;
margin: 5px 0;
.text {
width: 50%;
text-align: left;
:deep(.el-link__inner) {
display: inline-block;
width: 100%; /* 设置宽度 */
overflow: hidden; /* 隐藏超出部分 */
text-overflow: ellipsis; /* 显示省略号 */
white-space: nowrap; /* 阻止文本换行 */
}
}
}
}
}
& .content-box:nth-child(2) {
margin: 0 15px;
}
}
.bottom {
width: 1200px;
margin-bottom: 20px;
.job-item {
// :deep(.el-card__header) {
// padding: 26px 20px 10px;
// }
.card-header {
display: flex;
flex-direction: column;
.card-header-top {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16px;
.card-header-top-left {
font-weight: bolder;
}
.card-header-top-right {
div {
display: inline-block;
font-weight: bolder;
margin-right: 5px;
color: #f33f33;
}
text {
font-size: 12px;
color: #909399;
}
}
}
.card-header-bottom {
font-size: 14px;
color: #909399;
}
}
.card-content {
font-size: 14px;
.card-content-bottom {
color: #909399;
margin-top: 16px;
}
}
.el-col-8 {
margin-bottom: 15px;
max-width: calc((100% - 30px) / 3);
flex: 0 0 calc((100% - 30px) / 3);
}
.el-col-8:nth-child(3n + 2) {
margin: 0 15px;
}
}
}
}
</style>
<template>
<el-card></el-card>
</template>
<script setup lang="ts"></script>
<style lang="scss" scoped></style>
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"strict": true,
"jsx": "preserve",
"importHelpers": true,
"moduleResolution": "node",
"experimentalDecorators": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
},
"lib": ["esnext", "dom", "dom.iterable", "scripthost"]
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"strict": true,
"jsx": "preserve",
"importHelpers": true,
"moduleResolution": "node",
"experimentalDecorators": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
},
"include": [
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.vue",
"tests/**/*.ts",
"tests/**/*.tsx",
"types/auto-imports.d.ts"
],
"exclude": ["node_modules"]
"lib": ["esnext", "dom", "dom.iterable", "scripthost"],
"types": ["pinia-plugin-persist"]
},
"include": [
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.vue",
"tests/**/*.ts",
"tests/**/*.tsx",
"types/auto-imports.d.ts"
],
"exclude": ["node_modules"]
}
......@@ -35,10 +35,13 @@ declare module 'vue' {
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
ElSelect: typeof import('element-plus/es')['ElSelect']
ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
ElTabPane: typeof import('element-plus/es')['ElTabPane']
ElTabs: typeof import('element-plus/es')['ElTabs']
ElTag: typeof import('element-plus/es')['ElTag']
IEpArrowRight: typeof import('~icons/ep/arrow-right')['default']
IEpArrowRightBold: typeof import('~icons/ep/arrow-right-bold')['default']
IEpDocument: typeof import('~icons/ep/document')['default']
IEpLocation: typeof import('~icons/ep/location')['default']
IEpMenu: typeof import('~icons/ep/menu')['default']
IEpSearch: typeof import('~icons/ep/search')['default']
IEpSetting: typeof import('~icons/ep/setting')['default']
......
......@@ -78,11 +78,18 @@ export default defineConfig({
host: '0.0.0.0',
// 设置代理
proxy: {
// 将请求代理到另一个服务器
'/api': {
target: 'http://127.0.0.1:5173', //这是你要跨域请求的地址前缀
'/api2': {
target: 'http://127.0.0.1:5173/',
changeOrigin: true,
rewrite: path => path.replace(/^\/api/, '')
rewrite: path => path.replace(/^\/api2/, '')
},
// '/api': {
// target: 'http://sit.rms.jrit.top',
// changeOrigin: true
// },
'/api': {
target: 'https://rms.junrunrenli.com',
changeOrigin: true
}
}
},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论