generated from Leo_Ding/web-template
即将修改网站-联系我们-混乱中
This commit is contained in:
parent
0659f6ce8e
commit
bbd5816522
23
src/apis/modules/products.js
Normal file
23
src/apis/modules/products.js
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
/**
|
||||||
|
* 海邻招聘岗位接口
|
||||||
|
*/
|
||||||
|
import request from '@/utils/request'
|
||||||
|
// 获取产品列表
|
||||||
|
export const getProductsList = (params) => request.basic.get('/api/v1/products', params)
|
||||||
|
|
||||||
|
// 获取产品单条数据
|
||||||
|
export const getProductsItem = (id) => request.basic.get(`/api/v1/products/${id}`)
|
||||||
|
// 添加产品
|
||||||
|
export const createProductsItem = (params) => request.basic.post('/api/v1/products', params)
|
||||||
|
// 更新产品
|
||||||
|
export const updateProductsItem = (id, params) => request.basic.put(`/api/v1/products/${id}`, params)
|
||||||
|
// 删除产品
|
||||||
|
export const delProductsItem = (id) => request.basic.delete(`/api/v1/products/${id}`)
|
||||||
|
// 获取产品类别列表
|
||||||
|
export const getProduct = (params) => request.basic.get('/api/v1/products/job_areas', params)
|
||||||
|
// 获取产品适用对象
|
||||||
|
export const getProductObj = (params) => request.basic.get('/api/v1/products/job_areas', params)
|
||||||
|
// 添加产品类别
|
||||||
|
export const createProduct = (params) => request.basic.post('/api/v1/products/job_areas', params)
|
||||||
|
// 添加适用对象产品
|
||||||
|
export const createProductObj = (params) => request.basic.post('/api/v1/products/job_areas', params)
|
||||||
@ -409,6 +409,7 @@ function trigger() {
|
|||||||
.x-upload-btn,
|
.x-upload-btn,
|
||||||
.x-upload-item {
|
.x-upload-item {
|
||||||
border-radius: 10em;
|
border-radius: 10em;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,44 +1,27 @@
|
|||||||
<template>
|
<template>
|
||||||
<x-search-bar class="mb-8-2">
|
<x-search-bar class="mb-8-2">
|
||||||
<template #default="{ gutter, colSpan }">
|
<template #default="{ gutter, colSpan }">
|
||||||
<a-form
|
<a-form :model="searchFormData" layout="inline">
|
||||||
:label-col="{ style: { width: '100px' } }"
|
|
||||||
:model="searchFormData"
|
|
||||||
layout="inline">
|
|
||||||
<a-row :gutter="gutter">
|
<a-row :gutter="gutter">
|
||||||
<a-col v-bind="colSpan">
|
<a-col v-bind="colSpan">
|
||||||
<a-form-item
|
<a-form-item label="产品名称" name="title">
|
||||||
:label="$t('pages.system.user.form.username')"
|
<a-input placeholder="请输入产品名称" v-model:value="searchFormData.title"></a-input>
|
||||||
name="username">
|
|
||||||
<a-input
|
|
||||||
:placeholder="$t('pages.system.user.form.username.placeholder')"
|
|
||||||
v-model:value="searchFormData.username"></a-input>
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
|
||||||
<a-col v-bind="colSpan">
|
<a-col v-bind="colSpan">
|
||||||
<a-form-item name="name">
|
<a-form-item label="状态" name="status">
|
||||||
<template #label>
|
<a-select v-model:value="searchFormData.status" allowClear>
|
||||||
{{ $t('pages.system.user.form.name') }}
|
<a-select-option value="">全部</a-select-option>
|
||||||
<a-tooltip :title="$t('pages.system.user.form.name')">
|
<a-select-option value="enabled">启用</a-select-option>
|
||||||
<question-circle-outlined class="ml-4-1 color-placeholder" />
|
<a-select-option value="disabled">停用</a-select-option>
|
||||||
</a-tooltip>
|
</a-select>
|
||||||
</template>
|
|
||||||
<a-input
|
|
||||||
:placeholder="$t('pages.system.user.form.name.placeholder')"
|
|
||||||
v-model:value="searchFormData.name"></a-input>
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
<a-col class="align-right" v-bind="colSpan">
|
||||||
<a-col
|
|
||||||
class="align-right"
|
|
||||||
v-bind="colSpan">
|
|
||||||
<a-space>
|
<a-space>
|
||||||
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
|
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
|
||||||
<a-button
|
<a-button ghost type="primary" @click="handleSearch">
|
||||||
ghost
|
|
||||||
type="primary"
|
|
||||||
@click="handleSearch">
|
|
||||||
{{ $t('button.search') }}
|
{{ $t('button.search') }}
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-space>
|
</a-space>
|
||||||
@ -47,58 +30,45 @@
|
|||||||
</a-form>
|
</a-form>
|
||||||
</template>
|
</template>
|
||||||
</x-search-bar>
|
</x-search-bar>
|
||||||
<a-row
|
<a-row :gutter="8" :wrap="false">
|
||||||
:gutter="8"
|
|
||||||
:wrap="false">
|
|
||||||
<a-col flex="auto">
|
<a-col flex="auto">
|
||||||
<a-card type="flex">
|
<a-card type="flex">
|
||||||
<x-action-bar class="mb-8-2">
|
<x-action-bar class="mb-8-2">
|
||||||
<a-button
|
<a-button type="primary" @click="$refs.editDialogRef.handleCreate()">
|
||||||
type="primary"
|
|
||||||
@click="$refs.editDialogRef.handleCreate()">
|
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<plus-outlined></plus-outlined>
|
<plus-outlined></plus-outlined>
|
||||||
</template>
|
</template>
|
||||||
{{ $t('pages.system.user.add') }}
|
新增产品
|
||||||
</a-button>
|
</a-button>
|
||||||
</x-action-bar>
|
</x-action-bar>
|
||||||
<a-table
|
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
|
||||||
:columns="columns"
|
:pagination="paginationState" :scroll="{ x: 1000 }" @change="onTableChange">
|
||||||
:data-source="listData"
|
|
||||||
:loading="loading"
|
|
||||||
:pagination="paginationState"
|
|
||||||
:scroll="{ x: 1000 }"
|
|
||||||
@change="onTableChange">
|
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
<template v-if="'statusType' === column.key">
|
|
||||||
<!--状态-->
|
<template v-if="column.dataIndex === 'introduce'">
|
||||||
<a-tag
|
<a-tooltip :title="record.introduce">
|
||||||
v-if="statusUserTypeEnum.is('activated', record.status)"
|
<div class="text-ellipsis">{{ record.introduce }}</div>
|
||||||
color="processing">
|
</a-tooltip>
|
||||||
{{ statusUserTypeEnum.getDesc(record.status) }}
|
</template>
|
||||||
</a-tag>
|
<template v-if="column.dataIndex === 'duty'">
|
||||||
<!--状态-->
|
<a-tooltip :title="record.duty">
|
||||||
<a-tag
|
<div class="text-ellipsis">{{ record.duty }}</div>
|
||||||
v-if="statusUserTypeEnum.is('freezed', record.status)"
|
</a-tooltip>
|
||||||
color="processing">
|
|
||||||
{{ statusUserTypeEnum.getDesc(record.status) }}
|
|
||||||
</a-tag>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="'createAt' === column.key">
|
<template v-if="'status' === column.dataIndex">
|
||||||
{{ formatUtcDateTime(record.created_at) }}
|
<a-tag v-if="record.status === 'enabled'" :color="'green'">启用</a-tag>
|
||||||
|
<a-tag v-if="record.status === 'disabled'" :color="'red'">停用</a-tag>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="'action' === column.key">
|
<template v-if="'action' === column.key">
|
||||||
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">
|
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">
|
||||||
<a-tooltip>
|
<a-tooltip>
|
||||||
<template #title> {{ $t('pages.system.user.edit') }}</template>
|
<template #title> {{ $t('pages.system.user.edit') }}</template>
|
||||||
<edit-outlined /> </a-tooltip
|
<edit-outlined /> </a-tooltip></x-action-button>
|
||||||
></x-action-button>
|
|
||||||
<x-action-button @click="handleDelete(record)">
|
<x-action-button @click="handleDelete(record)">
|
||||||
<a-tooltip>
|
<a-tooltip>
|
||||||
<template #title>{{ $t('pages.system.delete') }}</template>
|
<template #title>{{ $t('pages.system.delete') }}</template>
|
||||||
<delete-outlined style="color: #ff4d4f" /> </a-tooltip
|
<delete-outlined style="color: #ff4d4f" /> </a-tooltip></x-action-button>
|
||||||
></x-action-button>
|
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</a-table>
|
</a-table>
|
||||||
@ -106,9 +76,7 @@
|
|||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
|
|
||||||
<edit-dialog
|
<edit-dialog ref="editDialogRef" @ok="onOk"></edit-dialog>
|
||||||
ref="editDialogRef"
|
|
||||||
@ok="onOk"></edit-dialog>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
@ -124,17 +92,18 @@ import EditDialog from './components/EditDialog.vue'
|
|||||||
import { PlusOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons-vue'
|
import { PlusOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons-vue'
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'product',
|
name: 'homeBanner',
|
||||||
})
|
})
|
||||||
const { t } = useI18n() // 解构出t方法
|
const { t } = useI18n() // 解构出t方法
|
||||||
const columns = [
|
const columns = [
|
||||||
{ title: t('pages.system.user.form.username'), dataIndex: 'username', width: 120 },
|
{ title: '招聘岗位', dataIndex: 'title', width: 120, },
|
||||||
{ title: t('pages.system.user.form.name'), dataIndex: 'name', key: 'name', width: 100 },
|
{ title: '所属基地', dataIndex: 'areaName', key: 'title', width: 150 },
|
||||||
{ title: t('pages.system.user.form.phone'), dataIndex: 'phone', width: 120 },
|
{ title: '岗位要求', dataIndex: 'introduce', key: 'introduce'},
|
||||||
{ title: t('pages.system.user.form.email'), dataIndex: 'email', width: 100 },
|
{ title: '岗位职责', dataIndex: 'duty',ellipsis: true,},
|
||||||
{ title: t('pages.system.user.form.status'), dataIndex: 'status', key: 'statusType', width: 60 },
|
{ title: '薪资范畴', dataIndex: 'salary', width: 120, align: 'center'},
|
||||||
{ title: t('pages.system.user.form.created_at'), key: 'createAt', fixed: 'right', width: 120 },
|
{ title: '岗位排序', dataIndex: 'sequence', width: 120, align: 'center'},
|
||||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100 },
|
{ title: '状态', dataIndex: 'status',width:80 , align: 'center'},
|
||||||
|
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
||||||
]
|
]
|
||||||
|
|
||||||
const { listData, loading, showLoading, hideLoading, paginationState, resetPagination, searchFormData } =
|
const { listData, loading, showLoading, hideLoading, paginationState, resetPagination, searchFormData } =
|
||||||
@ -150,8 +119,8 @@ async function getPageList() {
|
|||||||
try {
|
try {
|
||||||
showLoading()
|
showLoading()
|
||||||
const { pageSize, current } = paginationState
|
const { pageSize, current } = paginationState
|
||||||
const { success, data, total } = await apis.users
|
const { success, data, total } = await apis.recruitment
|
||||||
.getUsersList({
|
.getDataList({
|
||||||
pageSize,
|
pageSize,
|
||||||
page: current,
|
page: current,
|
||||||
...searchFormData.value,
|
...searchFormData.value,
|
||||||
@ -181,7 +150,7 @@ function handleDelete({ id }) {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
; (async () => {
|
; (async () => {
|
||||||
try {
|
try {
|
||||||
const { success } = await apis.users.delUsers(id).catch(() => {
|
const { success } = await apis.recruitment.delItem(id).catch(() => {
|
||||||
throw new Error()
|
throw new Error()
|
||||||
})
|
})
|
||||||
if (config('http.code.success') === success) {
|
if (config('http.code.success') === success) {
|
||||||
|
|||||||
@ -4,6 +4,9 @@
|
|||||||
<a-form-item :label="'零容忍'" name="reportContent">
|
<a-form-item :label="'零容忍'" name="reportContent">
|
||||||
<a-textarea :placeholder="'请输入零容忍内容'" v-model:value="reportContent"></a-textarea>
|
<a-textarea :placeholder="'请输入零容忍内容'" v-model:value="reportContent"></a-textarea>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
<a-form-item :label="'零容忍图片'" name="reportImage">
|
||||||
|
<x-upload-image v-model="reportImage" @imgChange="imgChange" />
|
||||||
|
</a-form-item>
|
||||||
<a-form-item :label="'举报邮箱'" name="email">
|
<a-form-item :label="'举报邮箱'" name="email">
|
||||||
<a-input :placeholder="'请输入举报邮箱'" v-model:value="email"></a-input>
|
<a-input :placeholder="'请输入举报邮箱'" v-model:value="email"></a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@ -22,16 +25,42 @@
|
|||||||
<a-form-item :label="'编码'" name="reportNum">
|
<a-form-item :label="'编码'" name="reportNum">
|
||||||
<a-input :placeholder="'请输入编码'" v-model:value="reportNum"></a-input>
|
<a-input :placeholder="'请输入编码'" v-model:value="reportNum"></a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<template>
|
<template v-if="Array.isArray(socialMedia)">
|
||||||
<a-form-item
|
<a-form-item
|
||||||
v-for="(itemImg, index) in socialMedia"
|
v-for="(itemImg, index) in socialMedia"
|
||||||
:key="index"
|
:key="index"
|
||||||
:label="itemImg.name || `社交媒体${index + 1}`">
|
:label="itemImg.name || `社交媒体${index + 1}`">
|
||||||
<a-input class="inputPhone" v-model:value="itemImg.name" placeholder="请输入图片名称" />
|
<a-input
|
||||||
<x-upload-image v-model="itemImg.image" @imgChange="(value) => imgChange(index, value)" />
|
class="inputPhone"
|
||||||
<a-input class="inputPhone" v-model:value="itemImg.link" placeholder="请输入跳转链接" />
|
v-model:value="itemImg.name"
|
||||||
|
placeholder="请输入图片名称"
|
||||||
|
/>
|
||||||
|
<x-upload-image
|
||||||
|
v-model="itemImg.image"
|
||||||
|
@imgChange="(value) => imgChange(index, value)"
|
||||||
|
/>
|
||||||
|
<a-input
|
||||||
|
class="inputPhone"
|
||||||
|
v-model:value="itemImg.link"
|
||||||
|
placeholder="请输入跳转链接"
|
||||||
|
/>
|
||||||
|
<a-button
|
||||||
|
danger
|
||||||
|
@click="removeSocialMedia(index)"
|
||||||
|
size="small"
|
||||||
|
style="margin-bottom: 20px">删除
|
||||||
|
</a-button>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
<a-form-item>
|
||||||
|
<a-button
|
||||||
|
type="dashed"
|
||||||
|
block
|
||||||
|
@click="addSocialMedia">新增社交媒体
|
||||||
|
</a-button>
|
||||||
|
</a-form-item>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
<x-editor :modelValue="affirm" @update:modelValue="affirm = $event" placeholder="请输入声明内容"></x-editor>
|
||||||
<a-button ghost type="primary" @click="handleSearch" style="margin-top: 20px">保存</a-button>
|
<a-button ghost type="primary" @click="handleSearch" style="margin-top: 20px">保存</a-button>
|
||||||
</template>
|
</template>
|
||||||
</x-search-bar>
|
</x-search-bar>
|
||||||
@ -45,13 +74,14 @@ import { useI18n } from 'vue-i18n'
|
|||||||
import { getWebData,updateWebData} from '@/apis/modules/webSite'
|
import { getWebData,updateWebData} from '@/apis/modules/webSite'
|
||||||
import XSearchBar from '@/components/SearchBar/SearchBar.vue' // 获取声明接口
|
import XSearchBar from '@/components/SearchBar/SearchBar.vue' // 获取声明接口
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'friendlyLinks',
|
name: 'contactUs',
|
||||||
})
|
})
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
const { showLoading, hideLoading } = usePagination()
|
const { showLoading, hideLoading } = usePagination()
|
||||||
const affirm = ref(null)
|
const affirm = ref(null)
|
||||||
const id = ref(null)
|
const id = ref(null)
|
||||||
const reportContent = ref(null)
|
const reportContent = ref(null)
|
||||||
|
const reportImage = ref(null)
|
||||||
const email = ref(null)
|
const email = ref(null)
|
||||||
const lat = ref(null)
|
const lat = ref(null)
|
||||||
const lon = ref(null)
|
const lon = ref(null)
|
||||||
@ -75,6 +105,7 @@ async function getPageList() {
|
|||||||
id.value = res.data.id
|
id.value = res.data.id
|
||||||
affirm.value = res.data.affirm
|
affirm.value = res.data.affirm
|
||||||
reportContent.value = res.data.reportContent
|
reportContent.value = res.data.reportContent
|
||||||
|
reportImage.value = res.data.reportImage
|
||||||
email.value = res.data.email
|
email.value = res.data.email
|
||||||
lat.value = res.data.lat
|
lat.value = res.data.lat
|
||||||
lon.value = res.data.lon
|
lon.value = res.data.lon
|
||||||
@ -82,8 +113,9 @@ async function getPageList() {
|
|||||||
phone.value = res.data.phone
|
phone.value = res.data.phone
|
||||||
reportNum.value = res.data.reportNum
|
reportNum.value = res.data.reportNum
|
||||||
socialMedia.value = Array.isArray(res.data.socialMedia) ? res.data.socialMedia : []
|
socialMedia.value = Array.isArray(res.data.socialMedia) ? res.data.socialMedia : []
|
||||||
console.log(affirm.value)
|
//console.log(affirm.value)
|
||||||
console.log(id.value)
|
console.log(id.value)
|
||||||
|
console.log(res.data)
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
message.error('获取声明内容失败')
|
message.error('获取声明内容失败')
|
||||||
@ -100,6 +132,7 @@ async function handleSearch() {
|
|||||||
await apis.webSite.updateWebData(id.value, {
|
await apis.webSite.updateWebData(id.value, {
|
||||||
affirm: affirm.value,
|
affirm: affirm.value,
|
||||||
reportContent: reportContent.value,
|
reportContent: reportContent.value,
|
||||||
|
reportImage: reportImage.value,
|
||||||
email: email.value,
|
email: email.value,
|
||||||
lat: lat.value,
|
lat: lat.value,
|
||||||
lon: lon.value,
|
lon: lon.value,
|
||||||
@ -115,13 +148,15 @@ async function handleSearch() {
|
|||||||
hideLoading()
|
hideLoading()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function addSocialMedia() {
|
||||||
|
socialMedia.value.push({ name: '', image: '', link: '' })
|
||||||
|
}
|
||||||
|
|
||||||
|
function removeSocialMedia(index) {
|
||||||
|
socialMedia.value.splice(index, 1)
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.inputPhone {
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
.inputPhone:last-child {
|
|
||||||
margin-top: 20px;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user