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-item {
|
||||
border-radius: 10em;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,44 +1,27 @@
|
||||
<template>
|
||||
<x-search-bar class="mb-8-2">
|
||||
<template #default="{ gutter, colSpan }">
|
||||
<a-form
|
||||
:label-col="{ style: { width: '100px' } }"
|
||||
:model="searchFormData"
|
||||
layout="inline">
|
||||
<a-form :model="searchFormData" layout="inline">
|
||||
<a-row :gutter="gutter">
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item
|
||||
:label="$t('pages.system.user.form.username')"
|
||||
name="username">
|
||||
<a-input
|
||||
:placeholder="$t('pages.system.user.form.username.placeholder')"
|
||||
v-model:value="searchFormData.username"></a-input>
|
||||
<a-form-item label="产品名称" name="title">
|
||||
<a-input placeholder="请输入产品名称" v-model:value="searchFormData.title"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item name="name">
|
||||
<template #label>
|
||||
{{ $t('pages.system.user.form.name') }}
|
||||
<a-tooltip :title="$t('pages.system.user.form.name')">
|
||||
<question-circle-outlined class="ml-4-1 color-placeholder" />
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<a-input
|
||||
:placeholder="$t('pages.system.user.form.name.placeholder')"
|
||||
v-model:value="searchFormData.name"></a-input>
|
||||
<a-form-item label="状态" name="status">
|
||||
<a-select v-model:value="searchFormData.status" allowClear>
|
||||
<a-select-option value="">全部</a-select-option>
|
||||
<a-select-option value="enabled">启用</a-select-option>
|
||||
<a-select-option value="disabled">停用</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col
|
||||
class="align-right"
|
||||
v-bind="colSpan">
|
||||
<a-col class="align-right" v-bind="colSpan">
|
||||
<a-space>
|
||||
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
|
||||
<a-button
|
||||
ghost
|
||||
type="primary"
|
||||
@click="handleSearch">
|
||||
<a-button ghost type="primary" @click="handleSearch">
|
||||
{{ $t('button.search') }}
|
||||
</a-button>
|
||||
</a-space>
|
||||
@ -47,58 +30,45 @@
|
||||
</a-form>
|
||||
</template>
|
||||
</x-search-bar>
|
||||
<a-row
|
||||
:gutter="8"
|
||||
:wrap="false">
|
||||
<a-row :gutter="8" :wrap="false">
|
||||
<a-col flex="auto">
|
||||
<a-card type="flex">
|
||||
<x-action-bar class="mb-8-2">
|
||||
<a-button
|
||||
type="primary"
|
||||
@click="$refs.editDialogRef.handleCreate()">
|
||||
<a-button type="primary" @click="$refs.editDialogRef.handleCreate()">
|
||||
<template #icon>
|
||||
<plus-outlined></plus-outlined>
|
||||
</template>
|
||||
{{ $t('pages.system.user.add') }}
|
||||
新增产品
|
||||
</a-button>
|
||||
</x-action-bar>
|
||||
<a-table
|
||||
:columns="columns"
|
||||
:data-source="listData"
|
||||
:loading="loading"
|
||||
:pagination="paginationState"
|
||||
:scroll="{ x: 1000 }"
|
||||
@change="onTableChange">
|
||||
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
|
||||
:pagination="paginationState" :scroll="{ x: 1000 }" @change="onTableChange">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="'statusType' === column.key">
|
||||
<!--状态-->
|
||||
<a-tag
|
||||
v-if="statusUserTypeEnum.is('activated', record.status)"
|
||||
color="processing">
|
||||
{{ statusUserTypeEnum.getDesc(record.status) }}
|
||||
</a-tag>
|
||||
<!--状态-->
|
||||
<a-tag
|
||||
v-if="statusUserTypeEnum.is('freezed', record.status)"
|
||||
color="processing">
|
||||
{{ statusUserTypeEnum.getDesc(record.status) }}
|
||||
</a-tag>
|
||||
|
||||
<template v-if="column.dataIndex === 'introduce'">
|
||||
<a-tooltip :title="record.introduce">
|
||||
<div class="text-ellipsis">{{ record.introduce }}</div>
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'duty'">
|
||||
<a-tooltip :title="record.duty">
|
||||
<div class="text-ellipsis">{{ record.duty }}</div>
|
||||
</a-tooltip>
|
||||
</template>
|
||||
|
||||
<template v-if="'createAt' === column.key">
|
||||
{{ formatUtcDateTime(record.created_at) }}
|
||||
<template v-if="'status' === column.dataIndex">
|
||||
<a-tag v-if="record.status === 'enabled'" :color="'green'">启用</a-tag>
|
||||
<a-tag v-if="record.status === 'disabled'" :color="'red'">停用</a-tag>
|
||||
</template>
|
||||
<template v-if="'action' === column.key">
|
||||
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">
|
||||
<a-tooltip>
|
||||
<template #title> {{ $t('pages.system.user.edit') }}</template>
|
||||
<edit-outlined /> </a-tooltip
|
||||
></x-action-button>
|
||||
<edit-outlined /> </a-tooltip></x-action-button>
|
||||
<x-action-button @click="handleDelete(record)">
|
||||
<a-tooltip>
|
||||
<template #title>{{ $t('pages.system.delete') }}</template>
|
||||
<delete-outlined style="color: #ff4d4f" /> </a-tooltip
|
||||
></x-action-button>
|
||||
<delete-outlined style="color: #ff4d4f" /> </a-tooltip></x-action-button>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
@ -106,9 +76,7 @@
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<edit-dialog
|
||||
ref="editDialogRef"
|
||||
@ok="onOk"></edit-dialog>
|
||||
<edit-dialog ref="editDialogRef" @ok="onOk"></edit-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@ -124,17 +92,18 @@ import EditDialog from './components/EditDialog.vue'
|
||||
import { PlusOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons-vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
defineOptions({
|
||||
name: 'product',
|
||||
name: 'homeBanner',
|
||||
})
|
||||
const { t } = useI18n() // 解构出t方法
|
||||
const columns = [
|
||||
{ title: t('pages.system.user.form.username'), dataIndex: 'username', width: 120 },
|
||||
{ title: t('pages.system.user.form.name'), dataIndex: 'name', key: 'name', width: 100 },
|
||||
{ title: t('pages.system.user.form.phone'), dataIndex: 'phone', width: 120 },
|
||||
{ title: t('pages.system.user.form.email'), dataIndex: 'email', width: 100 },
|
||||
{ title: t('pages.system.user.form.status'), dataIndex: 'status', key: 'statusType', width: 60 },
|
||||
{ title: t('pages.system.user.form.created_at'), key: 'createAt', fixed: 'right', width: 120 },
|
||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100 },
|
||||
{ title: '招聘岗位', dataIndex: 'title', width: 120, },
|
||||
{ title: '所属基地', dataIndex: 'areaName', key: 'title', width: 150 },
|
||||
{ title: '岗位要求', dataIndex: 'introduce', key: 'introduce'},
|
||||
{ title: '岗位职责', dataIndex: 'duty',ellipsis: true,},
|
||||
{ title: '薪资范畴', dataIndex: 'salary', width: 120, align: 'center'},
|
||||
{ title: '岗位排序', dataIndex: 'sequence', width: 120, align: 'center'},
|
||||
{ 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 } =
|
||||
@ -150,8 +119,8 @@ async function getPageList() {
|
||||
try {
|
||||
showLoading()
|
||||
const { pageSize, current } = paginationState
|
||||
const { success, data, total } = await apis.users
|
||||
.getUsersList({
|
||||
const { success, data, total } = await apis.recruitment
|
||||
.getDataList({
|
||||
pageSize,
|
||||
page: current,
|
||||
...searchFormData.value,
|
||||
@ -179,9 +148,9 @@ function handleDelete({ id }) {
|
||||
okText: t('button.confirm'),
|
||||
onOk: () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
;(async () => {
|
||||
; (async () => {
|
||||
try {
|
||||
const { success } = await apis.users.delUsers(id).catch(() => {
|
||||
const { success } = await apis.recruitment.delItem(id).catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
if (config('http.code.success') === success) {
|
||||
|
||||
@ -4,6 +4,9 @@
|
||||
<a-form-item :label="'零容忍'" name="reportContent">
|
||||
<a-textarea :placeholder="'请输入零容忍内容'" v-model:value="reportContent"></a-textarea>
|
||||
</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-input :placeholder="'请输入举报邮箱'" v-model:value="email"></a-input>
|
||||
</a-form-item>
|
||||
@ -22,16 +25,42 @@
|
||||
<a-form-item :label="'编码'" name="reportNum">
|
||||
<a-input :placeholder="'请输入编码'" v-model:value="reportNum"></a-input>
|
||||
</a-form-item>
|
||||
<template>
|
||||
<template v-if="Array.isArray(socialMedia)">
|
||||
<a-form-item
|
||||
v-for="(itemImg, index) in socialMedia"
|
||||
:key="index"
|
||||
:label="itemImg.name || `社交媒体${index + 1}`">
|
||||
<a-input class="inputPhone" 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-input
|
||||
class="inputPhone"
|
||||
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-button
|
||||
type="dashed"
|
||||
block
|
||||
@click="addSocialMedia">新增社交媒体
|
||||
</a-button>
|
||||
</a-form-item>
|
||||
|
||||
</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>
|
||||
</template>
|
||||
</x-search-bar>
|
||||
@ -45,13 +74,14 @@ import { useI18n } from 'vue-i18n'
|
||||
import { getWebData,updateWebData} from '@/apis/modules/webSite'
|
||||
import XSearchBar from '@/components/SearchBar/SearchBar.vue' // 获取声明接口
|
||||
defineOptions({
|
||||
name: 'friendlyLinks',
|
||||
name: 'contactUs',
|
||||
})
|
||||
const { t } = useI18n()
|
||||
const { showLoading, hideLoading } = usePagination()
|
||||
const affirm = ref(null)
|
||||
const id = ref(null)
|
||||
const reportContent = ref(null)
|
||||
const reportImage = ref(null)
|
||||
const email = ref(null)
|
||||
const lat = ref(null)
|
||||
const lon = ref(null)
|
||||
@ -75,6 +105,7 @@ async function getPageList() {
|
||||
id.value = res.data.id
|
||||
affirm.value = res.data.affirm
|
||||
reportContent.value = res.data.reportContent
|
||||
reportImage.value = res.data.reportImage
|
||||
email.value = res.data.email
|
||||
lat.value = res.data.lat
|
||||
lon.value = res.data.lon
|
||||
@ -82,8 +113,9 @@ async function getPageList() {
|
||||
phone.value = res.data.phone
|
||||
reportNum.value = res.data.reportNum
|
||||
socialMedia.value = Array.isArray(res.data.socialMedia) ? res.data.socialMedia : []
|
||||
console.log(affirm.value)
|
||||
//console.log(affirm.value)
|
||||
console.log(id.value)
|
||||
console.log(res.data)
|
||||
}
|
||||
} catch (e) {
|
||||
message.error('获取声明内容失败')
|
||||
@ -100,6 +132,7 @@ async function handleSearch() {
|
||||
await apis.webSite.updateWebData(id.value, {
|
||||
affirm: affirm.value,
|
||||
reportContent: reportContent.value,
|
||||
reportImage: reportImage.value,
|
||||
email: email.value,
|
||||
lat: lat.value,
|
||||
lon: lon.value,
|
||||
@ -115,13 +148,15 @@ async function handleSearch() {
|
||||
hideLoading()
|
||||
}
|
||||
}
|
||||
|
||||
function addSocialMedia() {
|
||||
socialMedia.value.push({ name: '', image: '', link: '' })
|
||||
}
|
||||
|
||||
function removeSocialMedia(index) {
|
||||
socialMedia.value.splice(index, 1)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.inputPhone {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.inputPhone:last-child {
|
||||
margin-top: 20px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user