稳定版
parent
a2d3f4267b
commit
10115a8bd4
@ -1,50 +0,0 @@
|
||||
import request from "../utils/request";
|
||||
|
||||
// 获取中奖列表
|
||||
export function getCarouselListApi(page, limit = 10) {
|
||||
return request({
|
||||
url: `/admin/banner/${page}/${limit}`,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
// 保存中奖
|
||||
export function saveCarouselApi(data) {
|
||||
return request({
|
||||
url: `/admin/banner/save`,
|
||||
method: "post",
|
||||
data: { img: data.img,title: data.title,status: data.status }
|
||||
});
|
||||
}
|
||||
|
||||
// 删除中奖
|
||||
export function deleteCarouselApi(id) {
|
||||
return request({
|
||||
url: `/admin/banner/remove/${id}`,
|
||||
method: "delete",
|
||||
});
|
||||
}
|
||||
|
||||
// 修改中奖
|
||||
export function updateCarouselApi(data) {
|
||||
return request({
|
||||
url: `/admin/banner/update`,
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 上传图片
|
||||
export function uploadImageApi(file) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
return request({
|
||||
url: '/admin/cms/upload',
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -0,0 +1,75 @@
|
||||
import request from "../utils/request";
|
||||
import qs from "qs";
|
||||
let setqs = function (data) {
|
||||
return qs.stringify(data);
|
||||
};
|
||||
|
||||
// 获取平台消息列表
|
||||
export function getCmsListNew (data) {
|
||||
return request({
|
||||
url: "/admin/v4/bocai/cms/list",
|
||||
method: "post",
|
||||
data: setqs(data),
|
||||
});
|
||||
}
|
||||
|
||||
// 删除
|
||||
export function delCms (id) {
|
||||
return request({
|
||||
url: "/yicai/bocai/cms/del/" + id,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
// 详情
|
||||
export function getCmsDetail (id) {
|
||||
return request({
|
||||
url: "/yicai/bocai/cms/details/" + id,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
获取金刚区列表
|
||||
*/
|
||||
export function getPositionList (data) {
|
||||
return request({
|
||||
url: "/admin/v4/diamond/position/getPage",
|
||||
method: "post",
|
||||
data: setqs(data),
|
||||
});
|
||||
}
|
||||
// 新增
|
||||
export function addPositionApi (data) {
|
||||
return request({
|
||||
url: "/admin/v4/diamond/position/addOrUpdate",
|
||||
method: "post",
|
||||
data: setqs(data),
|
||||
});
|
||||
}
|
||||
// 删除
|
||||
export function delPositionApi (data) {
|
||||
return request({
|
||||
url: "/admin/v4/diamond/position/delete",
|
||||
method: "post",
|
||||
data: setqs(data),
|
||||
});
|
||||
}
|
||||
// 状态更新
|
||||
export function updatePositionApi (data) {
|
||||
return request({
|
||||
url: "/admin/v4/diamond/position/updateStatus",
|
||||
method: "post",
|
||||
data: setqs(data),
|
||||
});
|
||||
}
|
||||
|
||||
// 获取职位列表
|
||||
export function getList (data) {
|
||||
return request({
|
||||
url: "/admin/v4/custom/job/list",
|
||||
method: "post",
|
||||
data: setqs(data),
|
||||
});
|
||||
}
|
||||
@ -1,59 +0,0 @@
|
||||
import request from "../utils/request";
|
||||
|
||||
// 获取内容列表
|
||||
export function getContentListApi(page, limit = 10,classify) {
|
||||
return request({
|
||||
url: `/admin/cms/${page}/${limit}?classify=${classify}`,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
// 新增内容
|
||||
export function saveContentApi(data) {
|
||||
return request({
|
||||
url: `/admin/cms/save`,
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 新增内容
|
||||
export function getHzd(data) {
|
||||
return request({
|
||||
url: `/admin/cms/get/61`,
|
||||
method: "get",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 更新内容
|
||||
export function updateContentApi(data) {
|
||||
return request({
|
||||
url: `/admin/cms/update`,
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 删除内容
|
||||
export function deleteContentApi(id) {
|
||||
return request({
|
||||
url: `/admin/cms/remove/${id}`,
|
||||
method: "delete",
|
||||
});
|
||||
}
|
||||
|
||||
// 上传图片
|
||||
export function uploadImageApi(file) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
return request({
|
||||
url: '/admin/cms/upload',
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -1,52 +0,0 @@
|
||||
import request from "../utils/request";
|
||||
|
||||
// 获取彩票列表
|
||||
export function getLotteryListApi(page, limit, classify) {
|
||||
return request({
|
||||
url: `/admin/lottery/${page}/${limit}?classify=${classify}`,
|
||||
method: "get",
|
||||
})
|
||||
}
|
||||
|
||||
// 获取今日开奖通告
|
||||
export function getTodayLotteryApi() {
|
||||
return request({
|
||||
url: `/admin/lottery/last`,
|
||||
method: "get",
|
||||
})
|
||||
}
|
||||
|
||||
// 获取彩票详情
|
||||
export function getLotteryDetailApi(id) {
|
||||
return request({
|
||||
url: `/admin/lottery/get/${id}`,
|
||||
method: "get",
|
||||
})
|
||||
}
|
||||
|
||||
// 删除彩票记录
|
||||
export function deleteLotteryApi(id) {
|
||||
return request({
|
||||
url: `/admin/lottery/remove/${id}`,
|
||||
method: "delete",
|
||||
})
|
||||
}
|
||||
|
||||
// 保存彩票记录
|
||||
export function saveLotteryApi(data) {
|
||||
return request({
|
||||
url: `/admin/lottery/save`,
|
||||
method: "post",
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
// 更新彩票记录
|
||||
export function updateLotteryApi(data) {
|
||||
return request({
|
||||
url: `/admin/lottery/update`,
|
||||
method: "put",
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
@ -1,81 +0,0 @@
|
||||
import request from "../../utils/request";
|
||||
import qs from "qs";
|
||||
let setqs = function (data) {
|
||||
return qs.stringify(data);
|
||||
};
|
||||
|
||||
// 保存内容
|
||||
export function saveMessageApi (data) {
|
||||
console.log(data);
|
||||
return request({
|
||||
url: `/admin/cms/save`,
|
||||
method: "POST",
|
||||
data,
|
||||
});
|
||||
}
|
||||
// 修改内容
|
||||
export function updateMessageApi (data) {
|
||||
return request({
|
||||
url: `/admin/cms/update`,
|
||||
method: "PUT",
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
// 获取内容列表
|
||||
export function getMessageListApi (data) {
|
||||
return request({
|
||||
url: `/admin/cms/${data.page}/${data.limit}`,
|
||||
method: "get",
|
||||
params: {
|
||||
status: data.status,
|
||||
keyword: data.keyword
|
||||
}
|
||||
// data,
|
||||
});
|
||||
}
|
||||
// 获取内容
|
||||
export function getMessageDetailApi (id) {
|
||||
return request({
|
||||
url: `/admin/cms/get/${id}`,
|
||||
method: "get",
|
||||
// data,
|
||||
});
|
||||
}
|
||||
|
||||
// 导入股权结构文件
|
||||
export function importStockModelApi (data) {
|
||||
return request({
|
||||
url: `/admin/stock/structure/import`,
|
||||
method: "post",
|
||||
headers: {
|
||||
"Content-Type": 'multipart/form-data',
|
||||
},
|
||||
data: setqs(data)
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 获取股权结构列表
|
||||
export function getStockInfoListApi (data) {
|
||||
return request({
|
||||
url: `/admin/stock/structure/list`,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
// 获取股权结构列表
|
||||
export function getStockMoreListApi (data) {
|
||||
return request({
|
||||
url: `/admin/stock/change/list`,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 删除用户
|
||||
export function delMessageApi (data) {
|
||||
return request({
|
||||
url: `/admin/cms/remove/${data}`,
|
||||
method: "DELETE",
|
||||
});
|
||||
}
|
||||
@ -1,52 +0,0 @@
|
||||
import request from "../utils/request"
|
||||
|
||||
// 获取笔记列表
|
||||
export function getScheduleListApi(page, limit, classify) {
|
||||
return request({
|
||||
url: `/admin/schedule/${page}/${limit}?classify=${classify}`,
|
||||
method: "get",
|
||||
})
|
||||
}
|
||||
|
||||
// 获取今日笔记
|
||||
export function getTodayScheduleApi() {
|
||||
return request({
|
||||
url: `/admin/schedule/last`,
|
||||
method: "get",
|
||||
})
|
||||
}
|
||||
|
||||
// 获取笔记详情
|
||||
export function getScheduleDetailApi(id) {
|
||||
return request({
|
||||
url: `/admin/schedule/get/${id}`,
|
||||
method: "get",
|
||||
})
|
||||
}
|
||||
|
||||
// 删除笔记
|
||||
export function deleteScheduleApi(id) {
|
||||
return request({
|
||||
url: `/admin/schedule/remove/${id}`,
|
||||
method: "delete",
|
||||
})
|
||||
}
|
||||
|
||||
// 保存笔记
|
||||
export function saveScheduleApi(data) {
|
||||
return request({
|
||||
url: `/admin/schedule/save`,
|
||||
method: "post",
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
// 更新笔记
|
||||
export function updateScheduleApi(data) {
|
||||
return request({
|
||||
url: `/admin/schedule/update`,
|
||||
method: "put",
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
@ -1,60 +0,0 @@
|
||||
import request from "../../utils/request";
|
||||
import qs from "qs";
|
||||
let setqs = function (data) {
|
||||
return qs.stringify(data);
|
||||
};
|
||||
|
||||
// 获取企业信息
|
||||
export function getProjectInfoApi (data) {
|
||||
console.log(data);
|
||||
return request({
|
||||
url: `/admin/company/info`,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
// 更新企业信息
|
||||
export function updateProjectInfoApi (data) {
|
||||
return request({
|
||||
url: `/admin/company/update`,
|
||||
method: "PUT",
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
// 导入股权结构文件
|
||||
export function importStockModelApi (data) {
|
||||
return request({
|
||||
url: `/admin/stock/structure/import`,
|
||||
method: "post",
|
||||
headers: {
|
||||
"Content-Type": 'multipart/form-data',
|
||||
},
|
||||
data: setqs(data)
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 获取股权结构列表
|
||||
export function getStockInfoListApi (data) {
|
||||
return request({
|
||||
url: `/admin/stock/structure/list`,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
// 获取股权结构列表
|
||||
export function getStockMoreListApi (data) {
|
||||
return request({
|
||||
url: `/admin/stock/change/list`,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 删除用户
|
||||
export function delUserApi (data) {
|
||||
return request({
|
||||
url: `/admin/user/remove/${data}`,
|
||||
method: "DELETE",
|
||||
});
|
||||
}
|
||||
@ -1,79 +0,0 @@
|
||||
import request from "../../utils/request";
|
||||
import qs from "qs";
|
||||
let setqs = function (data) {
|
||||
return qs.stringify(data);
|
||||
};
|
||||
|
||||
// 获取用户列表
|
||||
export function getUserListApi (data) {
|
||||
console.log(data);
|
||||
return request({
|
||||
url: `/admin/user/${data.page}/${data.limit}?keyword=${data.keyword}`,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
// 获取用户列表
|
||||
export function getStockUserListApi (data) {
|
||||
console.log(data);
|
||||
return request({
|
||||
url: `/admin/user/stock/${data.page}/${data.limit}?keyword=${data.keyword}`,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
// 用户状态变更
|
||||
export function updateUserStatusApi (data) {
|
||||
return request({
|
||||
url: `/admin/user/updateStatus/${data.id}/${data.status}`,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
// 新增用户
|
||||
export function addUserApi (data) {
|
||||
return request({
|
||||
url: `/admin/user/save`,
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
// 新增个人数据
|
||||
export function addStockUserApi (data) {
|
||||
return request({
|
||||
url: `/admin/user/stock/save`,
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
// 更新用户
|
||||
export function updateUserApi (data) {
|
||||
return request({
|
||||
url: `/admin/user/update`,
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
}
|
||||
// 更新用户数据
|
||||
export function updateUserStockApi (data) {
|
||||
return request({
|
||||
url: `/admin/user/stock/update`,
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
}
|
||||
// 删除用户
|
||||
export function delUserApi (data) {
|
||||
return request({
|
||||
url: `/admin/user/remove/${data}`,
|
||||
method: "DELETE",
|
||||
});
|
||||
}
|
||||
|
||||
// 获取股权结构列表
|
||||
export function getUserMoreListApi (data) {
|
||||
return request({
|
||||
url: `/admin/user/stock/record/${data.userId}/${data.page}/${data.limit}`,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
@ -1,272 +0,0 @@
|
||||
<template>
|
||||
<!-- 稍后处理时间组件 -->
|
||||
<div class="g-components-interval g_flex_column_between">
|
||||
<div v-if="speed > 0" class="interval-box">
|
||||
<!-- 存放时间 -->
|
||||
<div class="time-box g_flex_row_between g_flex_none">
|
||||
<div class="g_flex_1 g_flex_row_start key">
|
||||
<div class="g_flex_none g_flex_row_start">
|
||||
<div class="g_flex_column_center icon-box">
|
||||
<ClockCircleOutlined style="color: #929292;" />
|
||||
</div>
|
||||
<div class="g_flex_column_center text">稍后处理</div>
|
||||
</div>
|
||||
<div class="g_flex_none g_flex_row_start item-box">
|
||||
<div class="small-box g_flex_row_start">
|
||||
<div class="item g_fs_12" v-for="(item,index) in time" :key="index" @click="handleUpdateTime(item,index)" :class="active == index ? 'item-active' : ''">{{item.text}}</div>
|
||||
</div>
|
||||
<div class="g_flex_column_center" style="margin-left: 3px;">
|
||||
<a-date-picker v-model:value="timer" :show-time="{ format: 'HH:mm' }" format="YYYY-MM-DD HH:mm" size="small" class="g_w_150" @change="handlePointTimer" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="g_flex_none value g_flex_column_center" @click="handleSendEvent(30)">
|
||||
<div class="icon-bos">
|
||||
<ThunderboltOutlined class="g_w_12 g_h_18" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="g_flex_row_between g_flex_1">
|
||||
<!-- 存放输入框和提示语 -->
|
||||
<div class="input-box g_flex_1">
|
||||
<div class="an-input g_flex_column_center g-ant-textarea">
|
||||
<a-textarea v-model:value="send_text" placeholder="请输入跟进记录" :autoSize="{ minRows: 3, maxRows: 3 }" class="textare" style="border:0;" @change="handleChange" />
|
||||
</div>
|
||||
<div class="time-tip g_flex_column_center c045 f12 g_h_23">{{tip}}</div>
|
||||
</div>
|
||||
<!-- 存放提交按钮 -->
|
||||
<div class="submit-box g_flex_none g_flex_column_center">
|
||||
<div class="btn g_flex_c" @click="handleSubmitEvent">提交</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
/* 定时器
|
||||
* @function quickEvent 快捷发送事件
|
||||
* @function submitEvent 提交按钮事件
|
||||
*/
|
||||
import { ref, onMounted, getCurrentInstance, h, watch, defineEmits } from 'vue'
|
||||
import { ThunderboltOutlined, EditOutlined, EyeInvisibleOutlined, UserAddOutlined, TeamOutlined, PhoneOutlined, PlusCircleOutlined, MinusCircleOutlined, ClockCircleOutlined, PauseCircleOutlined, StopOutlined, InfoCircleOutlined, PoweroffOutlined } from '@ant-design/icons-vue'
|
||||
import { Modal, message } from 'ant-design-vue'
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
import { useStore } from '../../stores/counter.ts'
|
||||
import dayjs from 'dayjs'
|
||||
|
||||
/* #################### 初始化事件 #################### */
|
||||
const router = useRouter() // 应用路由
|
||||
const route = useRoute()
|
||||
const emits = defineEmits(['quickEvent', 'submitEvent'])
|
||||
const commonJS = getCurrentInstance().appContext.app.config.globalProperties.G
|
||||
const storeJS = useStore()
|
||||
const speed = ref(0)
|
||||
watch(storeJS.deliveryUserid, (val) => {
|
||||
if (val.content == -1) {
|
||||
speed.value = 0
|
||||
} else {
|
||||
speed.value = 1
|
||||
}
|
||||
active.value = -1
|
||||
send_text.value = ''
|
||||
timer.value = ''
|
||||
str.value = ''
|
||||
tip.value = ''
|
||||
})
|
||||
const time = ref([
|
||||
{
|
||||
text: '30min',
|
||||
num: '30',
|
||||
remark: '30分钟',
|
||||
},
|
||||
{
|
||||
text: '1h',
|
||||
num: '60',
|
||||
remark: '1小时',
|
||||
},
|
||||
{
|
||||
text: '2h',
|
||||
num: '120',
|
||||
remark: '2小时',
|
||||
},
|
||||
{
|
||||
text: '4h',
|
||||
num: '240',
|
||||
remark: '4小时',
|
||||
},
|
||||
{
|
||||
text: '1d',
|
||||
num: '1440',
|
||||
remark: '1天',
|
||||
},
|
||||
{
|
||||
text: '2d',
|
||||
num: '2880',
|
||||
remark: '2天',
|
||||
},
|
||||
{
|
||||
text: '3d',
|
||||
num: '4320',
|
||||
remark: '3天',
|
||||
},
|
||||
])
|
||||
const active = ref(-1)
|
||||
const tip = ref('')
|
||||
const handleUpdateTime = (item, index) => {
|
||||
if (index < 7) {
|
||||
tip.value = '提示:系统会在' + item.remark + '后提醒你'
|
||||
active.value = index
|
||||
timer.value = ''
|
||||
str.value = ''
|
||||
}
|
||||
}
|
||||
const send_text = ref('')
|
||||
const timer = ref('')
|
||||
const str = ref('')
|
||||
const handlePointTimer = (value, dateString) => {
|
||||
str.value = dateString
|
||||
active.value = -1
|
||||
tip.value = '提示:系统会在' + dateString + '提醒你'
|
||||
}
|
||||
|
||||
// 快捷发送
|
||||
const handleSendEvent = () => {
|
||||
commonJS.gConfirmModal('快速稍后处理', '系统会在30分钟后提醒你', () => {
|
||||
emits('quickEvent')
|
||||
})
|
||||
}
|
||||
// 提交事件
|
||||
const handleSubmitEvent = () => {
|
||||
let promise = new Promise((resolve, reject) => {
|
||||
emits('submitEvent', {
|
||||
type: str.value == '' ? 1 : 3,
|
||||
num: active.value < 0 ? '' : time.value[active.value].num,
|
||||
str: str.value,
|
||||
remark: send_text.value,
|
||||
})
|
||||
resolve()
|
||||
})
|
||||
promise
|
||||
.then(() => {
|
||||
active.value = -1
|
||||
send_text.value = ''
|
||||
timer.value = ''
|
||||
str.value = ''
|
||||
tip.value = ''
|
||||
})
|
||||
.catch()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.g-components-interval {
|
||||
.interval-box {
|
||||
height: 132px;
|
||||
box-shadow: 0px -4px 4px 0px rgba(228, 228, 228, 0.5);
|
||||
}
|
||||
.time-box {
|
||||
border-bottom: 1px solid #eee;
|
||||
height: 33px;
|
||||
.key,
|
||||
.value {
|
||||
height: 100%;
|
||||
}
|
||||
.icon-box {
|
||||
padding: 0 6px 0 6px;
|
||||
}
|
||||
.text {
|
||||
color: #929292;
|
||||
font-size: 14px;
|
||||
}
|
||||
.item-box {
|
||||
.item {
|
||||
border-radius: 3px;
|
||||
background-color: rgba(250, 250, 250, 1);
|
||||
border: 1px solid rgba(217, 217, 217, 1);
|
||||
padding: 0px 9px;
|
||||
height: 22px;
|
||||
line-height: 18px;
|
||||
margin-left: 5px;
|
||||
margin-top: 4.5px;
|
||||
cursor: pointer;
|
||||
color: #656565;
|
||||
&:hover {
|
||||
color: #109eff;
|
||||
}
|
||||
&:first-child {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
.item-active {
|
||||
background-color: #109eff;
|
||||
color: #fff;
|
||||
border-color: #109eff;
|
||||
&:hover {
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
.value {
|
||||
cursor: pointer;
|
||||
.icon-bos {
|
||||
padding: 0 10px;
|
||||
border-left: 1px solid #d9d9d9;
|
||||
}
|
||||
}
|
||||
}
|
||||
.input-box {
|
||||
padding-left: 0px;
|
||||
.time-tip {
|
||||
padding-left: 10px;
|
||||
margin-top: 3px;
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
.submit-box {
|
||||
padding: 0 15px;
|
||||
.btn {
|
||||
width: 60px;
|
||||
height: 28px;
|
||||
border-radius: 3px;
|
||||
background-color: rgba(24, 144, 255, 1);
|
||||
color: #fff;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
.ant-calendar-picker {
|
||||
min-width: 48px !important;
|
||||
width: 48px;
|
||||
.custom_default {
|
||||
min-width: 48px !important;
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 1680px) {
|
||||
.g-components-interval {
|
||||
.time-box {
|
||||
.icon-box {
|
||||
padding: 0 4px 0 4px;
|
||||
}
|
||||
.text {
|
||||
font-size: 12px;
|
||||
}
|
||||
.item-box {
|
||||
.item {
|
||||
padding: 0px 2px;
|
||||
line-height: 18px;
|
||||
margin-left: 4px;
|
||||
margin-top: 4.5px;
|
||||
&:first-child {
|
||||
margin-left: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -1,51 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- 视频 -->
|
||||
<a-modal v-model:open="videoModal.isShow" title :footer="null" style="width: 734px;" wrapClassName="video-modal" :destroyOnClose="true">
|
||||
<div class="g_flex_row_center">
|
||||
<video :controls="true" style="width: 90%;max-height:calc(100vh - 200px);">
|
||||
<source :src="videoModal.url" type="video/mp4" />
|
||||
<source :src="videoModal.url" type="video/ogg" />您的浏览器不支持 HTML5 video 标签。
|
||||
</video>
|
||||
</div>
|
||||
</a-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<script setup>
|
||||
/* 视频预览
|
||||
* @params videoModal 配置对象
|
||||
*/
|
||||
import { ref, onMounted, getCurrentInstance, watch, defineEmits, defineProps } from 'vue'
|
||||
import { message } from 'ant-design-vue'
|
||||
const props = defineProps({
|
||||
videoModal: {
|
||||
type: Object,
|
||||
default: {
|
||||
isShow: false,
|
||||
url: '',
|
||||
},
|
||||
},
|
||||
})
|
||||
const commonJS = getCurrentInstance().appContext.app.config.globalProperties.G
|
||||
onMounted(() => {})
|
||||
</script>
|
||||
|
||||
<style lang='less' scoped>
|
||||
.video-modal {
|
||||
.ant-modal-content {
|
||||
background-color: transparent;
|
||||
box-shadow: none;
|
||||
}
|
||||
.ant-modal-close {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
color: #ccc;
|
||||
svg {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -1,84 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<a-select v-model:value="selectedList" mode="multiple" placeholder="请选择驻场" option-label-prop="onsiteChildren" @change="onSiteChange">
|
||||
|
||||
<a-select-option v-for="item in onsiteList" :disabled="(selectedList ? (selectedList.length >= 3 ? true : false) :false) && item.disabled" :value="item.userName" :title="item.id">{{item.userName}}</a-select-option>
|
||||
</a-select>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, getCurrentInstance, watch, defineEmits, defineProps,computed } from 'vue'
|
||||
import { message } from 'ant-design-vue'
|
||||
import { getOnsiteListApi } from '../../../api/manage/onsite.js'
|
||||
|
||||
const props = defineProps({
|
||||
selectedList: {
|
||||
type: Array,
|
||||
default: [],
|
||||
},
|
||||
})
|
||||
const emits = defineEmits(['selectChange'])
|
||||
|
||||
// const selectedList = ref(props.selectedList)
|
||||
watch(
|
||||
() => props.selectedList,
|
||||
(val) => {
|
||||
console.log(val)
|
||||
onSiteChange(val)
|
||||
},
|
||||
{
|
||||
// immediate: true,
|
||||
}
|
||||
)
|
||||
let selectedList = computed(()=>{
|
||||
return props.selectedList
|
||||
})
|
||||
const commonJS = getCurrentInstance().appContext.app.config.globalProperties.G
|
||||
onMounted(() => {
|
||||
getOnsiteList()
|
||||
})
|
||||
const onsiteList = ref([])
|
||||
const agencyId = ref(localStorage.getItem('DAOTIAN_userinfo_agencyid'))
|
||||
|
||||
/**
|
||||
* 获取驻场列表
|
||||
*/
|
||||
const getOnsiteList = () => {
|
||||
let subInfo = {
|
||||
agencyId: agencyId.value,
|
||||
pageSize: 10000,
|
||||
pageNum: 1,
|
||||
}
|
||||
getOnsiteListApi(subInfo).then((res) => {
|
||||
console.log(res)
|
||||
onsiteList.value = res.data.recordList
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 驻场选择变化
|
||||
*/
|
||||
const onSiteChange = (e, e1) => {
|
||||
console.log(e)
|
||||
console.log(e1)
|
||||
console.log(onsiteList.value)
|
||||
let newArr = []
|
||||
// 设置列表禁用
|
||||
onsiteList.value.forEach((item) => {
|
||||
if (e.findIndex((i1) => i1 == item.userName) > -1) {
|
||||
item.disabled = false
|
||||
newArr.push(item)
|
||||
} else {
|
||||
item.disabled = true
|
||||
}
|
||||
})
|
||||
// selectedList = e
|
||||
|
||||
console.log(newArr)
|
||||
emits('selectChange', newArr)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='less' scoped>
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,44 +0,0 @@
|
||||
<template>
|
||||
<div class>
|
||||
<span class="timebox">{{ timedata.deadline }}秒</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, getCurrentInstance, watch, defineEmits, defineProps } from 'vue'
|
||||
const props = defineProps({
|
||||
timedata: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {
|
||||
isfinish: true,
|
||||
deadline: 60,
|
||||
timer: null,
|
||||
}
|
||||
},
|
||||
},
|
||||
})
|
||||
// const deadline = ref(60)
|
||||
onMounted(() => {
|
||||
setDeadline()
|
||||
})
|
||||
const setDeadline = () => {
|
||||
props.timedata.timer = setInterval(() => {
|
||||
props.timedata.deadline--
|
||||
console.log(props.timedata.deadline)
|
||||
if (props.timedata.deadline <= 0) {
|
||||
props.timedata.deadline = 60
|
||||
props.timedata.isfinish = true
|
||||
clearInterval(props.timedata.timer)
|
||||
}
|
||||
}, 1000)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.timebox {
|
||||
display: inline-block;
|
||||
width: 72px;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,88 +0,0 @@
|
||||
<template>
|
||||
<div style="border: 1px solid #ccc">
|
||||
<Toolbar
|
||||
style="border-bottom: 1px solid #ccc"
|
||||
:editor="editorRef"
|
||||
:defaultConfig="toolbarConfig"
|
||||
:mode="mode"
|
||||
/>
|
||||
<Editor
|
||||
style="height: 500px; overflow-y: hidden;"
|
||||
v-model="valueHtml"
|
||||
:defaultConfig="editorConfig"
|
||||
:mode="mode"
|
||||
@onCreated="handleCreated"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import '@wangeditor/editor/dist/css/style.css'
|
||||
import { onBeforeUnmount, ref, shallowRef, onMounted, watch } from 'vue'
|
||||
import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
|
||||
import { uploadImageApi } from "../../api/contentConfig";
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits(['update:modelValue', 'image-upload']);
|
||||
|
||||
const editorRef = shallowRef();
|
||||
const valueHtml = ref(props.modelValue);
|
||||
|
||||
watch(() => props.modelValue, (newValue) => {
|
||||
if (newValue !== valueHtml.value) {
|
||||
valueHtml.value = newValue;
|
||||
}
|
||||
});
|
||||
|
||||
watch(valueHtml, (newValue) => {
|
||||
emit('update:modelValue', newValue);
|
||||
});
|
||||
|
||||
const toolbarConfig = {};
|
||||
const editorConfig = {
|
||||
placeholder: '请输入内容...',
|
||||
MENU_CONF: {}
|
||||
};
|
||||
|
||||
editorConfig.MENU_CONF['uploadImage'] = {
|
||||
async customUpload(file, insertFn) {
|
||||
try {
|
||||
const response = await uploadImageApi(file);
|
||||
const imageUrl = 'http://123.249.121.26:8801/images/' + response.data;
|
||||
insertFn(imageUrl);
|
||||
} catch (error) {
|
||||
console.error('Image upload failed:', error);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
const editor = editorRef.value;
|
||||
if (editor == null) return;
|
||||
editor.destroy();
|
||||
});
|
||||
|
||||
const handleCreated = (editor) => {
|
||||
editorRef.value = editor;
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
setTimeout(() => {
|
||||
valueHtml.value = props.modelValue;
|
||||
}, 100);
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.wysiwyg-editor {
|
||||
border: 1px solid #ccc;
|
||||
z-index: 100;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -1,347 +0,0 @@
|
||||
<template>
|
||||
<div class="content-management">
|
||||
<a-tabs v-model:activeKey="activeTab" @change="tabChange">
|
||||
<a-tab-pane key="recommendations" tab="今日推荐"></a-tab-pane>
|
||||
<a-tab-pane key="stores" tab="门店"></a-tab-pane>
|
||||
<a-tab-pane key="events" tab="赛事分析"></a-tab-pane>
|
||||
<!-- <a-tab-pane key="highlights" tab="划重点"></a-tab-pane> -->
|
||||
<template #rightExtra>
|
||||
<a-button type="primary" @click="showAddModal">新增</a-button>
|
||||
</template>
|
||||
</a-tabs>
|
||||
|
||||
<a-table :columns="columns" :data-source="filteredData" :rowKey="record => record.id">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'content' && activeTab !== 'highlights'">
|
||||
<div v-if="record.classify === 1">
|
||||
<a-image
|
||||
:src="record.img"
|
||||
:width="50"
|
||||
:height="50"
|
||||
style="margin-right: 5px;"
|
||||
/>
|
||||
</div>
|
||||
<span v-else v-text="record.content1"></span>
|
||||
</template>
|
||||
<template v-if="column.key === 'relatedOption' && activeTab === 'highlights'">
|
||||
<span>{{ getRelatedOptionLabel(record.relatedOption) }}</span>
|
||||
</template>
|
||||
<template v-if="column.key === 'status' && activeTab !== 'highlights'">
|
||||
<a-tag :color="record.status === 1 ? 'green' : 'orange'">
|
||||
{{ record.status === 1 ? '已发布' : '未发布' }}
|
||||
</a-tag>
|
||||
</template>
|
||||
<template v-if="column.key === 'action'">
|
||||
<a-space>
|
||||
<a-button type="link" @click="editItem(record)">编辑</a-button>
|
||||
<a-button v-if="activeTab !== 'recommendations'" type="link" @click="deleteItem(record)">删除</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
|
||||
<a-modal
|
||||
v-model:visible="modalVisible"
|
||||
:title="modalMode === 'add' ? '新增内容' : '编辑内容'"
|
||||
@ok="handleModalOk"
|
||||
@cancel="handleModalCancel"
|
||||
width="800px"
|
||||
>
|
||||
<a-form :model="formState" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
|
||||
<a-form-item label="类型" v-if="activeTab !== 'highlights'">
|
||||
<a-select v-model:value="formState.classify" :disabled="modalMode === 'edit'">
|
||||
<a-select-option :value="1">今日推荐</a-select-option>
|
||||
<a-select-option :value="0">门店</a-select-option>
|
||||
<a-select-option :value="2">赛事分析</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item label="标题">
|
||||
<a-input v-model:value="formState.title" placeholder="输入标题"/>
|
||||
</a-form-item>
|
||||
<template v-if="activeTab !== 'highlights'">
|
||||
<a-form-item label="主图">
|
||||
<a-upload
|
||||
v-model:fileList="formState.images"
|
||||
list-type="picture-card"
|
||||
:max-count="1"
|
||||
@preview="handlePreview"
|
||||
@change="handleImageChange"
|
||||
:customRequest="customRequest"
|
||||
>
|
||||
<div v-if="formState.images.length < 1">
|
||||
<plus-outlined />
|
||||
<div style="margin-top: 8px">上传图片</div>
|
||||
</div>
|
||||
</a-upload>
|
||||
</a-form-item>
|
||||
<a-form-item label="内容" v-if="formState.classify !== 1">
|
||||
<wysiwyg-editor v-model="formState.content" @image-upload="handleEditorImageUpload" />
|
||||
</a-form-item>
|
||||
<a-form-item label="状态">
|
||||
<a-switch v-model:checked="formState.status" :checked-value="1" :unchecked-value="0" />
|
||||
</a-form-item>
|
||||
</template>
|
||||
<a-form-item label="关联选项" v-if="activeTab === 'highlights'">
|
||||
<a-select v-model:value="formState.relatedOption">
|
||||
<a-select-option v-for="option in relatedOptions" :key="option.key" :value="option.key">
|
||||
{{ option.label }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
|
||||
<a-modal v-model:visible="previewVisible" :title="previewTitle" :footer="null">
|
||||
<img alt="example" style="width: 100%" :src="previewImage" />
|
||||
</a-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, computed, onMounted } from 'vue';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||
import WysiwygEditor from './WysiwygEditor.vue';
|
||||
import { saveContentApi,getHzd, updateContentApi, getContentListApi, deleteContentApi, uploadImageApi } from "../../api/contentConfig";
|
||||
|
||||
const activeTab = ref('recommendations');
|
||||
const modalVisible = ref(false);
|
||||
const modalMode = ref('add');
|
||||
const previewVisible = ref(false);
|
||||
const previewImage = ref('');
|
||||
const previewTitle = ref('');
|
||||
|
||||
const columns = computed(() => {
|
||||
if (activeTab.value === 'highlights') {
|
||||
return [
|
||||
{ title: '类型', dataIndex: 'classify', key: 'classify' },
|
||||
{ title: '标题', dataIndex: 'title', key: 'title' },
|
||||
{ title: '关联', dataIndex: 'relatedOption', key: 'relatedOption' },
|
||||
{ title: '操作', key: 'action' },
|
||||
];
|
||||
} else {
|
||||
return [
|
||||
{ title: '类型', dataIndex: 'classify', key: 'classify' },
|
||||
{ title: '标题', dataIndex: 'title', key: 'title' },
|
||||
{ title: '内容', dataIndex: 'content', key: 'content' },
|
||||
{ title: '状态', dataIndex: 'status', key: 'status' },
|
||||
{ title: '操作', key: 'action' },
|
||||
];
|
||||
}
|
||||
});
|
||||
|
||||
const data = reactive([]);
|
||||
const classify = ref(1);
|
||||
|
||||
const formState = reactive({
|
||||
id: null,
|
||||
classify: 1,
|
||||
title: '',
|
||||
content: '',
|
||||
img: '',
|
||||
images: [],
|
||||
status: 0,
|
||||
relatedOption: null,
|
||||
});
|
||||
|
||||
const relatedOptions = [
|
||||
{ key: 1, label: '足球总进球' },
|
||||
{ key: 2, label: '足球2.0' },
|
||||
{ key: 3, label: '足球3.0' },
|
||||
{ key: 4, label: '足球中高倍' },
|
||||
{ key: 5, label: '足球高倍' },
|
||||
{ key: 6, label: '足球8.0' },
|
||||
{ key: 7, label: '篮球' },
|
||||
{ key: 8, label: '排列三' },
|
||||
{ key: 9, label: '快乐八' },
|
||||
];
|
||||
|
||||
const filteredData = computed(() => {
|
||||
const tabToClassify = {
|
||||
'recommendations': 1,
|
||||
'stores': 0,
|
||||
'events': 2,
|
||||
'highlights': 61,
|
||||
};
|
||||
return data.filter(item => item.classify === tabToClassify[activeTab.value]);
|
||||
});
|
||||
|
||||
const showAddModal = () => {
|
||||
modalMode.value = 'add';
|
||||
const tabToClassify = {
|
||||
'recommendations': 1,
|
||||
'stores': 0,
|
||||
'events': 2,
|
||||
'highlights': 61,
|
||||
};
|
||||
Object.assign(formState, {
|
||||
id: null,
|
||||
classify: tabToClassify[activeTab.value],
|
||||
title: '',
|
||||
content: '',
|
||||
img: '',
|
||||
images: [],
|
||||
status: activeTab.value === 'highlights' ? 1 : 0,
|
||||
relatedOption: null
|
||||
});
|
||||
modalVisible.value = true;
|
||||
};
|
||||
|
||||
const editItem = (record) => {
|
||||
modalMode.value = 'edit';
|
||||
Object.assign(formState, {
|
||||
...record,
|
||||
images: record.img ? [{
|
||||
uid: -1,
|
||||
name: 'image.jpg',
|
||||
status: 'done',
|
||||
url: record.img,
|
||||
}] : [],
|
||||
relatedOption: record.relatedOption,
|
||||
});
|
||||
modalVisible.value = true;
|
||||
};
|
||||
|
||||
const deleteItem = async (record) => {
|
||||
try {
|
||||
await deleteContentApi(record.id);
|
||||
message.success('删除成功');
|
||||
fetchData();
|
||||
} catch (error) {
|
||||
message.error('删除失败');
|
||||
}
|
||||
};
|
||||
|
||||
const handleModalOk = async () => {
|
||||
try {
|
||||
const data = {
|
||||
classify: activeTab.value === 'highlights' ? 61 : formState.classify,
|
||||
title: formState.title,
|
||||
content: activeTab.value === 'highlights' ? '' : (formState.classify === 1 ? '' : formState.content),
|
||||
img: activeTab.value === 'highlights' ? '' : processImagePath(formState.img),
|
||||
status: activeTab.value === 'highlights' ? 1 : formState.status,
|
||||
relatedOption: activeTab.value === 'highlights' ? formState.relatedOption : undefined,
|
||||
remark: activeTab.value === 'highlights' ? formState.relatedOption : undefined,
|
||||
};
|
||||
if (modalMode.value === 'add') {
|
||||
await saveContentApi(data);
|
||||
} else {
|
||||
await updateContentApi({ ...data, recordId: activeTab.value === 'highlights' ? 61 : formState.id });
|
||||
}
|
||||
message.success(modalMode.value === 'add' ? '添加成功' : '编辑成功');
|
||||
modalVisible.value = false;
|
||||
fetchData();
|
||||
} catch (error) {
|
||||
message.error(modalMode.value === 'add' ? '添加失败' : '编辑失败');
|
||||
}
|
||||
};
|
||||
|
||||
const handleModalCancel = () => {
|
||||
modalVisible.value = false;
|
||||
};
|
||||
|
||||
const processImagePath = (imgPath) => {
|
||||
const urlPrefix = 'http://123.249.121.26:8801/images/';
|
||||
if (imgPath.startsWith(urlPrefix)) {
|
||||
return imgPath.substring(urlPrefix.length);
|
||||
}
|
||||
return imgPath;
|
||||
};
|
||||
|
||||
const tabChange = (activeKey) => {
|
||||
classify.value = activeKey === 'recommendations' ? 1 : activeKey === 'stores' ? 0 : activeKey === 'events' ? 2 : 61;
|
||||
fetchData();
|
||||
};
|
||||
|
||||
const handlePreview = async (file) => {
|
||||
if (!file.url && !file.preview) {
|
||||
file.preview = await getBase64(file.originFileObj);
|
||||
}
|
||||
previewImage.value = file.url || file.preview;
|
||||
previewVisible.value = true;
|
||||
previewTitle.value = file.name || file.url.substring(file.url.lastIndexOf('/') + 1);
|
||||
};
|
||||
|
||||
const customRequest = async ({ file, onSuccess, onError }) => {
|
||||
try {
|
||||
const response = await uploadImageApi(file);
|
||||
formState.img = response.data;
|
||||
onSuccess(response, file);
|
||||
} catch (error) {
|
||||
onError(error);
|
||||
}
|
||||
};
|
||||
|
||||
const handleImageChange = ({ fileList }) => {
|
||||
formState.images = fileList;
|
||||
};
|
||||
|
||||
const handleEditorImageUpload = async (file) => {
|
||||
try {
|
||||
const response = await uploadImageApi(file);
|
||||
const imageUrl = `http://123.249.121.26:8801/images/${response.data}`;
|
||||
return imageUrl; // 返回完整的图片路径
|
||||
} catch (error) {
|
||||
message.error('图片上传失败');
|
||||
return '';
|
||||
}
|
||||
};
|
||||
|
||||
const getBase64 = (file) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const reader = new FileReader();
|
||||
reader.readAsDataURL(file);
|
||||
reader.onload = () => resolve(reader.result);
|
||||
reader.onerror = error => reject(error);
|
||||
});
|
||||
};
|
||||
|
||||
const fetchData = async () => {
|
||||
try {
|
||||
console.log(activeTab.value);
|
||||
if (activeTab.value == 'highlights') {
|
||||
const response = await getHzd();
|
||||
const records = response.data;
|
||||
console.log(records);
|
||||
//对象转数组
|
||||
|
||||
data.splice(0, data.length, ...records);
|
||||
|
||||
} else {
|
||||
const response = await getContentListApi(1, 10, classify.value);
|
||||
const records = response.data.records.map(record => {
|
||||
if (record.img) {
|
||||
record.img = 'http://123.249.121.26:8801/images/' + record.img;
|
||||
}
|
||||
//取前100个字
|
||||
record.content1 = record.content.length > 100 ? record.content.substring(0, 100) + '...' : record.content;
|
||||
return record;
|
||||
});
|
||||
data.splice(0, data.length, ...records);
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
message.error('获取数据失败');
|
||||
}
|
||||
};
|
||||
|
||||
const getRelatedOptionLabel = (optionKey) => {
|
||||
const option = relatedOptions.find(option => option.key === optionKey);
|
||||
return option ? option.label : '';
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
fetchData();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.content-management {
|
||||
padding: 24px;
|
||||
}
|
||||
.table-actions {
|
||||
margin-bottom: 16px;
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -1,280 +0,0 @@
|
||||
<template>
|
||||
<div class="today-notes">
|
||||
<a-tabs v-model:activeKey="activeTab" @change="handleTabChange">
|
||||
<a-tab-pane v-for="type in noteTypes" :key="type.key" :tab="type.label">
|
||||
<a-table :columns="getColumns(type.key)" :data-source="filteredData" :rowKey="record => record.recordId">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'scheduleJson'">
|
||||
<span v-if="record.classify !== 8 && record.classify !== 9">
|
||||
{{ formatScheduleJson(record.scheduleJson) }}
|
||||
</span>
|
||||
</template>
|
||||
<template v-if="column.key === 'today'">
|
||||
<span>{{ record.today }}</span>
|
||||
</template>
|
||||
<template v-if="column.key === 'action'">
|
||||
<a-space>
|
||||
<a-button type="link" @click="editItem(record)">编辑</a-button>
|
||||
<a-button type="link" @click="deleteItem(record)">删除</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-tab-pane>
|
||||
<template #rightExtra>
|
||||
<a-button type="primary" @click="showAddModal">新增</a-button>
|
||||
</template>
|
||||
</a-tabs>
|
||||
|
||||
<a-modal
|
||||
v-model:visible="modalVisible"
|
||||
:title="(modalMode === 'add' ? '新增' : '编辑') + currentNoteTypeLabel"
|
||||
@ok="handleModalOk"
|
||||
@cancel="handleModalCancel"
|
||||
width="800px"
|
||||
>
|
||||
<a-form :model="formState" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }">
|
||||
<a-form-item label="日期" name="todayStr" :rules="[{ required: true, message: '请选择日期' }]">
|
||||
<a-date-picker v-model:value="formState.todayStr" style="width: 100%" format="YYYY-MM-DD" />
|
||||
</a-form-item>
|
||||
<a-form-item label="类型" name="classify" :rules="[{ required: true, message: '请选择类型' }]">
|
||||
<a-select v-model:value="formState.classify">
|
||||
<a-select-option v-for="type in noteTypes" :key="type.key" :value="type.key">
|
||||
{{ type.label }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<template v-if="formState.classify !== 8 && formState.classify !== 9">
|
||||
<a-form-item label="比赛" name="match" :rules="[{ required: true, message: '请输入比赛' }]">
|
||||
<a-input v-model:value="formState.match" />
|
||||
</a-form-item>
|
||||
<a-form-item label="结果1" name="team1" :rules="[{ required: true, message: '请输入结果1' }]">
|
||||
<a-input v-model:value="formState.team1" />
|
||||
</a-form-item>
|
||||
<!-- <a-form-item label="结果2" name="team2" :rules="[{ required: false, message: '请输入结果2' }]">
|
||||
<a-input v-model:value="formState.team2" />
|
||||
</a-form-item> -->
|
||||
<!-- <a-form-item label="比分结果" name="result" :rules="[{ required: true, message: '请输入结果' }]">
|
||||
<a-input v-model:value="formState.result" />
|
||||
</a-form-item> -->
|
||||
</template>
|
||||
<a-form-item label="赔率" name="odds">
|
||||
<a-input v-model:value="formState.odds" />
|
||||
</a-form-item>
|
||||
<a-form-item label="中否" name="fruit">
|
||||
<a-input v-model:value="formState.fruit" />
|
||||
</a-form-item>
|
||||
<a-form-item v-if="formState.classify === 8" label="开奖号" name="winNo">
|
||||
<a-input v-model:value="formState.winNo" />
|
||||
</a-form-item>
|
||||
<a-form-item v-if="formState.classify === 8 || formState.classify === 9" label="推荐号" name="recommendNo">
|
||||
<a-input v-model:value="formState.recommendNo" />
|
||||
</a-form-item>
|
||||
<a-form-item label="截止时间" name="endTime">
|
||||
<a-input v-model:value="formState.endTime" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, computed, onMounted } from 'vue';
|
||||
import { message } from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
import { getScheduleListApi, deleteScheduleApi, saveScheduleApi, updateScheduleApi } from '../../api/scheduleConfig';
|
||||
|
||||
const noteTypes = [
|
||||
{ key: 1, label: '总进球' },
|
||||
{ key: 2, label: '足球2.0' },
|
||||
{ key: 3, label: '足球3.0' },
|
||||
{ key: 4, label: '中高倍' },
|
||||
{ key: 5, label: '高倍' },
|
||||
{ key: 6, label: '足球8.0' },
|
||||
{ key: 7, label: '篮球' },
|
||||
{ key: 8, label: '排列三' },
|
||||
{ key: 9, label: '快乐八' },
|
||||
];
|
||||
|
||||
const activeTab = ref(noteTypes[0].key);
|
||||
const modalVisible = ref(false);
|
||||
const modalMode = ref('add');
|
||||
|
||||
const data = reactive([]);
|
||||
|
||||
const formState = reactive({
|
||||
recordId: null,
|
||||
todayStr: '',
|
||||
classify: 1,
|
||||
match: '',
|
||||
team1: '',
|
||||
team2: '',
|
||||
result: '',
|
||||
odds: '',
|
||||
fruit: '',
|
||||
winNo: '',
|
||||
recommendNo: '',
|
||||
endTime: '',
|
||||
});
|
||||
|
||||
const filteredData = computed(() => {
|
||||
return data.map(item => ({
|
||||
...item,
|
||||
today: dayjs(item.today).format('YYYY-MM-DD')
|
||||
})).filter(item => item.classify === activeTab.value);
|
||||
});
|
||||
|
||||
const currentNoteType = computed(() => {
|
||||
return noteTypes.find(type => type.key === activeTab.value) || noteTypes[0];
|
||||
});
|
||||
|
||||
const currentNoteTypeLabel = computed(() => {
|
||||
return currentNoteType.value.label;
|
||||
});
|
||||
|
||||
const formatScheduleJson = (scheduleJson) => {
|
||||
try {
|
||||
const parsed = JSON.parse(scheduleJson);
|
||||
return `${parsed.match} ${parsed.team1}`;
|
||||
} catch (error) {
|
||||
return scheduleJson;
|
||||
}
|
||||
};
|
||||
|
||||
const showAddModal = () => {
|
||||
modalMode.value = 'add';
|
||||
Object.assign(formState, {
|
||||
recordId: null,
|
||||
todayStr: dayjs(),
|
||||
classify: activeTab.value,
|
||||
match: '',
|
||||
team1: '',
|
||||
team2: '',
|
||||
result: '',
|
||||
odds: '',
|
||||
fruit: '',
|
||||
winNo: '',
|
||||
recommendNo: '',
|
||||
endTime: '',
|
||||
});
|
||||
modalVisible.value = true;
|
||||
};
|
||||
|
||||
const editItem = (record) => {
|
||||
modalMode.value = 'edit';
|
||||
Object.assign(formState, {
|
||||
...record,
|
||||
todayStr: dayjs(record.today),
|
||||
});
|
||||
if (record.scheduleJson) {
|
||||
try {
|
||||
const parsed = JSON.parse(record.scheduleJson);
|
||||
formState.match = parsed.match;
|
||||
formState.team1 = parsed.team1;
|
||||
formState.team2 = parsed.team2;
|
||||
formState.result = parsed.result;
|
||||
} catch (error) {
|
||||
console.error('Error parsing scheduleJson:', error);
|
||||
}
|
||||
}
|
||||
modalVisible.value = true;
|
||||
};
|
||||
|
||||
const deleteItem = async (record) => {
|
||||
try {
|
||||
await deleteScheduleApi(record.id);
|
||||
message.success('删除成功');
|
||||
fetchData();
|
||||
} catch (error) {
|
||||
message.error('删除失败');
|
||||
}
|
||||
};
|
||||
|
||||
const handleModalOk = async () => {
|
||||
try {
|
||||
let payload = {
|
||||
...formState,
|
||||
recordId: formState.id,
|
||||
todayStr: formState.todayStr.format('YYYY-MM-DD'),
|
||||
};
|
||||
|
||||
if (payload.classify !== 8 && payload.classify !== 9) {
|
||||
payload.scheduleJson = JSON.stringify({
|
||||
match: payload.match,
|
||||
team1: payload.team1,
|
||||
team2: payload.team2,
|
||||
result: payload.result,
|
||||
});
|
||||
|
||||
// 清除不需要的字段
|
||||
delete payload.match;
|
||||
delete payload.team1;
|
||||
delete payload.team2;
|
||||
delete payload.result;
|
||||
}else{
|
||||
payload.scheduleJson = payload.scheduleJson ? payload.scheduleJson : '{"match":"","team1":"","team2":"","result":""}';
|
||||
}
|
||||
|
||||
if (modalMode.value === 'add') {
|
||||
await saveScheduleApi(payload);
|
||||
} else {
|
||||
await updateScheduleApi(payload);
|
||||
}
|
||||
|
||||
message.success(modalMode.value === 'add' ? '添加成功' : '编辑成功');
|
||||
modalVisible.value = false;
|
||||
fetchData();
|
||||
} catch (error) {
|
||||
message.error(modalMode.value === 'add' ? '添加失败' : '编辑失败');
|
||||
}
|
||||
};
|
||||
|
||||
const handleModalCancel = () => {
|
||||
modalVisible.value = false;
|
||||
};
|
||||
|
||||
const fetchData = async () => {
|
||||
try {
|
||||
const response = await getScheduleListApi(1, 100, activeTab.value);
|
||||
data.splice(0, data.length, ...response.data.records);
|
||||
} catch (error) {
|
||||
message.error('获取数据失败');
|
||||
}
|
||||
};
|
||||
|
||||
const handleTabChange = (newActiveKey) => {
|
||||
activeTab.value = newActiveKey;
|
||||
fetchData();
|
||||
};
|
||||
|
||||
const getColumns = (classify) => {
|
||||
const baseColumns = [
|
||||
{ title: '日期', dataIndex: 'today', key: 'today' },
|
||||
{ title: '赔率', dataIndex: 'odds', key: 'odds' },
|
||||
{ title: '结果', dataIndex: 'fruit', key: 'fruit' },
|
||||
{ title: '截止日期', dataIndex: 'endTime', key: 'endTime' },
|
||||
{ title: '操作', key: 'action' },
|
||||
];
|
||||
|
||||
if (classify === 8) {
|
||||
baseColumns.splice(1, 0, { title: '开奖号', dataIndex: 'winNo', key: 'winNo' });
|
||||
baseColumns.splice(2, 0, { title: '推荐号', dataIndex: 'recommendNo', key: 'recommendNo' });
|
||||
} else if (classify === 9) {
|
||||
baseColumns.splice(1, 0, { title: '推荐号', dataIndex: 'recommendNo', key: 'recommendNo' });
|
||||
} else {
|
||||
baseColumns.splice(1, 0, { title: '比赛内容', key: 'scheduleJson' });
|
||||
}
|
||||
|
||||
return baseColumns;
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
fetchData();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.today-notes {
|
||||
padding: 24px;
|
||||
}
|
||||
</style>
|
||||
@ -1,104 +0,0 @@
|
||||
<template>
|
||||
<div class="important-points">
|
||||
<a-form :model="formState" :label-col="{ span: 4 }" :wrapper-col="{ span: 16 }">
|
||||
<a-form-item label="标题">
|
||||
<a-input v-model:value="formState.title" />
|
||||
</a-form-item>
|
||||
<a-form-item label="关联项">
|
||||
<a-select v-model:value="formState.remark" style="width: 100%">
|
||||
<a-select-option v-for="type in noteTypes" :key="type.key" :value="type.key">
|
||||
{{ type.label }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
<a-row>
|
||||
<a-col :span="6" :offset="4"> <a-button type="primary" @click="handleSave">保存</a-button>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-divider />
|
||||
<!-- <div class="content-preview">
|
||||
<h2>内容预览</h2>
|
||||
<p>标题: {{ formState.title }}</p>
|
||||
<p>关联项: {{ getRemarkLabel(formState.remark) }}</p>
|
||||
</div> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { saveContentApi,getHzd, updateContentApi, getContentListApi, deleteContentApi, uploadImageApi } from "../../api/contentConfig";
|
||||
|
||||
|
||||
const noteTypes = [
|
||||
{ key: 1, label: '总进球' },
|
||||
{ key: 2, label: '足球2.0' },
|
||||
{ key: 3, label: '足球3.0' },
|
||||
{ key: 4, label: '中高倍' },
|
||||
{ key: 5, label: '高倍' },
|
||||
{ key: 6, label: '足球8.0' },
|
||||
{ key: 7, label: '篮球' },
|
||||
{ key: 8, label: '排列三' },
|
||||
{ key: 9, label: '快乐八' },
|
||||
];
|
||||
|
||||
const formState = reactive({
|
||||
recordId: 61,
|
||||
title: '',
|
||||
remark: null,
|
||||
});
|
||||
|
||||
const getRemarkLabel = (key) => {
|
||||
const type = noteTypes.find(t => t.key === key);
|
||||
return type ? type.label : '未选择';
|
||||
};
|
||||
|
||||
const fetchData = async () => {
|
||||
try {
|
||||
const response = await getHzd();
|
||||
formState.title = response.data.title;
|
||||
formState.remark = response.data.remark !== null ? parseInt(response.data.remark) : null;
|
||||
} catch (error) {
|
||||
message.error('获取数据失败');
|
||||
}
|
||||
};
|
||||
|
||||
const handleSave = async () => {
|
||||
try {
|
||||
await updateContentApi({
|
||||
recordId: formState.recordId,
|
||||
title: formState.title,
|
||||
content: formState.remark,
|
||||
remark:formState.remark
|
||||
});
|
||||
message.success('保存成功');
|
||||
} catch (error) {
|
||||
message.error('保存失败');
|
||||
}
|
||||
};
|
||||
|
||||
const handleTitleChange = (e) => {
|
||||
formState.title = e.target.value;
|
||||
};
|
||||
|
||||
const handleRemarkChange = (value) => {
|
||||
formState.remark = value;
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
fetchData();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.important-points {
|
||||
padding: 24px;
|
||||
}
|
||||
.content-preview {
|
||||
background-color: #f0f2f5;
|
||||
padding: 16px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -1,247 +0,0 @@
|
||||
<template>
|
||||
<div class="carousel-management">
|
||||
<div class="table-actions">
|
||||
<a-button type="primary" @click="showAddModal">新增</a-button>
|
||||
</div>
|
||||
|
||||
<a-table :columns="columns" :data-source="data" :rowKey="record => record.id">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'img'">
|
||||
<template v-if="record.img.endsWith('.mp4')">
|
||||
<video
|
||||
:src="record.img"
|
||||
:width="50"
|
||||
:height="50"
|
||||
style="margin-right: 5px;"
|
||||
controls
|
||||
/>
|
||||
</template>
|
||||
<template v-else>
|
||||
<a-image
|
||||
:src="record.img"
|
||||
:width="50"
|
||||
:height="50"
|
||||
style="margin-right: 5px;"
|
||||
/>
|
||||
</template>
|
||||
</template>
|
||||
<template v-if="column.key === 'status'">
|
||||
<a-tag :color="record.status === 1 ? 'green' : 'red'">
|
||||
{{ record.status === 1 ? '启用' : '不启用' }}
|
||||
</a-tag>
|
||||
</template>
|
||||
<template v-if="column.key === 'action'">
|
||||
<a-space>
|
||||
<a-button type="link" @click="editItem(record)">编辑</a-button>
|
||||
<a-button type="link" @click="deleteItem(record)">删除</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
|
||||
<a-modal
|
||||
v-model:visible="modalVisible"
|
||||
:title="modalMode === 'add' ? '新增轮播图' : '编辑轮播图'"
|
||||
@ok="handleModalOk"
|
||||
@cancel="handleModalCancel"
|
||||
width="800px"
|
||||
>
|
||||
<a-form :model="formState" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
|
||||
<a-form-item label="标题" name="title" :rules="[{ required: true, message: '请输入标题' }]">
|
||||
<a-input v-model:value="formState.title" />
|
||||
</a-form-item>
|
||||
<a-form-item label="图片" name="img" :rules="[{ required: true, message: '请上传图片' }]">
|
||||
<a-upload
|
||||
v-model:fileList="formState.images"
|
||||
list-type="picture-card"
|
||||
:max-count="1"
|
||||
@preview="handlePreview"
|
||||
@change="handleImageChange"
|
||||
:customRequest="customRequest"
|
||||
>
|
||||
<div v-if="formState.images.length < 1">
|
||||
<plus-outlined />
|
||||
<div style="margin-top: 8px">上传图片</div>
|
||||
</div>
|
||||
</a-upload>
|
||||
</a-form-item>
|
||||
<a-form-item label="状态" name="status">
|
||||
<a-switch v-model:checked="formState.status" :checked-value="1" :unchecked-value="0" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
|
||||
<a-modal v-model:visible="previewVisible" :title="previewTitle" :footer="null">
|
||||
<img alt="example" style="width: 100%" :src="previewImage" />
|
||||
</a-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||
import { getCarouselListApi, saveCarouselApi, deleteCarouselApi, updateCarouselApi, uploadImageApi } from "../../api/carouselConfig";
|
||||
|
||||
const modalVisible = ref(false);
|
||||
const modalMode = ref('add');
|
||||
const previewVisible = ref(false);
|
||||
const previewImage = ref('');
|
||||
const previewTitle = ref('');
|
||||
|
||||
const columns = [
|
||||
{ title: '标题', dataIndex: 'title', key: 'title' },
|
||||
{ title: '图片', dataIndex: 'img', key: 'img' },
|
||||
{ title: '状态', dataIndex: 'status', key: 'status' },
|
||||
{ title: '操作', key: 'action' },
|
||||
];
|
||||
|
||||
const data = reactive([]);
|
||||
|
||||
const formState = reactive({
|
||||
id: null,
|
||||
title: '',
|
||||
images: [],
|
||||
img: '',
|
||||
status: 1,
|
||||
});
|
||||
|
||||
const showAddModal = () => {
|
||||
modalMode.value = 'add';
|
||||
Object.assign(formState, { id: null, title: '', images: [], img: '', status: 1 });
|
||||
modalVisible.value = true;
|
||||
};
|
||||
|
||||
const editItem = (record) => {
|
||||
modalMode.value = 'edit';
|
||||
Object.assign(formState, {
|
||||
id: record.id,
|
||||
title: record.title,
|
||||
images: [{
|
||||
uid: -1,
|
||||
name: 'image.jpg',
|
||||
status: 'done',
|
||||
url: record.img,
|
||||
}],
|
||||
img: record.img,
|
||||
status: record.status,
|
||||
});
|
||||
modalVisible.value = true;
|
||||
};
|
||||
|
||||
const deleteItem = async (record) => {
|
||||
try {
|
||||
await deleteCarouselApi(record.id);
|
||||
message.success('删除成功');
|
||||
fetchData();
|
||||
} catch (error) {
|
||||
message.error('删除失败');
|
||||
}
|
||||
};
|
||||
|
||||
const handleModalOk = async () => {
|
||||
|
||||
console.log(formState);
|
||||
|
||||
try {
|
||||
const data = {
|
||||
title: formState.title,
|
||||
img: processImagePath(formState.img),
|
||||
status: formState.status
|
||||
};
|
||||
if (modalMode.value === 'add') {
|
||||
|
||||
console.log(data);
|
||||
|
||||
|
||||
await saveCarouselApi(data);
|
||||
} else {
|
||||
await updateCarouselApi({ ...data, recordId: formState.id });
|
||||
}
|
||||
message.success(modalMode.value === 'add' ? '添加成功' : '编辑成功');
|
||||
modalVisible.value = false;
|
||||
fetchData();
|
||||
} catch (error) {
|
||||
message.error(modalMode.value === 'add' ? '添加失败' : '编辑失败');
|
||||
}
|
||||
};
|
||||
|
||||
const processImagePath = (imgPath) => {
|
||||
const urlPrefix = 'http://123.249.121.26:8801/images/';
|
||||
if (imgPath.startsWith(urlPrefix)) {
|
||||
return imgPath.substring(urlPrefix.length);
|
||||
}
|
||||
return imgPath;
|
||||
};
|
||||
|
||||
const handleModalCancel = () => {
|
||||
modalVisible.value = false;
|
||||
};
|
||||
|
||||
const handlePreview = async (file) => {
|
||||
if (!file.url && !file.preview) {
|
||||
file.preview = await getBase64(file.originFileObj);
|
||||
}
|
||||
previewImage.value = file.url || file.preview;
|
||||
previewVisible.value = true;
|
||||
previewTitle.value = file.name || file.url.substring(file.url.lastIndexOf('/') + 1);
|
||||
};
|
||||
|
||||
const customRequest = async ({ file, onSuccess, onError }) => {
|
||||
try {
|
||||
const response = await uploadImageApi(file);
|
||||
formState.img = response.data.url;
|
||||
onSuccess(response, file);
|
||||
} catch (error) {
|
||||
onError(error);
|
||||
}
|
||||
};
|
||||
|
||||
const handleImageChange = ({ fileList }) => {
|
||||
formState.images = fileList;
|
||||
if (fileList.length > 0) {
|
||||
const lastFile = fileList[fileList.length - 1];
|
||||
formState.img = lastFile.response ? lastFile.response.data : lastFile.url;
|
||||
}
|
||||
};
|
||||
|
||||
const getBase64 = (file) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const reader = new FileReader();
|
||||
reader.readAsDataURL(file);
|
||||
reader.onload = () => resolve(reader.result);
|
||||
reader.onerror = error => reject(error);
|
||||
});
|
||||
};
|
||||
|
||||
const fetchData = async () => {
|
||||
try {
|
||||
const response = await getCarouselListApi(1);
|
||||
// data.splice(0, data.length, ...response.data.records);
|
||||
const records = response.data.records.map(record => {
|
||||
if (record.img) {
|
||||
record.img = 'http://123.249.121.26:8801/images/' + record.img;
|
||||
}
|
||||
return record;
|
||||
});
|
||||
data.splice(0, data.length, ...records);
|
||||
} catch (error) {
|
||||
message.error('获取数据失败');
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
fetchData();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.carousel-management {
|
||||
padding: 24px;
|
||||
}
|
||||
.table-actions {
|
||||
margin-bottom: 16px;
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
|
||||
Loading…
Reference in New Issue