feat: 清除除了默认页面和主要路由之外的其他无用页面

This commit is contained in:
hzj 2026-04-24 18:28:31 +08:00
parent e5e517a2a3
commit 63c97927a5
65 changed files with 287 additions and 15134 deletions

View File

@ -0,0 +1,207 @@
# 页面裁剪任务清单
## 文档定位
- 本文件用于记录“只保留主要路由与项目原有路由页面”的页面裁剪任务。
- 路由保留依据以 `docs/i18n/主要路由.md` 中接口返回数据、`src/router/index.js` 中项目原有路由、以及这些页面实际引用的 `src/views` 私有组件为准。
- 首页必须保留,包含 `src/views/dashboard/index.vue` 及其被首页模块直接或间接引用的页面内组件。
- 公共组件 `src/components/**` 不在本轮直接批量删除范围内;只有确认没有任何页面引用后,再单独处理。
- 删除页面时必须同步检查 `src/lang/messages/pages/en.js``src/lang/messages/pages/zh.js`。如果翻译 key 只被被删页面私有使用,则随页面一并清理;如果被保留页面复用,则保留。
## 多线程领取规则
- 每次领取前必须重新读取本文件、`docs/i18n/页面裁剪进度.md``docs/i18n/主要路由.md``docs/i18n/线程协作.md``docs/i18n/翻译清单.md``docs/i18n/翻译进度.md`
- 先在本文件写入“进行中”认领记录,再开始删除源码文件或翻译 key。
- 每个线程一次只领取一个批次,避免交叉编辑同一批文件或同一段翻译命名空间。
- 完成后必须更新本文件和 `docs/i18n/页面裁剪进度.md`,记录删除文件、翻译 key 处理结果、验证命令与未完成事项。
- 如果发现候选文件仍被保留页面引用,立即从待删除列表移到“保留复核”,并记录原因。
## 保留范围生成规则
1. 从 `docs/i18n/主要路由.md` 提取所有 `路径` 和原始接口 JSON 中的 `path`,映射到 `src/views/<path>.vue`
2. 从 `docs/i18n/主要路由.md` 提取所有显式记录的 `src/views/**/*.vue` 文件。
3. 从 `src/router/index.js` 提取所有 `@/views/**` 原有路由入口。
4. 强制保留基础页:`src/views/dashboard/index.vue``src/views/login/index.vue``src/views/401.vue``src/views/404.vue``src/views/common/user_deatils.vue`
5. 对以上入口执行 import/require 依赖闭包扫描;凡被保留页面直接或间接引用的 `src/views/**/*.vue` 私有组件一并保留。
## 当前统计
- 统计时间2026-04-24
- 初始路由/文档种子225
- 保留闭包内 `src/views/**/*.vue`382
- 已删除候选 `src/views/**/*.vue`61
- 复核后剩余候选 `src/views/**/*.vue`0
- 当前领取线程:本线程
- 当前领取批次:无,状态:本轮完成
## 批次 1低风险孤立页面
状态:已完成
领取时间2026-04-24
领取范围:
- `src/views/activity/picture-config/form-edit.vue`
- `src/views/activity/picture-config/index.vue`
- `src/views/cnf/product/gift-pack/add.vue`
- `src/views/cnf/product/gift-pack/config.vue`
- `src/views/cnf/product/gift-pack/index.vue`
- `src/views/cnf/product/index.vue`
- `src/views/cnf/product/product-platform/edit-package.vue`
- `src/views/cnf/product/product-platform/edit.vue`
- `src/views/cnf/product/product-platform/index.vue`
- `src/views/cnf/product/product-platform/recommend.vue`
- `src/views/cnf/product/product-pool/edit.vue`
- `src/views/cnf/product/product-pool/index.vue`
执行要求:
- 删除前检查这些文件是否被保留闭包引用。
- 检查 `pages.*` 翻译 key只清理确认为本批次私有的 key。
- 删除后执行一次引用扫描,确认没有保留文件继续引用本批次路径。
完成记录:
- 完成时间2026-04-24
- 删除文件12 个
- 翻译处理:本批次页面未使用 `pages.*` 页面翻译 key无需清理 `src/lang/messages/pages/en.js``src/lang/messages/pages/zh.js`
- 引用复核:删除前未发现保留页面引用本批次路径
## 批次 2孤立游戏与日志页面
状态:已完成
领取时间2026-04-24
领取范围:
- `src/views/game/fruit/log/bet-record/index.vue`
- `src/views/game/lucky-box/award-config/details.vue`
- `src/views/game/lucky-box/award-config/edit.vue`
- `src/views/game/lucky-box/award-config/index.vue`
- `src/views/game/lucky-box/bounty-config/details.vue`
- `src/views/game/lucky-box/bounty-config/edit.vue`
- `src/views/game/lucky-box/bounty-config/index.vue`
- `src/views/game/lucky-box/fortune-config/index.vue`
- `src/views/game/lucky-box/give-record/index.vue`
- `src/views/game/lucky-box/standard-config/edit.vue`
- `src/views/game/lucky-box/standard-config/gift-details.vue`
- `src/views/game/lucky-box/standard-config/index.vue`
- `src/views/game/lucky-box/standard-config/probability.vue`
- `src/views/game/song/gift/edit.vue`
- `src/views/game/song/gift/index.vue`
- `src/views/game/song/hot/index.vue`
- `src/views/game/song/manager/edit.vue`
- `src/views/game/song/manager/index.vue`
- `src/views/game/song/manager/show.vue`
- `src/views/game/song/user/index.vue`
- `src/views/game/trumpet/blacklist/index.vue`
- `src/views/log/logout-apply/index.vue`
- `src/views/log/logout-log/index.vue`
执行要求:
- 删除前检查这些文件是否被保留闭包引用。
- 检查 `pages.*` 翻译 key只清理确认为本批次私有的 key。
- 删除后执行一次引用扫描,确认没有保留文件继续引用本批次路径。
完成记录:
- 完成时间2026-04-24
- 删除文件23 个
- 翻译处理:已清理 `pages.luckyBoxGiftDetails``pages.luckyBoxStandardConfig``pages.luckyBoxAwardConfig``pages.luckyBoxBountyConfig``pages.luckyBoxFortuneConfig`
- 引用复核:删除前未发现保留页面引用本批次路径;仅存在同名后端 API URL 常量,不属于页面引用
## 批次 3零散孤立页面
状态:已完成
领取时间2026-04-24
领取范围:
- `src/views/dashboard/components/user-daily-currency-recharge-top/bar-graph-charts.vue`
- `src/views/datav/online-hourly-user-charts.vue`
- `src/views/datav/online-user-count.vue`
- `src/views/message/push/push-text-store.vue`
- `src/views/order/candy/running-water/db.vue`
- `src/views/props/props-send-tool/send-game-coupon.vue`
- `src/views/props/props-source-group/select-propsr-popover.vue`
- `src/views/sys/cp-cabin/form-edit.vue`
- `src/views/sys/cp-cabin/index.vue`
- `src/views/sys/user-recharge-blacklist/index.vue`
- `src/views/team/team-bill/team-member-add.vue`
- `src/views/team/team-bill/team-member-change.vue`
- `src/views/user/cp-confession/index.vue`
执行要求:
- 删除前检查这些文件是否被保留闭包引用。
- 检查 `pages.*` 翻译 key只清理确认为本批次私有的 key。
- 删除后执行一次引用扫描,确认没有保留文件继续引用本批次路径。
完成记录:
- 完成时间2026-04-24
- 删除文件13 个
- 翻译处理:候选文件本身仅 `src/views/dashboard/components/user-daily-currency-recharge-top/bar-graph-charts.vue` 使用 `pages.dashboard.shared.*`,该 key 属于首页共享翻译,已保留;其余文件未使用页面翻译 key
- 引用复核:删除前未发现保留页面引用本批次路径
## 批次 4红包邀请孤立页面
状态:已完成
领取时间2026-04-24
领取范围:
- `src/views/sys/red-packet-invite-user/carousel-awards/edit.vue`
- `src/views/sys/red-packet-invite-user/carousel-awards/index.vue`
- `src/views/sys/red-packet-invite-user/config/index.vue`
- `src/views/sys/red-packet-invite-user/config/red-packet-invite-user-2fun.vue`
- `src/views/sys/red-packet-invite-user/config/red-packet-invite-user-aswat.vue`
- `src/views/sys/red-packet-invite-user/config/red-packet-invite-user-halar.vue`
- `src/views/sys/red-packet-invite-user/config/red-packet-invite-user-tarab.vue`
- `src/views/sys/red-packet-invite-user/draw-log/index.vue`
- `src/views/sys/red-packet-invite-user/help-log/index.vue`
- `src/views/sys/red-packet-invite-user/red-packet/index.vue`
- `src/views/sys/red-packet-invite-user/target/exchange.vue`
- `src/views/sys/red-packet-invite-user/target/index.vue`
- `src/views/sys/red-packet-invite-user/withdraw-transit/index.vue`
执行要求:
- 删除前检查这些文件是否被保留闭包引用。
- 检查 `pages.*` 翻译 key只清理确认为本批次私有的 key。
- 删除后执行一次引用扫描,确认没有保留文件继续引用本批次路径。
完成记录:
- 完成时间2026-04-24
- 删除文件13 个
- 翻译处理:本批次页面未使用 `pages.*` 页面翻译 key无需清理语言文件
- 引用复核:删除前未发现保留页面引用本批次路径;仅存在本批次内部引用和后端 API 文件引用
## 待领取候选
- 暂无。
## 保留复核
- 暂无。
## 已完成
- 批次 1`src/views/activity/picture-config/**``src/views/cnf/product/**`,已删除 12 个页面,无页面私有翻译 key 需要清理。
- 批次 2孤立游戏与日志页面已删除 23 个页面,已清理 LuckyBox 私有翻译 key。
- 批次 3零散孤立页面已删除 13 个页面,无私有页面翻译 key 需要清理。
- 批次 4红包邀请孤立页面已删除 13 个页面,无页面私有翻译 key 需要清理。
## 验证记录
- 2026-04-24重新生成保留闭包`src/views/**/*.vue` 总数 382保留闭包 382剩余候选 0。
- 2026-04-24`node -c src/lang/messages/pages/en.js` 通过。
- 2026-04-24`node -c src/lang/messages/pages/zh.js` 通过。
- 2026-04-24直接执行 `npm run build:prod` 触发当前 Node 与 webpack 的既有 `ERR_OSSL_EVP_UNSUPPORTED`
- 2026-04-24改用 `$env:NODE_OPTIONS='--openssl-legacy-provider'; npm run build:prod` 构建通过,保留项目既有 warning。

View File

@ -0,0 +1,80 @@
# 页面裁剪进度
## 当前目标
- 只保留 `docs/i18n/主要路由.md` 中接口返回路由、`src/router/index.js` 中项目原有路由、首页、基础错误页、登录页、公共运行页,以及这些页面实际引用的 `src/views` 私有组件。
- 其他未被引用的 `src/views` 页面逐批删除。
- 每批删除时同步检查页面私有翻译 key并清理 `src/lang/messages/pages/en.js``src/lang/messages/pages/zh.js` 中不再使用的私有命名空间。
## 当前状态
- 2026-04-24已建立页面裁剪任务清单。
- 2026-04-24已完成保留闭包扫描当前候选删除页面为 61 个。
- 2026-04-24批次 1 已完成,已删除产品配置和活动图片配置相关孤立页面。
- 2026-04-24批次 2 已完成,已删除孤立游戏与日志页面,并清理 LuckyBox 私有翻译 key。
- 2026-04-24批次 3 已完成,已删除零散孤立页面。
- 2026-04-24批次 4 已完成,已删除红包邀请孤立页面。
- 2026-04-24重新生成保留闭包`src/views/**/*.vue` 总数 382保留闭包 382剩余候选 0。
- 2026-04-24语言文件语法检查通过`--openssl-legacy-provider` 的生产构建通过。
## 保留边界
- 首页保留:`src/views/dashboard/index.vue` 及其依赖闭包。
- 路由文件保留:`src/router/index.js` 中已有 `@/views/**` 路由入口及其依赖闭包。
- 主要路由保留:`docs/i18n/主要路由.md` 中所有接口返回 `path` 对应页面、显式列出的 `src/views/**/*.vue` 页面及其依赖闭包。
- 基础页面保留:`src/views/login/index.vue``src/views/401.vue``src/views/404.vue``src/views/common/user_deatils.vue`
- 公共组件暂不批量删除:后续只有确认全项目无引用时再处理。
## 批次记录
### 批次 1
- 状态:已完成
- 领取时间2026-04-24
- 领取线程:本线程
- 范围:`src/views/activity/picture-config/**``src/views/cnf/product/**`
- 删除文件12 个
- 翻译处理:未发现 `pages.*` 页面翻译 key无需清理语言文件
- 验证:删除前引用扫描未发现保留页面引用本批次路径
### 批次 2
- 状态:已完成
- 领取时间2026-04-24
- 领取线程:本线程
- 范围:孤立游戏与日志页面
- 删除文件23 个
- 翻译处理:已清理 `pages.luckyBoxGiftDetails``pages.luckyBoxStandardConfig``pages.luckyBoxAwardConfig``pages.luckyBoxBountyConfig``pages.luckyBoxFortuneConfig`
- 验证:删除前引用扫描未发现保留页面引用本批次路径
### 批次 3
- 状态:已完成
- 领取时间2026-04-24
- 领取线程:本线程
- 范围:零散孤立页面
- 删除文件13 个
- 翻译处理:保留首页共享 key `pages.dashboard.shared.*`,其余文件未发现页面翻译 key
- 验证:删除前引用扫描未发现保留页面引用本批次路径
### 批次 4
- 状态:已完成
- 领取时间2026-04-24
- 领取线程:本线程
- 范围:红包邀请孤立页面
- 删除文件13 个
- 翻译处理:未发现 `pages.*` 页面翻译 key无需清理语言文件
- 验证:删除前引用扫描未发现保留页面引用本批次路径
## 未完成事项
- 本轮页面裁剪候选已清零。
- 公共组件 `src/components/**` 暂未批量删除;后续如继续精简公共组件,需要单独做全项目引用扫描。
## 验证结果
- `node -c src/lang/messages/pages/en.js`:通过。
- `node -c src/lang/messages/pages/zh.js`:通过。
- `npm run build:prod`:当前 Node 环境下触发项目既有 `ERR_OSSL_EVP_UNSUPPORTED`
- `$env:NODE_OPTIONS='--openssl-legacy-provider'; npm run build:prod`:通过,剩余 17 个项目既有 warning 与 Sass deprecation 提示。

View File

@ -730,307 +730,6 @@ export default {
emptyContent: 'Content is empty'
}
},
luckyBoxGiftDetails: {
dialog: {
listTitle: 'Gift Configuration List',
formTitle: 'Gift Configuration'
},
alert: {
title: 'Lucky Box Gift Configuration - Required Reading',
description: 'Exactly {count} gifts must be configured before the game can start.'
},
table: {
platform: 'Platform',
name: 'Name',
cover: 'Cover',
gold: 'Gold',
createdAt: 'Created At',
actions: 'Actions'
},
form: {
system: 'System',
name: 'Name',
sort: 'Sort',
giftType: 'Gift Type',
resource: 'Resource'
},
placeholder: {
selectSystem: 'Select a system',
name: 'Name',
sort: 'Sort',
giftType: 'Gift Type',
select: 'Please select'
},
action: {
add: 'Add',
edit: 'Edit'
},
validation: {
requiredField: 'Required field cannot be empty'
},
giftType: {
ORDINARY: 'Ordinary Gift',
NATIONAL_FLAG: 'National Flag Gift',
CP: 'CP Gift',
FAMILY: 'Family Gift',
EXCLUSIVE: 'Exclusive Gift',
ARISTOCRACY: 'Nobility Gift',
LUCKY_GIFT: 'Lucky Gift',
ACTIVITY: 'Event Gift',
MAGIC: 'Magic Gift',
CUSTOMIZED: 'Custom Gift'
}
},
luckyBoxStandardConfig: {
filter: {
system: 'System',
lotteryType: 'Related Type',
status: 'Status'
},
dialog: {
formTitle: '{action} ({system})',
probabilityTitle: 'Probability Configuration'
},
table: {
platform: 'Platform',
name: 'Name',
type: 'Type',
giftQuantity: 'Displayed Gift Quantity',
status: 'Normal/Closed',
createdAt: 'Created At',
actions: 'Actions',
gold: 'Gold',
cover: 'Cover'
},
form: {
system: 'System',
type: 'Type',
name: 'Name',
giftQuantity: 'Displayed Gift Quantity',
quantity: 'Quantity',
gold: 'Gold'
},
placeholder: {
selectSystem: 'Select a system',
type: 'Type',
name: 'Name',
giftQuantity: 'Displayed Gift Quantity',
defaultProbability: 'Default Probability',
luckyProbability: 'Lucky Moment Probability',
select: 'Please select',
stock: 'Stock',
probabilityExample: 'Probability (100 means 1%)',
relationGift: 'Related Gift'
},
action: {
add: 'Add',
edit: 'Edit',
delete: 'Delete',
giftConfig: 'Gift Configuration',
probabilityConfig: 'Probability Configuration',
save: 'Save',
addProbabilityDetail: 'Add Probability Detail'
},
lotteryType: {
CLASSICS: 'Classic',
CONSTELLATION: 'Constellation'
},
status: {
normal: 'Normal',
closed: 'Closed'
},
section: {
probability: 'Probability',
giftInfo: 'Gift Information'
},
probability: {
sort: 'Sort: {value}',
remaining: 'Probability still needs {value} to reach 10000',
completed: 'Probability is complete',
exceeded: 'Probability exceeds by {value}, please adjust!',
luckyRemaining: 'Lucky moment probability still needs {value} to reach 10000',
luckyCompleted: 'Lucky moment probability is complete',
luckyExceeded: 'Lucky moment probability exceeds by {value}, please adjust!'
},
alert: {
probabilityRuleTitle: 'Lucky Box Gift Probability Rules - Required Reading',
probabilityRuleDescription: 'The probability configuration for all 3 quantity groups must be complete before the game can start.'
},
confirm: {
title: 'Prompt',
deleteMessage: 'Are you sure you want to delete it?',
saveTitle: 'Continuing will clear the currently running data!',
saveMessage: 'Are you sure you want to save?'
},
validation: {
requiredField: 'Required field cannot be empty',
notEmpty: 'Cannot be empty'
},
message: {
deleteSuccess: 'Deleted successfully',
quantityPositiveInteger: 'Quantity must be a positive integer!',
goldPositiveInteger: 'Gold must be a positive integer!',
configureProbabilityDetails: 'Please configure the probability details',
probabilityMustEqual10000: 'Probability must equal 10000',
luckyProbabilityMustEqual10000: 'Lucky moment probability must equal 10000',
probabilityGreaterThanZero: 'Probability must be greater than 0!',
luckyProbabilityGreaterThanZero: 'Lucky moment probability must be greater than 0!'
}
},
luckyBoxAwardConfig: {
filter: {
system: 'System',
lotteryType: 'Related Type'
},
dialog: {
formTitle: '{action} ({system})',
detailsListTitle: 'Lottery Reward Configuration List',
detailsFormTitle: 'Prop Configuration'
},
table: {
platform: 'Platform',
type: 'Type',
name: 'Name',
resource: 'Resource',
targetCount: 'Target Count',
validDays: 'Valid Days',
createdAt: 'Created At',
actions: 'Actions'
},
form: {
system: 'System',
lotteryType: 'Related Type',
name: 'Name',
propsType: 'Select Type',
propsId: 'Select Resource',
targetCount: 'Target Count',
validDays: 'Valid Days'
},
placeholder: {
selectSystem: 'Select a system',
type: 'Type',
name: 'Name',
propsType: 'Type',
targetCount: 'Target Count',
validDays: 'Valid Days'
},
action: {
add: 'Add',
edit: 'Edit',
delete: 'Delete',
rewardConfig: 'Reward Configuration'
},
lotteryType: {
CLASSICS: 'Classic',
CONSTELLATION: 'Constellation'
},
propsType: {
AVATAR_FRAME: 'Avatar Frame',
RIDE: 'Ride',
NOBLE_VIP: 'Noble',
THEME: 'Theme',
LAYOUT: 'Decoration',
CHAT_BUBBLE: 'Chat Bubble',
FLOAT_PICTURE: 'Floating Window',
FRAGMENTS: 'Fragments',
DATA_CARD: 'Profile Card',
SPECIAL_ID: 'Special ID',
CUSTOMIZE: 'Custom (Read Only)'
},
confirm: {
title: 'Prompt',
deleteMessage: 'Are you sure you want to delete it?'
},
validation: {
requiredField: 'Required field cannot be empty'
},
message: {
deleteSuccess: 'Deleted successfully'
}
},
luckyBoxBountyConfig: {
filter: {
system: 'System',
type: 'Type'
},
dialog: {
formTitle: '{action} ({system})',
detailsListTitle: 'Prop Configuration List',
detailsFormTitle: 'Prop Configuration'
},
table: {
platform: 'Platform',
type: 'Type',
cover: 'Cover',
resource: 'Resource',
targetQuantity: 'Target Quantity',
validDays: 'Valid Days',
createdAt: 'Created At',
actions: 'Actions'
},
form: {
system: 'System',
type: 'Type',
giftType: 'Gift Type',
resource: 'Resource',
propsType: 'Select Type',
propsId: 'Select Resource',
targetQuantity: 'Target Quantity',
validDays: 'Valid Days'
},
placeholder: {
selectSystem: 'Select a system',
type: 'Type',
giftType: 'Gift Type',
select: 'Please select',
propsType: 'Type',
targetQuantity: 'Target Quantity',
validDays: 'Valid Days'
},
action: {
add: 'Add',
edit: 'Edit',
delete: 'Delete',
propsConfig: 'Prop Configuration'
},
type: {
DAILY: 'Daily',
WEEKLY: 'Weekly'
},
giftType: {
ORDINARY: 'Ordinary Gift',
NATIONAL_FLAG: 'National Flag Gift',
CP: 'CP Gift',
FAMILY: 'Family Gift',
EXCLUSIVE: 'Exclusive Gift',
ARISTOCRACY: 'Nobility Gift',
LUCKY_GIFT: 'Lucky Gift',
ACTIVITY: 'Event Gift',
MAGIC: 'Magic Gift',
CUSTOMIZED: 'Custom Gift'
},
propsType: {
AVATAR_FRAME: 'Avatar Frame',
RIDE: 'Ride',
NOBLE_VIP: 'Noble',
THEME: 'Theme',
LAYOUT: 'Decoration',
CHAT_BUBBLE: 'Chat Bubble',
FLOAT_PICTURE: 'Floating Window',
DATA_CARD: 'Profile Card',
SPECIAL_ID: 'Special ID'
},
confirm: {
title: 'Prompt',
deleteMessage: 'Are you sure you want to delete it?'
},
validation: {
requiredField: 'Required field cannot be empty'
},
message: {
deleteSuccess: 'Deleted successfully'
}
},
userAuthForm: {
drawer: {
title: 'Authentication Info'
@ -1595,44 +1294,6 @@ export default {
no: 'No'
}
},
luckyBoxFortuneConfig: {
alert: {
singleDraw: 'Lucky point probability for a single draw (Unit: %)',
tenDraws: 'Lucky point probability for 10 draws (Unit: %)',
fiftyDraws: 'Lucky point probability for 50 draws (Unit: %)',
luckyMoment: 'Lucky moment configuration'
},
label: {
oneDot: '1 Point',
twoDot: '2 Points',
threeDot: '3 Points',
aroundElevenDot: '11-15 Points',
aroundSixteenDot: '16-20 Points',
aroundTwentyOneDot: '21-25 Points',
aroundTwentySixDot: '26-30 Points',
aroundFiftyOneDot: '51-100 Points',
aroundOneHundredDot: '101-150 Points',
luckyTimeOne: 'Lucky Moment 1',
luckyTimeTwo: 'Lucky Moment 2',
luckyTimeDuration: 'Lucky Moment Duration (S)'
},
action: {
submit: 'Submit'
},
validation: {
requiredField: 'Required field cannot be empty'
},
message: {
probabilityGreaterThanZero: 'Probability must be greater than 0!',
probabilityMustEqualHundred: 'Probability must equal 100!'
},
confirm: {
title: 'Prompt',
submitMessage: 'Are you sure you want to submit?',
confirmButtonText: 'Confirm',
cancelButtonText: 'Cancel'
}
},
gameEgg: {
tabs: {
exchangeRecord: 'Fragment Exchange',

View File

@ -729,307 +729,6 @@ export default {
emptyContent: '内容为空'
}
},
luckyBoxGiftDetails: {
dialog: {
listTitle: '礼物配置列表',
formTitle: '礼物配置'
},
alert: {
title: 'luckyBox礼物配置-必读',
description: '礼物必须配置({count})个,游戏才可进行!'
},
table: {
platform: '平台',
name: '名称',
cover: '封面',
gold: '金币',
createdAt: '创建时间',
actions: '操作'
},
form: {
system: '系统',
name: '名称',
sort: '序号',
giftType: '礼物类型',
resource: '资源'
},
placeholder: {
selectSystem: '选择系统',
name: '名称',
sort: '序号',
giftType: '礼物类型',
select: '请选择'
},
action: {
add: '添加',
edit: '编辑'
},
validation: {
requiredField: '必填字段不可为空'
},
giftType: {
ORDINARY: '普通礼物',
NATIONAL_FLAG: '国旗礼物',
CP: 'CP礼物',
FAMILY: '家族礼物',
EXCLUSIVE: '专属礼物',
ARISTOCRACY: '贵族礼物',
LUCKY_GIFT: '幸运礼物',
ACTIVITY: '活动礼物',
MAGIC: '魔法礼物',
CUSTOMIZED: '定制礼物'
}
},
luckyBoxStandardConfig: {
filter: {
system: '系统',
lotteryType: '关联类型',
status: '状态'
},
dialog: {
formTitle: '{action}{system}',
probabilityTitle: '概率配置'
},
table: {
platform: '平台',
name: '名称',
type: '类型',
giftQuantity: '展示礼物数量',
status: '正常/关闭',
createdAt: '创建时间',
actions: '操作',
gold: '金币',
cover: '封面'
},
form: {
system: '系统',
type: '类型',
name: '名称',
giftQuantity: '展示礼物数量',
quantity: '数量',
gold: '金币'
},
placeholder: {
selectSystem: '选择系统',
type: '类型',
name: '名称',
giftQuantity: '展示礼物数量',
defaultProbability: '默认概率',
luckyProbability: '幸运时刻概率',
select: '请选择',
stock: '库存',
probabilityExample: '概率(100就是1%)',
relationGift: '关联礼物'
},
action: {
add: '添加',
edit: '编辑',
delete: '删除',
giftConfig: '礼物配置',
probabilityConfig: '概率配置',
save: '保存',
addProbabilityDetail: '添加概率详情'
},
lotteryType: {
CLASSICS: '经典',
CONSTELLATION: '星座'
},
status: {
normal: '正常',
closed: '关闭'
},
section: {
probability: '概率',
giftInfo: '礼物信息'
},
probability: {
sort: '排序:{value}',
remaining: '概率还差{value}凑满10000',
completed: '概率已拼凑完整',
exceeded: '概率已超过{value},请调整!',
luckyRemaining: '幸运时刻概率还差{value}凑满10000',
luckyCompleted: '幸运时刻概率已拼凑完整',
luckyExceeded: '幸运时刻概率已超过{value},请调整!'
},
alert: {
probabilityRuleTitle: 'luckyBox礼物概率规则-必读',
probabilityRuleDescription: '规格概率配置3个数量配置需要配置完整游戏才可进行'
},
confirm: {
title: '提示',
deleteMessage: '确认删除吗?',
saveTitle: '如果继续保存,将会清除正在执行的数据!',
saveMessage: '确认保存吗?'
},
validation: {
requiredField: '必填字段不可为空',
notEmpty: '不可为空'
},
message: {
deleteSuccess: '删除成功',
quantityPositiveInteger: '数量只能为正整数!',
goldPositiveInteger: '金币只能为正整数!',
configureProbabilityDetails: '请配置概率详细',
probabilityMustEqual10000: '概率必须等于10000',
luckyProbabilityMustEqual10000: '幸运时刻概率必须等于10000',
probabilityGreaterThanZero: '概率必须大于0',
luckyProbabilityGreaterThanZero: '幸运时刻概率必须大于0'
}
},
luckyBoxAwardConfig: {
filter: {
system: '系统',
lotteryType: '关联类型'
},
dialog: {
formTitle: '{action}{system}',
detailsListTitle: '抽奖奖励配置列表',
detailsFormTitle: '道具配置'
},
table: {
platform: '平台',
type: '类型',
name: '名称',
resource: '资源',
targetCount: '目标次数',
validDays: '有效天数',
createdAt: '创建时间',
actions: '操作'
},
form: {
system: '系统',
lotteryType: '关联类型',
name: '名称',
propsType: '选择类型',
propsId: '选择资源',
targetCount: '目标次数',
validDays: '有效天数'
},
placeholder: {
selectSystem: '选择系统',
type: '类型',
name: '名称',
propsType: '类型',
targetCount: '目标次数',
validDays: '有效天数'
},
action: {
add: '添加',
edit: '编辑',
delete: '删除',
rewardConfig: '奖励配置'
},
lotteryType: {
CLASSICS: '经典',
CONSTELLATION: '星座'
},
propsType: {
AVATAR_FRAME: '头像框',
RIDE: '座驾',
NOBLE_VIP: '贵族',
THEME: '主题',
LAYOUT: '装扮',
CHAT_BUBBLE: '聊天气泡',
FLOAT_PICTURE: '飘窗',
FRAGMENTS: '碎片',
DATA_CARD: '资料卡',
SPECIAL_ID: '靓号',
CUSTOMIZE: '自定义(只读)'
},
confirm: {
title: '提示',
deleteMessage: '确认删除吗?'
},
validation: {
requiredField: '必填字段不可为空'
},
message: {
deleteSuccess: '删除成功'
}
},
luckyBoxBountyConfig: {
filter: {
system: '系统',
type: '类型'
},
dialog: {
formTitle: '{action}{system}',
detailsListTitle: '道具配置列表',
detailsFormTitle: '道具配置'
},
table: {
platform: '平台',
type: '类型',
cover: '封面',
resource: '资源',
targetQuantity: '目标数量',
validDays: '有效天数',
createdAt: '创建时间',
actions: '操作'
},
form: {
system: '系统',
type: '类型',
giftType: '礼物类型',
resource: '资源',
propsType: '选择类型',
propsId: '选择资源',
targetQuantity: '目标数量',
validDays: '有效天数'
},
placeholder: {
selectSystem: '选择系统',
type: '类型',
giftType: '礼物类型',
select: '请选择',
propsType: '类型',
targetQuantity: '目标数量',
validDays: '有效天数'
},
action: {
add: '添加',
edit: '编辑',
delete: '删除',
propsConfig: '道具配置'
},
type: {
DAILY: '每日',
WEEKLY: '每周'
},
giftType: {
ORDINARY: '普通礼物',
NATIONAL_FLAG: '国旗礼物',
CP: 'CP礼物',
FAMILY: '家族礼物',
EXCLUSIVE: '专属礼物',
ARISTOCRACY: '贵族礼物',
LUCKY_GIFT: '幸运礼物',
ACTIVITY: '活动礼物',
MAGIC: '魔法礼物',
CUSTOMIZED: '定制礼物'
},
propsType: {
AVATAR_FRAME: '头像框',
RIDE: '座驾',
NOBLE_VIP: '贵族',
THEME: '主题',
LAYOUT: '装扮',
CHAT_BUBBLE: '聊天气泡',
FLOAT_PICTURE: '飘窗',
DATA_CARD: '资料卡',
SPECIAL_ID: '靓号'
},
confirm: {
title: '提示',
deleteMessage: '确认删除吗?'
},
validation: {
requiredField: '必填字段不可为空'
},
message: {
deleteSuccess: '删除成功'
}
},
userAuthForm: {
drawer: {
title: '认证信息'
@ -1594,44 +1293,6 @@ export default {
no: '否'
}
},
luckyBoxFortuneConfig: {
alert: {
singleDraw: '单抽获取以下幸运值概率(单位%)',
tenDraws: '10抽获取以下幸运值概率(单位%)',
fiftyDraws: '50抽获取以下幸运值概率(单位%)',
luckyMoment: '幸运时刻配置'
},
label: {
oneDot: '1点',
twoDot: '2点',
threeDot: '3点',
aroundElevenDot: '11-15点',
aroundSixteenDot: '16-20点',
aroundTwentyOneDot: '21-25点',
aroundTwentySixDot: '26-30点',
aroundFiftyOneDot: '51-100点',
aroundOneHundredDot: '101-150点',
luckyTimeOne: '幸运时刻1',
luckyTimeTwo: '幸运时刻2',
luckyTimeDuration: '幸运时刻时长(S)'
},
action: {
submit: '提交'
},
validation: {
requiredField: '必填字段不可为空'
},
message: {
probabilityGreaterThanZero: '概率必须大于0',
probabilityMustEqualHundred: '概率必须等于100'
},
confirm: {
title: '提示',
submitMessage: '是否确认提交?',
confirmButtonText: '确定',
cancelButtonText: '取消'
}
},
gameEgg: {
tabs: {
exchangeRecord: '碎片兑换',

View File

@ -1,182 +0,0 @@
<template>
<div class="banner-form-edite">
<el-drawer
:title="textOptTitle"
:visible="true"
:before-close="handleClose"
:close-on-press-escape="false"
:wrapper-closable="false"
:modal-append-to-body="true"
:append-to-body="true"
custom-class="drawer-auto-layout"
>
<div v-loading="submitLoading">
<div class="drawer-form">
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="系统" prop="sysOrigin">
<el-select
v-model="form.sysOrigin"
placeholder="选择系统"
style="width:100%;"
class="filter-item"
>
<el-option
v-for="item in permissionsSysOriginPlatforms"
:key="item.value"
:label="item.label"
:value="item.value"
>
<span style="float: left;"> <sys-origin-icon :icon="item.value" :desc="item.value" /></span>
<span style="float: left;margin-left:10px">{{ item.label }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="活动图" prop="picture">
<el-upload
:disabled="pictureUploadLoading"
:file-list="pictureFileList"
:class="{'upload-but-hide': !isShowPictureUpload}"
action=""
list-type="picture-card"
:http-request="uploadPicture"
:show-file-list="!isShowPictureUpload"
:on-remove="handlePictureFileRemove"
accept="image/*"
>
<i slot="default" v-loading="pictureUploadLoading" class="el-icon-plus" />
</el-upload>
</el-form-item>
<el-form-item label="描述" prop="depict">
<el-input v-model.trim="form.name" placeholder="描述" />
</el-form-item>
</el-form>
</div>
<div class="drawer-footer">
<el-button @click="handleClose()">取消</el-button>
<el-button type="primary" @click="submitForm()">保存</el-button>
</div>
</div>
</el-drawer>
</div>
</template>
<script>
import { addActivityPicture, updateActivityPicture } from '@/api/activity'
import { getElementUiUploadFile } from '@/utils'
import { mapGetters } from 'vuex'
export default {
props: {
row: {
type: Object,
default: null
},
sysOrigin: {
type: String,
require: false,
default: ''
}
},
data() {
const commonRules = [{ required: true, message: '必填字段', trigger: 'blur' }]
return {
pictureUploadLoading: false,
pictureFileList: [],
form: {
id: '',
picture: '',
name: ''
},
submitLoading: false,
uploadLoading: false,
rules: {
picture: commonRules,
name: commonRules,
sysOrigin: commonRules
}
}
},
computed: {
textOptTitle() {
return `${(this.row && this.row.id ? '修改' : '新增')}(${this.sysOrigin})`
},
isShowPictureUpload() {
return !this.form.picture
},
...mapGetters(['permissionsSysOriginPlatforms'])
},
watch: {
row: {
handler(val) {
if (!val) {
this.listRegion()
return
}
const form = Object.assign({}, val)
this.pictureFileList = getElementUiUploadFile(form.picture)
this.form = Object.assign(this.form, form)
this.listRegion()
},
immediate: true
}
},
methods: {
uploadPicture(file) {
const that = this
that.pictureUploadLoading = true
that.$simpleUploadFlie(file, that.$application.fileBucket.other).then(res => {
that.pictureUploadLoading = false
that.form.picture = that.$getAccessImgUrl(res.name)
}).catch(er => {
that.pictureUploadLoading = false
})
},
handlePictureFileRemove(file, fileList) {
this.form.picture = ''
this.pictureUploadLoading = false
},
handleClose() {
this.$emit('close')
},
submitForm() {
const that = this
that.$refs.form.validate(valid => {
if (!valid) {
console.error('error submit!!')
return
}
const submitForm = Object.assign({}, that.form)
that.submitLoading = true
if (!submitForm.sysOrigin) {
submitForm.sysOrigin = that.sysOrigin
}
if (!submitForm.sysOrigin) {
that.$message.error('系统错误, 没有平台信息!')
return
}
if (submitForm.id) {
updateActivityPicture(submitForm).then(res => {
that.submitLoading = false
that.$emit('success', res)
}).catch(er => {
that.submitLoading = false
that.$emit('fial', er)
})
return
}
addActivityPicture(submitForm).then(res => {
that.submitLoading = false
that.$emit('success', res)
}).catch(er => {
that.submitLoading = false
console.error(er)
that.$emit('fial', er)
})
})
}
}
}
</script>

View File

@ -1,220 +0,0 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-select
v-model="listQuery.sysOrigin"
placeholder="系统"
style="width:120px;"
class="filter-item"
@change="changeSysOrigin"
>
<el-option
v-for="item in permissionsSysOriginPlatforms"
:key="item.value"
:label="item.label"
:value="item.value"
>
<span style="float: left;"> <sys-origin-icon :icon="item.value" :desc="item.value" /></span>
<span style="float: left;margin-left:10px">{{ item.label }}</span>
</el-option>
</el-select>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleSearch"
>
搜索
</el-button>
<el-button
class="filter-item"
type="primary"
icon="el-icon-edit"
@click="handleCreate"
>
新增
</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
fit
highlight-current-row
@cell-mouse-enter="handleMouseEnter"
>
<el-table-column label="归属系统" align="center">
<template slot-scope="scope">
<sys-origin-icon :icon="scope.row.sysOrigin" :desc="scope.row.sysOrigin" />
</template>
</el-table-column>
<el-table-column label="活动图片" align="center" width="150">
<template slot-scope="scope">
<el-image
:lazy="true"
style="width: 150px; height: 111px"
:src="scope.row.picture"
:preview-src-list="[scope.row.picture]"
>
<div slot="error" class="image-slot">
<i class="el-icon-picture-outline" />
</div>
</el-image>
</template>
</el-table-column>
<el-table-column prop="name" label="描述" align="center" />
<el-table-column fixed="right" label="操作" align="center" width="200">
<template slot-scope="scope">
<el-button type="text" @click.native="copyTextContent(scope.row.id)">复制活动内容</el-button>
<el-button type="text" @click.native="handleUpdate()">修改</el-button>
<el-button type="text" @click.native="handlDel(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="listQuery.cursor"
:limit.sync="listQuery.limit"
@pagination="renderData"
/>
<form-edit
v-if="formEditVisible"
:row="thatRow"
:sys-origin="listQuery.sysOrigin"
@close="formEditVisible = false"
@success="formEditSuccess"
/>
</div>
</template>
<script>
import { activityPicture, deleteActivityPicture } from '@/api/activity'
import Pagination from '@/components/Pagination'
import { sysOriginPlatforms } from '@/constant/origin'
import FormEdit from './form-edit.vue'
import { copyText } from '@/utils'
import { mapGetters } from 'vuex'
export default {
components: { Pagination, FormEdit },
data() {
return {
thatRow: {},
textContent: '',
sysOriginPlatforms,
list: [],
total: 0,
listQuery: {
cursor: 1,
limit: 20,
sysOrigin: 'HALAR'
},
formEditVisible: false,
listLoading: true
}
},
computed: {
...mapGetters(['permissionsSysOriginPlatforms'])
},
created() {
const that = this
const querySystem = this.permissionsSysOriginPlatforms[0]
if (!querySystem) {
return
}
that.listQuery.sysOrigin = querySystem.value
that.renderData()
},
methods: {
renderData(isClean) {
const that = this
if (isClean === true) {
this.listQuery.cursor = 1
this.listQuery.list = []
}
that.listLoading = true
activityPicture(that.listQuery).then(res => {
const { body } = res
that.total = body.total || 0
that.list = body.records
that.listLoading = false
})
},
handleSearch() {
this.renderData(true)
},
renderDataSuccess() {
this.$message({
message: '操作成功',
type: 'success'
})
this.renderData()
},
changeSysOrigin() {
this.handleSearch()
},
queryUserDetails(row) {
this.userDeatilsDrawer = true
this.thatSelectedUserId = row.id
},
//
handlDel(row) {
this.$confirm('确认删除吗?', '提示', {
type: 'warning'
}).then(() => {
this.listLoading = true
deleteActivityPicture(row.id).then((res) => {
this.listLoading = false
this.$message({
message: '删除成功',
type: 'success'
})
this.renderData()
})
}).catch(() => {
})
},
handleCreate() {
this.thatRow = null
this.formEditVisible = true
},
handleUpdate() {
this.formEditVisible = true
},
handleMouseEnter(row) {
this.thatRow = row
},
formEditSuccess() {
this.formEditVisible = false
this.renderData()
},
copyTextContent(text) {
const that = this
that.textContent = 'https://web.aswat1304.com/#/activity_picture_config/' + text
copyText(that.textContent).then(() => {
that.$message({
message: '复制成功',
type: 'success'
})
}).catch(() => {
that.$message({
message: '复制失败',
type: 'error'
})
})
}
}
}
</script>
<style scoped lang="scss">
.popover-content {
max-width: 300px;
line-height: 20px;
}
</style>

View File

@ -1,503 +0,0 @@
<template>
<el-dialog
:title="'礼包配置('+ sysOriginName +')'"
:visible="true"
:modal-append-to-body="true"
:append-to-body="true"
width="45%"
top="50px"
:before-close="handleClose"
>
<div class="launch-content">
<el-form ref="form" :model="form" label-width="80px" label-position="left" :rules="rules">
<div class="content-box block-content">
<el-form-item label="平台" prop="sysPlatform">
<el-cascader
v-model="form.sysPlatform"
:options="options"
:props="{ expandTrigger: 'hover' }"
style="width:100%;"
/>
</el-form-item>
</div>
<div class="content-box block-content">
<el-form-item label="金币">
<el-input v-model="form.gold" v-number placeholder="请输入金币数量" />
</el-form-item>
</div>
<div class="content-box block-content">
<el-form-item label="礼 包 配 置">
<div class="launch-type" />
<div class="main">
<div class="gift-pack-list">
<el-row v-for="(v,i) in form.giftPackConfigParams" :key="i" class="gift-pack-item sponsor">
<div v-if="v.type=='GIFT'" class="content content-box">
<div class="gift-pack-common-no">
<div class="gift-pack-label">
<span>礼物</span>
</div>
</div>
<el-row :gutter="10">
<el-col :span="3">
<div class="preview-img" style="width: 36px; height: 36px">
<el-image
style="width: 100%; height: 100%"
:src="v.cover"
:preview-src-list="[v.cover]"
>
<div slot="error" class="image-slot">
<i class="el-icon-picture-outline" />
</div>
</el-image>
<div class="preview-svga">
<svgaplayer
type="popover"
:url="v.sourceUrl"
/>
</div>
</div>
</el-col>
<el-col :span="13">
<el-form-item
:prop="'giftPackConfigParams.' + i + '.relevanceId'"
:rules="{ required: true, message: '必填参数', trigger: 'change'}"
>
<el-select
v-model="v.relevanceId"
placeholder="请选择礼物"
style="width:100%"
filterable
@change="(val)=>giftChange(val,v) "
>
<el-option
v-for="item in allGiftList"
:key="item.id"
:label="`${item.giftName}/${item.giftCandy}`"
:value="item.id"
>
<span>{{ item.giftName }}/{{ item.giftCandy }} </span>
<img :src="item.giftPhoto" style="height:32px;float: right">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item
:prop="'giftPackConfigParams.' + i + '.giftQuantity'"
:rules="{
required: true, message: '请填写礼物数量', trigger: 'blur'
}"
>
<span><el-input v-model="v.giftQuantity" placeholder="礼物数量" /></span>
</el-form-item>
</el-col>
</el-row>
<el-tooltip content="删除礼物" placement="top" style="margin-left: 15px;" class="delete-icon-wrapper">
<i class="el-icon-close" @click="deleteNode(i)" />
</el-tooltip>
</div>
<div v-if="v.type=='AVATAR_FRAME'" class="content content-box">
<div class="gift-pack-common-no">
<div class="gift-pack-label">
<span>头像框</span>
</div>
</div>
<el-row :gutter="10">
<el-col :span="3">
<div class="preview-img" style="width: 36px; height: 36px">
<el-image
style="width: 100%; height: 100%"
:src="v.cover"
:preview-src-list="[v.cover]"
>
<div slot="error" class="image-slot">
<i class="el-icon-picture-outline" />
</div>
</el-image>
<div class="preview-svga">
<svgaplayer
type="popover"
:url="v.sourceUrl"
/>
</div>
</div>
</el-col>
<el-col :span="13">
<el-form-item
:prop="'giftPackConfigParams.' + i + '.relevanceId'"
:rules="{
required: true, message: '必填参数', trigger: 'change'
}"
>
<el-select
v-model="v.relevanceId"
placeholder="请选择头像框"
style="width:100%"
filterable
@change="(val)=>avatarChange(val,v)"
>
<el-option
v-for="item in allAvatarList"
:key="item.id"
:label="`${item.name}/${item.amount}`"
:value="item.id"
>
<span>{{ item.name }}/{{ item.amount }}</span>
<img :src="item.cover" style="height:32px;float: right">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item
:prop="'giftPackConfigParams.' + i + '.effectDuration'"
:rules="{
required: true, message: '必填参数', trigger: 'blur'
}"
>
<span><el-input v-model="v.effectDuration" style="width: 100%;" placeholder="有效天" /></span>
</el-form-item>
</el-col>
</el-row>
<el-tooltip content="删除头像框" placement="top" style="margin-left: 13px;" class="delete-icon-wrapper">
<i class="el-icon-close" @click="deleteNode(i)" />
</el-tooltip>
</div>
<div v-if="v.type=='RIDE'" class="content content-box">
<div class="gift-pack-common-no">
<div class="gift-pack-label">
<span>座驾</span>
</div>
</div>
<el-row :gutter="10">
<el-col :span="3">
<div class="preview-img" style="width: 36px; height: 36px">
<el-image
style="width: 100%; height: 100%"
:src="v.cover"
:preview-src-list="[v.cover]"
>
<div slot="error" class="image-slot">
<i class="el-icon-picture-outline" />
</div>
</el-image>
<div class="preview-svga">
<svgaplayer
type="popover"
:url="v.sourceUrl"
/>
</div>
</div>
</el-col>
<el-col :span="13">
<el-form-item
:prop="'giftPackConfigParams.' + i + '.relevanceId'"
:rules="{
required: true, message: '必填参数', trigger: 'change'
}"
>
<el-select
v-model="v.relevanceId"
placeholder="请选择座驾"
style="width:100%"
filterable
@change="(val)=>cardChange(val,v)"
>
<el-option
v-for="item in allRideList"
:key="item.id"
:label="`${item.name}/${item.amount}`"
:value="item.id"
>
<span>{{ item.name }}/{{ item.amount }} </span>
<img :src="item.cover" style="height:32px;float: right">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item
:prop="'giftPackConfigParams.' + i + '.effectDuration'"
:rules="{
required: true, message: '必填参数', trigger: 'blur'
}"
>
<span><el-input v-model="v.effectDuration" style="width: 100%;" placeholder="必填参数" /> </span>
</el-form-item>
</el-col>
</el-row>
<el-tooltip content="删除该座驾" placement="top" style="margin-left: 13px;" class="delete-icon-wrapper">
<i class="el-icon-close" @click="deleteNode(i)" />
</el-tooltip>
</div>
</el-row>
</div>
<el-row>
<el-col>
<!-- <el-button type="text" @click="addGift"><i class="el-icon-circle-plus" />添加礼物</el-button> -->
<el-button type="text" @click="addAvatar"><i class="el-icon-circle-plus" />添加头像框</el-button>
<el-button type="text" @click="addRide"><i class="el-icon-circle-plus" />添加座驾</el-button>
</el-col>
</el-row>
</div>
</el-form-item>
</div>
<div class="content-box block-content">
<el-form-item>
<el-button type="primary" style="margin: 0px 0px 0px 100px;" @click="submit('form')">提交</el-button>
</el-form-item>
</div>
</el-form>
</div>
</el-dialog>
</template>
<script>
import { addGiftPackConfig, getGiftPackGrade } from '@/api/gift-pack'
import { listGiftBySysOrigin } from '@/api/gift'
import { listSysOriginTypeList } from '@/api/props'
import { sysOriginPlatforms } from '@/constant/origin'
export default {
name: 'AddGiftPackConfig',
props: {
sysOrigin: {
type: String,
default: ''
}
},
data() {
return {
options: [],
listLoading: false,
allGiftList: [],
allAvatarList: [],
allRideList: [],
form: {
sysPlatform: [],
giftPackId: '',
gold: '',
giftPackConfigParams: []
},
rules: {
sysPlatform: [{ type: 'array', required: true, message: '请选择平台', trigger: 'change' }]
},
sysOriginPlatformMap: {}
}
},
computed: {
sysOriginName() {
const origin = this.sysOriginPlatformMap[this.sysOrigin]
return origin ? origin.label : ''
}
},
created() {
const that = this
sysOriginPlatforms.forEach(item => {
that.sysOriginPlatformMap[item.value] = item
})
that.giftContent()
that.avatarContent()
that.rideContent()
that.getESmCodeList()
},
methods: {
giftChange(val, item) {
const giftSelect = this.allGiftList.find(item => item.id === val)
if (giftSelect) {
item.cover = giftSelect.giftPhoto
item.sourceUrl = giftSelect.giftSourceUrl
}
},
avatarChange(val, item) {
const avatarSelect = this.allAvatarList.find(item => item.id === val)
if (avatarSelect) {
item.cover = avatarSelect.cover
item.sourceUrl = avatarSelect.sourceUrl
}
},
cardChange(val, item) {
const cardSelect = this.allRideList.find(item => item.id === val)
if (cardSelect) {
item.cover = cardSelect.cover
item.sourceUrl = cardSelect.sourceUrl
}
},
handleClose() {
this.$emit('close')
},
submit(formName) {
const that = this
this.$refs[formName].validate((valid) => {
if (valid) {
that.form.giftPackId = that.form.sysPlatform[2]
that.listLoading = true
addGiftPackConfig(that.form).then(res => {
that.listLoading = false
that.$emit('success', Object.assign({}, that.form))
that.handleClose()
}).catch(err => {
that.listLoading = false
that.$emit('fial', err)
that.handleClose()
})
} else {
console.error('error submit!!')
return false
}
})
},
addGift() { //
this.form.giftPackConfigParams.push({ relevanceId: '', type: 'GIFT', giftQuantity: 1, effectDuration: 0 })
},
addAvatar() { //
this.form.giftPackConfigParams.push({ relevanceId: '', type: 'AVATAR_FRAME', giftQuantity: 0, effectDuration: 1 })
},
addRide() { //
this.form.giftPackConfigParams.push({ relevanceId: '', type: 'RIDE', giftQuantity: 0, effectDuration: 1 })
},
deleteNode(i) { //
this.form.giftPackConfigParams.splice(i, 1)
},
getESmCodeList() {
const that = this
getGiftPackGrade().then(res => {
that.options = res.body || []
}).catch(er => {
console.error(er)
})
},
giftContent() {
const that = this
listGiftBySysOrigin(that.sysOrigin).then(res => {
that.allGiftList = res.body || []
}).catch(er => {
console.error(er)
})
},
avatarContent() {
const that = this
listSysOriginTypeList(that.sysOrigin, 'AVATAR_FRAME').then(res => {
that.allAvatarList = res.body || []
}).catch(er => {
console.error(er)
})
},
rideContent() {
const that = this
listSysOriginTypeList(that.sysOrigin, 'RIDE').then(res => {
that.allRideList = res.body || []
}).catch(er => {
console.error(er)
})
},
accountHandleSuccess(data) {
this.$message({
message: 'Successful',
type: 'success'
})
}
}
}
</script>
<style scoped>
.app-container{
padding-top: 20px;
}
.launch-content {
max-height: 700px;
overflow: auto;
}
.content-box {
padding: 30px;
}
.block-content {
margin-bottom: 5px;
background: #fff;
box-shadow: 0 2px 4px 0 #e5e7ea;
border-radius: 2px;
}
.main .gift-pack-list .gift-pack-item {
margin-bottom: 20px;
background-color: #fff;
border: 1px solid #e5e7ea;
border-radius: 2px;
}
.main .gift-pack-list .gift-pack-item .content {
position: relative;
padding: 20px 45px;
}
.gift-pack-common-no {
position: absolute;
top: 0;
left: -6px;
white-space: nowrap;
display: -ms-flexbox;
display: flex;
-ms-flex-align: center;
align-items: center;
height: 30px;
}
.gift-pack-common-no .gift-pack-label {
line-height: 18px;
padding: 0 2px;
border-radius: 2px;
background: linear-gradient(315deg, #737d91, #959caa);
}
.gift-pack-common-no .gift-pack-label span {
display: inline-block;
font-size: 12px;
color: #fff;
transform: scale(.8);
}
.el-col button, .el-upload button {
font-size: 15.5px;
}
.el-col button i, .el-upload button i {
margin-right: 5px;
}
.menu-bar .back-button {
float: left;
margin-top: 18px;
line-height: 14px;
padding-right: 15px;
}
.menu-bar .back-button .el-button {
padding: 0;
color: #4c596e;
}
.menu-bar .button-group {
position: absolute;
top: 11px;
right: 30px;
}
.delete-icon-wrapper {
position: absolute;
right: 0;
top: 0;
font-size: 24px;
overflow: hidden;
color: #7f8997;
cursor: pointer;
}
.gift-pack-list .el-form-item__label{
color: #001330 !important;
}
</style>

View File

@ -1,427 +0,0 @@
<template>
<el-dialog
:title="'礼包配置('+ sysOriginName +')'"
:visible="true"
:modal-append-to-body="true"
:append-to-body="true"
width="45%"
top="50px"
:before-close="handleClose"
>
<div class="launch-content">
<el-form ref="form" :model="form" label-width="80px" label-position="left">
<div class="content-box block-content">
<el-form-item label="金币">
<el-input v-model="form.gold" v-number placeholder="请输入金币数量" />
</el-form-item>
</div>
<div class="content-box block-content">
<el-form-item label="礼 包 配 置">
<div class="launch-type" />
<div v-loading="listLoading" class="main">
<div class="gift-pack-list">
<el-row v-for="(v,i) in form.giftPackConfigParams" :key="i" class="gift-pack-item sponsor">
<div v-if="v.type=='GIFT'" class="content content-box">
<div class="gift-pack-common-no">
<div class="gift-pack-label">
<span>礼物</span>
</div>
</div>
<el-row :gutter="10">
<el-col :span="17">
<el-form-item
:prop="'giftPackConfigParams.' + i + '.relevanceId'"
:rules="{
required: true, message: '请选择礼物', trigger: 'change'
}"
>
<el-select
v-model="v.relevanceId"
placeholder="请选择礼物"
style="width:100%"
filterable
>
<el-option
v-for="item in allGiftList"
:key="item.id"
:label="`${item.giftName}/${item.giftCandy}`"
:value="item.id"
>
<span>{{ item.giftName }}/{{ item.giftCandy }}</span>
<img :src="item.giftPhoto" style="height:32px;float: right">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item
:prop="'giftPackConfigParams.' + i + '.giftQuantity'"
:rules="{
required: true, message: '必填参数', trigger: 'blur'
}"
>
<span><el-input v-model="v.giftQuantity" style="width: 100%;" placeholder="礼物数量" /></span>
</el-form-item>
</el-col>
</el-row>
<el-tooltip content="删除该礼物" placement="top" style="margin-left: 15px;" class="delete-icon-wrapper">
<i class="el-icon-close" @click="deleteNode(i)" />
</el-tooltip>
</div>
<div v-if="v.type=='AVATAR_FRAME'" class="content content-box">
<div class="gift-pack-common-no">
<div class="gift-pack-label">
<span>头像框</span>
</div>
</div>
<el-row :gutter="10">
<el-col :span="17">
<el-form-item
:prop="'giftPackConfigParams.' + i + '.relevanceId'"
:rules="{
required: true, message: '必填参数', trigger: 'change'
}"
>
<el-select
v-model="v.relevanceId"
placeholder="请选择头像框"
style="width:100%"
filterable
>
<el-option
v-for="item in allAvatarList"
:key="item.id"
:label="`${item.name}/${item.amount}`"
:value="item.id"
>
<span>{{ item.name }}/{{ item.amount }} </span>
<img :src="item.cover" style="height:32px;float: right">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item
:prop="'giftPackConfigParams.' + i + '.effectDuration'"
:rules="{
required: true, message: '必填参数', trigger: 'blur'
}"
>
<span><el-input v-model="v.effectDuration" style="width: 100%" placeholder="必填参数" /> </span>
</el-form-item>
</el-col>
</el-row>
<el-tooltip content="删除该头像框" placement="top" style="margin-left: 13px;" class="delete-icon-wrapper">
<i class="el-icon-close" @click="deleteNode(i)" />
</el-tooltip>
</div>
<div v-if="v.type=='RIDE'" class="content content-box">
<div class="gift-pack-common-no">
<div class="gift-pack-label">
<span>座驾</span>
</div>
</div>
<el-row :gutter="10">
<el-col :span="17">
<el-form-item
:prop="'giftPackConfigParams.' + i + '.relevanceId'"
:rules="{
required: true, message: '请选择座驾', trigger: 'change'
}"
>
<el-select
v-model="v.relevanceId"
placeholder="请选择座驾"
style="width:100%"
filterable
>
<el-option
v-for="item in allRideList"
:key="item.id"
:label="`${item.name}/${item.amount}`"
:value="item.id"
>
<span>{{ item.name }}/{{ item.amount }}</span>
<img :src="item.cover" style="height:32px;float: right">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item
:prop="'giftPackConfigParams.' + i + '.effectDuration'"
:rules="{
required: true, message: '必填参数', trigger: 'blur'
}"
>
<span><el-input v-model="v.effectDuration" style="width: 100%" placeholder="必填参数" /> </span>
</el-form-item>
</el-col>
</el-row>
<el-tooltip content="删除该座驾" placement="top" style="margin-left: 13px;" class="delete-icon-wrapper">
<i class="el-icon-close" @click="deleteNode(i)" />
</el-tooltip>
</div>
</el-row>
</div>
<el-row>
<el-col>
<!-- <el-button type="text" @click="addGift"><i class="el-icon-circle-plus" />添加礼物</el-button> -->
<el-button type="text" @click="addAvatar"><i class="el-icon-circle-plus" />添加头像框</el-button>
<el-button type="text" @click="addRide"><i class="el-icon-circle-plus" />添加座驾</el-button>
</el-col>
</el-row>
</div>
</el-form-item>
</div>
<div class="content-box block-content">
<el-form-item>
<el-button type="primary" style="margin: 0px 0px 0px 100px;" @click="submit('form')">提交</el-button>
</el-form-item>
</div>
</el-form>
</div>
</el-dialog>
</template>
<script>
import { getGiftPackInfo, giftPackConfig } from '@/api/gift-pack'
import { listGiftBySysOrigin } from '@/api/gift'
import { listSysOriginTypeList } from '@/api/props'
import { sysOriginPlatforms } from '@/constant/origin'
export default {
name: 'GiftPackConfig',
props: {
packId: {
type: String,
default: ''
},
sysOrigin: {
type: String,
default: ''
}
},
data() {
return {
listLoading: false,
allGiftList: [],
allAvatarList: [],
allRideList: [],
form: {
giftPackId: '',
gold: '',
giftPackConfigParams: []
},
sysOriginPlatformMap: {}
}
},
computed: {
sysOriginName() {
const origin = this.sysOriginPlatformMap[this.sysOrigin]
return origin ? origin.label : ''
}
},
watch: {
packId: {
immediate: true,
deep: true,
handler(newVal) {
if (newVal) {
this.form.giftPackId = newVal
this.giftContent()
this.avatarContent()
this.rideContent()
this.renderData()
}
}
}
},
created() {
const that = this
sysOriginPlatforms.forEach(item => {
that.sysOriginPlatformMap[item.value] = item
})
},
methods: {
handleClose() {
this.$emit('close')
},
renderData() {
const that = this
that.listLoading = true
getGiftPackInfo(that.form.giftPackId).then(res => {
const { body } = res
that.listLoading = false
that.form.gold = body.gold || ''
that.form.giftPackConfigParams = body.giftPackConfigParams || []
}).catch(er => {
console.error(er)
that.listLoading = false
})
},
submit(formName) {
const that = this
this.$refs[formName].validate((valid) => {
if (valid) {
that.listLoading = true
giftPackConfig(that.form).then(res => {
that.listLoading = false
that.$emit('success', Object.assign({}, that.form))
that.handleClose()
}).catch(err => {
that.listLoading = false
that.$emit('fial', err)
that.handleClose()
})
} else {
console.error('error submit!!')
return false
}
})
},
addGift() { //
this.form.giftPackConfigParams.push({ relevanceId: '', type: 'GIFT', giftQuantity: 1, effectDuration: 0 })
},
addAvatar() { //
this.form.giftPackConfigParams.push({ relevanceId: '', type: 'AVATAR_FRAME', giftQuantity: 0, effectDuration: 1 })
},
addRide() { //
this.form.giftPackConfigParams.push({ relevanceId: '', type: 'RIDE', giftQuantity: 0, effectDuration: 1 })
},
deleteNode(i) { //
this.form.giftPackConfigParams.splice(i, 1)
},
giftContent() {
const that = this
listGiftBySysOrigin(that.sysOrigin).then(res => {
that.allGiftList = res.body || []
}).catch(er => {
console.error(er)
})
},
avatarContent() {
const that = this
listSysOriginTypeList(that.sysOrigin, 'AVATAR_FRAME').then(res => {
that.allAvatarList = res.body || []
}).catch(er => {
console.error(er)
})
},
rideContent() {
const that = this
listSysOriginTypeList(that.sysOrigin, 'RIDE').then(res => {
that.allRideList = res.body || []
}).catch(er => {
console.error(er)
})
},
accountHandleSuccess(data) {
this.$message({
message: 'Successful',
type: 'success'
})
}
}
}
</script>
<style scoped>
.app-container{
padding-top: 20px;
}
.launch-content {
max-height: 700px;
overflow: auto;
}
.content-box {
padding: 30px;
}
.block-content {
margin-bottom: 5px;
background: #fff;
box-shadow: 0 2px 4px 0 #e5e7ea;
border-radius: 2px;
}
.main .gift-pack-list .gift-pack-item {
margin-bottom: 20px;
background-color: #fff;
border: 1px solid #e5e7ea;
border-radius: 2px;
}
.main .gift-pack-list .gift-pack-item .content {
position: relative;
padding: 20px 45px;
}
.gift-pack-common-no {
position: absolute;
top: 0;
left: -6px;
white-space: nowrap;
display: -ms-flexbox;
display: flex;
-ms-flex-align: center;
align-items: center;
height: 30px;
}
.gift-pack-common-no .gift-pack-label {
line-height: 18px;
padding: 0 2px;
border-radius: 2px;
background: linear-gradient(315deg, #737d91, #959caa);
}
.gift-pack-common-no .gift-pack-label span {
display: inline-block;
font-size: 12px;
color: #fff;
transform: scale(.8);
}
.el-col button, .el-upload button {
font-size: 15.5px;
}
.el-col button i, .el-upload button i {
margin-right: 5px;
}
.menu-bar .back-button {
float: left;
margin-top: 18px;
line-height: 14px;
padding-right: 15px;
}
.menu-bar .back-button .el-button {
padding: 0;
color: #4c596e;
}
.menu-bar .button-group {
position: absolute;
top: 11px;
right: 30px;
}
.delete-icon-wrapper {
position: absolute;
right: 0;
top: 0;
font-size: 24px;
overflow: hidden;
color: #7f8997;
cursor: pointer;
}
.gift-pack-list .el-form-item__label{
color: #001330 !important;
}
</style>

View File

@ -1,447 +0,0 @@
<template>
<div class="app-container-product-platform">
<div class="filter-container">
<el-cascader
v-model="sysPlatform"
class="filter-item"
:options="permissionsSysOriginPlatformAlls"
@change="renderDataChage"
/>
<el-select
v-model="listQuery.showcase"
placeholder="状态"
style="width: 120px"
class="filter-item"
@change="renderDataChage"
>
<el-option
v-for="item in productConfigShowcase"
:key="item.value"
:label="item.name"
:value="item.value"
/>
</el-select>
<el-select
v-model="listQuery.productType"
placeholder="产品类型"
clearable
style="width: 120px"
class="filter-item"
@change="renderDataChage"
>
<el-option
v-for="item in productTypes"
:key="item.value"
:label="item.name"
:value="item.value"
/>
</el-select>
<el-input
v-model.trim="listQuery.productId"
placeholder="产品ID"
style="width: 200px;"
class="filter-item"
/>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleSearch"
>
搜索
</el-button>
<el-button
class="filter-item"
type="primary"
icon="el-icon-edit"
:disabled="true"
@click="handleCreate"
>
添加
</el-button>
<el-dropdown v-if="isDrag" v-loading="isDragLoading" class="filter-item">
<el-button type="danger">
保存排序<i class="el-icon-arrow-down el-icon--right" />
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="handleSort(false)">仅当前平台</el-dropdown-item>
<el-dropdown-item @click.native="handleSort(true)">同步所有平台</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
fit
highlight-current-row
@cell-mouse-enter="handleMouseEnter"
>
<el-table-column
v-for="(item, index) in col"
:id="item.id"
:key="`col_${index}`"
:prop="item.prop"
:label="item.label"
align="center"
:width="item.width"
>
<template slot-scope="scope">
<div v-if="index === 0 && scope.row.recommend === true" class="seal-block seal-danger">推荐</div>
<div v-if="item.prop === 'productId'">
<el-link @click="copyContent(scope.row.productId)">{{ scope.row.productId }}</el-link>
</div>
<div v-else-if="item.prop === 'productType'">
<el-link @click="copyContent(scope.row.productType)">{{ getTypeNames(scope.row.productType) }}</el-link>
</div>
<div v-else-if="item.prop === 'productPackage'">
<el-link @click="copyContent(scope.row.productPackage)">{{ scope.row.productPackage }}</el-link>
</div>
<div v-else-if="item.prop === 'groupName'">
{{ getGroupNames(scope.row.groupName) }}
</div>
<div v-else-if="item.prop === 'showcase'">
<span v-if="scope.row.showcase === false">下架</span>
<span v-if="scope.row.showcase === true">上架</span>
</div>
<div v-else>{{ scope.row[item.prop] }}</div>
<div v-if="item.prop === 'operation'">
<el-button type="text" @click.native="systemConfig(scope.row)">配置</el-button>
<el-button type="text" @click="giftPackDetails(scope.row)">礼包详情</el-button>
</div>
</template>
</el-table-column>
</el-table>
<cnf-product-edit
v-if="cnfProductVisible"
:platform="listQuery.platform"
:sys-origin="'x'"
:edit-id="editId"
@close="cnfProductVisible = false; editId='';"
@success="renderData()"
/>
<product-recommend
v-if="productRecommendVisible"
:id="recommendId"
:product-id="recommendProductId"
:platform="listQuery.platform"
:sys-origin="listQuery.sysOrigin"
:product-type="recommendProductType"
:type="recommendType"
:prompt="recommendPromptDesc"
@success="productRecommendSuccess"
@close="productRecommendVisible=false;recommendId='';recommendProductId='';recommendType=1;recommendProductType=''"
/>
<gift-pack-config
v-if="giftPackConfigVisable"
:pack-id="giftPackId"
:sys-origin="listQuery.sysOrigin"
@close="giftPackConfigVisable=false"
@success="renderDataSuccess"
/>
<add-gift-pack-config
v-if="addGiftPackConfigVisable"
:sys-origin="listQuery.sysOrigin"
@close="addGiftPackConfigVisable=false"
@success="renderDataSuccess"
/>
<gift-pack-deatils-drawer
v-if="giftPackDeatilsDrawer"
:row="thisRow"
@close="giftPackDeatilsDrawer = false"
/>
</div>
</template>
<script>
import { getProductConfigPackList, delProductConfig, updateSort } from '@/api/product'
import { productConfigGroupNames, productConfigShowcase, productTypes, platformOrigins, productTags, productPositions } from '@/constant/type'
import ProductRecommend from '@/views/cnf/product/product-platform/recommend'
import { convertDescription } from '@/utils'
import { simpleElDropTable } from '@/utils/drop-table'
import CnfProductEdit from '@/views/cnf/product/product-platform/edit'
import { copyText } from '@/utils'
import giftPackConfig from './config'
import addGiftPackConfig from './add'
import GiftPackDeatilsDrawer from '@/components/data/GiftPackDeatilsDrawer'
import { mapGetters } from 'vuex'
export default {
name: 'ProductPlatform',
components: { ProductRecommend, CnfProductEdit, giftPackConfig, addGiftPackConfig, GiftPackDeatilsDrawer },
data() {
return {
giftPackId: '',
giftPackConfigVisable: false,
addGiftPackConfigVisable: false,
giftPackDeatilsDrawer: false,
thisRow: {},
sysPlatform: [],
editId: '',
cnfProductVisible: false,
isDragLoading: false,
isDrag: false,
col: [
{
label: '产品id',
prop: 'productId'
},
{
label: '描述',
prop: 'description'
},
{
label: '包名',
prop: 'productPackage'
},
{
label: '产品单价',
prop: 'unitPrice',
width: '80px'
},
{
label: '获得糖果数量',
prop: 'obtainCandy'
},
{
label: '分组',
prop: 'groupName'
},
{
label: '产品类型',
prop: 'productType'
},
{
label: '平台',
prop: 'platform',
width: '80px'
},
{
label: '优惠比率',
prop: 'discountRate'
},
{
label: '标签',
prop: 'tags'
},
{
label: '状态',
prop: 'showcase'
},
{
label: '序号',
prop: 'sort',
width: '50px'
},
{
label: '创建时间',
prop: 'createTime',
width: '180px'
},
{
label: '操作',
prop: 'operation',
width: '200px'
}
],
recommendType: 1,
recommendId: '',
recommendProductId: '',
recommendProductType: '',
productRecommendVisible: false,
clickRow: {},
list: [],
people: 0,
listQuery: {
productId: '',
groupName: 'GIFT_PACK',
showcase: true,
productType: '',
sysOrigin: '',
platform: ''
},
productConfigGroupNameMap: {},
productConfigTypeMap: {},
productConfigGroupNames,
productConfigShowcase,
productTags,
productTypes,
productPositions,
platformOrigins,
listLoading: true
}
},
computed: {
...mapGetters(['permissionsSysOriginPlatformAlls', 'permissionsFirstSysOrigin']),
recommendPromptDesc() {
return this.recommendType === 1 ? '同时只能推荐一个产品,该产品被推荐将会取消上一个推荐产品是否继续?' : '是否确定取消推荐产品?'
}
},
mounted() {
this.rowDrop()
},
created() {
const that = this
if (!that.permissionsFirstSysOrigin) {
return
}
that.listQuery.sysOrigin = that.permissionsFirstSysOrigin.value
that.listQuery.platform = that.permissionsFirstSysOrigin.children[0].value
that.sysPlatform = [that.listQuery.sysOrigin, that.listQuery.platform]
that.renderData()
that.productConfigGroupNames.forEach(item => {
that.productConfigGroupNameMap[item.value] = item.name
})
that.productTypes.forEach(item => {
that.productConfigTypeMap[item.value] = item.name
})
},
methods: {
renderData(isClean) {
const that = this
that.listLoading = true
if (isClean === true) {
that.listQuery.cursor = 1
}
that.listQuery.sysOrigin = that.sysPlatform[0]
that.listQuery.platform = that.sysPlatform[1]
getProductConfigPackList(that.listQuery).then(res => {
that.listLoading = false
const { body } = res
that.list = body || []
// that.total = body.total || 0
// that.list = body.records
})
},
getGroupNames(key) {
return this.productConfigGroupNameMap[key]
},
getTypeNames(key) {
return this.productConfigTypeMap[key]
},
handleSearch() {
this.renderData(true)
},
handleCreate() {
this.addGiftPackConfigVisable = true
},
systemConfig(row) {
const that = this
that.giftPackId = row.id
that.giftPackConfigVisable = true
},
handlDel(id) {
const that = this
that.searchLoading = that.listLoading = false
this.$confirm('您确定要删除该产品配置吗?', '温馨提示', {
confirmButtonText: '确定',
cancelButtonText: '取消'
}).then(() => {
delProductConfig(id, that.listQuery.sysOrigin).then(res => {
that.renderData()
that.$opsMessage.success()
}).catch(er => {
})
}).catch(() => {})
},
renderDataSuccess() {
this.$message({
message: 'Successful',
type: 'success'
})
this.renderData()
},
handleRowClick(row) {
this.clickRow = row
},
productRecommendSuccess() {
this.renderData()
this.productRecommendVisible = false
},
convertPositionIndexName(value) {
return convertDescription(value, this.productPositions)
},
rowDrop() {
const that = this
simpleElDropTable((event, type) => {
if (event.newIndex === event.oldIndex) {
return
}
that.list.splice(event.newIndex, 0, that.list.splice(event.oldIndex, 1)[0])
const newArray = that.list.slice(0)
that.list = []
that.$nextTick(function() {
that.list = newArray
})
that.isDrag = true
})
},
handleGroupNameChange(value) {
if (value === 'VIP') {
this.form.showcase = true
}
},
handleSort(allPlatform) {
const that = this
const list = that.list
if (list.length <= 0) {
return
}
const productConfigSorts = []
const size = list.length
for (let index = 0; index < size; index++) {
const data = list[index]
productConfigSorts.push({
id: data.id,
productId: data.productId,
sort: size - index
})
}
that.isDragLoading = true
updateSort({
productConfigSorts,
allPlatform,
sysOrigin: this.listQuery.sysOrigin
}).then(res => {
that.isDragLoading = false
that.isDrag = false
}).catch(er => {
that.isDragLoading = false
console.error('error', er)
})
},
renderDataChage() {
this.renderData(true)
},
handleMouseEnter(row) {
this.thisRow = row
},
giftPackDetails(row) {
this.giftPackDeatilsDrawer = true
},
copyContent(text) {
const that = this
copyText(text).then(() => {
that.$opsMessage.success()
}).catch(er => {
that.$opsMessage.fail()
})
}
}
}
</script>

View File

@ -1,36 +0,0 @@
<template>
<div class="app-container">
<el-tabs v-model="activeName">
<el-tab-pane v-for="item in tables" :key="item.name" :label="item.title" :name="item.component" />
<component :is="activeName" />
</el-tabs>
</div>
</template>
<script>
import ProductPool from './product-pool'
import ProductPlatform from './product-platform'
import GiftPack from './gift-pack'
export default {
name: 'ConfProdcut',
components: { ProductPool, ProductPlatform, GiftPack },
data() {
return {
activeName: 'ProductPool',
tables: [
{
title: '产品池',
component: 'ProductPool'
},
{
title: '平台产品',
component: 'ProductPlatform'
},
{
title: '礼包配置',
component: 'GiftPack'
}
]
}
}
}
</script>

View File

@ -1,131 +0,0 @@
<template>
<div class="edit-package">
<el-drawer
title="关联平台包名"
:visible="true"
:append-to-body="true"
:before-close="handleClose"
:close-on-press-escape="false"
:wrapper-closable="false"
size="450px"
:modal-append-to-body="false"
>
<div v-loading="queryLoading" class="content">
<div class="desc">
<div class="flex-l col">
<div><strong>ID:</strong> {{ row.productId }}</div>
<div><strong>平台:</strong> {{ row.platform }}</div>
<div><strong>单价:</strong> {{ row.unitPrice }}</div>
</div>
</div>
<el-form ref="form" v-loading="submitLoading" :model="form" label-width="80px" style="padding:0px 10px;">
<el-form-item v-for="(item,index) in form.packages" :key="index" :label="item.payPlatform">
<el-input v-model.trim="item.productPackage" placeholder="请输入包名" clearable />
</el-form-item>
<el-form-item>
<el-button type="primary" :loading="submitLoading" @click="submit()">提交</el-button>
</el-form-item>
</el-form>
</div>
</el-drawer>
</div>
</template>
<script>
import { listConfigPackageByCnfId, addOrUpdatePackageBatch } from '@/api/product'
export default {
props: {
row: {
type: Object,
required: true
}
},
data() {
return {
queryLoading: false,
productPackages: [],
submitLoading: false,
form: {
packages: []
},
packageMap: {
'iOS': [
{ id: '', productCnfId: '', productPackage: '', payPlatform: 'Apple' }
],
'Android': [
{ id: '', productCnfId: '', productPackage: '', payPlatform: 'Google' },
{ id: '', productCnfId: '', productPackage: '', payPlatform: 'Huawei' }
]
}
}
},
watch: {
row: {
immediate: true,
handler(newValue) {
if (!newValue) {
return
}
this.form.packages = this.packageMap[this.row.platform]
this.form.packages.forEach(item => {
item.productCnfId = newValue.id
})
this.loadProcutConfigPackage(newValue.id)
}
}
},
methods: {
loadProcutConfigPackage(productCnfId) {
const that = this
that.queryLoading = true
listConfigPackageByCnfId(productCnfId).then(res => {
that.queryLoading = false
that.productPackages = res.body || []
that.form.packages = Object.assign(that.form.packages, that.productPackages)
}).catch(er => {
that.queryLoading = false
})
},
handleClose() {
this.$emit('close')
},
handleClick() {
},
handleBaseInfoSuccess(data) {
this.baseInfo = data
},
submit() {
const that = this
if (that.submitLoading) {
return
}
that.submitLoading = true
addOrUpdatePackageBatch({
sysOrigin: that.row.sysOrigin,
packages: that.form.packages
}).then(res => {
that.submitLoading = false
that.$opsMessage.success()
}).catch(er => {
that.submitLoading = false
that.$opsMessage.fail()
})
}
}
}
</script>
<style scoped lang="scss">
.edit-package {
.content {
.desc {
padding: 0px 20px 30px 30px;
line-height: 30px;
.col > div {
margin-right: 20px;
}
}
}
}
</style>

View File

@ -1,335 +0,0 @@
<template>
<div class="cnf-product-edit">
<el-dialog
:title="title + '('+sysOriginName+')'"
:visible="true"
:modal-append-to-body="true"
:append-to-body="true"
:before-close="handleClose"
:close-on-press-escape="false"
:close-on-click-modal="false"
width="550px"
top="50px"
>
<el-tabs v-model="activeName">
<el-tab-pane v-for="(tabItem, tabIndex) in tabs" :key="tabIndex" :label=" tabItem.title" :name="tabItem.name">
<div v-loading="submitLoading" style="height: 500px;overflow: auto;">
<el-form
:ref="'form_' + tabIndex"
style="width: 400px; margin-left:50px;"
:model="tabItem.form"
:rules="rules"
>
<el-form-item v-if="!isEdit" label="关联产品" prop="productId">
<el-select
v-model="tabItem.form.productPoolIndex"
v-loading="listProductPoolLoading"
placeholder="关联产品"
:disabled="isDisabled"
class="filter-item"
style="width:100%;"
@change="productPoolChange"
>
<el-option
v-for="(item, index) in productPools"
:key="item.id"
:value="index"
:label="item.productDesc+ '-'+ item.unitPrice + '('+item.productId+')'"
/>
</el-select>
</el-form-item>
<!-- <el-form-item v-if="!isEdit" label="关联包名" prop="productPackage">
<el-input v-model.trim="tabItem.form.productPackage" type="text" />
</el-form-item> -->
<el-form-item label="获得金币" prop="obtainCandy">
<el-input v-model.trim="tabItem.form.obtainCandy" :disabled="isDisabled" oninput="value=value.replace(/[^\d^\.]/g,'')" type="text" />
</el-form-item>
<el-form-item label="奖励金币" prop="rewardCandy">
<el-input v-model.trim="tabItem.form.rewardCandy" :disabled="isDisabled" oninput="value=value.replace(/[^\d^\.]/g,'')" type="text" />
</el-form-item>
<el-form-item label="优惠比率" prop="discountRate">
<el-input v-model="tabItem.form.discountRate" v-number :disabled="isDisabled" type="text" />
</el-form-item>
<el-form-item label="状态" prop="showcase">
<el-select
v-model="tabItem.form.showcase"
:disabled="syncAll"
placeholder="状态"
class="filter-item"
style="width:100%;"
>
<el-option
v-for="item in productConfigShowcase"
:key="item.value"
:value="item.value"
:label="item.name"
/>
</el-select>
</el-form-item>
<el-form-item label="标签">
<el-select
v-model="tabItem.form.tags"
:disabled="isDisabled"
clearable
placeholder="标签"
class="filter-item"
style="width:100%;"
>
<el-option
v-for="item in productTags"
:key="item.value"
:value="item.value"
:label="item.name"
/>
</el-select>
</el-form-item>
</el-form>
</div>
</el-tab-pane>
</el-tabs>
<el-tooltip placement="top">
<div slot="content">
<p v-if="isEdit" class="font-danger">修改操作需同步平台不存在不会自动创建</p>
<p v-else>请确认参数无误同步将锁定参数不可输入</p>
</div>
<el-checkbox v-model="syncAll" @click.native.prevent="handleSyncAllClick">同步所有平台</el-checkbox>
</el-tooltip>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm()">保存</el-button>
<el-button @click="handleClose()">取消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { deepClone } from '@/utils'
import { sysOriginPlatforms } from '@/constant/origin'
import { addBatchProductConfigInfo, updateProductConfigInfo, getProductConfigInfo, listProductPool } from '@/api/product'
import { productConfigGroupNames, productConfigShowcase, productTypes, platformOrigins, productTags, productPositions } from '@/constant/type'
function getFormData() {
return {
id: '',
productId: '',
productPoolIndex: '',
productPackage: '',
productType: '',
description: '',
groupName: '',
unitPrice: '',
obtainCandy: '',
rewardCandy: '',
platform: 'iOS',
sort: '0',
discountRate: '',
showcase: true,
checkProperty: false,
tags: ''
}
}
export default {
name: 'CnfProductEdit',
props: {
sysOrigin: {
type: String,
required: true
},
platform: {
type: String,
required: true
},
editId: {
type: String,
required: false,
default: null
}
},
data() {
var commonRequiredParams = [{ required: true, message: '必填参数不可为空', trigger: 'blur' }]
return {
productPools: [],
title: '添加',
tabs: [],
productPositions,
productTags,
platformOrigins,
productConfigShowcase,
productConfigGroupNames,
productTypes,
syncAll: false,
activeName: 'iOS',
form: getFormData(),
submitLoading: false,
rules: {
productId: commonRequiredParams,
productPackage: commonRequiredParams,
productType: commonRequiredParams,
description: commonRequiredParams,
groupName: commonRequiredParams,
unitPrice: commonRequiredParams,
obtainCandy: commonRequiredParams,
rewardCandy: commonRequiredParams,
platform: commonRequiredParams,
sort: commonRequiredParams,
discountRate: commonRequiredParams,
showcase: commonRequiredParams,
positionIndex: commonRequiredParams
},
sysOriginPlatformMap: {},
sysOriginName: ''
}
},
computed: {
isEdit() {
return this.editId && this.editId.length > 0
},
isDisabled() {
return this.syncAll && !this.isEdit
}
},
watch: {
platform: {
handler(newVal) {
this.activeName = newVal
this.addTab(newVal, getFormData())
},
immediate: true
},
editId: {
handler(newVal) {
if (newVal) {
this.title = '修改'
this.submitLoading = true
getProductConfigInfo(newVal).then(res => {
this.submitLoading = false
this.tabs[0].form = res.body
}).catch(er => {
this.submitLoading = false
})
return
}
this.title = '添加'
},
immediate: true
}
},
created() {
const that = this
sysOriginPlatforms.forEach(item => {
that.sysOriginPlatformMap[item.value] = item
})
that.sysOriginName = that.sysOriginPlatformMap[that.sysOrigin].label
that.listProductPoolLoading = true
listProductPool().then(res => {
that.listProductPoolLoading = false
const { body } = res
that.productPools = body || []
}).catch(er => {
that.listProductPoolLoading = false
})
},
methods: {
addTab(platform, form) {
form.productPackage = ''
form.platform = platform
this.tabs.push({
title: platform,
name: platform,
form
})
},
handleClose() {
this.$emit('close')
},
handleSyncAllClick() {
if (this.tabs.length === 1) {
this.$refs['form_0'][0].validate(valid => {
if (valid) {
if (!this.isEdit) {
this.syncAll = true
this.addTab(this.allPlatform(), deepClone(this.tabs[0].form))
return
}
this.syncAll = !this.syncAll
return
}
this.syncAll = false
})
return
}
this.syncAll = !this.syncAll
this.tabs = this.tabs.slice(0, 1)
this.activeName = this.platform
},
allPlatform() {
return this.platform === 'iOS' ? 'Android' : 'iOS'
},
handleGroupNameChange(value) {
if (value === 'VIP') {
this.form.showcase = true
}
},
getSubmitParams() {
return this.tabs.map(item => item.form)
},
submitForm() {
const that = this
let index = 0
let checkParamPass = true
for (const key in that.$refs) {
if (that.$refs[key] && that.$refs[key].length > 0) {
that.$refs[key][0].validate(valid => {
if (!valid) {
checkParamPass = false
that.activeName = that.tabs[index].name
return
}
})
++index
}
}
if (checkParamPass === true) {
if (!that.editId) {
addBatchProductConfigInfo({
sysOrigin: that.sysOrigin,
configs: that.getSubmitParams()
}).then(res => {
that.submitLoading = false
that.handleClose()
that.$emit('success')
}).catch(er => {
that.submitLoading = false
console.error(er)
that.$emit('fail')
})
return
}
updateProductConfigInfo({ sysProductConfig: that.tabs[0].form, sync: that.syncAll }).then(res => {
that.submitLoading = false
that.handleClose()
that.$emit('success')
}).catch(er => {
that.submitLoading = false
console.error(er)
that.$emit('fail')
})
}
return
},
productPoolChange(value) {
const firstForm = this.tabs[0].form
var item = this.productPools[value]
firstForm.sysOrigin = this.sysOrigin
firstForm.productId = item.productId
firstForm.productType = item.productType
firstForm.description = item.productDesc
firstForm.groupName = item.groupName
firstForm.unitPrice = item.unitPrice
}
}
}
</script>

View File

@ -1,502 +0,0 @@
<template>
<div class="app-container-product-platform">
<div class="filter-container">
<el-cascader
v-model="sysPlatform"
class="filter-item"
:options="permissionsSysOriginPlatformAlls"
@change="changeSysOriginPlatform"
/>
<el-select
v-model="listQuery.payPlatform"
placeholder="支付平台"
style="width: 120px"
class="filter-item"
@change="renderDataChage"
>
<el-option
v-for="item in payPlatform[listQuery.platform]"
:key="item.value"
:label="item.name"
:value="item.value"
/>
</el-select>
<el-select
v-model="listQuery.groupName"
placeholder="分组名称"
style="width: 120px"
class="filter-item"
@change="renderDataChage"
>
<el-option
v-for="item in productConfigGroupNames"
:key="item.value"
:label="item.name"
:value="item.value"
/>
</el-select>
<el-select
v-model="listQuery.showcase"
placeholder="状态"
style="width: 120px"
class="filter-item"
@change="renderDataChage"
>
<el-option
v-for="item in productConfigShowcase"
:key="item.value"
:label="item.name"
:value="item.value"
/>
</el-select>
<el-select
v-model="listQuery.productType"
placeholder="产品类型"
clearable
style="width: 120px"
class="filter-item"
@change="renderDataChage"
>
<el-option
v-for="item in productTypes"
:key="item.value"
:label="item.name"
:value="item.value"
/>
</el-select>
<el-input
v-model.trim="listQuery.productId"
placeholder="产品ID"
style="width: 200px;"
class="filter-item"
/>
<el-input
v-model.trim="listQuery.productPackage"
placeholder="产品包名"
style="width: 200px;"
class="filter-item"
/>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleSearch"
>
搜索
</el-button>
<el-button
class="filter-item"
type="primary"
icon="el-icon-edit"
@click="handleCreate"
>
添加
</el-button>
<el-dropdown v-if="isDrag" v-loading="isDragLoading" class="filter-item">
<el-button type="danger">
保存排序<i class="el-icon-arrow-down el-icon--right" />
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="handleSort(false)">仅当前平台</el-dropdown-item>
<el-dropdown-item @click.native="handleSort(true)">同步所有平台</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
fit
highlight-current-row
>
<el-table-column
v-for="(item, index) in col"
:id="item.id"
:key="`col_${index}`"
:prop="item.prop"
:label="item.label"
align="center"
:width="item.width"
>
<template slot-scope="scope">
<div v-if="index === 0 && scope.row.recommend === true" class="seal-block seal-danger">推荐</div>
<div v-if="item.prop === 'productId'">
<el-link @click="copyContent(scope.row.productId)">{{ scope.row.productId }}</el-link>
</div>
<div v-else-if="item.prop === 'productType'">
<el-link @click="copyContent(scope.row.productType)">{{ getTypeNames(scope.row.productType) }}</el-link>
</div>
<div v-else-if="item.prop === 'productPackage'">
<el-link @click="copyContent(scope.row.productPackage)">{{ scope.row.productPackage }}</el-link>
</div>
<div v-else-if="item.prop === 'groupName'">
{{ getGroupNames(scope.row.groupName) }}
</div>
<div v-else-if="item.prop === 'showcase'">
<span v-if="scope.row.showcase === false">下架</span>
<span v-if="scope.row.showcase === true">上架</span>
</div>
<div v-else>{{ scope.row[item.prop] }}</div>
<div v-if="item.prop === 'operation'">
<el-button type="text" @click.native="handleUpdate(scope.row)">编辑</el-button>
<el-dropdown>
<span class="el-dropdown-link">
更多
</span>
<el-dropdown-menu slot="dropdown">
<!-- <el-dropdown-item @click.native="handleRecommend(scope.row)">
<span v-if="scope.row.groupName === 'CANDY'">{{ scope.row.recommend === true ? '取消推荐' : '推荐' }} </span>
<span v-else-if="scope.row.groupName === 'VIP'">推荐</span>
</el-dropdown-item> -->
<el-dropdown-item v-if="scope.row.showcase === false" @click.native="handlDel(scope.row, false)">删除</el-dropdown-item>
<el-dropdown-item v-if="scope.row.showcase === false" @click.native="handlDel(scope.row, true)">同步删除</el-dropdown-item>
<el-dropdown-item @click.native="handleEdit(scope.row)">修改包名</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</template>
</el-table-column>
</el-table>
<cnf-product-edit
v-if="cnfProductVisible"
:platform="listQuery.platform"
:sys-origin="listQuery.sysOrigin"
:edit-id="editId"
@close="cnfProductVisible = false; editId='';"
@success="renderData()"
/>
<product-recommend
v-if="productRecommendVisible"
:id="recommendId"
:product-id="recommendProductId"
:platform="listQuery.platform"
:sys-origin="listQuery.sysOrigin"
:product-type="recommendProductType"
:type="recommendType"
:prompt="recommendPromptDesc"
@success="productRecommendSuccess"
@close="productRecommendVisible=false;recommendId='';recommendProductId='';recommendType=1;recommendProductType=''"
/>
<edit-package
v-if="editPackageVisible"
:row="clickRow"
@close="editPackageVisible=false"
/>
</div>
</template>
<script>
// delByProductId
import { getProductConfigList, delProductConfig, updateSort } from '@/api/product'
import { productConfigGroupNames, productConfigShowcase, productTypes, platformOrigins, productTags, productPositions } from '@/constant/type'
import ProductRecommend from './recommend'
import { convertDescription } from '@/utils'
import { simpleElDropTable } from '@/utils/drop-table'
import CnfProductEdit from './edit'
import { copyText } from '@/utils'
import { mapGetters } from 'vuex'
import EditPackage from './edit-package'
export default {
name: 'ProductPlatform',
components: { ProductRecommend, CnfProductEdit, EditPackage },
data() {
return {
editPackageVisible: false,
payPlatform: {
'iOS': [
{ value: 'Apple', name: 'Apple' }
],
'Android': [
{ value: 'Google', name: 'Google' },
{ value: 'Huawei', name: 'Huawei' }
]
},
sysPlatform: [],
editId: '',
cnfProductVisible: false,
isDragLoading: false,
isDrag: false,
col: [
{
label: '产品id',
prop: 'productId'
},
{
label: '描述',
prop: 'description'
},
{
label: '包名',
prop: 'productPackage'
},
{
label: '产品单价',
prop: 'unitPrice',
width: '80px'
},
{
label: '获得糖果数量',
prop: 'obtainCandy'
},
{
label: '分组',
prop: 'groupName'
},
{
label: '区域',
prop: 'regionName',
width: '80px'
},
{
label: '产品类型',
prop: 'productType'
},
{
label: '平台',
prop: 'platform',
width: '80px'
},
{
label: '优惠比率',
prop: 'discountRate'
},
{
label: '标签',
prop: 'tags'
},
{
label: '状态',
prop: 'showcase'
},
{
label: '序号',
prop: 'sort',
width: '50px'
},
{
label: '创建时间',
prop: 'createTime',
width: '180px'
},
{
label: '操作',
prop: 'operation'
}
],
recommendType: 1,
recommendId: '',
recommendProductId: '',
recommendProductType: '',
productRecommendVisible: false,
clickRow: {},
list: [],
people: 0,
listQuery: {
productId: '',
groupName: 'CANDY',
showcase: true,
productType: '',
sysOrigin: '',
platform: '',
payPlatform: 'Apple',
productPackage: '',
region: ''
},
productConfigGroupNameMap: {},
productConfigTypeMap: {},
productConfigGroupNames,
productConfigShowcase,
productTags,
productTypes,
productPositions,
platformOrigins,
listLoading: true,
sysOriginPlatforms: []
}
},
computed: {
...mapGetters(['permissionsSysOriginPlatformAlls', 'permissionsFirstSysOrigin']),
recommendPromptDesc() {
return this.recommendType === 1 ? '同时只能推荐一个产品,该产品被推荐将会取消上一个推荐产品是否继续?' : '是否确定取消推荐产品?'
}
},
mounted() {
this.rowDrop()
},
created() {
const that = this
if (!that.permissionsFirstSysOrigin) {
return
}
that.listQuery.sysOrigin = that.permissionsFirstSysOrigin.value
that.listQuery.platform = that.permissionsFirstSysOrigin.children[0].value
that.sysPlatform = [that.listQuery.sysOrigin, that.listQuery.platform]
that.renderData(true)
that.productConfigGroupNames.forEach(item => {
that.productConfigGroupNameMap[item.value] = item.name
})
that.productTypes.forEach(item => {
that.productConfigTypeMap[item.value] = item.name
})
},
methods: {
renderData(isClean) {
const that = this
that.listLoading = true
if (isClean === true) {
that.listQuery.cursor = 1
}
that.listQuery.sysOrigin = that.sysPlatform[0]
that.listQuery.platform = that.sysPlatform[1]
getProductConfigList(that.listQuery).then(res => {
that.listLoading = false
const { body } = res
that.list = body || []
// that.total = body.total || 0
// that.list = body.records
})
},
getGroupNames(key) {
return this.productConfigGroupNameMap[key]
},
getTypeNames(key) {
return this.productConfigTypeMap[key]
},
handleSearch() {
this.renderData(true)
},
handleCreate() {
this.cnfProductVisible = true
},
handleUpdate(row) {
this.editId = row.id
this.cnfProductVisible = true
},
handleEdit(item) {
const that = this
that.editPackageVisible = true
that.clickRow = item
},
handlDel(row, sysncDel) {
const that = this
that.searchLoading = that.listLoading = false
const tipsText = sysncDel ? '同步删除所有,将会删除所有与当前产品关联项, 您确定要删除吗?' : '将会删除所有与当前产品关联项, 您确定要删除吗?'
this.$confirm(tipsText, '温馨提示', {
confirmButtonText: '确定',
cancelButtonText: '取消'
}).then(() => {
delProductConfig({ id: row.id, sysOrigin: that.listQuery.sysOrigin, groupName: row.groupName, productId: sysncDel ? row.productId : '' }).then(res => {
that.renderData()
that.$opsMessage.success()
}).catch(er => {
})
}).catch(() => {})
},
renderDataSuccess() {
this.$message({
message: 'Successful',
type: 'success'
})
this.renderData()
},
handleRowClick(row) {
this.clickRow = row
},
handleRecommend(row) {
const that = this
that.productRecommendVisible = true
that.recommendId = row.id
that.recommendProductId = row.productId
that.recommendProductType = row.productType
if (row.groupName === 'CANDY') {
that.recommendType = row.recommend === true ? 2 : 1
} else if (row.groupName === 'VIP') {
that.recommendType = 1
}
},
productRecommendSuccess() {
this.renderData()
this.productRecommendVisible = false
},
convertPositionIndexName(value) {
return convertDescription(value, this.productPositions)
},
rowDrop() {
const that = this
simpleElDropTable((event, type) => {
if (event.newIndex === event.oldIndex) {
return
}
that.list.splice(event.newIndex, 0, that.list.splice(event.oldIndex, 1)[0])
const newArray = that.list.slice(0)
that.list = []
that.$nextTick(function() {
that.list = newArray
})
that.isDrag = true
})
},
handleGroupNameChange(value) {
if (value === 'VIP') {
this.form.showcase = true
}
},
handleSort(allPlatform) {
const that = this
const list = that.list
if (list.length <= 0) {
return
}
const productConfigSorts = []
const size = list.length
for (let index = 0; index < size; index++) {
const data = list[index]
productConfigSorts.push({
id: data.id,
productId: data.productId,
sort: size - index
})
}
that.isDragLoading = true
updateSort({
productConfigSorts,
allPlatform,
sysOrigin: this.listQuery.sysOrigin
}).then(res => {
that.isDragLoading = false
that.isDrag = false
}).catch(er => {
that.isDragLoading = false
console.error('error', er)
})
},
changeSysOriginPlatform(val) {
this.listQuery.payPlatform = this.payPlatform[val[val.length - 1]][0].value
this.renderDataChage()
},
renderDataChage() {
this.renderData(true)
},
copyContent(text) {
const that = this
copyText(text).then(() => {
that.$opsMessage.success()
}).catch(er => {
that.$opsMessage.fail()
})
}
}
}
</script>

View File

@ -1,148 +0,0 @@
<template>
<el-dialog
title="提示"
:visible="true"
:modal-append-to-body="true"
:append-to-body="true"
width="500px"
:before-close="handleClose"
>
<div>{{ prompt }}</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="handleClose">取消</el-button>
<el-dropdown v-if="isRecommend" size="small">
<el-button size="small" type="primary" :disabled="!id || !productId" :loading="submitLoading">
推荐操作<i class="el-icon-arrow-down el-icon--right" />
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="handleCurrentPlatform()">仅当前平台</el-dropdown-item>
<el-dropdown-item @click.native="handleAllPlatform()">同步所有平台</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-dropdown v-if="isCancelRecommend" size="small">
<el-button size="small" type="primary" :disabled="!platform" :loading="submitLoading">
推荐操作<i class="el-icon-arrow-down el-icon--right" />
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="handleCancelRecommend(false)">仅当前平台</el-dropdown-item>
<el-dropdown-item @click.native="handleCancelRecommend(true)">同步所有平台</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</span>
</el-dialog>
</template>
<script>
import { singleRecommend, syncAllRecommend, cancelRecommend } from '@/api/product'
export default {
name: 'ProductRecommend',
props: {
// 1. 2.
type: {
type: Number,
require: true,
default: 1
},
prompt: {
type: String,
require: true,
default: ''
},
id: {
type: String,
require: true,
default: ''
},
productId: {
type: String,
require: true,
default: ''
},
platform: {
type: String,
require: true,
default: ''
},
sysOrigin: {
type: String,
required: true
},
productType: {
type: String,
required: true
}
},
data() {
return {
submitLoading: false
}
},
computed: {
isRecommend() {
return this.type === 1
},
isCancelRecommend() {
return this.type === 2
}
},
created() {
},
methods: {
handleClose() {
this.$emit('close')
},
handleCurrentPlatform() {
const that = this
that.submitLoading = true
singleRecommend({
id: that.id,
platform: that.platform,
productId: that.productId,
sysOrigin: that.sysOrigin,
productType: that.productType
}).then(res => {
that.submitLoading = false
that.$emit('success', 'singleRecommend')
}).catch(er => {
console.error(er)
that.submitLoading = false
that.$emit('fail', 'singleRecommend')
})
},
handleAllPlatform() {
const that = this
that.submitLoading = true
syncAllRecommend({
productId: that.productId,
sysOrigin: that.sysOrigin,
productType: that.productType
}).then(res => {
that.submitLoading = false
that.$emit('success', 'syncAllRecommend')
}).catch(er => {
console.error(er)
that.submitLoading = false
that.$emit('fail', 'syncAllRecommend')
})
},
handleCancelRecommend(syncAll) {
const that = this
that.submitLoading = true
cancelRecommend({
platform: that.platform,
syncAll,
productId: that.productId,
sysOrigin: that.sysOrigin,
productType: that.productType
}).then(res => {
that.submitLoading = false
that.$emit('success', 'cancelRecommendAll')
}).catch(er => {
that.submitLoading = false
that.$emit('fail', 'cancelRecommendAll')
})
}
}
}
</script>

View File

@ -1,129 +0,0 @@
<template>
<div class="cnf-product-edit">
<el-dialog
title="添加产品配置"
:visible="true"
:modal-append-to-body="true"
:append-to-body="true"
:before-close="handleClose"
:close-on-press-escape="false"
:close-on-click-modal="false"
width="550px"
top="50px"
>
<div v-loading="submitLoading" style="height: 500px;overflow: auto;">
<el-form
ref="form"
style="width: 400px; margin-left:50px;"
:model="form"
:rules="rules"
>
<el-form-item label="CODE" prop="productId">
<el-input v-model.trim="form.productId" type="text" />
</el-form-item>
<el-form-item label="描述" prop="productDesc">
<el-input v-model.trim="form.productDesc" placeholder="请输入产品描述" />
</el-form-item>
<el-form-item label="分组" prop="groupName">
<el-select
v-model="form.groupName"
placeholder="分组名称"
class="filter-item"
style="width:100%;"
>
<el-option
v-for="item in productConfigGroupNames"
:key="item.value"
:value="item.value"
:label="item.name"
/>
</el-select>
</el-form-item>
<el-form-item label="产品类型" prop="productType">
<el-select
v-model="form.productType"
placeholder="产品类型"
class="filter-item"
style="width:100%;"
>
<el-option
v-for="item in productTypes"
:key="item.value"
:value="item.value"
:label="item.name"
/>
</el-select>
<el-form-item label="产品单价" prop="unitPrice">
<el-input v-model.trim="form.unitPrice" oninput="value=value.replace(/[^\d^\.]/g,'')" type="text" />
</el-form-item>
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm()">保存</el-button>
<el-button @click="handleClose()">取消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { addProductPool } from '@/api/product'
import { productConfigGroupNames, productTypes } from '@/constant/type'
export default {
name: 'CnfProductPoolEdit',
data() {
var commonRequiredParams = [{ required: true, message: '必填参数不可为空', trigger: 'blur' }]
return {
productConfigGroupNames,
productTypes,
form: {
id: '',
productId: '',
productDesc: '',
unitPrice: '',
groupName: '',
productType: ''
},
submitLoading: false,
rules: {
productId: commonRequiredParams,
productType: commonRequiredParams,
productDesc: commonRequiredParams,
groupName: commonRequiredParams,
unitPrice: commonRequiredParams
}
}
},
created() {
},
methods: {
handleClose() {
this.$emit('close')
},
submitForm() {
const that = this
that.$refs.form.validate(valid => {
if (!valid) {
console.error('submit error!')
return
}
that.submitLoading = true
addProductPool(that.form).then(res => {
that.submitLoading = false
that.handleClose()
that.$emit('success')
}).catch(er => {
that.submitLoading = false
console.error(er)
that.$emit('fail')
})
})
return
}
}
}
</script>

View File

@ -1,178 +0,0 @@
<template>
<div class="app-container-product-pool">
<div class="filter-container">
<el-input
v-model.trim="listQuery.productId"
placeholder="产品ID"
style="width: 200px;"
class="filter-item"
/>
<el-select
v-model="listQuery.groupName"
clearable
placeholder="分组名称"
style="width: 120px"
class="filter-item"
>
<el-option
v-for="item in productConfigGroupNames"
:key="item.value"
:label="item.name"
:value="item.value"
/>
</el-select>
<el-select
v-model="listQuery.productType"
placeholder="产品类型"
clearable
style="width: 120px"
class="filter-item"
>
<el-option
v-for="item in productTypes"
:key="item.value"
:label="item.name"
:value="item.value"
/>
</el-select>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleSearch"
>
搜索
</el-button>
<el-button
class="filter-item"
type="primary"
icon="el-icon-edit"
@click="handleCreate"
>
添加
</el-button>
</div>
<el-alert
title="注意"
type="warning"
:closable="false"
>
产品创建后不可修改变更可选择删除创建新的产品如果产品被其他平台引用需要删除关联后才可移除产品池
</el-alert>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
fit
highlight-current-row
@cell-mouse-enter="handleMouseEnter"
>
<el-table-column label="产品id" prop="productId" align="center" />
<el-table-column label="描述" prop="productDesc" align="center" />
<el-table-column label="分组" prop="groupName" align="center" width="100" />
<el-table-column label="单价" prop="unitPrice" align="center" width="100" />
<el-table-column prop="createTime" width="200" label="创建时间" align="center">
<template slot-scope="scope">
{{ scope.row.createTime | dateFormat }}
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" align="center" width="100">
<template slot-scope="scope">
<div class="operation">
<el-button type="text" @click.native="handlDel(scope.row.productId)">删除</el-button>
<!-- <el-dropdown>
<span class="el-dropdown-link">
更多
</span>
<el-dropdown-menu slot="dropdown">
</el-dropdown-menu>
</el-dropdown> -->
</div>
</template>
</el-table-column>
</el-table>
<cnf-product-pool-edit
v-if="cnfProductPoolVisible"
:edit-id="thisRow.id"
@close="cnfProductPoolVisible = false;"
@success="renderData()"
/>
</div>
</template>
<script>
import { listProductPool, delProductPool } from '@/api/product'
import { productConfigGroupNames, productTypes, platformOrigins, productTags, productPositions } from '@/constant/type'
import CnfProductPoolEdit from './edit'
export default {
name: 'ProductPool',
components: { CnfProductPoolEdit },
data() {
return {
thisRow: {},
cnfProductPoolVisible: false,
clickRow: {},
list: [],
listQuery: {
productId: '',
groupName: '',
showcase: true,
productType: ''
},
productConfigGroupNameMap: {},
productConfigTypeMap: {},
productConfigGroupNames,
productTags,
productTypes,
productPositions,
platformOrigins,
listLoading: true
}
},
created() {
const that = this
that.renderData()
},
methods: {
renderData() {
const that = this
that.listLoading = true
listProductPool(that.listQuery).then(res => {
that.listLoading = false
const { body } = res
that.list = body || []
})
},
handleSearch() {
this.renderData()
},
handleCreate() {
this.cnfProductPoolVisible = true
},
handlDel(productId) {
const that = this
that.searchLoading = that.listLoading = false
this.$confirm('您确定要删除该产品配置吗?', '温馨提示', {
confirmButtonText: '确定',
cancelButtonText: '取消'
}).then(() => {
delProductPool(productId).then(res => {
that.renderData()
that.$opsMessage.success()
}).catch(er => {
})
}).catch(() => {})
},
handleMouseEnter(row) {
this.thisRow = row
}
}
}
</script>

View File

@ -1,186 +0,0 @@
<template>
<div class="daily-currency-charts" :data-language="language">
<el-select v-model="typeValue" :placeholder="$t('pages.dashboard.shared.select')" size="mini" @change="typeValueChange">
<el-option
v-for="item in types"
:key="item.value"
:label="item.name"
:value="item.value"
/>
</el-select>
<div id="barCharts" ref="barCharts" :style="'width: 100%;height:' + height + ';'" />
</div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
props: {
height: {
type: String,
default: '600px'
},
chartsData: {
type: Array,
default: () => []
}
},
data() {
return {
dateNumber: '',
typeValue: 0,
barCharts: null,
groupChartsData: {
income: [],
expenditure: []
}
}
},
computed: {
...mapGetters(['language']),
types() {
const language = this.language
return [
{ value: 0, name: this.$t('pages.dashboard.shared.income') },
{ value: 1, name: this.$t('pages.dashboard.shared.expenditure') }
]
}
},
watch: {
chartsData: {
handler() {
this.groupChartsData = this.groupChartsDataByType()
this.$nextTick(() => {
this.renderCharts()
})
},
immediate: true
},
language() {
this.$nextTick(() => {
this.renderCharts()
})
}
},
mounted() {
this.barCharts = this.$echarts.init(this.$refs.barCharts)
this.renderCharts()
window.addEventListener('resize', () => {
this.barCharts.resize()
})
},
methods: {
groupChartsDataByType() {
const obj = {
income: [],
expenditure: []
}
if (this.chartsData.length > 0) {
this.chartsData.forEach(item => {
if (item.type === 0) {
obj.income.push(item)
}
if (item.type === 1) {
obj.expenditure.push(item)
}
})
}
return obj
},
getBarData(list) {
const dataKeys = []
const dataList = []
if (!list || list.length === 0) {
return { keys: dataKeys, data: dataList }
}
const size = list.length - 1
for (let index = size; index >= 0; index--) {
const item = list[index]
dataKeys.push(item.originName)
dataList.push({
groupId: item.originName,
name: item.originName,
value: item.quantity,
itemStyle: {
color: this.getRandomColor()
}
})
}
return { keys: dataKeys, data: dataList }
},
renderCharts() {
if (!this.barCharts) {
return
}
const barData = this.getBarData(this.typeValue === 0 ? this.groupChartsData.income : this.groupChartsData.expenditure)
this.barCharts.setOption({
color: ['#66b3ff', '#ce90e8', '#ff9c6e', '#5cdbd3'],
tooltip: {
trigger: 'axis',
backgroundColor: 'rgba(50,50,50,0.5)',
axisPointer: {
type: 'cross',
label: {
lineStyle: { color: '#009688' },
crossStyle: { color: '#008acd' },
shadowStyle: { color: 'rgba(200,200,200,0.2)' }
}
}
},
grid: {
x: 20,
y: 50,
x2: 20,
y2: 0,
containLabel: true,
borderColor: '#eee'
},
xAxis: [{
show: false
}],
yAxis: [{
type: 'category',
data: barData.keys,
splitLine: { lineStyle: { color: ['#eee'] }},
axisLine: { lineStyle: { color: '#b7bdc7' }},
axisLabel: {
interval: 0,
rotate: 38,
width: 15,
overflow: 'truncate',
ellipsis: '...',
formatter(value) {
return value.length > 10 ? value.substring(0, 10) + '...' : value
}
}
}],
legend: {
y: 10,
textStyle: { color: '#8e929b' }
},
series: {
type: 'bar',
label: {
show: true,
position: 'right',
valueAnimation: true
},
data: barData.data
}
}, true)
},
getRandomColor() {
const r = Math.floor(Math.random() * 255)
const g = Math.floor(Math.random() * 255)
const b = Math.floor(Math.random() * 255)
return 'rgba(' + r + ',' + g + ',' + b + ',0.8)'
},
typeValueChange() {
this.$nextTick(() => {
this.renderCharts()
})
}
}
}
</script>

View File

@ -1,145 +0,0 @@
<template>
<div class="online-hourly-user-charts">
<div id="videoUserCharts" ref="videoUserCharts" style="width: 100%;height: 4.7rem;" />
</div>
</template>
<script>
import { formatDate } from '@/utils'
import { getVideoUsageRateTimeCharts } from '@/api/statistics'
export default {
name: 'OnlineHourlyUserCharts',
props: {
timeOutSecond: {
type: Number,
required: false,
default: 60 * 5
}
},
data() {
const now = Date.now()
return {
listLoading: true,
listQuery: {
year: formatDate(now, 'yyyy'),
month: formatDate(now, 'MM'),
day: formatDate(now, 'dd')
},
rangeDate: formatDate(now, 'yyyy-MM-dd'),
list: [],
videoRealTimeUserCharts: null,
pickerOptions: {
disabledDate(time) {
return time.getTime() > now
}
}
}
},
created() {
const that = this
that.renderData()
var intervalIndex = setInterval(() => {
that.renderData()
}, that.timeOutSecond * 1000)
that.$store.dispatch('app/pushRunTask', intervalIndex)
},
mounted() {
const that = this
that.videoRealTimeUserCharts = that.$echarts.init(that.$refs.videoUserCharts)
window.onresize = function() {
that.videoRealTimeUserCharts.resize()
}
},
methods: {
renderData() {
const that = this
that.listLoading = true
getVideoUsageRateTimeCharts(that.listQuery).then(res => {
const { body } = res
that.list = body
that.renderCharts()
that.listLoading = false
})
},
handleSearch() {
this.renderData()
},
renderCharts() {
const that = this
// const lastIndex = that.list.length > 8 ? that.list.length - 8 : 0
const matchSizeSeries = []
// const matchUserSeries = []
that.list.forEach((item, index) => {
// if (index < lastIndex) {
// return
// }
const date = formatDate(item.minTime, 'yyyy-MM-dd HH:mm')
const matchSize = item.matchSize || 0
matchSizeSeries.push([date, matchSize])
// const matchUserSize = item.matchUserSize || 0
// matchUserSeries.push([date, matchUserSize])
})
that.renderVideoRealTimeUserCharts({ matchSizeSeries })
},
renderVideoRealTimeUserCharts({ matchSizeSeries }) {
const that = this
that.videoRealTimeUserCharts.setOption({
color: ['#6450F9'],
tooltip: {
trigger: 'axis'
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true,
borderColor: '#eee'
},
xAxis: [
{
type: 'category',
axisLabel: {
rotate: 38,
formatter: function(value) {
return formatDate(value, 'HH')
}
},
axisLine: {
lineStyle: {
color: '#fff'
}
},
splitLine: { lineStyle: { color: ['#eee'] }}
}
],
yAxis: [{
type: 'value',
axisTick: { show: true, length: 0 },
splitNumber: 5,
splitLine: { lineStyle: { color: ['#eee'] }},
axisLine: {
lineStyle: {
color: '#fff'
}
}
}],
legend: {
show: false,
textStyle: { color: '#8e929b' }
},
series: [
{
name: '用户量',
type: 'bar',
barWidth: 8,
data: matchSizeSeries
}]
}, true)
}
}
}
</script>

View File

@ -1,100 +0,0 @@
<template>
<div class="online-user-counts">
<el-row>
<el-col class="count" :span="6">
<div class="title">总人数</div>
<div><countTo :start-val="0" :end-val="userTotal" :duration="3000" /></div>
</el-col>
<el-col class="count" :span="6">
<div class="title">女生</div>
<div><countTo :start-val="0" :end-val="femaleUserCount" :duration="3000" /></div>
</el-col>
<el-col class="count" :span="6">
<div class="title">男生</div>
<div><countTo :start-val="0" :end-val="maleUserCount" :duration="3000" /></div>
</el-col>
<el-col class="count" :span="6">
<div class="title">主播</div>
<div><countTo :start-val="0" :end-val="anchorCount" :duration="3000" /></div>
</el-col>
<!-- <el-col class="count" :span="4">-->
<!-- <div class="title">会员</div>-->
<!-- <div><countTo :start-val="0" :end-val="vipCount" :duration="3000" /></div>-->
<!-- </el-col>-->
<!-- <el-col class="count" :span="4">-->
<!-- <div class="title">PLUS</div>-->
<!-- <div><countTo :start-val="0" :end-val="plusCount" :duration="3000" /></div>-->
<!-- </el-col>-->
</el-row>
</div>
</template>
<script>
import { onlineUserCount } from '@/api/datav'
export default {
name: 'OnlineUserCount',
props: {
timeOutSecond: {
type: Number,
required: false,
default: 30
}
},
data() {
return {
userTotal: 0,
plusCount: 0,
vipCount: 0,
femaleUserCount: 0,
anchorCount: 0,
maleUserCount: 0
}
},
created() {
const that = this
that.loadData()
var intervalIndex = setInterval(() => {
that.loadData()
}, that.timeOutSecond * 1000)
that.$store.dispatch('app/pushRunTask', intervalIndex)
},
methods: {
loadData() {
const that = this
onlineUserCount().then(res => {
that.userTotal = res.body || 0
}).catch(er => {})
onlineUserCount({ gender: 0 }).then(res => {
that.femaleUserCount = res.body || 0
}).catch(er => {})
onlineUserCount({ gender: 0, anchor: true }).then(res => {
that.anchorCount = res.body || 0
}).catch(er => {})
onlineUserCount({ gender: 1 }).then(res => {
that.maleUserCount = res.body || 0
}).catch(er => {})
onlineUserCount({ gender: 1, candy: true }).then(res => {
that.plusCount = res.body || 0
}).catch(er => {})
onlineUserCount({ gender: 1, vip: true }).then(res => {
that.vipCount = res.body || 0
}).catch(er => {})
}
}
}
</script>
<style scoped lang="scss">
.online-user-counts {
.count {
text-align: center;
line-height: .6rem;
font-size: 0.4rem;
padding-bottom: .2rem;
}
}
</style>

View File

@ -1,220 +0,0 @@
<template>
<div>
<div class="filter-container">
<el-select
v-model="listQuery.sysOrigin"
placeholder="归属系统"
style="width: 120px"
class="filter-item"
@change="handleSearch"
>
<el-option
v-for="(item, index) in permissionsSysOriginPlatforms"
:key="index"
:label="item.label"
:value="item.value"
>
<span style="float: left;"> <sys-origin-icon :icon="item.value" :desc="item.value" /></span>
<span style="float: left;margin-left:10px">{{ item.label }}</span>
</el-option>
</el-select>
<div class="filter-item">
<div><account-input v-model="listQuery.userId" :sys-origin="listQuery.sysOrigin" :query-details="true" placeholder="用户id" type="USER" /></div>
</div>
<div class="filter-item">
<el-date-picker
v-model="rangeDate"
value-format="timestamp"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
/>
</div>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleSearch"
>
搜索
</el-button>
</div>
<div class="app-container-egg">
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
fit
:default-sort="{prop: 'date', order: 'descending'}"
highlight-current-row
@sort-change="handleSortChange"
>
<el-table-column label="序号" prop="round" sortable align="center" min-width="80">
<template slot-scope="scope">
{{ scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column label="游戏轮数" prop="round" sortable align="center" min-width="120" />
<el-table-column label="下注用户" sortable prop="userProfile" align="center">
<template slot-scope="scope">
<user-table-exhibit :user-profile="scope.row.userProfile" :query-details="true" :tag-name="scope.row.backOperationName" />
</template>
</el-table-column>
<el-table-column label="最后下注时间" sortable prop="lastBetTime" align="center">
<template slot-scope="scope">
{{ scope.row.lastBetTime | dateFormat }}
</template>
</el-table-column>
<el-table-column label="下注选项" sortable prop="betPrize" align="center" />
<el-table-column label="下注金额" sortable prop="betAmount" align="center" />
<el-table-column label="本轮开奖选项" sortable prop="lotteryPrize" align="center" />
<el-table-column label="获得奖励" sortable prop="awards" align="center" />
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="listQuery.cursor"
:limit.sync="listQuery.limit"
@pagination="renderData"
/>
<div style="padding: 30px;">
<div slot="title" class="count-item">
<i>
<strong class="strong-style"> 筛选结果汇总</strong>
</i>
<i>
<strong class="strong-style"> 下注金额: {{ gameFruitCount.betAmount || '-' }}</strong>
</i>
<i>
<strong class="strong-style"> 获得奖励: {{ gameFruitCount.awards || '-' }}</strong>
</i>
<i>
<strong class="strong-style"> 参与人数: {{ gameFruitCount.playerNum || '-' }}</strong>
</i>
</div>
</div>
</div>
</div>
</template>
<script>
import { pageUserBetRecord } from '@/api/game'
import Pagination from '@/components/Pagination'
import { pickerOptions } from '@/constant/el-const'
import { sysOriginPlatforms } from '@/constant/origin'
import { mapGetters } from 'vuex'
export default {
name: 'EggExchangeRecord',
components: { Pagination },
data() {
return {
sysOriginPlatforms,
searchDisabled: false,
pickerOptions,
thatSelectedGameId: '',
gameTotals: [0, 0],
list: [],
total: 0,
rangeDate: [],
gameFruitCount: { playerNum: '', betAmount: '', awards: '' },
listQuery: {
cursor: 1,
limit: 20,
sysOrigin: '',
userId: '',
startTime: '',
endTime: ''
},
listLoading: true
}
},
computed: {
...mapGetters(['permissionsSysOriginPlatforms'])
},
watch: {
rangeDate: {
immediate: true,
deep: true,
handler(newVal) {
if (newVal && newVal.length > 0) {
console.log(111, newVal)
this.listQuery.startTime = newVal[0]
this.listQuery.endTime = newVal[1]
return
}
this.listQuery.startTime = ''
this.listQuery.endTime = ''
}
}
},
created() {
const that = this
console.log('that.listQuery.sysOrigin', that.listQuery.sysOrigin)
const querySystem = this.permissionsSysOriginPlatforms[0]
if (!querySystem) {
return
}
that.listQuery.sysOrigin = querySystem.value
//
const currentDate = new Date()
// 0
currentDate.setHours(0, 0, 0, 0)
// 0
this.listQuery.startTime = currentDate.getTime()
this.listQuery.endTime = new Date().getTime()
this.rangeDate[0] = currentDate.getTime()
this.rangeDate[1] = new Date().getTime()
this.renderData()
},
methods: {
handleSortChange(row) {
if (row.order) {
this.listQuery[row.prop] = row.order === 'ascending'
}
this.renderData()
console.log('row', row, this.listQuery[row.prop])
},
renderData(isClean) {
const that = this
if (isClean === true) {
that.list = []
that.listQuery.cursor = 1
}
that.listLoading = true
pageUserBetRecord(that.listQuery).then(res => {
const { body } = res
that.total = body.gameUserBetRecords.total || 0
that.list = body.gameUserBetRecords.records
that.gameFruitCount.betAmount = body.betAmount
that.gameFruitCount.awards = body.awards
that.gameFruitCount.playerNum = body.playerNum
that.listLoading = false
})
},
handleSearch() {
this.renderData(true)
}
}
}
</script>
<style scoped lang="scss">
.store-table-expand {
font-size: 0;
label {
width: 90px;
color: #99a9bf;
.el-form-item {
margin-right: 0;
margin-bottom: 0;
width: 50%;
}
}
}
</style>

View File

@ -1,409 +0,0 @@
<template>
<div class="app-container">
<el-dialog
:title="$t('pages.luckyBoxAwardConfig.dialog.detailsListTitle')"
:visible.sync="isDialog"
:modal-append-to-body="true"
:append-to-body="true"
:before-close="handleClose"
:close-on-click-modal="false"
:fullscreen="true"
top="20px"
>
<div class="filter-container">
<el-button
class="filter-item"
style="margin-left: 10px;"
type="primary"
icon="el-icon-edit"
:disabled="isAdd"
@click="handleAdd"
>
{{ $t('pages.luckyBoxAwardConfig.action.add') }}
</el-button>
</div>
<el-table
v-loading="listLoading"
:data="dataList"
element-loading-text="Loading"
fit
highlight-current-row
>
<el-table-column type="index" width="50" label="No" />
<el-table-column prop="sysOrigin" :label="$t('pages.luckyBoxAwardConfig.table.platform')" align="center" width="280" />
<el-table-column width="280" :label="$t('pages.luckyBoxAwardConfig.table.type')" align="center">
<template slot-scope="scope">
{{ getPropsTypeLabel(scope.row.propsType) }}
</template>
</el-table-column>
<el-table-column :label="$t('pages.luckyBoxAwardConfig.table.resource')" width="280" align="center">
<template slot-scope="scope">
<div class="preview-img">
<el-image
style="width: 100%; height: 100%"
:src="scope.row.cover"
:preview-src-list="[scope.row.cover]"
/>
<div :v-if="scope.row.type != 'THMEM'" class="preview-svga">
<svgaplayer
type="popover"
:url="scope.row.sourceUrl"
/>
</div>
</div>
</template>
</el-table-column>
<el-table-column prop="lotteryNumber" :label="$t('pages.luckyBoxAwardConfig.table.targetCount')" align="center" width="280" />
<el-table-column prop="validDays" :label="$t('pages.luckyBoxAwardConfig.table.validDays')" align="center" width="280" />
<el-table-column prop="createTime" :label="$t('pages.luckyBoxAwardConfig.table.createdAt')" align="center" width="300">
<template slot-scope="scope">
{{ scope.row.createTime | dateFormat }}
</template>
</el-table-column>
<el-table-column fixed="right" :label="$t('pages.luckyBoxAwardConfig.table.actions')" align="center">
<template slot-scope="scope">
<el-button type="text" @click.native="hanldeEidt(scope.row)">{{ $t('pages.luckyBoxAwardConfig.action.edit') }}</el-button>
</template>
</el-table-column>
</el-table>
<div>
<el-dialog
:title="$t('pages.luckyBoxAwardConfig.dialog.detailsFormTitle')"
:visible.sync="innerEditVisible"
:modal-append-to-body="true"
width="550px"
top="50px"
:close-on-press-escape="false"
:close-on-click-modal="false"
append-to-body
>
<div style="height: 500px;overflow: auto;">
<el-form
ref="dataForm"
:rules="dialogFormRules"
:model="formData"
style="width: 400px; margin-left:50px;"
>
<el-form-item :label="$t('pages.luckyBoxAwardConfig.form.system')" prop="sysOrigin">
<el-select
v-model="formData.sysOrigin"
:placeholder="$t('pages.luckyBoxAwardConfig.placeholder.selectSystem')"
style="width:100%;"
class="filter-item"
@change="changeSysOrigin"
>
<el-option
v-for="item in permissionsSysOriginPlatforms"
:key="item.value"
:label="item.label"
:value="item.value"
>
<span style="float: left;"> <sys-origin-icon :icon="item.value" :desc="item.value" /></span>
<span style="float: left;margin-left:10px">{{ item.label }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('pages.luckyBoxAwardConfig.form.propsType')" prop="propsType">
<el-select
v-model="formData.propsType"
:placeholder="$t('pages.luckyBoxAwardConfig.placeholder.propsType')"
style="width:100%;"
class="filter-item"
@change="changePropsType"
>
<el-option
v-for="item in localizedPropsTypes"
:key="item.value"
:label="item.name"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('pages.luckyBoxAwardConfig.form.propsId')" prop="propsId">
<div v-if="selectProps.cover" class="payer-source">
<div class="paler-icon">
<svgaplayer
type="popover"
:url="selectProps.sourceUrl || ''"
/>
</div>
<img :src="selectProps.cover" alt="cover">
</div>
<props-source-select-popover
v-loading="propsTypeMap[formData.propsType] ? propsTypeMap[formData.propsType].loading : false"
:data="propsTypeMap[formData.propsType] ? propsTypeMap[formData.propsType].list : []"
:property="selectPopoverProperty"
:visible="visiblePopover"
:show-filter="true"
@select="selectPropsSourcePopover"
/>
</el-form-item>
<el-form-item :label="$t('pages.luckyBoxAwardConfig.form.targetCount')" prop="lotteryNumber">
<el-input v-model="formData.lotteryNumber" v-number :placeholder="$t('pages.luckyBoxAwardConfig.placeholder.targetCount')" />
</el-form-item>
<el-form-item :label="$t('pages.luckyBoxAwardConfig.form.validDays')" prop="validDays">
<el-input v-model="formData.validDays" v-number :placeholder="$t('pages.luckyBoxAwardConfig.placeholder.validDays')" />
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="innerEditVisible = false">
{{ $t('common.cancel') }}
</el-button>
<el-button
:loading="submitLoading"
type="primary"
@click="handleSubmit"
>
{{ $t('common.submit') }}
</el-button>
</div>
</el-dialog>
</div>
</el-dialog>
</div>
</template>
<script>
import { getGameLuckyBoxAwardDetailsConfig, addGameLuckyBoxAwardDetailsConfig } from '@/api/game-lucky-box-config'
import { mapGetters } from 'vuex'
import { propsTypes } from '@/constant/type'
import { listNotFamilyBySysOriginType } from '@/api/props'
import PropsSourceSelectPopover from '@/components/data/PropsSourceSelectPopover'
export default {
name: 'BountyDetailsConfigTable',
components: { PropsSourceSelectPopover },
props: {
awardId: {
type: String,
required: true
},
updatePropsData: {
type: Object,
default: null
}
},
data() {
const propsTypeMap = {}
propsTypes.forEach(item => {
propsTypeMap[item.value] = {
list: [],
loading: false,
loadData: false
}
})
return {
propsTypes,
visiblePopover: false,
propsTypeMap,
selectPopoverProperty: {
label: 'name',
cover: 'cover',
svgaUrl: 'sourceUrl',
value: 'id'
},
selectProps: {},
updateData: null,
dataList: [],
isDialog: true,
innerEditVisible: false,
listQuery: {
awardId: '',
sysOrigin: 'HALAR'
},
formData: {
id: '',
awardId: '',
propsType: '',
propsId: '',
lotteryNumber: '',
validDays: '',
sysOrigin: 'HALAR'
},
submitLoading: false,
isAdd: true,
listLoading: true
}
},
computed: {
localizedPropsTypes() {
return this.propsTypes.map(item => ({
...item,
name: this.getPropsTypeLabel(item.value)
}))
},
dialogFormRules() {
const requiredMessage = this.$t('pages.luckyBoxAwardConfig.validation.requiredField')
const commonRules = [{ required: true, message: requiredMessage, trigger: 'blur' }]
return {
propsType: commonRules,
propsId: commonRules,
lotteryNumber: commonRules,
validDays: commonRules,
sysOrigin: commonRules
}
},
...mapGetters(['permissionsSysOriginPlatforms'])
},
watch: {
awardId: {
handler(newVal) {
this.listQuery.awardId = newVal
this.renderData()
},
immediate: true
},
updatePropsData: {
immediate: true,
deep: true,
handler(newVal) {
Object.assign(this.formData, newVal)
this.propsData = newVal
}
}
},
created() {
if (!this.permissionsFirstSysOrigin) {
return
}
this.listQuery.sysOrigin = this.permissionsFirstSysOrigin.value
this.renderData()
this.propsTypes = this.propsTypes.filter(item => !(item.value === 'CUSTOMIZE' || item.value === 'FRAGMENTS'))
},
methods: {
getPropsTypeLabel(type) {
return this.$t(`pages.luckyBoxAwardConfig.propsType.${type}`)
},
changeSysOrigin(val) {
const that = this
that.formData.propsType = ''
that.selectProps = {}
},
changePropsType(val) {
const that = this
that.formData.vipOrigin = null
if (!that.formData.sysOrigin) {
return
}
that.selectProps = {}
that.formData.propsId = ''
const propsTypeItem = that.propsTypeMap[val]
propsTypeItem.list = []
propsTypeItem.loading = true
listNotFamilyBySysOriginType(that.formData.sysOrigin, val).then(res => {
propsTypeItem.loading = false
propsTypeItem.loadData = true
propsTypeItem.list = (res.body || [])
}).catch(er => {
propsTypeItem.loading = false
console.error(er)
})
},
selectPropsSourcePopover(item) {
this.selectProps = item
this.formData.propsId = item.id
},
renderData() {
const that = this
that.listLoading = true
getGameLuckyBoxAwardDetailsConfig(that.listQuery).then(res => {
const { body } = res
that.dataList = body
that.isAdd = parseInt(that.dataList.length) === 6
that.listLoading = false
}).catch(er => {
that.listLoading = false
})
},
handleAdd() {
this.innerEditVisible = true
this.formData = {}
this.selectProps = {}
},
hanldeEidt(row) {
this.innerEditVisible = true
this.propsData = row
this.formData = this.propsData
this.selectProps.cover = this.propsData.cover
this.selectProps.sourceUrl = this.propsData.sourceUrl
},
//
// hanldeDelete(row) {
// this.$confirm('', '', {
// type: 'warning'
// }).then(() => {
// this.listLoading = true
// deleteAwardDetailsConfig(row.id).then((res) => {
// this.listLoading = false
// this.$message({
// message: '',
// type: 'success'
// })
// this.renderData()
// })
// }).catch(() => {
// this.listLoading = false
// })
// },
handleClose() {
this.$emit('close')
},
handleSubmit() {
const that = this
that.$refs.dataForm.validate(valid => {
if (valid) {
that.submitLoading = true
that.formData.awardId = that.listQuery.awardId
addGameLuckyBoxAwardDetailsConfig(that.formData).then(res => {
that.submitLoading = false
that.innerEditVisible = false
that.renderData()
this.$emit('success', 'create')
}).catch(er => {
that.submitLoading = false
that.innerEditVisible = false
console.error(er)
this.$emit('fail')
})
} else {
console.error('error submit!!')
return false
}
})
}
}
}
</script>
<style scoped lang="scss">
.this-level {
padding-bottom: 30px;
display: flex;
> div {
width: 150px;
}
}
.el-tag + .el-tag {
margin-left: 10px;
}
.button-new-tag {
margin-left: 10px;
}
.input-new-tag {
width: 90px;
margin-left: 10px;
vertical-align: bottom;
}
.payer-source {
position: relative;
.paler-icon {
position:absolute;
left: 60px;
top: -20px;
}
img {
width: 100px;
height: 100px;
}
}
</style>

View File

@ -1,162 +0,0 @@
<template>
<div class="edit-award">
<el-dialog
:title="title"
:visible="true"
:modal-append-to-body="true"
:append-to-body="true"
width="550px"
top="50px"
:before-close="handleClose"
:close-on-press-escape="false"
:close-on-click-modal="false"
>
<div style="height: 500px;overflow: auto;">
<el-form
ref="dataForm"
:rules="formRules"
:model="formData"
style="width: 400px; margin-left:50px;"
>
<el-form-item :label="$t('pages.luckyBoxAwardConfig.form.system')" prop="sysOrigin">
<el-select
v-model="formData.sysOrigin"
:placeholder="$t('pages.luckyBoxAwardConfig.placeholder.selectSystem')"
style="width:100%;"
class="filter-item"
>
<el-option
v-for="item in permissionsSysOriginPlatforms"
:key="item.value"
:label="item.label"
:value="item.value"
>
<span style="float: left;"> <sys-origin-icon :icon="item.value" :desc="item.value" /></span>
<span style="float: left;margin-left:10px">{{ item.label }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('pages.luckyBoxAwardConfig.form.lotteryType')" prop="lotteryType">
<el-select
v-model="formData.lotteryType"
:placeholder="$t('pages.luckyBoxAwardConfig.placeholder.type')"
clearable
style="width:100%;"
class="filter-item"
>
<el-option :label="$t('pages.luckyBoxAwardConfig.lotteryType.CLASSICS')" :value="'CLASSICS'" />
<el-option :label="$t('pages.luckyBoxAwardConfig.lotteryType.CONSTELLATION')" :value="'CONSTELLATION'" />
</el-select>
</el-form-item>
<el-form-item :label="$t('pages.luckyBoxAwardConfig.form.name')" prop="name">
<el-input v-model.trim="formData.name" type="text" :placeholder="$t('pages.luckyBoxAwardConfig.placeholder.name')" />
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleClose">
{{ $t('common.cancel') }}
</el-button>
<el-button
:loading="submitLoading"
type="primary"
@click="handleSubmit"
>
{{ $t('common.submit') }}
</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { addGameLuckyBoxAwardConfig } from '@/api/game-lucky-box-config'
import { mapGetters } from 'vuex'
export default {
name: 'AwardConfigEdit',
props: {
updateData: {
type: Object,
default: null
},
sysOrigin: {
type: String,
default: null
}
},
data() {
return {
formData: {
id: '',
sysOrigin: 'HALAR',
name: '',
lotteryType: ''
},
submitLoading: false
}
},
computed: {
isAdd() {
return this.updateData === null
},
title() {
const system = this.isAdd ? this.sysOrigin : this.updateData.sysOrigin
const action = this.isAdd
? this.$t('pages.luckyBoxAwardConfig.action.add')
: this.$t('pages.luckyBoxAwardConfig.action.edit')
return this.$t('pages.luckyBoxAwardConfig.dialog.formTitle', { action, system })
},
formRules() {
const requiredMessage = this.$t('pages.luckyBoxAwardConfig.validation.requiredField')
return {
sysOrigin: [{ required: true, message: requiredMessage, trigger: 'blur' }],
name: [{ required: true, message: requiredMessage, trigger: 'blur' }],
lotteryType: [{ required: true, message: requiredMessage, trigger: 'blur' }]
}
},
...mapGetters(['permissionsSysOriginPlatforms'])
},
watch: {
updateData: {
immediate: true,
deep: true,
handler(newVal) {
Object.assign(this.formData, newVal)
}
}
},
methods: {
handleClose() {
this.$emit('close')
},
handleSubmit() {
const that = this
that.$refs.dataForm.validate(valid => {
if (valid) {
that.submitLoading = true
that.formData.sysOrigin = that.sysOrigin
addGameLuckyBoxAwardConfig(that.formData).then(res => {
that.submitLoading = false
this.$emit('success', 'create')
}).catch(er => {
that.submitLoading = false
console.error(er)
this.$emit('fail')
})
} else {
console.error('error submit!!')
return false
}
})
}
}
}
</script>
<style scoped>
.col-margin {
margin-bottom: 20px;
}
img[src=""],img:not([src]){
opacity: 0;
}
</style>

View File

@ -1,228 +0,0 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-select
v-model="listQuery.sysOrigin"
:placeholder="$t('pages.luckyBoxAwardConfig.filter.system')"
style="width: 120px"
class="filter-item"
@change="handleSearch"
>
<el-option
v-for="item in permissionsSysOriginPlatformAlls"
:key="item.value"
:label="item.label"
:value="item.value"
>
<span style="float: left;"> <sys-origin-icon :icon="item.value" :desc="item.value" /></span>
<span style="float: left;margin-left:10px">{{ item.label }}</span>
</el-option>
</el-select>
<el-select
v-model="listQuery.lotteryType"
:placeholder="$t('pages.luckyBoxAwardConfig.filter.lotteryType')"
style="width:120px;"
class="filter-item"
clearable
@change="handleSearch"
>
<el-option :label="$t('pages.luckyBoxAwardConfig.lotteryType.CLASSICS')" :value="'CLASSICS'" />
<el-option :label="$t('pages.luckyBoxAwardConfig.lotteryType.CONSTELLATION')" :value="'CONSTELLATION'" />
</el-select>
<el-button
:loading="searchLoading"
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleSearch"
>
{{ $t('common.search') }}
</el-button>
<el-button
class="filter-item"
style="margin-left: 10px;"
type="primary"
icon="el-icon-edit"
@click="handleAdd"
>
{{ $t('pages.luckyBoxAwardConfig.action.add') }}
</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
fit
highlight-current-row
>
<el-table-column prop="sysOrigin" :label="$t('pages.luckyBoxAwardConfig.table.platform')" align="center" />
<el-table-column :label="$t('pages.luckyBoxAwardConfig.table.type')" align="center">
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.lotteryType === 'CLASSICS'">{{ $t('pages.luckyBoxAwardConfig.lotteryType.CLASSICS') }}</el-tag>
<el-tag v-else-if="scope.row.lotteryType === 'CONSTELLATION'">{{ $t('pages.luckyBoxAwardConfig.lotteryType.CONSTELLATION') }}</el-tag>
</div>
</template>
</el-table-column>
<el-table-column prop="name" :label="$t('pages.luckyBoxAwardConfig.table.name')" align="center" width="200" />
<el-table-column prop="createTime" :label="$t('pages.luckyBoxAwardConfig.table.createdAt')" align="center" width="200">
<template slot-scope="scope">
{{ scope.row.createTime | dateFormat }}
</template>
</el-table-column>
<el-table-column fixed="right" :label="$t('pages.luckyBoxAwardConfig.table.actions')" align="center" width="380">
<template slot-scope="scope">
<el-button type="text" @click.native="hanldeEidt(scope.row)">{{ $t('pages.luckyBoxAwardConfig.action.edit') }}</el-button>
<el-button type="text" @click.native="handleAwardConfigList(scope.row)">{{ $t('pages.luckyBoxAwardConfig.action.rewardConfig') }}</el-button>
<el-button type="text" @click.native="handlDel(scope.row)">{{ $t('pages.luckyBoxAwardConfig.action.delete') }}</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="listQuery.cursor"
:limit.sync="listQuery.limit"
@pagination="renderData"
/>
<config-edit
v-if="awardConfigEditVisible"
:update-data="updateData"
:sys-origin="listQuery.sysOrigin"
@close="awardConfigEditVisible = false"
@success="awardConfigEditSuccess"
/>
<details-config
v-if="detailsConfigVisible"
:award-id="thatSelectedAwardConfigId"
:event="luckyBoxEditEvent"
@close="detailsConfigVisible=false"
/>
</div>
</template>
<script>
import { getAwardConfig, deleteAwardConfig } from '@/api/game-lucky-box-config'
import Pagination from '@/components/Pagination'
import ConfigEdit from './edit.vue'
import DetailsConfig from './details.vue'
import { mapGetters } from 'vuex'
export default {
name: 'AwardConfigTable',
components: {
Pagination, ConfigEdit, DetailsConfig
},
data() {
return {
awardConfigEditVisible: false,
detailsConfigVisible: false,
thatSelectedAwardConfigId: '',
updateData: null,
luckyBoxEditEvent: 'ADD',
thisRow: {},
list: [],
total: 0,
listQuery: {
cursor: 1,
limit: 20,
sysOrigin: 'HALAR',
lotteryType: ''
},
listLoading: true,
searchLoading: false,
clickUserId: ''
}
},
computed: {
...mapGetters(['permissionsSysOriginPlatformAlls', 'permissionsFirstSysOrigin'])
},
created() {
if (!this.permissionsFirstSysOrigin) {
return
}
this.listQuery.sysOrigin = this.permissionsFirstSysOrigin.value
this.renderData(true)
},
methods: {
renderData(isReset) {
const that = this
if (isReset === true) {
that.listQuery.cursor = 1
}
that.listLoading = true
getAwardConfig(that.listQuery).then(res => {
const { body } = res
that.total = body.total || 0
that.list = body.records
that.searchLoading = that.listLoading = false
}).catch(er => {
that.searchLoading = that.listLoading = false
})
},
handleSearch() {
this.searchLoading = true
this.renderData(true)
},
handleAwardConfigList(row) {
this.thatSelectedAwardConfigId = String(row.id)
this.detailsConfigVisible = true
},
handleAdd() {
this.awardConfigEditVisible = true
this.updateData = null
},
hanldeEidt(row) {
this.awardConfigEditVisible = true
this.updateData = row
},
awardConfigEditSuccess(event) {
this.updateData = null
this.awardConfigEditVisible = false
this.renderData(event === 'create')
},
//
handlDel(row) {
this.$confirm(this.$t('pages.luckyBoxAwardConfig.confirm.deleteMessage'), this.$t('pages.luckyBoxAwardConfig.confirm.title'), {
type: 'warning'
}).then(() => {
this.listLoading = true
deleteAwardConfig(row.id).then((res) => {
this.listLoading = false
this.$message({
message: this.$t('pages.luckyBoxAwardConfig.message.deleteSuccess'),
type: 'success'
})
this.renderData()
})
}).catch(() => {
this.listLoading = false
})
}
}
}
</script>
<style scoped lang="scss">
.this-level {
padding-bottom: 30px;
display: flex;
> div {
width: 150px;
}
}
.el-tag + .el-tag {
margin-left: 10px;
}
.button-new-tag {
margin-left: 10px;
}
.input-new-tag {
width: 90px;
margin-left: 10px;
vertical-align: bottom;
}
</style>

View File

@ -1,375 +0,0 @@
<template>
<div class="app-container">
<el-dialog
:title="$t('pages.luckyBoxBountyConfig.dialog.detailsListTitle')"
:visible.sync="isDialog"
:modal-append-to-body="true"
:append-to-body="true"
:before-close="handleClose"
:close-on-click-modal="false"
:fullscreen="true"
top="20px"
>
<div class="filter-container">
<el-button
class="filter-item"
style="margin-left: 10px;"
type="primary"
icon="el-icon-edit"
@click="handleAdd"
>
{{ $t('pages.luckyBoxBountyConfig.action.add') }}
</el-button>
</div>
<el-table
v-loading="listLoading"
:data="dataList"
element-loading-text="Loading"
fit
highlight-current-row
>
<el-table-column prop="sysOrigin" :label="$t('pages.luckyBoxBountyConfig.table.platform')" align="center" width="280" />
<el-table-column :label="$t('pages.luckyBoxBountyConfig.table.resource')" width="280" align="center">
<template slot-scope="scope">
<div class="preview-img">
<el-image
style="width: 100%; height: 100%"
:src="scope.row.cover"
:preview-src-list="[scope.row.cover]"
/>
<div :v-if="scope.row.type != 'THMEM'" class="preview-svga">
<svgaplayer
type="popover"
:url="scope.row.sourceUrl"
/>
</div>
</div>
</template>
</el-table-column>
<el-table-column prop="targetQuantity" :label="$t('pages.luckyBoxBountyConfig.table.targetQuantity')" align="center" width="280" />
<el-table-column prop="validDays" :label="$t('pages.luckyBoxBountyConfig.table.validDays')" align="center" width="280" />
<el-table-column prop="createTime" :label="$t('pages.luckyBoxBountyConfig.table.createdAt')" align="center" width="300">
<template slot-scope="scope">
{{ scope.row.createTime | dateFormat }}
</template>
</el-table-column>
<el-table-column fixed="right" :label="$t('pages.luckyBoxBountyConfig.table.actions')" align="center">
<template slot-scope="scope">
<el-button type="text" @click.native="hanldeDelete(scope.row)">{{ $t('pages.luckyBoxBountyConfig.action.delete') }}</el-button>
</template>
</el-table-column>
</el-table>
<div>
<el-dialog
:title="$t('pages.luckyBoxBountyConfig.dialog.detailsFormTitle')"
:visible.sync="innerEditVisible"
:modal-append-to-body="true"
width="550px"
top="50px"
:close-on-press-escape="false"
:close-on-click-modal="false"
append-to-body
>
<div style="height: 500px;overflow: auto;">
<el-form
ref="dataForm"
:rules="dialogFormRules"
:model="formData"
style="width: 400px; margin-left:50px;"
>
<el-form-item :label="$t('pages.luckyBoxBountyConfig.form.system')" prop="sysOrigin">
<el-select
v-model="formData.sysOrigin"
:placeholder="$t('pages.luckyBoxBountyConfig.placeholder.selectSystem')"
style="width:100%;"
class="filter-item"
@change="changeSysOrigin"
>
<el-option
v-for="item in permissionsSysOriginPlatforms"
:key="item.value"
:label="item.label"
:value="item.value"
>
<span style="float: left;"> <sys-origin-icon :icon="item.value" :desc="item.value" /></span>
<span style="float: left;margin-left:10px">{{ item.label }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('pages.luckyBoxBountyConfig.form.propsType')" prop="propsType">
<el-select
v-model="formData.propsType"
:placeholder="$t('pages.luckyBoxBountyConfig.placeholder.propsType')"
style="width:100%;"
class="filter-item"
@change="changePropsType"
>
<el-option v-for="item in localizedPropsTypes" :key="item.value" :label="item.name" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item :label="$t('pages.luckyBoxBountyConfig.form.propsId')" prop="propsId">
<div v-if="selectProps.cover" class="payer-source">
<div class="paler-icon">
<svgaplayer
type="popover"
:url="selectProps.sourceUrl || ''"
/>
</div>
<img :src="selectProps.cover" alt="cover">
</div>
<props-source-select-popover
v-loading="propsTypeMap[formData.propsType] ? propsTypeMap[formData.propsType].loading : false"
:data="propsTypeMap[formData.propsType] ? propsTypeMap[formData.propsType].list : []"
:property="selectPopoverProperty"
:visible="visiblePopover"
:show-filter="true"
@select="selectPropsSourcePopover"
/>
</el-form-item>
<el-form-item :label="$t('pages.luckyBoxBountyConfig.form.targetQuantity')" prop="targetQuantity">
<el-input v-model="formData.targetQuantity" v-number :placeholder="$t('pages.luckyBoxBountyConfig.placeholder.targetQuantity')" />
</el-form-item>
<el-form-item :label="$t('pages.luckyBoxBountyConfig.form.validDays')" prop="validDays">
<el-input v-model="formData.validDays" v-number :placeholder="$t('pages.luckyBoxBountyConfig.placeholder.validDays')" />
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="innerEditVisible = false">
{{ $t('common.cancel') }}
</el-button>
<el-button
:loading="submitLoading"
type="primary"
@click="handleSubmit"
>
{{ $t('common.submit') }}
</el-button>
</div>
</el-dialog>
</div>
</el-dialog>
</div>
</template>
<script>
import { getBountyDetialsConfigTable, addOrUpdateBountyDetialsConfig, deleteBountyDetailsConfig } from '@/api/game-lucky-box-config'
import { mapGetters } from 'vuex'
import { propsTypes } from '@/constant/type'
import { listNotFamilyBySysOriginType } from '@/api/props'
import PropsSourceSelectPopover from '@/components/data/PropsSourceSelectPopover'
export default {
name: 'BountyDetailsConfigTable',
components: { PropsSourceSelectPopover },
props: {
bountyId: {
type: String,
required: true
}
},
data() {
const propsTypeMap = {}
propsTypes.forEach(item => {
propsTypeMap[item.value] = {
list: [],
loading: false,
loadData: false
}
})
return {
propsTypes,
visiblePopover: false,
propsTypeMap,
selectPopoverProperty: {
label: 'name',
cover: 'cover',
svgaUrl: 'sourceUrl',
value: 'id'
},
selectProps: {},
updateData: null,
dataList: [],
isDialog: true,
innerEditVisible: false,
listQuery: {
bountyId: '',
sysOrigin: 'HALAR'
},
formData: {
id: '',
bountyId: '',
propsType: '',
propsId: '',
targetQuantity: '',
validDays: '',
sysOrigin: 'HALAR'
},
submitLoading: false,
listLoading: true
}
},
computed: {
dialogFormRules() {
const requiredMessage = this.$t('pages.luckyBoxBountyConfig.validation.requiredField')
const commonRules = [{ required: true, message: requiredMessage, trigger: 'blur' }]
return {
propsType: commonRules,
propsId: commonRules,
targetQuantity: commonRules,
validDays: commonRules,
sysOrigin: commonRules
}
},
localizedPropsTypes() {
return this.propsTypes.map(item => ({
...item,
name: this.getPropsTypeLabel(item.value)
}))
},
...mapGetters(['permissionsSysOriginPlatforms'])
},
watch: {
bountyId: {
handler(newVal) {
this.listQuery.bountyId = newVal
this.renderData()
},
immediate: true
}
},
created() {
if (!this.permissionsFirstSysOrigin) {
return
}
this.listQuery.sysOrigin = this.permissionsFirstSysOrigin.value
this.renderData()
this.propsTypes = this.propsTypes.filter(item => !(item.value === 'CUSTOMIZE' || item.value === 'FRAGMENTS'))
},
methods: {
getPropsTypeLabel(type) {
return this.$t(`pages.luckyBoxBountyConfig.propsType.${type}`)
},
changeSysOrigin(val) {
const that = this
that.formData.propsType = ''
that.selectProps = {}
},
changePropsType(val) {
const that = this
that.formData.vipOrigin = null
if (!that.formData.sysOrigin) {
return
}
that.selectProps = {}
that.formData.propsId = ''
const propsTypeItem = that.propsTypeMap[val]
propsTypeItem.list = []
propsTypeItem.loading = true
listNotFamilyBySysOriginType(that.formData.sysOrigin, val).then(res => {
propsTypeItem.loading = false
propsTypeItem.loadData = true
propsTypeItem.list = (res.body || [])
}).catch(er => {
propsTypeItem.loading = false
console.error(er)
})
},
selectPropsSourcePopover(item) {
this.selectProps = item
this.formData.propsId = item.id
},
renderData() {
const that = this
that.listLoading = true
getBountyDetialsConfigTable(that.listQuery).then(res => {
const { body } = res
that.dataList = body
that.listLoading = false
}).catch(er => {
that.listLoading = false
})
},
handleAdd() {
this.innerEditVisible = true
this.formData = {}
this.selectProps = {}
},
hanldeDelete(row) {
this.$confirm(this.$t('pages.luckyBoxBountyConfig.confirm.deleteMessage'), this.$t('pages.luckyBoxBountyConfig.confirm.title'), {
type: 'warning'
}).then(() => {
this.listLoading = true
deleteBountyDetailsConfig(row.id).then((res) => {
this.listLoading = false
this.$message({
message: this.$t('pages.luckyBoxBountyConfig.message.deleteSuccess'),
type: 'success'
})
this.renderData()
})
}).catch(() => {
this.listLoading = false
})
},
handleClose() {
this.$emit('close')
},
handleSubmit() {
const that = this
that.$refs.dataForm.validate(valid => {
if (valid) {
that.submitLoading = true
that.formData.bountyId = that.listQuery.bountyId
addOrUpdateBountyDetialsConfig(that.formData).then(res => {
that.submitLoading = false
that.innerEditVisible = false
that.renderData()
this.$emit('success', 'create')
}).catch(er => {
that.submitLoading = false
that.innerEditVisible = false
console.error(er)
this.$emit('fail')
})
} else {
console.error('error submit!!')
return false
}
})
}
}
}
</script>
<style scoped lang="scss">
.this-level {
padding-bottom: 30px;
display: flex;
> div {
width: 150px;
}
}
.el-tag + .el-tag {
margin-left: 10px;
}
.button-new-tag {
margin-left: 10px;
}
.input-new-tag {
width: 90px;
margin-left: 10px;
vertical-align: bottom;
}
.payer-source {
position: relative;
.paler-icon {
position:absolute;
left: 60px;
top: -20px;
}
img {
width: 100px;
height: 100px;
}
}
</style>

View File

@ -1,232 +0,0 @@
<template>
<div class="edit-bounty">
<el-dialog
:title="title"
:visible="true"
:modal-append-to-body="true"
:append-to-body="true"
width="550px"
top="50px"
:before-close="handleClose"
:close-on-press-escape="false"
:close-on-click-modal="false"
>
<div style="height: 500px;overflow: auto;">
<el-form
ref="dataForm"
:rules="formRules"
:model="formData"
style="width: 400px; margin-left:50px;"
>
<el-form-item :label="$t('pages.luckyBoxBountyConfig.form.system')" prop="sysOrigin">
<el-select
v-model="formData.sysOrigin"
:placeholder="$t('pages.luckyBoxBountyConfig.placeholder.selectSystem')"
style="width:100%;"
class="filter-item"
>
<el-option
v-for="item in permissionsSysOriginPlatforms"
:key="item.value"
:label="item.label"
:value="item.value"
>
<span style="float: left;"> <sys-origin-icon :icon="item.value" :desc="item.value" /></span>
<span style="float: left;margin-left:10px">{{ item.label }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('pages.luckyBoxBountyConfig.form.type')" prop="type">
<el-select
v-model="formData.type"
:placeholder="$t('pages.luckyBoxBountyConfig.placeholder.type')"
clearable
style="width:100%;"
class="filter-item"
>
<el-option :label="$t('pages.luckyBoxBountyConfig.type.DAILY')" :value="'DAILY'" />
<el-option :label="$t('pages.luckyBoxBountyConfig.type.WEEKLY')" :value="'WEEKLY'" />
</el-select>
</el-form-item>
<el-form-item :label="$t('pages.luckyBoxBountyConfig.form.giftType')">
<el-select
v-model="formData.giftType"
:placeholder="$t('pages.luckyBoxBountyConfig.placeholder.giftType')"
style="width:100%;"
class="filter-item"
@change="getGiftListInfo()"
>
<el-option v-for="(item) in localizedGiftConfigTabs" :key="item.value" :label="item.name" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item prop="giftId" :label="$t('pages.luckyBoxBountyConfig.form.resource')">
<el-select v-model="formData.giftId" v-loading="giftLoading" :placeholder="$t('pages.luckyBoxBountyConfig.placeholder.select')" style="width:100%;" @change="showPhoto">
<el-option
v-for="(item, index) in gifts"
:key="index"
:label="item.id"
:value="item.id"
:style="'height:65px'"
>
<div style="float: left;">
<img :src="item.giftPhoto" width="65px" height="65px">
</div>
</el-option>
</el-select>
<div style="float: left;">
<img class="img" :src="photoUrl" width="65px" height="65px">
</div>
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleClose">
{{ $t('common.cancel') }}
</el-button>
<el-button
:loading="submitLoading"
type="primary"
@click="handleSubmit"
>
{{ $t('common.submit') }}
</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { addOrUpdateBountyConfig } from '@/api/game-lucky-box-config'
import { mapGetters } from 'vuex'
import { giftConfigTabs } from '@/constant/type'
import { listByTabV2 } from '@/api/gift'
export default {
name: 'StandardConfigEdit',
props: {
updateData: {
type: Object,
default: null
},
sysOrigin: {
type: String,
default: null
}
},
data() {
return {
giftConfigTabs,
gifts: [],
photoUrl: '',
giftPhoto: '',
giftLoading: false,
formData: {
id: '',
sysOrigin: 'HALAR',
giftType: '',
giftId: '',
type: ''
},
gift: {
id: '',
giftPhoto: ''
},
submitLoading: false
}
},
computed: {
isAdd() {
return this.updateData === null
},
localizedGiftConfigTabs() {
return this.giftConfigTabs.map(item => ({
...item,
name: this.$t(`pages.luckyBoxBountyConfig.giftType.${item.value}`)
}))
},
title() {
const system = this.isAdd ? this.sysOrigin : this.updateData.sysOrigin
const action = this.isAdd
? this.$t('pages.luckyBoxBountyConfig.action.add')
: this.$t('pages.luckyBoxBountyConfig.action.edit')
return this.$t('pages.luckyBoxBountyConfig.dialog.formTitle', { action, system })
},
formRules() {
const requiredMessage = this.$t('pages.luckyBoxBountyConfig.validation.requiredField')
return {
sysOrigin: [{ required: true, message: requiredMessage, trigger: 'blur' }],
giftType: [{ required: true, message: requiredMessage, trigger: 'blur' }],
giftId: [{ required: true, message: requiredMessage, trigger: 'blur' }],
type: [{ required: true, message: requiredMessage, trigger: 'blur' }]
}
},
...mapGetters(['permissionsSysOriginPlatforms'])
},
watch: {
updateData: {
immediate: true,
deep: true,
handler(newVal) {
Object.assign(this.formData, newVal)
this.getGiftList()
}
}
},
methods: {
handleClose() {
this.$emit('close')
},
handleSubmit() {
const that = this
that.$refs.dataForm.validate(valid => {
if (valid) {
that.submitLoading = true
that.formData.sysOrigin = that.sysOrigin
addOrUpdateBountyConfig(that.formData).then(res => {
that.submitLoading = false
this.$emit('success', 'create')
}).catch(er => {
that.submitLoading = false
console.error(er)
this.$emit('fail')
})
} else {
console.error('error submit!!')
return false
}
})
},
getGiftListInfo() {
const that = this
that.formData.giftId = ''
that.photoUrl = ''
that.getGiftList()
},
getGiftList() {
const that = this
that.giftLoading = true
listByTabV2({ 'sysOrigin': that.formData.sysOrigin, 'giftTab': that.formData.giftType }).then(res => {
that.gifts = res.body || []
that.giftLoading = false
this.showPhoto()
}).catch(er => {
that.giftLoading = false
console.error(er)
})
},
showPhoto() {
const that = this
const item = this.gifts.find(item1 => item1.id === that.formData.giftId) || that.gift
that.photoUrl = item.giftPhoto
}
}
}
</script>
<style scoped>
.col-margin {
margin-bottom: 20px;
}
img[src=""],img:not([src]){
opacity: 0;
}
</style>

View File

@ -1,235 +0,0 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-select
v-model="listQuery.sysOrigin"
:placeholder="$t('pages.luckyBoxBountyConfig.filter.system')"
style="width: 120px"
class="filter-item"
@change="handleSearch"
>
<el-option
v-for="item in permissionsSysOriginPlatformAlls"
:key="item.value"
:label="item.label"
:value="item.value"
>
<span style="float: left;"> <sys-origin-icon :icon="item.value" :desc="item.value" /></span>
<span style="float: left;margin-left:10px">{{ item.label }}</span>
</el-option>
</el-select>
<el-select
v-model="listQuery.type"
:placeholder="$t('pages.luckyBoxBountyConfig.filter.type')"
style="width:120px;"
class="filter-item"
clearable
@change="handleSearch"
>
<el-option :label="$t('pages.luckyBoxBountyConfig.type.DAILY')" :value="'DAILY'" />
<el-option :label="$t('pages.luckyBoxBountyConfig.type.WEEKLY')" :value="'WEEKLY'" />
</el-select>
<el-button
:loading="searchLoading"
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleSearch"
>
{{ $t('common.search') }}
</el-button>
<el-button
class="filter-item"
style="margin-left: 10px;"
type="primary"
icon="el-icon-edit"
@click="handleAdd"
>
{{ $t('pages.luckyBoxBountyConfig.action.add') }}
</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
fit
highlight-current-row
>
<el-table-column prop="sysOrigin" :label="$t('pages.luckyBoxBountyConfig.table.platform')" align="center" />
<el-table-column :label="$t('pages.luckyBoxBountyConfig.table.type')" align="center">
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.type === 'DAILY'" type="danger">{{ $t('pages.luckyBoxBountyConfig.type.DAILY') }}</el-tag>
<el-tag v-else-if="scope.row.type === 'WEEKLY'">{{ $t('pages.luckyBoxBountyConfig.type.WEEKLY') }}</el-tag>
</div>
</template>
</el-table-column>
<el-table-column :label="$t('pages.luckyBoxBountyConfig.table.cover')" align="center">
<template slot-scope="scope">
<el-image
style="width: 50px; height: 50px"
:src="scope.row.photoUrl"
:preview-src-list="[scope.row.photoUrl]"
/>
</template>
</el-table-column>
<el-table-column prop="createTime" :label="$t('pages.luckyBoxBountyConfig.table.createdAt')" align="center" width="200">
<template slot-scope="scope">
{{ scope.row.createTime | dateFormat }}
</template>
</el-table-column>
<el-table-column fixed="right" :label="$t('pages.luckyBoxBountyConfig.table.actions')" align="center" width="380">
<template slot-scope="scope">
<el-button type="text" @click.native="hanldeEidt(scope.row)">{{ $t('pages.luckyBoxBountyConfig.action.edit') }}</el-button>
<el-button type="text" @click.native="handleProbabilityConfigList(scope.row)">{{ $t('pages.luckyBoxBountyConfig.action.propsConfig') }}</el-button>
<el-button type="text" @click.native="handlDel(scope.row)">{{ $t('pages.luckyBoxBountyConfig.action.delete') }}</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="listQuery.cursor"
:limit.sync="listQuery.limit"
@pagination="renderData"
/>
<config-edit
v-if="bountyConfigEditVisible"
:update-data="updateData"
:sys-origin="listQuery.sysOrigin"
@close="bountyConfigEditVisible = false"
@success="bountyConfigEditSuccess"
/>
<details-config
v-if="detailsConfigVisible"
:bounty-id="thatSelectedBountyConfigId"
:event="luckyBoxEditEvent"
@close="detailsConfigVisible=false"
/>
</div>
</template>
<script>
import { getBountyConfigTable, deleteBountyConfig } from '@/api/game-lucky-box-config'
import Pagination from '@/components/Pagination'
import ConfigEdit from './edit.vue'
import DetailsConfig from './details.vue'
import { mapGetters } from 'vuex'
export default {
name: 'BountyConfigTable',
components: {
Pagination, ConfigEdit, DetailsConfig
},
data() {
return {
bountyConfigEditVisible: false,
detailsConfigVisible: false,
thatSelectedBountyConfigId: '',
updateData: null,
luckyBoxEditEvent: 'ADD',
thisRow: {},
list: [],
total: 0,
listQuery: {
cursor: 1,
limit: 20,
sysOrigin: 'HALAR',
type: ''
},
listLoading: true,
searchLoading: false,
clickUserId: ''
}
},
computed: {
...mapGetters(['permissionsSysOriginPlatformAlls', 'permissionsFirstSysOrigin'])
},
created() {
if (!this.permissionsFirstSysOrigin) {
return
}
this.listQuery.sysOrigin = this.permissionsFirstSysOrigin.value
this.renderData(true)
},
methods: {
renderData(isReset) {
const that = this
if (isReset === true) {
that.listQuery.cursor = 1
}
that.listLoading = true
getBountyConfigTable(that.listQuery).then(res => {
const { body } = res
that.total = body.total || 0
that.list = body.records
that.searchLoading = that.listLoading = false
}).catch(er => {
that.searchLoading = that.listLoading = false
})
},
handleSearch() {
this.searchLoading = true
this.renderData(true)
},
handleProbabilityConfigList(row) {
this.thatSelectedBountyConfigId = String(row.id)
this.detailsConfigVisible = true
},
handleAdd() {
this.bountyConfigEditVisible = true
this.updateData = null
},
hanldeEidt(row) {
this.bountyConfigEditVisible = true
this.updateData = row
},
bountyConfigEditSuccess(event) {
this.updateData = null
this.bountyConfigEditVisible = false
this.renderData(event === 'create')
},
handlDel(row) {
this.$confirm(this.$t('pages.luckyBoxBountyConfig.confirm.deleteMessage'), this.$t('pages.luckyBoxBountyConfig.confirm.title'), {
type: 'warning'
}).then(() => {
this.listLoading = true
deleteBountyConfig(row.id).then((res) => {
this.listLoading = false
this.$message({
message: this.$t('pages.luckyBoxBountyConfig.message.deleteSuccess'),
type: 'success'
})
this.renderData()
})
}).catch(() => {
this.listLoading = false
})
}
}
}
</script>
<style scoped lang="scss">
.this-level {
padding-bottom: 30px;
display: flex;
> div {
width: 150px;
}
}
.el-tag + .el-tag {
margin-left: 10px;
}
.button-new-tag {
margin-left: 10px;
}
.input-new-tag {
width: 90px;
margin-left: 10px;
vertical-align: bottom;
}
</style>

View File

@ -1,190 +0,0 @@
<template>
<div class="app-container">
<div v-loading="loading" class="fortune-config">
<el-form ref="form" :model="form" :rules="rules" label-width="130px">
<el-alert
:title="$t('pages.luckyBoxFortuneConfig.alert.singleDraw')"
type="info"
:closable="false"
style="margin-bottom: 20px;"
/>
<el-form-item prop="oneDot" :label="$t('pages.luckyBoxFortuneConfig.label.oneDot')">
<el-input v-model="form.oneDot" v-number />
</el-form-item>
<el-form-item prop="twoDot" :label="$t('pages.luckyBoxFortuneConfig.label.twoDot')">
<el-input v-model.trim="form.twoDot" v-number />
</el-form-item>
<el-form-item :label="$t('pages.luckyBoxFortuneConfig.label.threeDot')" prop="threeDot">
<el-input v-model="form.threeDot" v-number />
</el-form-item>
<el-alert
:title="$t('pages.luckyBoxFortuneConfig.alert.tenDraws')"
type="info"
:closable="false"
style="margin-bottom: 20px;"
/>
<el-form-item prop="aroundElevenDot" :label="$t('pages.luckyBoxFortuneConfig.label.aroundElevenDot')">
<el-input v-model="form.aroundElevenDot" v-number />
</el-form-item>
<el-form-item prop="aroundSixteenDot" :label="$t('pages.luckyBoxFortuneConfig.label.aroundSixteenDot')">
<el-input v-model.trim="form.aroundSixteenDot" v-number />
</el-form-item>
<el-form-item :label="$t('pages.luckyBoxFortuneConfig.label.aroundTwentyOneDot')" prop="aroundTwentyOneDot">
<el-input v-model="form.aroundTwentyOneDot" v-number />
</el-form-item>
<el-form-item :label="$t('pages.luckyBoxFortuneConfig.label.aroundTwentySixDot')" prop="aroundTwentySixDot">
<el-input v-model="form.aroundTwentySixDot" v-number />
</el-form-item>
<el-alert
:title="$t('pages.luckyBoxFortuneConfig.alert.fiftyDraws')"
type="info"
:closable="false"
style="margin-bottom: 20px;"
/>
<el-form-item prop="aroundFiftyOneDot" :label="$t('pages.luckyBoxFortuneConfig.label.aroundFiftyOneDot')">
<el-input v-model="form.aroundFiftyOneDot" v-number />
</el-form-item>
<el-form-item prop="aroundOneHundredDot" :label="$t('pages.luckyBoxFortuneConfig.label.aroundOneHundredDot')">
<el-input v-model.trim="form.aroundOneHundredDot" v-number />
</el-form-item>
<el-alert
:title="$t('pages.luckyBoxFortuneConfig.alert.luckyMoment')"
type="info"
:closable="false"
style="margin-bottom: 20px;"
/>
<el-form-item :label="$t('pages.luckyBoxFortuneConfig.label.luckyTimeOne')" prop="luckyTimeOne">
<el-input v-model="form.luckyTimeOne" v-number />
</el-form-item>
<el-form-item :label="$t('pages.luckyBoxFortuneConfig.label.luckyTimeTwo')" prop="luckyTimeTwo">
<el-input v-model="form.luckyTimeTwo" v-number />
</el-form-item>
<el-form-item :label="$t('pages.luckyBoxFortuneConfig.label.luckyTimeDuration')" prop="luckyTimeDuration">
<el-input v-model="form.luckyTimeDuration" v-number />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">{{ $t('pages.luckyBoxFortuneConfig.action.submit') }}</el-button>
</el-form-item>
</el-form>
</div>
</div>
</template>
<script>
import { getLuckyBoxFortuneConfig, addLuckyBoxFortuneConfig } from '@/api/game-lucky-box-config'
import { mapGetters } from 'vuex'
export default {
name: 'FortuneConfig',
data() {
return {
loading: false,
form: {
id: '',
oneDot: '',
twoDot: '',
threeDot: '',
aroundElevenDot: '',
aroundSixteenDot: '',
aroundTwentyOneDot: '',
aroundTwentySixDot: '',
aroundFiftyOneDot: '',
aroundOneHundredDot: '',
luckyTimeOne: '',
luckyTimeTwo: '',
luckyTimeDuration: '',
sysOrigin: 'HALAR'
},
fortuneConfigQuery: {
sysOrigin: 'HALAR'
}
}
},
computed: {
...mapGetters(['permissionsSysOriginPlatforms']),
rules() {
const commonValid = [{ required: true, message: this.$t('pages.luckyBoxFortuneConfig.validation.requiredField'), trigger: 'blur' }]
return {
oneDot: commonValid,
twoDot: commonValid,
threeDot: commonValid,
aroundElevenDot: commonValid,
aroundSixteenDot: commonValid,
aroundTwentyOneDot: commonValid,
aroundTwentySixDot: commonValid,
aroundFiftyOneDot: commonValid,
aroundOneHundredDot: commonValid,
luckyTimeOne: commonValid,
luckyTimeTwo: commonValid,
luckyTimeDuration: commonValid,
sysOrigin: commonValid
}
}
},
created() {
const that = this
const querySystem = this.permissionsSysOriginPlatforms[0]
if (!querySystem) {
return
}
that.fortuneConfigQuery.sysOrigin = querySystem.value
that.fortuneConfig()
},
methods: {
fortuneConfig() {
const that = this
that.submitLoading = true
getLuckyBoxFortuneConfig(that.fortuneConfigQuery).then(res => {
const { body } = res
that.form = body
that.submitLoading = false
}).catch(er => {
that.submitLoading = false
console.error(er)
that.$emit('fial', { error: er })
})
},
onSubmit() {
const that = this
var probability_1 = parseInt(that.form.oneDot) + parseInt(that.form.twoDot) + parseInt(that.form.threeDot)
var probability_2 = parseInt(that.form.aroundElevenDot) + parseInt(that.form.aroundSixteenDot) + parseInt(that.form.aroundTwentyOneDot) + parseInt(that.form.aroundTwentySixDot)
var probability_3 = parseInt(that.form.aroundFiftyOneDot) + parseInt(that.form.aroundOneHundredDot)
if (parseInt(that.form.oneDot) === 0 || parseInt(that.form.twoDot) === 0 || parseInt(that.form.threeDot) === 0 ||
parseInt(that.form.aroundElevenDot) === 0 || parseInt(that.form.aroundSixteenDot) === 0 ||
parseInt(that.form.aroundTwentyOneDot) === 0 || parseInt(that.form.aroundTwentySixDot) === 0 ||
parseInt(that.form.aroundFiftyOneDot) === 0 || parseInt(that.form.aroundOneHundredDot) === 0) {
that.$opsMessage.fail(that.$t('pages.luckyBoxFortuneConfig.message.probabilityGreaterThanZero'))
return
}
if (probability_1 !== 100 || probability_2 !== 100 || probability_3 !== 100) {
that.$opsMessage.fail(that.$t('pages.luckyBoxFortuneConfig.message.probabilityMustEqualHundred'))
return
}
that.$refs.form.validate((valid) => {
if (!valid) {
console.error('error submit!!')
return false
}
that.$confirm(that.$t('pages.luckyBoxFortuneConfig.confirm.submitMessage'), that.$t('pages.luckyBoxFortuneConfig.confirm.title'), {
confirmButtonText: that.$t('pages.luckyBoxFortuneConfig.confirm.confirmButtonText'),
cancelButtonText: that.$t('pages.luckyBoxFortuneConfig.confirm.cancelButtonText'),
type: 'warning'
}).then(() => {
that.loading = true
that.form.sysOrigin = that.fortuneConfigQuery.sysOrigin
addLuckyBoxFortuneConfig(that.form).then(res => {
that.loading = false
that.$opsMessage.success()
that.fortuneConfig()
}).catch(er => {
that.loading = false
console.error(er)
})
}).catch(() => { })
})
}
}
}
</script>

View File

@ -1,315 +0,0 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-select
v-model="listQuery.sysOrigin"
placeholder="系统"
style="width: 120px"
class="filter-item"
@change="changeSysOrigin"
>
<el-option
v-for="item in permissionsSysOriginPlatforms"
:key="item.value"
:label="item.label"
:value="item.value"
>
<span style="float: left;"> <sys-origin-icon :icon="item.value" :desc="item.value" /></span>
<span style="float: left;margin-left:10px">{{ item.label }}</span>
</el-option>
</el-select>
<div class="filter-item">
<div><account-input v-model="listQuery.userId" placeholder="用户id" type="USER" :sys-origin="listQuery.sysOrigin" /></div>
</div>
<el-select
v-model="listQuery.frequency"
placeholder="抽奖频数"
style="width: 120px"
class="filter-item"
clearable
@change="handleSearch"
>
<el-option
label="1"
:value="'1'"
/>
<el-option
label="10"
:value="'10'"
/>
<el-option
label="50"
:value="'50'"
/>
</el-select>
<div class="filter-item">
<search-room-input @success="searchRoomSuccess" @fail="searchRoomFail" @load="loadSearchRoom" />
</div>
<div class="filter-item">
<el-date-picker
v-model="rangeDate"
value-format="timestamp"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
/>
</div>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleSearch"
>
搜索
</el-button>
</div>
<div v-loading="countLoading">
<div slot="title" class="count-item">
<i>
<strong class="strong-style"> 筛选结果汇总</strong>
</i>
<i>
<strong class="strong-style"> 参加人数: {{ gameLuckyBoxCount.userCount || '-' }}</strong>
</i>
<i>
<strong class="strong-style"> 用户支出糖果数: {{ gameLuckyBoxCount.userExpendCount || '-' }}</strong>
</i>
<i>
<strong class="strong-style"> 出奖糖果数: {{ gameLuckyBoxCount.awardCount || '-' }}</strong>
</i>
</div>
<div slot="title" class="count-item">
<i>
<strong class="strong-style"> 抽奖券结果汇总</strong>
</i>
<i>
<strong class="strong-style"> 抽奖券数量: {{ gameLuckyBoxCount.ticketCount || '-' }}</strong>
</i>
<i>
<strong class="strong-style"> 消耗抽奖券数量: {{ gameLuckyBoxCount.consumeTicketCount || '-' }}</strong>
</i>
<i>
<strong class="strong-style"> 减去抽奖券出奖糖果数: {{ gameLuckyBoxCount.awardNotTicketCount || '-' }}</strong>
</i>
</div>
</div>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
fit
highlight-current-row
>
<el-table-column label="归属系统" align="center" min-width="50">
<template slot-scope="scope">
<sys-origin-icon :icon="scope.row.sysOrigin" :desc="scope.row.sysOrigin" />
</template>
</el-table-column>
<el-table-column label="用户" align="center" min-width="100">
<template slot-scope="scope">
<user-table-exhibit :user-profile="scope.row.userProfile" :query-details="true" />
</template>
</el-table-column>
<el-table-column label="房间" align="center">
<template slot-scope="scope">
<div class="room-profile flex-l">
<div class="avatar" style="margin: auto 0.2rem;">
<el-image
style="width:1rem;height: 1rem;border-radius: .2rem;"
:src="scope.row.roomProfile.roomCover"
:preview-src-list="[scope.row.roomProfile.roomCover]"
>
<div slot="error" class="image-slot">
<i class="el-icon-picture-outline" />
</div>
</el-image>
</div>
<div class="info nowrap-ellipsis">
<div class="nickname">
<el-link v-if="scope.row.roomProfile.roomName" @click="queryRoomDetails(scope.row.roomProfile.id)">
{{ scope.row.roomProfile.roomName }}
</el-link>
</div>
<div class="desc">
{{ scope.row.roomProfile.roomAccount }}
</div>
</div>
</div>
</template>
</el-table-column>
<el-table-column prop="payAmount" label="支出金币" align="center" min-width="100" />
<el-table-column prop="frequency" label="抽奖频数" align="center" min-width="100" />
<el-table-column prop="giftAmount" label="中奖礼物总价值" align="center" min-width="100" />
<el-table-column prop="createTime" label="创建时间" align="center" width="200">
<template slot-scope="scope">
{{ scope.row.createTime | dateFormat }}
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="listQuery.cursor"
:limit.sync="listQuery.limit"
@pagination="renderData"
/>
<user-deatils-drawer
v-if="userDeatilsDrawer"
:user-id="thatSelectedUserId"
@close="userDeatilsDrawer=false"
/>
<room-deatils-drawer
v-if="roomDeatilsDrawerVisible"
:room-id="roomId"
@close="roomDeatilsDrawerVisible=false"
/>
</div>
</template>
<script>
import { pageLuckyBoxGameRecord, countLuckyBoxGame } from '@/api/game-lucky-box-config'
import { mapGetters } from 'vuex'
import Pagination from '@/components/Pagination'
import { regionConfigTable } from '@/api/sys'
import RoomDeatilsDrawer from '@/components/data/RoomDeatilsDrawer'
export default {
name: 'LuckyGiftGiveRecord',
components: { RoomDeatilsDrawer, Pagination },
data() {
return {
list: [],
regions: [],
countLoading: false,
searchDisabled: false,
userDeatilsDrawer: false,
roomDeatilsDrawerVisible: false,
roomId: '',
thatSelectedUserId: '',
gameLuckyBoxCount: {},
rangeDate: [],
total: 0,
listQuery: {
cursor: 1,
limit: 20,
sysOrigin: 'HALAR',
roomId: '',
userId: '',
frequency: '',
startTime: '',
endTime: ''
},
listLoading: true
}
},
computed: {
...mapGetters(['permissionsSysOriginPlatforms'])
},
watch: {
rangeDate: {
immediate: true,
deep: true,
handler(newVal) {
if (newVal && newVal.length > 0) {
this.listQuery.startTime = newVal[0]
this.listQuery.endTime = newVal[1]
return
}
this.listQuery.startTime = ''
this.listQuery.endTime = ''
}
}
},
created() {
const that = this
const querySystem = this.permissionsSysOriginPlatforms[0]
if (!querySystem) {
return
}
that.listQuery.sysOrigin = querySystem.value
that.renderData(true)
that.listRegion()
that.getCountLuckyBoxGame()
},
methods: {
listRegion() {
const that = this
that.loading = true
regionConfigTable({ 'sysOrigin': that.listQuery.sysOrigin }).then(res => {
that.regions = res.body || []
that.loading = false
}).catch(er => {
that.loading = false
})
},
renderData(isReset) {
const that = this
if (isReset === true) {
that.listQuery.cursor = 1
that.list = []
}
that.listLoading = true
pageLuckyBoxGameRecord(that.listQuery).then(res => {
const { body } = res
that.total = body.total || 0
that.list = body.records
that.listLoading = false
}).catch(er => {
that.listLoading = false
})
},
changeSysOrigin() {
this.listRegion()
this.handleSearch()
},
handleSearch() {
this.renderData(true)
this.getCountLuckyBoxGame()
},
getCountLuckyBoxGame() {
const that = this
that.countLoading = true
countLuckyBoxGame(that.listQuery).then(res => {
that.countLoading = false
that.gameLuckyBoxCount = res.body || {}
}).catch(er => {
that.countLoading = false
})
},
loadSearchRoom() {
this.searchDisabled = true
},
queryRoomDetails(roomId) {
this.roomDeatilsDrawerVisible = true
this.roomId = roomId
},
searchRoomSuccess(res) {
this.searchDisabled = false
if (!res) {
return
}
this.listQuery.roomId = res.id
},
searchRoomFail() {
this.listQuery.roomId = ''
this.searchDisabled = false
},
queryUserDetails(userId) {
this.userDeatilsDrawer = true
this.thatSelectedUserId = userId
}
}
}
</script>
<style scoped lang="scss">
.strong-style{
padding-right: 20px;
font-style: normal;
}
.count-item{
padding-bottom: 20px;
}
</style>

View File

@ -1,158 +0,0 @@
<template>
<div class="edit-role">
<el-dialog
:title="title"
:visible="true"
:modal-append-to-body="true"
:append-to-body="true"
width="550px"
top="50px"
:before-close="handleClose"
:close-on-press-escape="false"
:close-on-click-modal="false"
>
<div style="height: 500px;overflow: auto;">
<el-form
ref="dataForm"
:rules="formRules"
:model="formData"
style="width: 400px; margin-left:50px;"
>
<el-form-item :label="$t('pages.luckyBoxStandardConfig.form.system')" prop="sysOrigin">
<el-select
v-model="formData.sysOrigin"
:placeholder="$t('pages.luckyBoxStandardConfig.placeholder.selectSystem')"
style="width:100%;"
class="filter-item"
>
<el-option
v-for="item in permissionsSysOriginPlatforms"
:key="item.value"
:label="item.label"
:value="item.value"
>
<span style="float: left;"> <sys-origin-icon :icon="item.value" :desc="item.value" /></span>
<span style="float: left;margin-left:10px">{{ item.label }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('pages.luckyBoxStandardConfig.form.type')" prop="lotteryType">
<el-select
v-model="formData.lotteryType"
:placeholder="$t('pages.luckyBoxStandardConfig.placeholder.type')"
clearable
style="width:100%;"
class="filter-item"
>
<el-option :label="$t('pages.luckyBoxStandardConfig.lotteryType.CLASSICS')" :value="'CLASSICS'" />
<el-option :label="$t('pages.luckyBoxStandardConfig.lotteryType.CONSTELLATION')" :value="'CONSTELLATION'" />
</el-select>
</el-form-item>
<el-form-item :label="$t('pages.luckyBoxStandardConfig.form.name')" prop="name">
<el-input v-model.trim="formData.name" type="text" :placeholder="$t('pages.luckyBoxStandardConfig.placeholder.name')" />
</el-form-item>
<el-form-item :label="$t('pages.luckyBoxStandardConfig.form.giftQuantity')" prop="giftQuantity">
<el-input v-model.trim="formData.giftQuantity" type="text" :placeholder="$t('pages.luckyBoxStandardConfig.placeholder.giftQuantity')" />
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleClose">
{{ $t('common.cancel') }}
</el-button>
<el-button
:loading="submitLoading"
type="primary"
@click="handleSubmit"
>
{{ $t('common.submit') }}
</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { addStandardConfig } from '@/api/game-lucky-box-config'
import { mapGetters } from 'vuex'
export default {
name: 'StandardConfigEdit',
props: {
updateData: {
type: Object,
default: null
},
sysOrigin: {
type: String,
default: null
}
},
data() {
return {
formData: {
id: '',
sysOrigin: '',
name: '',
lotteryType: '',
giftQuantity: ''
},
submitLoading: false
}
},
computed: {
isAdd() {
return this.updateData === null
},
title() {
const system = this.isAdd ? this.sysOrigin : this.updateData.sysOrigin
const action = this.isAdd
? this.$t('pages.luckyBoxStandardConfig.action.add')
: this.$t('pages.luckyBoxStandardConfig.action.edit')
return this.$t('pages.luckyBoxStandardConfig.dialog.formTitle', { action, system })
},
formRules() {
const requiredMessage = this.$t('pages.luckyBoxStandardConfig.validation.requiredField')
return {
sysOrigin: [{ required: true, message: requiredMessage, trigger: 'blur' }],
lotteryType: [{ required: true, message: requiredMessage, trigger: 'blur' }],
giftQuantity: [{ required: true, message: requiredMessage, trigger: 'blur' }]
}
},
...mapGetters(['permissionsSysOriginPlatforms'])
},
watch: {
updateData: {
immediate: true,
deep: true,
handler(newVal) {
Object.assign(this.formData, newVal)
}
}
},
methods: {
handleClose() {
this.$emit('close')
},
handleSubmit() {
const that = this
that.$refs.dataForm.validate(valid => {
if (valid) {
that.submitLoading = true
that.formData.sysOrigin = that.sysOrigin
addStandardConfig(that.formData).then(res => {
that.submitLoading = false
this.$emit('success', 'create')
}).catch(er => {
that.submitLoading = false
console.error(er)
this.$emit('fail')
})
} else {
console.error('error submit!!')
return false
}
})
}
}
}
</script>

View File

@ -1,406 +0,0 @@
<template>
<div class="app-container">
<el-dialog
:title="$t('pages.luckyBoxGiftDetails.dialog.listTitle')"
:visible.sync="isDialog"
:modal-append-to-body="true"
:append-to-body="true"
:before-close="handleClose"
:close-on-click-modal="false"
:fullscreen="true"
top="20px"
>
<div class="filter-container">
<el-button
class="filter-item"
style="margin-left: 10px;"
type="primary"
icon="el-icon-edit"
:disabled="isAdd"
@click="handleAdd"
>
{{ $t("pages.luckyBoxGiftDetails.action.add") }}
</el-button>
<el-alert
:title="$t('pages.luckyBoxGiftDetails.alert.title')"
type="warning"
:description="description"
show-icon
:closable="false"
/>
</div>
<el-table
v-loading="listLoading"
:data="dataList"
element-loading-text="Loading"
fit
highlight-current-row
>
<el-table-column type="index" width="50" label="No" />
<el-table-column
prop="sysOrigin"
:label="$t('pages.luckyBoxGiftDetails.table.platform')"
align="center"
width="280"
/>
<el-table-column
prop="name"
:label="$t('pages.luckyBoxGiftDetails.table.name')"
align="center"
width="280"
/>
<el-table-column
:label="$t('pages.luckyBoxGiftDetails.table.cover')"
align="center"
>
<template slot-scope="scope">
<el-image
style="width: 50px; height: 50px"
:src="scope.row.photoUrl"
:preview-src-list="[scope.row.photoUrl]"
/>
</template>
</el-table-column>
<el-table-column
prop="giftCandy"
:label="$t('pages.luckyBoxGiftDetails.table.gold')"
align="center"
width="280"
/>
<el-table-column
prop="createTime"
:label="$t('pages.luckyBoxGiftDetails.table.createdAt')"
align="center"
width="300"
>
<template slot-scope="scope">
{{ scope.row.createTime | dateFormat }}
</template>
</el-table-column>
<el-table-column
fixed="right"
:label="$t('pages.luckyBoxGiftDetails.table.actions')"
align="center"
>
<template slot-scope="scope">
<el-button type="text" @click.native="hanldeEidt(scope.row)">{{
$t("pages.luckyBoxGiftDetails.action.edit")
}}</el-button>
</template>
</el-table-column>
</el-table>
<div>
<el-dialog
:title="$t('pages.luckyBoxGiftDetails.dialog.formTitle')"
width="550px"
top="50px"
:visible.sync="innerEditVisible"
:modal-append-to-body="true"
:close-on-press-escape="false"
:close-on-click-modal="false"
append-to-body
>
<div style="height: 500px;overflow: auto;">
<el-form
ref="dataForm"
:rules="formRules"
:model="formData"
class="i18n-form"
style="width: 400px; margin-left:50px;"
>
<el-form-item
:label="$t('pages.luckyBoxGiftDetails.form.system')"
prop="sysOrigin"
>
<el-select
v-model="formData.sysOrigin"
:placeholder="$t('pages.luckyBoxGiftDetails.placeholder.selectSystem')"
style="width:100%;"
class="filter-item"
>
<el-option
v-for="item in permissionsSysOriginPlatforms"
:key="item.value"
:label="item.label"
:value="item.value"
>
<span style="float: left;"> <sys-origin-icon :icon="item.value" :desc="item.value" /></span>
<span style="float: left;margin-left:10px">{{ item.label }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item
:label="$t('pages.luckyBoxGiftDetails.form.name')"
prop="name"
>
<el-input
v-model="formData.name"
:placeholder="$t('pages.luckyBoxGiftDetails.placeholder.name')"
/>
</el-form-item>
<el-form-item
:label="$t('pages.luckyBoxGiftDetails.form.sort')"
prop="sort"
>
<el-input
v-model="formData.sort"
:placeholder="$t('pages.luckyBoxGiftDetails.placeholder.sort')"
/>
</el-form-item>
<el-form-item :label="$t('pages.luckyBoxGiftDetails.form.giftType')">
<el-select
v-model="formData.giftType"
:placeholder="$t('pages.luckyBoxGiftDetails.placeholder.giftType')"
style="width:100%;"
class="filter-item"
@change="getGiftListInfo()"
>
<el-option
v-for="item in localizedGiftConfigTabs"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item
prop="giftId"
:label="$t('pages.luckyBoxGiftDetails.form.resource')"
>
<el-select
v-model="formData.giftId"
v-loading="giftLoading"
:placeholder="$t('pages.luckyBoxGiftDetails.placeholder.select')"
style="width:100%;"
@change="showPhoto"
>
<el-option
v-for="(item, index) in gifts"
:key="index"
:label="item.id"
:value="item.id"
:style="'height:65px'"
>
<div style="float: left;">
<img :src="item.giftPhoto" width="65px" height="65px">
</div>
</el-option>
</el-select>
<div style="float: left;">
<img class="img" :src="photoUrl" width="65px" height="65px">
</div>
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="innerEditVisible = false">
{{ $t("common.cancel") }}
</el-button>
<el-button
:loading="submitLoading"
type="primary"
@click="handleSubmit"
>
{{ $t("common.submit") }}
</el-button>
</div>
</el-dialog>
</div>
</el-dialog>
</div>
</template>
<script>
import { getGameLuckyBoxGiftConfig, addOrUpdateGiftConfig } from '@/api/game-lucky-box-config'
import { mapGetters } from 'vuex'
import { giftConfigTabs } from '@/constant/type'
import { listByTabV2 } from '@/api/gift'
export default {
name: 'GiftConfigTable',
components: { },
props: {
standardInfo: {
type: Object,
required: true
},
updateGiftData: {
type: Object,
default: null
}
},
data() {
return {
standardConfig: {
id: '',
giftQuantity: ''
},
gifts: [],
isAdd: true,
photoUrl: '',
giftPhoto: '',
giftLoading: false,
giftConfigTabs,
dataList: [],
isDialog: true,
innerEditVisible: false,
listQuery: {
standardId: '',
sysOrigin: 'HALAR'
},
formData: {
id: '',
standardId: '',
sysOrigin: 'HALAR',
name: '',
giftType: '',
giftId: '',
sort: ''
},
gift: {
id: '',
giftPhoto: ''
},
submitLoading: false,
listLoading: true
}
},
computed: {
description() {
return this.$t('pages.luckyBoxGiftDetails.alert.description', {
count: this.standardConfig.giftQuantity
})
},
localizedGiftConfigTabs() {
return this.giftConfigTabs.map(item => ({
...item,
label: this.$t(`pages.luckyBoxGiftDetails.giftType.${item.value}`)
}))
},
formRules() {
const commonRules = [
{
required: true,
message: this.$t('pages.luckyBoxGiftDetails.validation.requiredField'),
trigger: 'blur'
}
]
return {
sysOrigin: commonRules,
sort: commonRules,
giftType: commonRules
}
},
...mapGetters(['permissionsSysOriginPlatforms'])
},
watch: {
standardInfo: {
handler(newVal) {
this.standardConfig = newVal
this.listQuery.standardId = this.standardConfig.id
this.renderData()
},
immediate: true
},
updateGiftData: {
immediate: true,
deep: true,
handler(newVal) {
Object.assign(this.formData, newVal)
this.giftData = newVal
this.getGiftList()
}
}
},
created() {
if (!this.permissionsFirstSysOrigin) {
return
}
this.listQuery.sysOrigin = this.permissionsFirstSysOrigin.value
this.renderData()
},
methods: {
renderData() {
const that = this
that.listLoading = true
getGameLuckyBoxGiftConfig(that.listQuery).then(res => {
const { body } = res
that.dataList = body
that.isAdd = parseInt(that.standardConfig.giftQuantity) === parseInt(that.dataList.length)
that.listLoading = false
}).catch(er => {
that.listLoading = false
})
},
handleAdd() {
this.innerEditVisible = true
this.formData = {}
this.photoUrl = ''
},
handleClose() {
this.$emit('close')
},
handleSubmit() {
const that = this
that.$refs.dataForm.validate(valid => {
if (valid) {
that.submitLoading = true
that.formData.standardId = that.listQuery.standardId
addOrUpdateGiftConfig(that.formData).then(res => {
that.submitLoading = false
that.innerEditVisible = false
that.renderData()
this.$emit('success', 'create')
}).catch(er => {
that.submitLoading = false
that.innerEditVisible = false
console.error(er)
this.$emit('fail')
})
} else {
console.error('error submit!!')
return false
}
})
},
getGiftListInfo() {
const that = this
that.formData.giftId = ''
that.photoUrl = ''
that.getGiftList()
},
hanldeEidt(row) {
this.innerEditVisible = true
this.giftData = row
this.formData = this.giftData
this.photoUrl = this.giftData.photoUrl
},
showPhoto() {
const that = this
const item = this.gifts.find(item1 => item1.id === that.formData.giftId) || that.gift
that.photoUrl = item.giftPhoto
},
getGiftList() {
const that = this
that.giftLoading = true
listByTabV2({ 'sysOrigin': that.formData.sysOrigin, 'giftTab': that.formData.giftType }).then(res => {
that.gifts = res.body || []
that.giftLoading = false
this.showPhoto()
}).catch(er => {
that.giftLoading = false
console.error(er)
})
}
}
}
</script>
<style scoped lang="scss">
.col-margin {
margin-bottom: 20px;
}
img[src=""],img:not([src]){
opacity: 0;
}
</style>

View File

@ -1,272 +0,0 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-select
v-model="listQuery.sysOrigin"
:placeholder="$t('pages.luckyBoxStandardConfig.filter.system')"
style="width: 120px"
class="filter-item"
@change="handleSearch"
>
<el-option
v-for="item in permissionsSysOriginPlatformAlls"
:key="item.value"
:label="item.label"
:value="item.value"
>
<span style="float: left;"> <sys-origin-icon :icon="item.value" :desc="item.value" /></span>
<span style="float: left;margin-left:10px">{{ item.label }}</span>
</el-option>
</el-select>
<el-select
v-model="listQuery.lotteryType"
:placeholder="$t('pages.luckyBoxStandardConfig.filter.lotteryType')"
style="width:120px;"
class="filter-item"
clearable
@change="handleSearch"
>
<el-option :label="$t('pages.luckyBoxStandardConfig.lotteryType.CLASSICS')" :value="'CLASSICS'" />
<el-option :label="$t('pages.luckyBoxStandardConfig.lotteryType.CONSTELLATION')" :value="'CONSTELLATION'" />
</el-select>
<el-select
v-model="listQuery.closed"
:placeholder="$t('pages.luckyBoxStandardConfig.filter.status')"
style="width: 120px"
class="filter-item"
clearable
@change="handleSearch"
>
<el-option :label="$t('pages.luckyBoxStandardConfig.status.normal')" :value="false" />
<el-option :label="$t('pages.luckyBoxStandardConfig.status.closed')" :value="true" />
</el-select>
<el-button
:loading="searchLoading"
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleSearch"
>
{{ $t('common.search') }}
</el-button>
<el-button
class="filter-item"
style="margin-left: 10px;"
type="primary"
icon="el-icon-edit"
@click="handleAdd"
>
{{ $t('pages.luckyBoxStandardConfig.action.add') }}
</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
fit
highlight-current-row
>
<el-table-column prop="sysOrigin" :label="$t('pages.luckyBoxStandardConfig.table.platform')" align="center" width="200" />
<el-table-column prop="name" :label="$t('pages.luckyBoxStandardConfig.table.name')" width="200" />
<el-table-column :label="$t('pages.luckyBoxStandardConfig.table.type')" align="center" width="200">
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.lotteryType === 'CLASSICS'">{{ $t('pages.luckyBoxStandardConfig.lotteryType.CLASSICS') }}</el-tag>
<el-tag v-else-if="scope.row.lotteryType === 'CONSTELLATION'">{{ $t('pages.luckyBoxStandardConfig.lotteryType.CONSTELLATION') }}</el-tag>
</div>
</template>
</el-table-column>
<el-table-column prop="giftQuantity" :label="$t('pages.luckyBoxStandardConfig.table.giftQuantity')" width="200" />
<el-table-column width="200" :label="$t('pages.luckyBoxStandardConfig.table.status')" align="center" min-width="100">
<template slot-scope="scope">
<el-switch
v-model="scope.row.closed"
:active-value="false"
:inactive-value="true"
@change="handleSwitchChange(scope.row)"
/>
</template>
</el-table-column>
<el-table-column prop="createTime" :label="$t('pages.luckyBoxStandardConfig.table.createdAt')" align="center" width="200">
<template slot-scope="scope">
{{ scope.row.createTime | dateFormat }}
</template>
</el-table-column>
<el-table-column fixed="right" :label="$t('pages.luckyBoxStandardConfig.table.actions')" align="center">
<template slot-scope="scope">
<el-button type="text" @click.native="hanldeEidt(scope.row)">{{ $t('pages.luckyBoxStandardConfig.action.edit') }}</el-button>
<el-button type="text" @click.native="hanldeGiftConfig(scope.row)">{{ $t('pages.luckyBoxStandardConfig.action.giftConfig') }}</el-button>
<el-button type="text" @click.native="handleProbabilityConfigList(scope.row)">{{ $t('pages.luckyBoxStandardConfig.action.probabilityConfig') }}</el-button>
<el-button type="text" @click.native="handlDel(scope.row)">{{ $t('pages.luckyBoxStandardConfig.action.delete') }}</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="listQuery.cursor"
:limit.sync="listQuery.limit"
@pagination="renderData"
/>
<config-edit
v-if="standardConfigEditVisible"
:update-data="updateData"
:sys-origin="listQuery.sysOrigin"
@close="standardConfigEditVisible = false"
@success="standardConfigEditSuccess"
/>
<gift-config-edit
v-if="giftConfigVisible"
:standard-info="thatSelectedStandardConfig"
:event="luckyBoxEditEvent"
@close="giftConfigVisible=false"
/>
<probability-config
v-if="probabilityConfigVisible"
:standard-id="thatSelectedStandardConfigId"
:event="luckyBoxEditEvent"
@close="probabilityConfigVisible=false"
/>
</div>
</template>
<script>
import { getStandardConfig, deleteStandardConfig, switchStatus } from '@/api/game-lucky-box-config'
import Pagination from '@/components/Pagination'
import ConfigEdit from './edit.vue'
import GiftConfigEdit from './gift-details.vue'
import ProbabilityConfig from './probability.vue'
import { mapGetters } from 'vuex'
export default {
name: 'StandardConfigTable',
components: {
Pagination, ConfigEdit, ProbabilityConfig, GiftConfigEdit
},
data() {
return {
standardConfigEditVisible: false,
probabilityConfigVisible: false,
giftConfigVisible: false,
thatSelectedStandardConfigId: '',
thatSelectedStandardConfig: {},
updateData: null,
luckyBoxEditEvent: 'ADD',
thisRow: {},
list: [],
total: 0,
listQuery: {
cursor: 1,
limit: 20,
sysOrigin: 'HALAR',
lotteryType: '',
closed: ''
},
listLoading: true,
searchLoading: false
}
},
computed: {
...mapGetters(['permissionsSysOriginPlatformAlls', 'permissionsFirstSysOrigin'])
},
created() {
if (!this.permissionsFirstSysOrigin) {
return
}
this.listQuery.sysOrigin = this.permissionsFirstSysOrigin.value
this.renderData(true)
},
methods: {
renderData(isReset) {
const that = this
if (isReset === true) {
that.listQuery.cursor = 1
}
that.listLoading = true
getStandardConfig(that.listQuery).then(res => {
const { body } = res
that.total = body.total || 0
that.list = body.records
that.searchLoading = that.listLoading = false
}).catch(er => {
that.searchLoading = that.listLoading = false
})
},
handleSearch() {
this.searchLoading = true
this.renderData(true)
},
handleProbabilityConfigList(row) {
this.thatSelectedStandardConfigId = String(row.id)
this.probabilityConfigVisible = true
},
hanldeGiftConfig(row) {
this.thatSelectedStandardConfig = row
this.giftConfigVisible = true
},
handleAdd() {
this.standardConfigEditVisible = true
this.updateData = null
},
hanldeEidt(row) {
this.standardConfigEditVisible = true
this.updateData = row
},
standardConfigEditSuccess(event) {
this.updateData = null
this.standardConfigEditVisible = false
this.renderData(event === 'create')
},
handleSwitchChange(row) {
switchStatus(row.id, row.closed)
.then(res => {})
.catch(er => {
row.closed = !row.closed
})
},
//
handlDel(row) {
this.$confirm(this.$t('pages.luckyBoxStandardConfig.confirm.deleteMessage'), this.$t('pages.luckyBoxStandardConfig.confirm.title'), {
type: 'warning'
}).then(() => {
this.listLoading = true
deleteStandardConfig(row.id).then((res) => {
this.listLoading = false
this.$message({
message: this.$t('pages.luckyBoxStandardConfig.message.deleteSuccess'),
type: 'success'
})
this.renderData()
})
}).catch(() => {
this.listLoading = false
})
}
}
}
</script>
<style scoped lang="scss">
.this-level {
padding-bottom: 30px;
display: flex;
> div {
width: 150px;
}
}
.el-tag + .el-tag {
margin-left: 10px;
}
.button-new-tag {
margin-left: 10px;
}
.input-new-tag {
width: 90px;
margin-left: 10px;
vertical-align: bottom;
}
</style>

View File

@ -1,569 +0,0 @@
<template>
<div class="app-container">
<el-dialog
v-loading="listLoading"
:title="$t('pages.luckyBoxStandardConfig.dialog.probabilityTitle')"
:visible="isDialog"
:modal-append-to-body="true"
:append-to-body="true"
:before-close="handleClose"
:close-on-click-modal="false"
:fullscreen="true"
top="20px"
>
<div style="display: inline-flex; flex-direction: row; justify-content: space-around;">
<el-card v-for="(item, index) in configList" :key="index" class="box-card" style="width:820px;margin: 0rem 10px;margin-bottom: 20px;">
<div slot="header" class="clearfix">
<span>{{ $t('pages.luckyBoxStandardConfig.probability.sort', { value: item.sort }) }}</span>
<el-button style="float: right; padding: 3px 0" type="text" @click="saveData(item)">{{ $t('pages.luckyBoxStandardConfig.action.save') }}</el-button>
</div>
<div style="padding-bottom: 20px;">
<el-alert
v-if="10000 - item.sumProbability > 0"
:title="$t('pages.luckyBoxStandardConfig.probability.remaining', { value: 10000 - item.sumProbability })"
type="warning"
:closable="false"
/>
<el-alert
v-else-if="10000 == item.sumProbability"
:title="$t('pages.luckyBoxStandardConfig.probability.completed')"
type="success"
:closable="false"
/>
<el-alert
v-else
:title="$t('pages.luckyBoxStandardConfig.probability.exceeded', { value: item.sumProbability - 10000 })"
type="error"
:closable="false"
/>
<el-alert
v-if="10000 - item.sumLuckyProbability > 0"
:title="$t('pages.luckyBoxStandardConfig.probability.luckyRemaining', { value: 10000 - item.sumLuckyProbability })"
type="warning"
:closable="false"
/>
<el-alert
v-else-if="10000 == item.sumLuckyProbability"
:title="$t('pages.luckyBoxStandardConfig.probability.luckyCompleted')"
type="success"
:closable="false"
/>
<el-alert
v-else
:title="$t('pages.luckyBoxStandardConfig.probability.luckyExceeded', { value: item.sumLuckyProbability - 10000 })"
type="error"
:closable="false"
/>
</div>
<div class="gift-probability-form">
<el-form :ref="'configList' + index" :model="item" label-width="140px">
<el-form-item :label="$t('pages.luckyBoxStandardConfig.form.quantity')" class="gift-probability-label">
<el-input v-model.trim="item.frequency" class="gift-probability-config" oninput="value=value.replace(/[^0-9.]/g,'')" />
</el-form-item>
<el-form-item :label="$t('pages.luckyBoxStandardConfig.form.gold')" class="gift-probability-label">
<el-input v-model.trim="item.consumptionGold" class="gift-probability-config" oninput="value=value.replace(/[^0-9.]/g,'')" />
</el-form-item>
</el-form>
</div>
<el-divider>{{ $t('pages.luckyBoxStandardConfig.section.probability') }}</el-divider>
<div class="luck-gift-probability-details-config-edit">
<div class="form-edit">
<el-form :ref="'formInfo' + index" :model="item.formInfo" label-width="80px" style="margin-right:50px;">
<div class="dr-content">
<div ref="probabilityDetailsContent">
<div
v-for="(item1, index1) in item.formInfo.probabilityDetailsConfigList"
:key="index1"
style="display: flex;
flex-direction: row;
justify-content: space-around;
align-items: flex-start;margin: auto;
cursor:pointer;line-height:30px;align-items: center;"
>
<div class="sort" style="width: 30px;">{{ index1 + 1 }}</div>
<div style="width: 130px;color:#f78e8e;margin-left: 0.3rem;"><el-input v-model.trim="item1.probability" oninput="value=value.replace(/[^0-9.]/g,'')" :placeholder="$t('pages.luckyBoxStandardConfig.placeholder.defaultProbability')" @input="calculateProbability(item)" /></div>
<div style="width: 130px;color:#f78e8e;margin-left: 0.3rem;"><el-input v-model.trim="item1.luckyProbability" oninput="value=value.replace(/[^0-9.]/g,'')" :placeholder="$t('pages.luckyBoxStandardConfig.placeholder.luckyProbability')" @input="calculateProbability(item)" /></div>
<div style="width: 130px;color:#f78e8e;margin-left: 0.3rem;">
<el-select v-model="item1.giftConfigId" v-loading="loading" :placeholder="$t('pages.luckyBoxStandardConfig.placeholder.select')" style="width:100%;">
<el-option
v-for="(item10, index10) in mapGiftConfig"
:key="index10"
:label="item10.name"
:value="item10.value"
/>
</el-select>
</div>
<div style="width: 130px;color:#f78e8e;margin-left: 0.3rem;"><el-input v-model.trim="item1.quantity" oninput="value=value.replace(/[^0-9.]/g,'')" :placeholder="$t('pages.luckyBoxStandardConfig.placeholder.stock')" /></div>
<div style="width: 30px;text-align: left; padding-left: 10px;"><i class="del el-icon-delete-solid" @click="deleteUpdateItem(item,index1)" /></div>
</div>
</div>
</div>
<el-form-item>
<div class="content-list">
<el-row v-for="(item2, index2) in item.formInfo.tmpConfigList" :key="index2">
<div class="content-box">
<div
style="display: flex;
flex-direction: row;
justify-content: space-around;
align-items: flex-start;margin: 0.1rem auto;"
>
<div style="width: 240px;">
<el-form-item
:prop="'tmpConfigList.' + index2 + '.probability'"
:rules="requiredRule"
>
<span><el-input v-model="item2.probability" v-number :placeholder="$t('pages.luckyBoxStandardConfig.placeholder.probabilityExample')" oninput="value=value.replace(/[^0-9.]/g,'')" /></span>
</el-form-item>
</div>
<div style="width: 240px; margin: 0rem 0.1rem;">
<el-form-item
:prop="'tmpConfigList.' + index2 + '.luckyProbability'"
:rules="requiredRule"
>
<span><el-input v-model="item2.luckyProbability" :placeholder="$t('pages.luckyBoxStandardConfig.placeholder.luckyProbability')" oninput="value=value.replace(/[^0-9.]/g,'')" /></span>
</el-form-item>
</div>
<div style="width: 215px; margin: 0rem 0.1rem;">
<el-form-item
:prop="'tmpConfigList.' + index2 + '.giftConfigId'"
:rules="requiredRule"
>
<el-select v-model="item2.giftConfigId" v-loading="loading" :placeholder="$t('pages.luckyBoxStandardConfig.placeholder.relationGift')" style="width:100%;">
<el-option
v-for="(item9, index9) in mapGiftConfig"
:key="index9"
:label="item9.name"
:value="item9.value"
/>
</el-select>
</el-form-item>
</div>
<div style="width: 120px; margin: 0rem 0.1rem;">
<el-form-item
:prop="'tmpConfigList.' + index2 + '.quantity'"
:rules="requiredRule"
>
<span><el-input v-model="item2.quantity" :placeholder="$t('pages.luckyBoxStandardConfig.placeholder.stock')" oninput="value=value.replace(/[^0-9.]/g,'')" /></span>
</el-form-item>
</div>
<div style="width: 100px;">
<i class="del el-icon-delete-solid" @click="deleteItem(item)" />
<i class="save el-icon-success" @click="submitItem(index, item2, item)" />
</div>
</div>
</div>
</el-row>
</div>
<div style="text-align: center;">
<el-button type="text" @click="addContent(index, item)"><i class="el-icon-circle-plus" />{{ $t('pages.luckyBoxStandardConfig.action.addProbabilityDetail') }}</el-button>
</div>
</el-form-item>
</el-form>
</div>
</div>
</el-card>
</div>
<el-alert
:title="$t('pages.luckyBoxStandardConfig.alert.probabilityRuleTitle')"
type="warning"
:description="$t('pages.luckyBoxStandardConfig.alert.probabilityRuleDescription')"
show-icon
:closable="false"
/>
<el-divider>{{ $t('pages.luckyBoxStandardConfig.section.giftInfo') }}</el-divider>
<div>
<el-table
v-loading="giftListLoading"
:data="giftDataList"
element-loading-text="Loading"
fit
highlight-current-row
>
<el-table-column type="index" width="50" label="No" />
<el-table-column prop="sysOrigin" :label="$t('pages.luckyBoxStandardConfig.table.platform')" align="center" width="280" />
<el-table-column prop="name" :label="$t('pages.luckyBoxStandardConfig.table.name')" align="center" width="280" />
<el-table-column prop="giftCandy" :label="$t('pages.luckyBoxStandardConfig.table.gold')" align="center" width="280" />
<el-table-column :label="$t('pages.luckyBoxStandardConfig.table.cover')" align="center">
<template slot-scope="scope">
<el-image
style="width: 50px; height: 50px"
:src="scope.row.photoUrl"
:preview-src-list="[scope.row.photoUrl]"
/>
</template>
</el-table-column>
<el-table-column prop="createTime" :label="$t('pages.luckyBoxStandardConfig.table.createdAt')" align="center" width="300">
<template slot-scope="scope">
{{ scope.row.createTime | dateFormat }}
</template>
</el-table-column>
</el-table>
</div>
</el-dialog>
</div>
</template>
<script>
import { getGameLuckyBoxStandardDetailsConfig, addGameLuckyBoxStandardDetailsConfig, mapLuckyBoxGiftMap, getGameLuckyBoxGiftConfig } from '@/api/game-lucky-box-config'
import { mapGetters } from 'vuex'
export default {
name: 'LuckyBoxProbabilityConfigEdit',
props: {
standardId: {
type: String,
required: true
}
},
data() {
return {
disableAddContent: false,
submitLoading: false,
mapGiftConfig: [],
configList: [
{ id: '', standardId: '', consumptionGold: '', frequency: '', sysOrigin: '', sumProbability: 0, sumLuckyProbability: 0, sort: 1, formInfo: {
tmpConfigList: [],
probabilityDetailsConfigList: []
}},
{ id: '', standardId: '', consumptionGold: '', frequency: '', sysOrigin: '', sumProbability: 0, sumLuckyProbability: 0, sort: 2, formInfo: {
tmpConfigList: [],
probabilityDetailsConfigList: []
}},
{ id: '', standardId: '', consumptionGold: '', frequency: '', sysOrigin: '', sumProbability: 0, sumLuckyProbability: 0, sort: 3, formInfo: {
tmpConfigList: [],
probabilityDetailsConfigList: []
}}],
submitDataInfo: {
gameLuckyBoxTimeConfig: { id: '', standardId: '', consumptionGold: '', frequency: '', sysOrigin: '', sort: '' },
gameLuckyBoxProbabilityConfigs: []
},
listQuery: {
standardId: '',
sysOrigin: 'HALAR'
},
isDialog: true,
giftListLoading: true,
giftDataList: [],
listLoading: false
}
},
computed: {
requiredRule() {
return { required: true, message: this.$t('pages.luckyBoxStandardConfig.validation.notEmpty'), trigger: 'blur' }
},
...mapGetters(['permissionsSysOriginPlatforms'])
},
watch: {
standardId: {
handler(newVal) {
this.listQuery.standardId = newVal
this.probabilityConfig()
//
this.loadMapLuckyBoxGiftConfig()
},
immediate: true
}
},
created() {
const that = this
const querySystem = this.permissionsSysOriginPlatforms[0]
if (!querySystem) {
return
}
that.listQuery.sysOrigin = querySystem.value
that.renderGiftData()
},
methods: {
probabilityConfig() {
const that = this
that.listLoading = true
getGameLuckyBoxStandardDetailsConfig(that.listQuery).then(res => {
const { body } = res
const dataList = body || []
if (dataList) {
that.configList.forEach((configItem, configIndex) => {
const items = dataList.filter(item_ => item_.sort === configItem.sort)
if (items.length > 0) {
const item = items[0]
var probabilityDetails_ = 0
var luckyProbabilityDetails_ = 0
item.gameLuckyBoxProbabilityConfigs.forEach(probabilityDetails => {
probabilityDetails_ += probabilityDetails.probability
luckyProbabilityDetails_ += probabilityDetails.luckyProbability
})
const dataTmp = {
id: item.id,
standardId: item.standardId,
frequency: item.frequency,
consumptionGold: item.consumptionGold,
sysOrigin: item.sysOrigin,
sort: item.sort,
sumProbability: probabilityDetails_,
sumLuckyProbability: luckyProbabilityDetails_,
formInfo: {
tmpConfigList: [],
probabilityDetailsConfigList: item.gameLuckyBoxProbabilityConfigs
}
}
that.configList.splice(configIndex, 1, dataTmp)
}
})
}
that.listLoading = false
}).catch(er => {
that.listLoading = false
})
},
handleClose() {
this.$emit('close')
},
saveData(item) {
const that = this
if (!item.frequency || parseInt(item.frequency) <= 0) {
that.$opsMessage.fail(this.$t('pages.luckyBoxStandardConfig.message.quantityPositiveInteger'))
return
}
if (!item.consumptionGold || parseInt(item.consumptionGold) <= 0) {
that.$opsMessage.fail(this.$t('pages.luckyBoxStandardConfig.message.goldPositiveInteger'))
return
}
if (item.formInfo.probabilityDetailsConfigList.length <= 0) {
that.$opsMessage.fail(this.$t('pages.luckyBoxStandardConfig.message.configureProbabilityDetails'))
return
}
var probability_ = 0
var probabilityValue = 0
var luckyProbability_ = 0
var luckyProbabilityValue = 0
item.formInfo.probabilityDetailsConfigList.forEach(detailsConfig => {
probabilityValue = parseInt(detailsConfig.probability)
probability_ += parseInt(detailsConfig.probability)
luckyProbabilityValue = parseInt(detailsConfig.luckyProbability)
luckyProbability_ += parseInt(detailsConfig.luckyProbability)
})
if (probability_ !== 10000) {
that.$opsMessage.fail(this.$t('pages.luckyBoxStandardConfig.message.probabilityMustEqual10000'))
return
}
if (luckyProbability_ !== 10000) {
that.$opsMessage.fail(this.$t('pages.luckyBoxStandardConfig.message.luckyProbabilityMustEqual10000'))
return
}
if (probabilityValue === 0) {
that.$opsMessage.fail(this.$t('pages.luckyBoxStandardConfig.message.probabilityGreaterThanZero'))
return
}
if (luckyProbabilityValue === 0) {
that.$opsMessage.fail(this.$t('pages.luckyBoxStandardConfig.message.luckyProbabilityGreaterThanZero'))
return
}
that.listLoading = true
that.submitDataInfo.gameLuckyBoxProbabilityConfigs = item.formInfo.probabilityDetailsConfigList
that.submitDataInfo.gameLuckyBoxTimeConfig.id = item.id
that.submitDataInfo.gameLuckyBoxTimeConfig.frequency = item.frequency
that.submitDataInfo.gameLuckyBoxTimeConfig.consumptionGold = item.consumptionGold
that.submitDataInfo.gameLuckyBoxTimeConfig.sysOrigin = that.listQuery.sysOrigin
that.submitDataInfo.gameLuckyBoxTimeConfig.standardId = that.listQuery.standardId
that.submitDataInfo.gameLuckyBoxTimeConfig.sort = item.sort
this.$confirm(this.$t('pages.luckyBoxStandardConfig.confirm.saveMessage'), this.$t('pages.luckyBoxStandardConfig.confirm.saveTitle'), {
type: 'warning'
}).then(() => {
addGameLuckyBoxStandardDetailsConfig(that.submitDataInfo).then(res => {
that.listLoading = false
this.$opsMessage.success()
this.probabilityConfig()
}).catch(er => {
that.listLoading = false
this.$opsMessage.fail()
this.probabilityConfig()
})
}).catch(() => {
this.listLoading = false
})
},
deleteItem(item) {
item.formInfo.tmpConfigList = []
this.calculateProbability(item)
},
deleteUpdateItem(item, index) {
item.formInfo.probabilityDetailsConfigList.splice(index, 1)
this.calculateProbability(item)
},
calculateProbability(item) {
var sumProbability = 0
var sumLuckyProbability = 0
item.formInfo.probabilityDetailsConfigList.forEach(details => {
if (details.probability) {
sumProbability += parseInt(details.probability)
}
if (details.luckyProbability) {
sumLuckyProbability += parseInt(details.luckyProbability)
}
})
item.sumProbability = sumProbability
item.sumLuckyProbability = sumLuckyProbability
},
addContent(index, item) {
const that = this
that.$refs['formInfo' + index][0].validate(valid => {
if (!valid) {
console.error('error submit!!')
return
}
if (item.formInfo.tmpConfigList.length > 0) {
return
}
item.formInfo.tmpConfigList.push({
luckyProbability: '',
probability: '',
quantity: '',
giftConfigId: ''
})
})
},
submitItem(index, item, itemSuper) {
const that = this
that.$refs['formInfo' + index][0].validate(valid => {
if (!valid) {
console.error('error submit!!')
return
}
itemSuper.formInfo.probabilityDetailsConfigList.push({
luckyProbability: item.luckyProbability,
quantity: item.quantity,
probability: item.probability,
giftConfigId: item.giftConfigId
})
itemSuper.formInfo.tmpConfigList = []
that.calculateProbability(itemSuper)
})
},
loadMapLuckyBoxGiftConfig() {
const that = this
that.loading = true
mapLuckyBoxGiftMap(that.listQuery).then(res => {
that.mapGiftConfig = res.body || []
that.loading = false
}).catch(er => {
that.loading = false
})
},
renderGiftData() {
const that = this
that.giftListLoading = true
getGameLuckyBoxGiftConfig(that.listQuery).then(res => {
const { body } = res
that.giftDataList = body
that.giftListLoading = false
}).catch(er => {
that.giftListLoading = false
})
}
}
}
</script>
<style scoped lang="scss">
.app-container {
.luck-gift-probability-details-config-edit {
.form-edit {
overflow: auto;
.dr-content {
padding: 5px 0px 5px 20px;
}
.sort {
border-radius: 50%;
width: 30px;
height: 30px;
background: #f7f6f5;
margin: auto;
text-align: center;
line-height: 29px;
font-weight: bold;
}
.del {
font-size: 30px;
color: #F56C6C;
cursor: pointer;
}
.save {
font-size: 30px;
color: #FF9326;
cursor: pointer;
}
}
}
.filter-container {
.el-dropdown {
vertical-align: top;
}
.el-dropdown + .el-dropdown {
margin-left: 15px;
}
.el-icon-arrow-down {
font-size: 12px;
}
}
.form_ {
display: flex;
justify-content: space-around;
flex-direction: row;
align-items: center;
text-align: center;
}
}
.time {
font-size: 13px;
color: #999;
}
.bottom {
margin-top: 13px;
line-height: 12px;
}
.button {
padding: 0;
float: right;
}
.image {
width: 30%;
margin-top: 10px;
display: block;
}
.clearfix:before,
.clearfix:after {
display: table;
content: "";
}
.clearfix:after {
clear: both
}
.gift-probability-config{
width: 75%;
}
.gift-probability-label{
padding: 0px;
text-align: left;
}
.table-column{
padding: 0px;
}
.dialog-footer{
font-size: medium;
font-style: oblique;
font-family: ui-rounded;
color: rgb(255, 17, 0);
}
</style>

View File

@ -1,251 +0,0 @@
<template>
<div class="gift-edit">
<el-dialog
:title="eventName"
:visible="true"
:modal-append-to-body="true"
:append-to-body="true"
:before-close="handleClose"
:destroy-on-close="true"
:close-on-click-modal="false"
top="50px"
width="80%"
>
<div v-loading="submitLoading">
<el-form ref="form" :model="form" :rules="rules" label-width="110px" style="margin-right:50px;">
<el-form-item label-width="0">
<el-col :md="12" :sm="24" class="col-margin">
<el-form-item label="平台" prop="sysOrigin">
<el-select
v-model="form.sysOrigin"
:disabled="isUpdate"
placeholder="归属平台"
style="width: 100%"
class="filter-item"
@change="listRegion()"
>
<el-option
v-for="(item, index) in permissionsSysOriginPlatforms"
:key="index"
:label="item.label"
:value="item.value"
>
<span style="float: left;"> <sys-origin-icon :icon="item.value" :desc="item.value" /></span>
<span style="float: left;margin-left:10px">{{ item.label }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item prop="regionList" label="区域">
<el-select v-model="form.regionList" v-loading="loading" multiple placeholder="请选择" style="width:100%;">
<el-option
v-for="(item, index) in regions"
:key="index"
:label="item.regionName"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
</el-form-item>
<el-form-item prop="giftTab" label-width="0">
<el-col :md="12" :sm="24">
<el-form-item prop="resourceType" label="资源类型">
<el-select
v-model="form.resourceType"
placeholder="资源类型"
style="width:100%;"
class="filter-item"
@change="listGiftOrEmojiV2()"
>
<el-option label="礼物" :value="'GIFT'" />
<el-option label="表情包" :value="'EMOJI'" />
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" class="col-margin">
<el-form-item prop="resourceId" label="资源">
<el-select v-model="form.resourceId" v-loading="giftLoading" placeholder="请选择" style="width:100%;" @change="showPhoto">
<el-option
v-for="(item, index) in gifts"
:key="index"
:label="item.resourceId"
:value="item.resourceId"
:style="'height:65px'"
>
<div style="float: left;">
<img :src="item.photoInfo" width="65px" height="65px">
</div>
</el-option>
</el-select>
<div style="float: left;">
<img class="img" :src="photoUrl" width="65px" height="65px">
</div>
</el-form-item>
</el-col>
</el-form-item>
</el-form>
<div slot="footer" style="text-align: center;">
<el-button @click="handleClose()">取消</el-button>
<el-button type="primary" @click="submitForm()">保存</el-button>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
import { updateSongGift, addSongGift, listGiftOrEmoji } from '@/api/game-song-gift'
import { mapGetters } from 'vuex'
import { regionConfigTable } from '@/api/sys'
export default {
name: 'GiftEdit',
props: {
// ADD or UPDATE
event: {
type: String,
required: true,
default: 'ADD'
},
selectParam: {
type: Object,
default: null
}
},
data() {
function commonFormRules() {
return [
{ required: true, message: '必填字段', trigger: 'blur' }
]
}
return {
submitLoading: false,
giftLoading: false,
regions: [],
gifts: [],
photoUrl: '',
photoInfo: '',
form: {
id: '',
resourceId: '',
resourceType: 'GIFT',
sysOrigin: 'HALAR',
regionList: []
},
rules: {
resourceId: commonFormRules(),
resourceType: commonFormRules(),
sysOrigin: commonFormRules(),
regionList: commonFormRules()
}
}
},
computed: {
...mapGetters(['permissionsSysOriginPlatforms']),
eventName() {
return this.event === 'ADD' ? '添加' : this.event === 'UPDATE' ? '修改' : 'ERROR'
},
isUpdate() {
return this.event === 'UPDATE'
}
},
watch: {
selectParam: {
handler(newVal) {
if (!newVal) {
return
}
if (newVal.regions) {
newVal.regionList = newVal.regions.split(',')
}
this.form = Object.assign({}, newVal)
this.listRegion()
this.listGiftOrEmoji()
},
immediate: true
}
},
methods: {
handleClose() {
this.$emit('close')
},
listRegion() {
const that = this
that.loading = true
regionConfigTable({ 'sysOrigin': that.form.sysOrigin }).then(res => {
that.regions = res.body || []
that.loading = false
}).catch(er => {
that.loading = false
})
},
listGiftOrEmoji() {
const that = this
that.giftLoading = true
listGiftOrEmoji({ 'resourceType': that.form.resourceType, 'sysOrigin': that.form.sysOrigin }).then(res => {
that.gifts = res.body || []
that.giftLoading = false
this.showPhoto()
}).catch(er => {
that.giftLoading = false
})
},
listGiftOrEmojiV2() {
const that = this
that.giftLoading = true
that.form.resourceId = ''
that.photoUrl = ''
listGiftOrEmoji({ 'resourceType': that.form.resourceType, 'sysOrigin': that.form.sysOrigin }).then(res => {
that.gifts = res.body || []
that.giftLoading = false
}).catch(er => {
that.giftLoading = false
})
},
showPhoto() {
const that = this
const item = this.gifts.find(item1 => item1.resourceId === this.form.resourceId)
that.photoUrl = item.photoInfo
},
submitForm() {
const that = this
that.$refs.form.validate(valid => {
if (valid) {
that.submitLoading = true
if (that.form.id) {
updateSongGift(that.form).then(res => {
that.submitLoading = false
that.$emit('success', { result: res, event: that.event })
}).catch(er => {
that.submitLoading = false
that.$emit('fial', { error: er, event: that.event })
})
return
}
addSongGift(that.form).then(res => {
that.submitLoading = false
that.$emit('success', { result: res, event: that.event })
}).catch(er => {
that.submitLoading = false
console.error(er)
that.$emit('fial', { error: er, event: that.event })
})
} else {
console.error('error submit!!')
return false
}
})
}
}
}
</script>
<style scoped>
.col-margin {
margin-bottom: 20px;
}
img[src=""],img:not([src]){
opacity: 0;
}
</style>

View File

@ -1,247 +0,0 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-select
v-model="listQuery.sysOrigin"
placeholder="归属系统"
style="width: 120px"
class="filter-item"
@change="changeSysOrigin"
>
<el-option
v-for="(item, index) in permissionsSysOriginPlatforms"
:key="index"
:label="item.label"
:value="item.value"
>
<span style="float: left;"> <sys-origin-icon :icon="item.value" :desc="item.value" /></span>
<span style="float: left;margin-left:10px">{{ item.label }}</span>
</el-option>
</el-select>
<el-select
v-model="listQuery.region"
v-loading="loading"
placeholder="区域"
style="width:120px;"
class="filter-item"
clearable
@change="handleSearch"
>
<el-option
v-for="(item, index) in regions"
:key="index"
:label="item.regionName"
:value="item.id"
/>
</el-select>
<el-select
v-model="listQuery.resourceType"
placeholder="资源类型"
style="width:120px;"
class="filter-item"
clearable
@change="handleSearch"
>
<el-option label="礼物" :value="'GIFT'" />
<el-option label="表情包" :value="'EMOJI'" />
</el-select>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleSearch"
>
搜索
</el-button>
<el-button
class="filter-item"
type="primary"
icon="el-icon-edit"
@click="handleCreate"
>
新增
</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
fit
highlight-current-row
>
<el-table-column label="资源ID" width="200" align="center" prop="resourceId" />
<el-table-column label="封面" align="center">
<template slot-scope="scope">
<el-image
style="width: 50px; height: 50px"
:src="scope.row.photoInfo"
:preview-src-list="[scope.row.photoInfo]"
/>
</template>
</el-table-column>
<el-table-column label="类型" align="center">
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.resourceType === 'GIFT'" type="danger">礼物</el-tag>
<el-tag v-else-if="scope.row.resourceType === 'EMOJI'">表情包</el-tag>
</div>
</template>
</el-table-column>
<el-table-column prop="regionNameStr" label="区域" align="center" />
<el-table-column prop="createTime" label="创建时间" align="center" min-width="170">
<template slot-scope="scope">
{{ scope.row.createTime | dateFormat }}
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" align="center" width="200">
<template slot-scope="scope">
<el-button type="text" @click.native="handleUpdate(scope.row)">修改</el-button>
<el-button type="text" @click.native="handlDel(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="listQuery.cursor"
:limit.sync="listQuery.limit"
@pagination="renderData"
/>
<gift-edit
v-if="formVisible"
:event="giftEditEvent"
:select-param="giftEditParam"
@close="handleClose"
@success="giftEditSuccess"
@fail="giftEditFail"
/>
</div>
</template>
<script>
import { songGiftTable, deleteSongGift } from '@/api/game-song-gift'
import { regionConfigTable } from '@/api/sys'
import Pagination from '@/components/Pagination'
import GiftEdit from './edit'
import { mapGetters } from 'vuex'
export default {
components: { Pagination, GiftEdit },
data() {
return {
giftEditParam: {},
giftEditEvent: 'ADD',
loading: false,
pushTextHistoryLoading: false,
pushTextHistoryVisible: false,
disabledTranslate: false,
list: [],
delarr: [],
total: 0,
regions: [],
listQuery: {
cursor: 1,
limit: 20,
sysOrigin: 'HALAR',
resourceType: '',
region: ''
},
formVisible: false,
listLoading: true
}
},
computed: {
...mapGetters(['permissionsSysOriginPlatforms'])
},
created() {
const that = this
const querySystem = this.permissionsSysOriginPlatforms[0]
if (!querySystem) {
return
}
that.listQuery.sysOrigin = querySystem.value
that.listRegion()
that.renderData()
},
methods: {
changeSysOrigin() {
this.listRegion()
this.handleSearch()
},
renderData(isClean) {
const that = this
if (isClean === true) {
that.listQuery.cursor = 1
that.list = []
}
that.listLoading = true
songGiftTable(that.listQuery).then(res => {
const { body } = res
that.total = body.total || 0
that.list = body.records
that.listLoading = false
})
},
listRegion() {
const that = this
that.loading = true
regionConfigTable({ 'sysOrigin': that.listQuery.sysOrigin }).then(res => {
that.regions = res.body || []
that.loading = false
}).catch(er => {
that.loading = false
})
},
handleSearch() {
this.renderData(true)
},
queryUserDetails(row) {
this.userDeatilsDrawer = true
this.thatSelectedUserId = row.id
},
handlDel(id) {
const that = this
that.$confirm('此操作将永删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteSongGift(id).then(res => {
that.renderData(true)
})
}).catch(() => {
that.$message({
type: 'info',
message: '已取消删除'
})
})
},
handleClose() {
this.formVisible = false
},
handleCreate() {
this.giftEditEvent = 'ADD'
this.giftEditParam = {}
this.formVisible = true
},
handleUpdate(row) {
this.giftEditEvent = 'UPDATE'
this.formVisible = true
this.giftEditParam = row
},
giftEditSuccess(res) {
this.$opsMessage.success()
this.formVisible = false
this.renderData()
},
giftEditFail() {
this.$opsMessage.fail()
}
}
}
</script>

View File

@ -1,174 +0,0 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-select
v-model="listQuery.sysOrigin"
placeholder="系统"
style="width: 120px"
class="filter-item"
@change="changeSysOrigin"
>
<el-option
v-for="item in permissionsSysOriginPlatforms"
:key="item.value"
:label="item.label"
:value="item.value"
>
<span style="float: left;"> <sys-origin-icon :icon="item.value" :desc="item.value" /></span>
<span style="float: left;margin-left:10px">{{ item.label }}</span>
</el-option>
</el-select>
<el-select
v-model="listQuery.region"
v-loading="loading"
placeholder="区域"
style="width:120px;"
class="filter-item"
clearable
@change="handleSearch"
>
<el-option
v-for="(item, index) in regions"
:key="index"
:label="item.regionName"
:value="item.id"
/>
</el-select>
<div class="filter-item">
<el-date-picker
v-model="listQuery.dateNumber"
type="month"
placeholder="选择日期"
format="yyyy 年 MM 月"
value-format="yyyyMM"
/>
</div>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleSearch"
>
搜索
</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
fit
highlight-current-row
>
<el-table-column label="归属系统" align="center">
<template slot-scope="scope">
<sys-origin-icon :icon="scope.row.sysOrigin" :desc="scope.row.sysOrigin" />
</template>
</el-table-column>
<el-table-column prop="songId" label="歌曲id" align="center" min-width="100" />
<el-table-column prop="songName" label="歌名" align="center" min-width="100" />
<el-table-column prop="popularityValue" label="人气值" align="center" min-width="100" />
<el-table-column prop="frequency" label="点播次数" align="center" min-width="100" />
<el-table-column prop="dateNumber" label="年月" align="center" min-width="100" />
<el-table-column prop="regionNameStr" label="区域" align="center" min-width="100" />
<el-table-column prop="createTime" label="创建时间" align="center" width="200">
<template slot-scope="scope">
{{ scope.row.createTime | dateFormat }}
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="listQuery.cursor"
:limit.sync="listQuery.limit"
@pagination="renderData"
/>
</div>
</template>
<script>
import { hotSongCount } from '@/api/game-song-count'
import { mapGetters } from 'vuex'
import Pagination from '@/components/Pagination'
import { pickerOptions } from '@/constant/el-const'
import { regionConfigTable } from '@/api/sys'
export default {
name: 'HotSongCount',
components: { Pagination },
data() {
return {
list: [],
total: 0,
pickerOptions,
regions: [],
listQuery: {
cursor: 1,
limit: 20,
sysOrigin: 'HALAR',
dateNumber: '',
region: ''
},
listLoading: true
}
},
computed: {
...mapGetters(['permissionsSysOriginPlatforms'])
},
created() {
const that = this
const querySystem = this.permissionsSysOriginPlatforms[0]
if (!querySystem) {
return
}
that.listQuery.sysOrigin = querySystem.value
that.renderData(true)
that.listRegion()
},
methods: {
listRegion() {
const that = this
that.loading = true
regionConfigTable({ 'sysOrigin': that.listQuery.sysOrigin }).then(res => {
that.regions = res.body || []
that.loading = false
}).catch(er => {
that.loading = false
})
},
renderData(isReset) {
const that = this
if (isReset === true) {
that.listQuery.cursor = 1
}
that.listLoading = true
hotSongCount(that.listQuery).then(res => {
const { body } = res
that.total = body.total || 0
that.list = body.records
that.listLoading = false
})
},
changeSysOrigin() {
this.listRegion()
this.handleSearch()
},
handleSearch() {
this.renderData(true)
},
querySearch(queryString, cb) {
var restaurants = this.propsOrigins
var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants
cb(results)
},
handleSelect(item) {
this.renderData(true)
},
createFilter(queryString) {
return (restaurant) => {
return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) >= 0) || (restaurant.name.toLowerCase().indexOf(queryString.toLowerCase()) >= 0)
}
}
}
}
</script>

View File

@ -1,360 +0,0 @@
<template>
<div class="song-edit">
<el-dialog
:title="eventName"
:visible="true"
:modal-append-to-body="true"
:append-to-body="true"
:before-close="handleClose"
:destroy-on-close="true"
:close-on-click-modal="false"
top="50px"
width="80%"
>
<div v-loading="submitLoading">
<el-form ref="form" :model="form" :rules="rules" label-width="110px" style="margin-right:50px;">
<el-form-item label-width="0">
<el-col :md="12" :sm="24" class="col-margin">
<el-form-item label="平台" prop="sysOrigin">
<el-select
v-model="form.sysOrigin"
:disabled="isUpdate"
placeholder="归属平台"
style="width: 100%"
class="filter-item"
@change="listRegion()"
>
<el-option
v-for="(item, index) in permissionsSysOriginPlatforms"
:key="index"
:label="item.label"
:value="item.value"
>
<span style="float: left;"> <sys-origin-icon :icon="item.value" :desc="item.value" /></span>
<span style="float: left;margin-left:10px">{{ item.label }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item prop="regionList" label="区域">
<el-select v-model="form.regionList" v-loading="loading" multiple placeholder="请选择" style="width:100%;">
<el-option
v-for="(item, index) in regions"
:key="index"
:label="item.regionName"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
</el-form-item>
<el-form-item label-width="0px">
<el-col :md="12" :sm="24" class="col-margin">
<el-form-item label="歌名" prop="songName">
<el-input v-model.trim="form.songName" type="text" placeholder="歌名" />
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" class="col-margin">
<el-form-item label="歌手" prop="songUser">
<el-input v-model.trim="form.songUser" type="text" placeholder="歌手" />
</el-form-item>
</el-col>
</el-form-item>
<el-form-item label-width="0">
<el-col :md="12" :sm="24">
<el-form-item label="状态" prop="shelfStatus">
<el-select
v-model="form.shelfStatus"
placeholder="状态"
clearable
style="width:100%;"
class="filter-item"
>
<el-option label="上架" :value="true" />
<el-option label="下架" :value="false" />
</el-select>
</el-form-item></el-col>
<el-col :md="12" :sm="24">
<el-form-item label="排序" prop="sort">
<el-input v-model="form.sort" v-number type="text" placeholder="请输入排序权重" />
</el-form-item>
</el-col>
</el-form-item>
<el-form-item label-width="0">
<el-col :md="12" :sm="24" class="col-margin">
<el-form-item label="封面" prop="coverUrl">
<el-upload
:file-list="coverUrlFileList"
:class="{'upload-but-hide': songCoverUploadVisible}"
action=""
list-type="picture-card"
:http-request="httpRequestSongCover"
:limit="1"
:show-file-list="true"
:on-remove="removeSongCover"
accept="image/*"
>
<i slot="default" class="el-icon-plus" />
</el-upload>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="音频文件(MP3格式)" prop="songSourceUrl" label-width="205px">
<el-upload
v-loading="songSourceLoading"
:class="{'upload-but-hide': songUploadVisible}"
action=""
:http-request="httpRequestUploadSourceUrl"
:on-remove="handleRemoveSourceUrl"
:file-list="sourceUrlFileList"
:limit="1"
accept=".mp3,.Aac,.Wav"
>
<div class="upload-but">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传mp3AacWav文件</div>
</div>
</el-upload>
</el-form-item>
</el-col>
</el-form-item>
<el-form-item label-width="0">
<el-col :md="12" :sm="24">
<el-form-item label="歌词文件(lrc格式)" prop="lyricSourceUrl" label-width="200px">
<el-upload
v-loading="lyricSourceLoading"
:class="{'upload-but-hide': lyricUploadVisible}"
action=""
:http-request="httpRequestLyricUploadSourceUrl"
:on-remove="handleRemoveLyricSourceUrl"
:file-list="lyricSourceUrlFileList"
:limit="1"
accept=".lrc"
>
<div class="upload-but">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传lrc文件</div>
</div>
</el-upload>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="时长" prop="songDuration">
<el-input v-model="form.songDuration" v-number type="text" placeholder="请输入歌曲时长(秒)" />
</el-form-item>
</el-col>
</el-form-item>
</el-form>
<div slot="footer" style="text-align: center;">
<el-button @click="handleClose()">取消</el-button>
<el-button type="primary" @click="submitForm()">保存</el-button>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
import { updateSong, addSong } from '@/api/game-song-config'
import { mapGetters } from 'vuex'
import { regionConfigTable } from '@/api/sys'
export default {
name: 'SongEdit',
props: {
// ADD or UPDATE
event: {
type: String,
required: true,
default: 'ADD'
},
selectParam: {
type: Object,
default: null
}
},
data() {
function commonFormRules() {
return [
{ required: true, message: '必填字段', trigger: 'blur' }
]
}
return {
songCoverUploadVisible: false,
songUploadVisible: false,
lyricUploadVisible: false,
submitLoading: false,
songSourceLoading: false,
lyricSourceLoading: false,
regions: [],
coverUrlFileList: [],
sourceUrlFileList: [],
lyricSourceUrlFileList: [],
form: {
id: '',
coverUrl: '',
songSourceUrl: '',
lyricSourceUrl: '',
songName: '',
songUser: '',
shelfStatus: '',
songDuration: '',
sort: '',
sysOrigin: 'HALAR',
regionList: []
},
rules: {
coverUrl: commonFormRules(),
songName: commonFormRules(),
songUser: commonFormRules(),
shelfStatus: commonFormRules(),
songSourceUrl: commonFormRules(),
lyricSourceUrl: commonFormRules(),
sort: commonFormRules(),
sysOrigin: commonFormRules(),
regionList: commonFormRules(),
songDuration: commonFormRules()
}
}
},
computed: {
...mapGetters(['permissionsSysOriginPlatforms']),
eventName() {
return this.event === 'ADD' ? '上传' : this.event === 'UPDATE' ? '修改' : 'ERROR'
},
isUpdate() {
return this.event === 'UPDATE'
}
},
watch: {
selectParam: {
handler(newVal) {
if (!newVal) {
return
}
if (newVal.regions) {
newVal.regionList = newVal.regions.split(',')
}
if (newVal.coverUrl) {
this.songCoverUploadVisible = true
this.coverUrlFileList.push({ url: newVal.coverUrl })
}
if (newVal.songSourceUrl) {
this.songUploadVisible = true
this.sourceUrlFileList.push({ url: newVal.songSourceUrl })
}
if (newVal.lyricSourceUrl) {
this.lyricUploadVisible = true
this.lyricSourceUrlFileList.push({ url: newVal.lyricSourceUrl })
}
this.form = Object.assign({}, newVal)
this.listRegion()
},
immediate: true
}
},
methods: {
handleClose() {
this.$emit('close')
},
httpRequestUploadSourceUrl(file) {
const that = this
that.songUploadVisible = true
that.songSourceLoading = true
that.$simpleUploadFlie(file, 'songs').then(res => {
that.$opsMessage.success()
that.form.songSourceUrl = res.name
that.songSourceLoading = false
}).catch(er => {
console.error(er)
that.songUploadVisible = false
that.$opsMessage.fail()
})
},
handleRemoveSourceUrl(file, fileList) {
this.form.songSourceUrl = ''
this.songUploadVisible = false
},
httpRequestLyricUploadSourceUrl(file) {
const that = this
that.lyricUploadVisible = true
that.lyricSourceLoading = true
that.$simpleUploadFlie(file, 'songs').then(res => {
that.$opsMessage.success()
that.form.lyricSourceUrl = res.name
that.lyricSourceLoading = false
}).catch(er => {
console.error(er)
that.lyricUploadVisible = false
that.$opsMessage.fail()
})
},
handleRemoveLyricSourceUrl(file, fileList) {
this.form.lyricSourceUrl = ''
this.lyricUploadVisible = false
},
httpRequestSongCover(file) {
const that = this
that.songCoverUploadVisible = true
this.$simpleUploadFlie(file, 'songs').then(res => {
that.form.coverUrl = res.name
}).catch(er => {
console.error(er)
that.songCoverUploadVisible = false
that.$opsMessage.fail('上传失败,请尝试重新上传!')
})
},
listRegion() {
const that = this
that.loading = true
regionConfigTable({ 'sysOrigin': that.form.sysOrigin }).then(res => {
that.regions = res.body || []
that.loading = false
}).catch(er => {
that.loading = false
})
},
removeSongCover() {
this.form.coverUrl = ''
this.songCoverUploadVisible = false
},
submitForm() {
const that = this
console.log(that.form)
that.$refs.form.validate(valid => {
if (valid) {
that.submitLoading = true
if (that.form.id) {
updateSong(that.form).then(res => {
that.submitLoading = false
that.$emit('success', { result: res, event: that.event })
}).catch(er => {
that.submitLoading = false
that.$emit('fial', { error: er, event: that.event })
})
return
}
addSong(that.form).then(res => {
that.submitLoading = false
that.$emit('success', { result: res, event: that.event })
}).catch(er => {
that.submitLoading = false
console.error(er)
that.$emit('fial', { error: er, event: that.event })
})
} else {
console.error('error submit!!')
return false
}
})
}
}
}
</script>
<style scoped>
.col-margin {
margin-bottom: 20px;
}
</style>

View File

@ -1,347 +0,0 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-select
v-model="listQuery.sysOrigin"
placeholder="归属系统"
style="width: 120px"
class="filter-item"
@change="changeSysOrigin"
>
<el-option
v-for="(item, index) in permissionsSysOriginPlatforms"
:key="index"
:label="item.label"
:value="item.value"
>
<span style="float: left;"> <sys-origin-icon :icon="item.value" :desc="item.value" /></span>
<span style="float: left;margin-left:10px">{{ item.label }}</span>
</el-option>
</el-select>
<el-select
v-model="listQuery.sortType"
placeholder="排序方式"
style="width: 120px"
class="filter-item"
@change="handleSearch"
>
<el-option v-for="item in sortTypes" :key="item.value" :label="item.name" :value="item.value" />
</el-select>
<el-select
v-model="listQuery.shelfStatus"
placeholder="上/下架"
style="width: 120px"
class="filter-item"
clearable
@change="handleSearch"
>
<el-option v-for="item in showcaseTypes" :key="item.value" :label="item.name" :value="item.value" />
</el-select>
<el-select
v-model="listQuery.region"
v-loading="loading"
placeholder="区域"
style="width:120px;"
class="filter-item"
clearable
@change="handleSearch"
>
<el-option
v-for="(item, index) in regions"
:key="index"
:label="item.regionName"
:value="item.id"
/>
</el-select>
<el-input
v-model.trim="listQuery.songId"
placeholder="歌曲ID"
clearable
style="width: 200px;"
class="filter-item"
/>
<el-input
v-model.trim="listQuery.songName"
placeholder="歌曲名称"
clearable
style="width: 200px;"
class="filter-item"
/>
<div class="filter-item">
<el-date-picker
v-model="rangeDate"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="至"
start-placeholder="上传开始日期"
end-placeholder="上传结束日期"
/>
</div>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleSearch"
>
搜索
</el-button>
<el-button
class="filter-item"
type="primary"
icon="el-icon-edit"
@click="handleCreate"
>
上传
</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
fit
highlight-current-row
>
<el-table-column type="index" width="50" label="No" />
<el-table-column label="排序" width="200" align="center" prop="sort" />
<el-table-column label="ID" width="200" align="center" prop="id" />
<el-table-column label="封面" align="center">
<template slot-scope="scope">
<el-image
style="width: 50px; height: 50px"
:src="scope.row.coverUrl"
:preview-src-list="[scope.row.coverUrl]"
/>
</template>
</el-table-column>
<el-table-column prop="songName" label="歌名" align="center" />
<el-table-column prop="songUser" label="歌手" align="center" />
<el-table-column prop="songDuration" label="时长(秒)" align="center" />
<el-table-column prop="regionNameStr" label="区域" align="center" />
<el-table-column width="100" label="上/下架" align="center">
<template slot-scope="scope">
<el-switch
v-model="scope.row.shelfStatus"
:active-value="true"
:inactive-value="false"
@change="handleSwitchChange(scope.row)"
/>
</template>
</el-table-column>
<el-table-column prop="createTime" label="上传时间" align="center" min-width="170">
<template slot-scope="scope">
{{ scope.row.createTime | dateFormat }}
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" align="center" width="80">
<template slot-scope="scope">
<el-dropdown>
<span class="el-dropdown-link">
<i class="el-icon-more" />
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item type="text" @click.native="handleShow(scope.row)">详情</el-dropdown-item>
<el-dropdown-item type="text" @click.native="handleUpdate(scope.row)">编辑</el-dropdown-item>
<el-dropdown-item type="text" @click.native="deleteSong(scope.row.id)">删除</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="listQuery.cursor"
:limit.sync="listQuery.limit"
@pagination="renderData"
/>
<song-edit
v-if="formVisible"
:event="songEditEvent"
:select-param="songEditParam"
@close="handleClose"
@success="songEditSuccess"
@fail="songEditFail"
/>
<song-show
v-if="showVisible"
:select-param="songEditParam"
@close="handleClose"
/>
</div>
</template>
<script>
import { songTable, switchShelfStatus, deleteSong } from '@/api/game-song-config'
import { regionConfigTable } from '@/api/sys'
import Pagination from '@/components/Pagination'
import SongEdit from './edit'
import SongShow from './show'
import { mapGetters } from 'vuex'
export default {
components: { Pagination, SongEdit, SongShow },
data() {
return {
sortTypes: [
{ value: 'DESC', name: '降序' },
{ value: 'ASC', name: '升序' }
],
showcaseTypes: [
{ value: true, name: '上架' },
{ value: false, name: '下架' }
],
songEditParam: {},
songEditEvent: 'ADD',
rangeDate: '',
loading: false,
pushTextHistoryLoading: false,
pushTextHistoryVisible: false,
disabledTranslate: false,
fileList: [],
pushTextHistory: [],
list: [],
delarr: [],
total: 0,
regions: [],
listQuery: {
cursor: 1,
limit: 20,
startCreateDate: '',
endCreateDate: '',
songName: '',
sysOrigin: 'HALAR',
songId: '',
shelfStatus: true,
region: '',
sortType: 'ASC'
},
formVisible: false,
showVisible: false,
listLoading: true
}
},
computed: {
...mapGetters(['permissionsSysOriginPlatforms'])
},
watch: {
rangeDate: {
immediate: true,
deep: true,
handler(newVal) {
if (newVal && newVal.length > 0) {
this.listQuery.startCreateDate = newVal[0]
this.listQuery.endCreateDate = newVal[1]
return
}
this.listQuery.startCreateDate = ''
this.listQuery.endCreateDate = ''
}
}
},
created() {
const that = this
const querySystem = this.permissionsSysOriginPlatforms[0]
if (!querySystem) {
return
}
that.listQuery.sysOrigin = querySystem.value
that.listRegion()
that.renderData(true)
},
methods: {
changeSysOrigin() {
this.listRegion()
this.handleSearch()
},
renderData(isClean) {
const that = this
if (isClean === true) {
that.listQuery.cursor = 1
that.list = []
}
that.listLoading = true
songTable(that.listQuery).then(res => {
const { body } = res
that.total = body.total || 0
that.list = body.records
that.listLoading = false
})
},
listRegion() {
const that = this
that.loading = true
regionConfigTable({ 'sysOrigin': that.listQuery.sysOrigin }).then(res => {
that.regions = res.body || []
that.loading = false
}).catch(er => {
that.loading = false
})
},
handleSearch() {
this.renderData(true)
},
queryUserDetails(row) {
this.userDeatilsDrawer = true
this.thatSelectedUserId = row.id
},
deleteSong(id) {
const that = this
that.$confirm('此操作将永删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteSong({ id: id }).then(res => {
that.renderData(true)
})
}).catch(() => {
that.$message({
type: 'info',
message: '已取消删除'
})
})
},
handleClose() {
this.formVisible = false
this.showVisible = false
},
handleCreate() {
this.songEditEvent = 'ADD'
this.songEditParam = {}
this.formVisible = true
},
handleUpdate(row) {
this.songEditEvent = 'UPDATE'
this.formVisible = true
this.songEditParam = row
},
handleShow(row) {
this.showVisible = true
this.songEditParam = row
},
songEditSuccess(res) {
this.$opsMessage.success()
this.formVisible = false
this.renderData()
},
songEditFail() {
this.$opsMessage.fail()
},
handleSwitchChange(row) {
switchShelfStatus(row.id, row.shelfStatus)
.then((res) => {})
.catch(er => {
row.shelfStatus = !row.shelfStatus
})
}
}
}
</script>

View File

@ -1,272 +0,0 @@
<template>
<div class="song-show">
<el-dialog
:visible="true"
:modal-append-to-body="true"
:append-to-body="true"
:before-close="handleClose"
:destroy-on-close="true"
:close-on-click-modal="false"
top="50px"
width="80%"
>
<div v-loading="submitLoading">
<el-form :model="form" label-width="110px" style="margin-right:50px;">
<el-form-item label-width="0">
<el-col :md="12" :sm="24" class="col-margin">
<el-form-item label="平台" prop="sysOrigin">
<el-select
v-model="form.sysOrigin"
:disabled="true"
placeholder="归属平台"
style="width: 100%"
class="filter-item"
@change="listRegion()"
>
<el-option
v-for="(item, index) in permissionsSysOriginPlatforms"
:key="index"
:label="item.label"
:value="item.value"
>
<span style="float: left;"> <sys-origin-icon :icon="item.value" :desc="item.value" /></span>
<span style="float: left;margin-left:10px">{{ item.label }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item prop="regionList" label="区域">
<el-select v-model="form.regionList" v-loading="loading" :disabled="true" multiple placeholder="请选择" style="width:100%;">
<el-option
v-for="(item, index) in regions"
:key="index"
:label="item.regionName"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
</el-form-item>
<el-form-item label-width="0px">
<el-col :md="12" :sm="24" class="col-margin">
<el-form-item label="歌名" prop="songName">
<el-input v-model.trim="form.songName" type="text" placeholder="歌名" :disabled="true" />
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" class="col-margin">
<el-form-item label="歌手" prop="songUser">
<el-input v-model.trim="form.songUser" type="text" placeholder="歌手" :disabled="true" />
</el-form-item>
</el-col>
</el-form-item>
<el-form-item label-width="0">
<el-col :md="12" :sm="24">
<el-form-item label="状态" prop="shelfStatus">
<el-select
v-model="form.shelfStatus"
placeholder="状态"
:disabled="true"
style="width:100%;"
class="filter-item"
>
<el-option label="上架" :value="true" />
<el-option label="下架" :value="false" />
</el-select>
</el-form-item></el-col>
<el-col :md="12" :sm="24">
<el-form-item label="排序" prop="sort">
<el-input v-model="form.sort" v-number type="text" placeholder="请输入排序权重" :disabled="true" />
</el-form-item>
</el-col>
</el-form-item>
<el-form-item label-width="0">
<el-col :md="12" :sm="24" class="col-margin">
<el-form-item label="封面" prop="coverUrl">
<el-upload
:file-list="coverUrlFileList"
:class="{'upload-but-hide': songCoverUploadVisible}"
:disabled="true"
action=""
list-type="picture-card"
:limit="1"
:show-file-list="true"
accept="image/*"
>
<i slot="default" class="el-icon-plus" />
</el-upload>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="音频文件(MP3格式)" prop="songSourceUrl" label-width="205px">
<el-upload
:class="{'upload-but-hide': songUploadVisible}"
:disabled="true"
action=""
:file-list="sourceUrlFileList"
:limit="1"
accept=".mp3,.aac,.wav"
>
<div class="upload-but">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传mp3aacwav文件</div>
</div>
</el-upload>
<a label-width="250px" style="margin-left: -135px;" @click="downloadSongFile">下载歌曲</a>
</el-form-item>
</el-col>
</el-form-item>
<el-form-item label-width="0">
<el-col :md="12" :sm="24">
<el-form-item label="歌词文件(lrc格式)" prop="lyricSourceUrl" label-width="193px">
<el-upload
:class="{'upload-but-hide': lyricUploadVisible}"
:disabled="true"
action=""
:file-list="lyricSourceUrlFileList"
:limit="1"
accept=".lrc"
>
<div class="upload-but">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传lrc文件</div>
</div>
</el-upload>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="时长(秒)" prop="songDuration">
<el-input v-model="form.songDuration" v-number type="text" placeholder="请输入歌曲时长(秒)" :disabled="true" />
</el-form-item>
</el-col>
</el-form-item>
<el-form-item label-width="0">
<el-col :md="12" :sm="48">
<el-form-item label="" label-width="80px">
<a style="margin-left: -10px;" @click="downloadFile">下载lrc歌词</a>
</el-form-item>
</el-col>
</el-form-item>
</el-form>
<div slot="footer" style="text-align: center;">
<el-button @click="handleClose()">关闭</el-button>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { regionConfigTable } from '@/api/sys'
export default {
name: 'SongShow',
props: {
selectParam: {
type: Object,
default: null
}
},
data() {
return {
songCoverUploadVisible: false,
songUploadVisible: false,
lyricUploadVisible: false,
submitLoading: false,
regions: [],
coverUrlFileList: [],
sourceUrlFileList: [],
lyricSourceUrlFileList: [],
lrcFile: '',
songFile: '',
form: {
id: '',
coverUrl: '',
songSourceUrl: '',
lyricSourceUrl: '',
songName: '',
songUser: '',
shelfStatus: '',
sort: '',
sysOrigin: 'HALAR',
regionList: []
}
}
},
computed: {
...mapGetters(['permissionsSysOriginPlatforms'])
},
watch: {
selectParam: {
handler(newVal) {
if (!newVal) {
return
}
if (newVal.regions) {
newVal.regionList = newVal.regions.split(',')
}
if (newVal.coverUrl) {
this.songCoverUploadVisible = true
this.coverUrlFileList.push({ url: newVal.coverUrl })
}
if (newVal.songSourceUrl) {
this.songUploadVisible = true
this.sourceUrlFileList.push({ url: newVal.songSourceUrl })
}
if (newVal.lyricSourceUrl) {
this.lyricUploadVisible = true
this.lyricSourceUrlFileList.push({ url: newVal.lyricSourceUrl })
}
this.form = Object.assign({}, newVal)
this.listRegion()
this.lrcFile = newVal.lyricSourceUrl
this.songFile = newVal.songSourceUrl
},
immediate: true
}
},
methods: {
handleClose() {
this.$emit('close')
},
listRegion() {
const that = this
that.loading = true
regionConfigTable({ 'sysOrigin': that.form.sysOrigin }).then(res => {
that.regions = res.result || []
that.loading = false
}).catch(er => {
that.loading = false
})
},
downloadFile() {
const that = this
const fileUrl = that.lrcFile
const link = document.createElement('a')
link.href = fileUrl
link.download = that.form.songName + '.lrc'
link.style.display = 'none'
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
},
downloadSongFile() {
const that = this
const fileUrl = that.songFile
const link = document.createElement('a')
link.href = fileUrl
link.style.display = 'none'
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
}
}
}
</script>
<style scoped>
.col-margin {
margin-bottom: 20px;
}
</style>

View File

@ -1,240 +0,0 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-select
v-model="listQuery.sysOrigin"
placeholder="系统"
style="width: 120px"
class="filter-item"
@change="changeSysOrigin"
>
<el-option
v-for="item in permissionsSysOriginPlatforms"
:key="item.value"
:label="item.label"
:value="item.value"
>
<span style="float: left;"> <sys-origin-icon :icon="item.value" :desc="item.value" /></span>
<span style="float: left;margin-left:10px">{{ item.label }}</span>
</el-option>
</el-select>
<el-select
v-model="listQuery.region"
v-loading="loading"
placeholder="区域"
style="width:120px;"
class="filter-item"
clearable
@change="handleSearch"
>
<el-option
v-for="(item, index) in regions"
:key="index"
:label="item.regionName"
:value="item.id"
/>
</el-select>
<div class="filter-item">
<div><account-input v-model="listQuery.userId" placeholder="用户id" type="USER" :sys-origin="listQuery.sysOrigin" /></div>
</div>
<div class="filter-item">
<search-room-input @success="searchRoomSuccess" @fail="searchRoomFail" @load="loadSearchRoom" />
</div>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleSearch"
>
搜索
</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
fit
highlight-current-row
>
<el-table-column label="归属系统" align="center" min-width="50">
<template slot-scope="scope">
<sys-origin-icon :icon="scope.row.sysOrigin" :desc="scope.row.sysOrigin" />
</template>
</el-table-column>
<el-table-column label="用户" align="center" min-width="100">
<template slot-scope="scope">
<user-table-exhibit :user-profile="scope.row.userProfile" :query-details="true" />
</template>
</el-table-column>
<el-table-column label="房间" align="center">
<template slot-scope="scope">
<div class="room-profile flex-l">
<div class="avatar" style="margin: auto 0.2rem;">
<el-image
style="width:1.5rem;height: 1.5rem;border-radius: .2rem;"
:src="scope.row.roomProfile.roomCover"
:preview-src-list="[scope.row.roomProfile.roomCover]"
>
<div slot="error" class="image-slot">
<i class="el-icon-picture-outline" />
</div>
</el-image>
</div>
<div class="info nowrap-ellipsis">
<div class="nickname">
<el-link v-if="scope.row.roomProfile.roomName" @click="queryRoomDetails(scope.row.roomProfile.id)">
{{ scope.row.roomProfile.roomName }}
</el-link>
</div>
<div class="desc">
{{ scope.row.roomProfile.roomAccount }}
</div>
</div>
</div>
</template>
</el-table-column>
<el-table-column prop="songId" label="歌曲Id" align="center" min-width="100" />
<el-table-column prop="songName" label="歌名" align="center" min-width="100" />
<el-table-column prop="popularityValue" label="人气值" align="center" min-width="100" />
<el-table-column prop="regionNameStr" label="区域" align="center" min-width="100" />
<el-table-column prop="createTime" label="创建时间" align="center" width="200">
<template slot-scope="scope">
{{ scope.row.createTime | dateFormat }}
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="listQuery.cursor"
:limit.sync="listQuery.limit"
@pagination="renderData"
/>
<user-deatils-drawer
v-if="userDeatilsDrawer"
:user-id="thatSelectedUserId"
@close="userDeatilsDrawer=false"
/>
<room-deatils-drawer
v-if="roomDeatilsDrawerVisible"
:room-id="roomId"
@close="roomDeatilsDrawerVisible=false"
/>
</div>
</template>
<script>
import { userSongCount } from '@/api/game-song-count'
import { mapGetters } from 'vuex'
import Pagination from '@/components/Pagination'
import { pickerOptions } from '@/constant/el-const'
import { regionConfigTable } from '@/api/sys'
import RoomDeatilsDrawer from '@/components/data/RoomDeatilsDrawer'
export default {
name: 'UserSongCount',
components: { Pagination, RoomDeatilsDrawer },
data() {
return {
list: [],
total: 0,
pickerOptions,
regions: [],
searchDisabled: false,
userDeatilsDrawer: false,
roomDeatilsDrawerVisible: false,
roomId: '',
thatSelectedUserId: '',
listQuery: {
cursor: 1,
limit: 20,
sysOrigin: 'HALAR',
region: '',
roomId: '',
userId: ''
},
listLoading: true
}
},
computed: {
...mapGetters(['permissionsSysOriginPlatforms'])
},
created() {
const that = this
const querySystem = this.permissionsSysOriginPlatforms[0]
if (!querySystem) {
return
}
that.listQuery.sysOrigin = querySystem.value
that.renderData(true)
that.listRegion()
},
methods: {
listRegion() {
const that = this
that.loading = true
regionConfigTable({ 'sysOrigin': that.listQuery.sysOrigin }).then(res => {
that.regions = res.body || []
that.loading = false
}).catch(er => {
that.loading = false
})
},
renderData(isReset) {
const that = this
if (isReset === true) {
that.listQuery.cursor = 1
}
that.listLoading = true
userSongCount(that.listQuery).then(res => {
const { body } = res
that.total = body.total || 0
that.list = body.records
that.listLoading = false
})
},
changeSysOrigin() {
this.listRegion()
this.handleSearch()
},
handleSearch() {
this.renderData(true)
},
querySearch(queryString, cb) {
var restaurants = this.propsOrigins
var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants
cb(results)
},
handleSelect(item) {
this.renderData(true)
},
loadSearchRoom() {
this.searchDisabled = true
},
queryRoomDetails(roomId) {
this.roomDeatilsDrawerVisible = true
this.roomId = roomId
},
searchRoomSuccess(res) {
this.searchDisabled = false
if (!res) {
return
}
this.listQuery.roomId = res.id
},
searchRoomFail() {
this.listQuery.roomId = ''
this.searchDisabled = false
},
queryUserDetails(userId) {
this.userDeatilsDrawer = true
this.thatSelectedUserId = userId
},
createFilter(queryString) {
return (restaurant) => {
return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) >= 0) || (restaurant.name.toLowerCase().indexOf(queryString.toLowerCase()) >= 0)
}
}
}
}
</script>

View File

@ -1,285 +0,0 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-select
v-model="listQuery.sysOrigin"
placeholder="系统"
style="width: 120px"
class="filter-item"
@change="handleSearch"
>
<el-option
v-for="item in permissionsSysOriginPlatforms"
:key="item.value"
:label="item.label"
:value="item.value"
>
<span style="float: left;"> <sys-origin-icon :icon="item.value" :desc="item.value" /></span>
<span style="float: left;margin-left:10px">{{ item.label }}</span>
</el-option>
</el-select>
<div class="filter-item">
<account-input v-model="listQuery.userId" :sys-origin="listQuery.sysOrigin" placeholder="用户ID" />
</div>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
:disabled="searchDisabled"
@click="handleSearch"
>
搜索
</el-button>
<el-button
class="filter-item"
type="primary"
icon="el-icon-edit"
@click="handleBlacklist"
>
加入黑名单
</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
fit
highlight-current-row
>
<el-table-column prop="sysOrigin" label="系统" align="center">
<template slot-scope="scope">
<sys-origin-icon :icon="scope.row.originSys" :desc="scope.row.originSys" />
</template>
</el-table-column>
<el-table-column label="头像" align="center" width="150">
<template slot-scope="scope">
<avatar :url="scope.row.userAvatar" :gender="scope.row.userSex" />
<div
style="width:100%;overflow: hidden;text-overflow:ellipsis;white-space: nowrap;"
>
<a :title="scope.row.actualAccount">
{{ scope.row.actualAccount }}
</a>
</div>
</template>
</el-table-column>
<el-table-column label="昵称" align="center">
<template slot-scope="scope">
<div
style="width:100%;overflow: hidden;text-overflow:ellipsis;white-space: nowrap;"
>
<el-link @click="queryUserDetails(scope.row.id)"><a :title="scope.row.userNickname"> {{ scope.row.userNickname }} </a></el-link>
</div>
</template>
</el-table-column>
<el-table-column prop="userSex" label="性别" align="center">
<template slot-scope="scope">
<span v-if="scope.row.userSex === 1">
</span>
<span v-else>
</span>
</template>
</el-table-column>
<el-table-column width="70" label="国旗" align="center">
<template slot-scope="scope">
<a :title="scope.row.countryName" @click="copyTextContent(scope.row.countryName)">
<flag-icon :code="scope.row.countryCode" style="margin-top: 20px;" />
</a>
</template>
</el-table-column>
<el-table-column prop="createTime" label="拉黑时间" align="center">
<template slot-scope="scope">
{{ scope.row.createTime | dateFormat }}
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" align="center" width="120">
<template slot-scope="scope">
<el-button type="text" @click.native="delBlacklist(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="listQuery.cursor"
:limit.sync="listQuery.limit"
@pagination="renderData"
/>
<user-deatils-drawer
v-if="userDeatilsDrawerVisible"
:user-id="thatSelectedUserId"
@close="userDeatilsDrawerVisible=false"
/>
<el-dialog
:title="textOptTitle"
:visible.sync="formVisible"
:modal-append-to-body="true"
:append-to-body="true"
:before-close="handleClose"
:close-on-click-modal="false"
width="400px"
>
<div v-loading="submitLoading">
<el-form ref="form" :model="form" :rules="rules" label-width="100px" style="margin-left: 15px;">
<el-form-item label="平台">
<el-input v-model.trim="listQuery.sysOrigin" :disabled="true" type="text" />
</el-form-item>
<el-form-item label="账号" prop="account">
<el-input v-model.trim="form.account" type="text" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm()">保存</el-button>
<el-button @click="handleClose()">取消</el-button>
</el-form-item>
</el-form>
</div>
</el-dialog>
</div>
</template>
<script>
import { trumpetBlacklistTable, addTrumpetBlacklist, deleteTrumpetBlacklist } from '@/api/game'
import Pagination from '@/components/Pagination'
import { pickerOptions } from '@/constant/el-const'
import { mapGetters } from 'vuex'
function getFormData() {
return {
account: '',
sysOrigin: ''
}
}
export default {
name: 'DynamicBlacklist',
components: { Pagination },
data() {
return {
submitLoading: false,
formVisible: false,
textOptTitle: '',
searchDisabled: false,
pickerOptions,
userDeatilsDrawerVisible: false,
thatSelectedUserId: '',
list: [],
form: { userId: '' },
total: 0,
rangeDate: [],
listQuery: {
cursor: 1,
limit: 20,
sysOrigin: 'HALAR',
userId: ''
},
rules: {
account: [{ required: true, trigger: 'blur', message: '必填参数不可为空' }]
},
listLoading: true,
clickUserId: ''
}
},
computed: {
...mapGetters(['permissionsSysOriginPlatforms'])
},
created() {
const that = this
const querySystem = this.permissionsSysOriginPlatforms[0]
if (!querySystem) {
return
}
that.listQuery.sysOrigin = querySystem.value
that.renderData()
},
methods: {
renderData(isClean) {
const that = this
if (isClean === true) {
that.list = []
that.listQuery.cursor = 1
}
that.listLoading = true
trumpetBlacklistTable(that.listQuery).then(res => {
const { body } = res
that.total = body.total || 0
that.list = body.records
that.listLoading = false
})
},
handleSearch() {
this.renderData(true)
},
handleClose() {
this.formVisible = false
this.resetForm()
},
resetForm() {
this.form = getFormData()
},
handleBlacklist() {
this.textOptTitle = '喇叭-禁止用户发喇叭'
this.formVisible = true
this.form = getFormData()
},
queryUserDetails(id) {
this.userDeatilsDrawerVisible = true
this.thatSelectedUserId = id
},
delBlacklist(item) {
const that = this
that.listLoading = true
deleteTrumpetBlacklist(item.id).then((res) => {
that.listLoading = false
that.$message({
message: '删除成功',
type: 'success'
})
that.renderData()
}).catch(er => {
that.listLoading = false
})
},
submitForm() {
const that = this
that.$refs.form.validate(valid => {
if (valid) {
that.submitLoading = true
that.form.sysOrigin = that.listQuery.sysOrigin
addTrumpetBlacklist(that.form).then(res => {
that.submitLoading = false
that.formVisible = false
that.resetForm()
that.renderData(true)
}).catch(er => {
that.submitLoading = false
this.$emit('fail')
})
} else {
console.error('error submit!!')
return false
}
})
}
}
}
</script>
<style scoped lang="scss">
.store-table-expand {
font-size: 0;
label {
width: 90px;
color: #99a9bf;
.el-form-item {
margin-right: 0;
margin-bottom: 0;
width: 50%;
}
}
}
</style>

View File

@ -1,149 +0,0 @@
<template>
<div class="app-container">
<div class="filter-container">
<div class="filter-item">
<el-input v-model="listQuery.userAccount" placeholder="用户账号" />
</div>
<el-select
v-model="listQuery.logoutType"
placeholder="注销类型"
style="width: 120px"
class="filter-item"
clearable
@change="handleSearch"
>
<el-option
label="注销账号"
:value="'LOGOUT_ACCOUNT'"
/>
<el-option
label="删除数据"
:value="'DELETE_DATA'"
/>
</el-select>
<div class="filter-item">
<el-date-picker
v-model="rangeDate"
value-format="timestamp"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
/>
</div>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
:disabled="searchDisabled"
@click="handleSearch"
>
搜索
</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
fit
highlight-current-row
>
<el-table-column prop="userAccount" label="账号" width="400" align="center" />
<el-table-column prop="userName" label="用户名称" width="400" align="center" />
<el-table-column label="凭证" align="center">
<template slot-scope="scope">
<el-image
style="width: 50px; height: 50px"
:src="scope.row.uploadCover"
:preview-src-list="[scope.row.uploadCover]"
/>
</template>
</el-table-column>
<el-table-column label="类型" width="400" align="center">
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.logoutType === 'LOGOUT_ACCOUNT'">注销账号</el-tag>
<el-tag v-else-if="scope.row.logoutType === 'DELETE_DATA'">删除数据</el-tag>
</div>
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间" width="400" align="center">
<template slot-scope="scope">
{{ scope.row.createTime | dateFormat }}
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="listQuery.cursor"
:limit.sync="listQuery.limit"
@pagination="renderData"
/>
</div>
</template>
<script>
import { logoutApplyPage } from '@/api/sys'
import Pagination from '@/components/Pagination'
export default {
name: 'LogoutLog',
components: { Pagination },
data() {
return {
list: [],
total: 0,
rangeDate: [],
listQuery: {
cursor: 1,
limit: 20,
userAccount: '',
logoutType: '',
startTime: '',
endTime: ''
},
listLoading: true,
searchDisabled: false
}
},
watch: {
rangeDate: {
immediate: true,
deep: true,
handler(newVal) {
if (newVal && newVal.length > 0) {
this.listQuery.startTime = newVal[0]
this.listQuery.endTime = newVal[1]
return
}
this.listQuery.startTime = ''
this.listQuery.endTime = ''
}
}
},
created() {
this.renderData()
},
methods: {
renderData(isClean) {
const that = this
if (isClean === true) {
that.list = []
that.listQuery.cursor = 1
}
that.listLoading = true
logoutApplyPage(that.listQuery).then(res => {
const { body } = res
that.total = body.total || 0
that.list = body.records
that.listLoading = false
})
},
handleSearch() {
this.renderData(true)
}
}
}
</script>

View File

@ -1,143 +0,0 @@
<template>
<div class="app-container">
<div class="filter-container">
<div class="filter-item">
<account-input v-model="listQuery.userId" placeholder="用户ID" />
</div>
<el-select
v-model="listQuery.logoutType"
placeholder="注销类型"
style="width: 120px"
class="filter-item"
clearable
@change="handleSearch"
>
<el-option
label="注销账号"
:value="'LOGOUT_ACCOUNT'"
/>
<el-option
label="删除数据"
:value="'DELETE_DATA'"
/>
</el-select>
<div class="filter-item">
<el-date-picker
v-model="rangeDate"
value-format="timestamp"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
/>
</div>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
:disabled="searchDisabled"
@click="handleSearch"
>
搜索
</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
fit
highlight-current-row
>
<el-table-column label="用户" align="center" min-width="200">
<template slot-scope="scope">
<user-table-exhibit :user-profile="scope.row.userProfile" :query-details="true" />
</template>
</el-table-column>
<el-table-column label="类型" width="400" align="center">
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.logoutType === 'LOGOUT_ACCOUNT'">注销账号</el-tag>
<el-tag v-else-if="scope.row.logoutType === 'DELETE_DATA'">删除数据</el-tag>
</div>
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间" width="400" align="center">
<template slot-scope="scope">
{{ scope.row.createTime | dateFormat }}
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="listQuery.cursor"
:limit.sync="listQuery.limit"
@pagination="renderData"
/>
</div>
</template>
<script>
import { logoutLogPage } from '@/api/sys'
import Pagination from '@/components/Pagination'
export default {
name: 'LogoutLog',
components: { Pagination },
data() {
return {
list: [],
total: 0,
rangeDate: [],
listQuery: {
cursor: 1,
limit: 20,
userId: '',
logoutType: '',
startTime: '',
endTime: ''
},
listLoading: true,
searchDisabled: false
}
},
watch: {
rangeDate: {
immediate: true,
deep: true,
handler(newVal) {
if (newVal && newVal.length > 0) {
this.listQuery.startTime = newVal[0]
this.listQuery.endTime = newVal[1]
return
}
this.listQuery.startTime = ''
this.listQuery.endTime = ''
}
}
},
created() {
this.renderData()
},
methods: {
renderData(isClean) {
const that = this
if (isClean === true) {
that.list = []
that.listQuery.cursor = 1
}
that.listLoading = true
logoutLogPage(that.listQuery).then(res => {
const { body } = res
that.total = body.total || 0
that.list = body.records
that.listLoading = false
})
},
handleSearch() {
this.renderData(true)
}
}
}
</script>

View File

@ -1,576 +0,0 @@
<!-- TODO push文案库 使用 消息文案库代替 暂无其他地方使用后面可直接删除-->
<template>
<div class="app-container">
<div class="filter-container">
<el-select
v-model="listQuery.pushType"
placeholder="推送类型"
clearable
style="width: 120px"
class="filter-item"
>
<el-option value="STRATEGY" label="策略" />
</el-select>
<el-select
v-model="listQuery.pushBusinessScene"
placeholder="业务场景"
clearable
style="width: 120px"
class="filter-item"
>
<el-option
v-for="item in messageBusinessScene"
:key="item.value"
:value="item.value"
:label="item.name"
/>
</el-select>
<!-- <el-select
v-model="listQuery.pushUserType"
placeholder="用户类型"
clearable
style="width: 120px"
class="filter-item"
>
<el-option
v-for="item in userTypes"
:key="item.value"
:value="item.value"
:label="item.name"
/>
</el-select> -->
<div class="filter-item">
<el-date-picker
v-model="rangeCreateDate"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="至"
start-placeholder="创建时间"
end-placeholder="创建时间"
/>
</div>
<div class="filter-item">
<el-date-picker
v-model="latestRangeDate"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="至"
start-placeholder="最近发送时间"
end-placeholder="最近发送时间"
/>
</div>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleSearch"
>
搜索
</el-button>
<el-button
class="filter-item"
style="margin-left: 10px;"
type="primary"
icon="el-icon-edit"
@click="handleCreate"
>
添加
</el-button>
<el-button
class="filter-item"
style="margin-left: 10px;"
type="primary"
icon="el-icon-refresh"
@click="handleSynchronize"
>
一键同步翻译
</el-button>
<el-tooltip class="item" effect="dark">
<div slot="content">
<p>
如果后台有更新语言请先同步翻译现有模板消息然后再进行新增/修改
</p>
</div>
<i class="el-icon-question" style="font-size:26px;" />
</el-tooltip>
</div>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
fit
highlight-current-row
>
<el-table-column prop="pushTypeName" label="推送类型" align="center" />
<el-table-column
prop="businessSceneName"
label="业务场景"
align="center"
/>
<!-- <el-table-column prop="pushUserTypeName" label="用户类型" align="center" /> -->
<el-table-column prop="sysPushTextContents" label="标题" align="center">
<template slot-scope="scope">
<span
v-if="
!scope.row.sysPushTextContents ||
scope.row.sysPushTextContents.length === 0
"
>暂无标题</span>
<span v-else>{{ scope.row.sysPushTextContents[0].title }}</span>
</template>
</el-table-column>
<el-table-column
prop="sysPushTextContents"
label="文案内容"
align="center"
>
<template slot-scope="scope">
<span
v-if="
!scope.row.sysPushTextContents ||
scope.row.sysPushTextContents.length === 0
"
>暂无文案</span>
<span v-else>{{ scope.row.sysPushTextContents[0].content }}</span>
</template>
</el-table-column>
<el-table-column prop="latestTime" label="最近发送时间" align="center">
<template slot-scope="scope">
{{ scope.row.latestTime | dateFormat }}
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间" align="center">
<template slot-scope="scope">
{{ scope.row.createTime | dateFormat }}
</template>
</el-table-column>
<el-table-column label="创建者" align="center">
<template slot-scope="scope">
<span v-if="scope.row.user">{{ scope.row.user.nickname }}</span>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" align="center" width="100">
<template slot-scope="scope">
<el-button
type="text"
@click.native="handleUpdate(scope.row)"
>修改</el-button>
<el-button
type="text"
@click.native="handlePushTextHistory(scope.row)"
>详情</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="listQuery.cursor"
:limit.sync="listQuery.limit"
@pagination="renderData"
/>
<el-dialog
title="已录入语言"
:visible="pushTextHistoryVisible"
:modal-append-to-body="true"
:append-to-body="true"
:before-close="handlerPushTextHistoryClose"
width="70%"
>
<div
v-loading="pushTextHistoryLoading"
style="max-height:500px;overflow:auto"
>
<el-card
v-for="item in pushTextHistory"
:key="item.id"
style="margin-bottom: 10px"
>
<h4>{{ item.languageName }}</h4>
<p>标题{{ item.title }}</p>
<p>内容{{ item.content }}</p>
</el-card>
</div>
</el-dialog>
<el-dialog
:title="textOptTitle"
:visible.sync="formVisible"
:modal-append-to-body="true"
:append-to-body="true"
:before-close="handlerFormClose"
width="400px"
>
<div v-loading="submitLoading">
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="推送类型" prop="pushType">
<el-select
v-model="form.pushType"
disabled
placeholder="推送类型"
class="filter-item"
>
<el-option value="STRATEGY" label="策略" />
</el-select>
</el-form-item>
<el-form-item label="业务场景" prop="businessScene">
<el-select
v-model="form.businessScene"
placeholder="业务场景"
class="filter-item"
>
<el-option
v-for="item in messageBusinessScene"
:key="item.value"
:value="item.value"
:label="item.name"
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="用户类型" prop="pushUserType">
<el-select
disabled
v-model="form.pushUserType"
placeholder="用户类型"
class="filter-item"
>
<el-option
v-for="item in userTypes"
:key="item.value"
:value="item.value"
:label="item.name"
/>
</el-select>
</el-form-item> -->
<!-- <el-form-item label="语言类型" prop="language">
<el-select
ref="language"
v-model="form.language"
placeholder="语言类型"
class="filter-item"
@change="handleLanguageChange"
>
<el-option
v-for="item in language"
:key="item.value"
:value="item.value"
:label="item.name"
/>
</el-select>
</el-form-item>-->
<!--<div style="padding: 0px 0px 20px 15px;"> 共计 <span class="font-danger">{{ language.length }}</span> 语言<span v-if="languageNames && languageNames.length > 0">已录入{{ languageNames.join(',') }}</span></div>
<el-form-item label="标题" prop="title">
<el-input v-model.trim="form.title" type="text" @blur="handleLanguageBlur" />
</el-form-item>
<el-form-item label="内容" prop="content">
<el-input v-model.trim="form.content" type="textarea" @blur="handleLanguageBlur" />
</el-form-item>-->
<el-form-item label="标题" prop="title">
<el-input v-model.trim="form.title" type="text" />
</el-form-item>
<el-form-item label="模板内容" prop="content">
<el-input
v-model.trim="form.content"
placeholder="请输入模板,尽量简洁明了..."
type="textarea"
:rows="4"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm()">保存</el-button>
<el-button @click="resetForm()">重置</el-button>
</el-form-item>
</el-form>
</div>
</el-dialog>
</div>
</template>
<script>
import { userTypes, messageBusinessScene, language } from '@/constant/type'
import {
pushTextStoreTable,
addPushTextStore,
updatePushTextStore,
getPushTextHistory,
synchronPushText
} from '@/api/message'
import Pagination from '@/components/Pagination'
export default {
components: { Pagination },
data() {
return {
rangeCreateDate: '',
latestRangeDate: '',
messageBusinessScene,
userTypes,
language,
pushTextHistoryLoading: false,
pushTextHistoryVisible: false,
pushTextHistory: [],
list: [],
total: 0,
listQuery: {
cursor: 1,
limit: 20,
pushType: '',
pushBusinessScene: '',
pushUserType: '',
startTime: '',
endTime: '',
startLastDate: '',
endLastDate: ''
},
formVisible: false,
textOptTitle: '添加推送文案',
form: {
id: '',
pushType: 'STRATEGY',
businessScene: 'CARD_LIKE',
pushUserType: 'ALL',
title: '',
content: ''
},
submitLoading: false,
languageMap: {},
languageNames: [],
prevSelectedVal: 'en',
rules: {
pushType: [
{ required: true, message: '请选择推送类型', trigger: 'blur' }
],
businessScene: [
{ required: true, message: '请选择业务类型', trigger: 'blur' }
],
pushUserType: [
{ required: true, message: '请选会员类型', trigger: 'blur' }
],
title: [{ required: true, message: '请填写标题', trigger: 'blur' }],
content: [{ required: true, message: '请填写内容', trigger: 'blur' }]
},
listLoading: true
}
},
watch: {
rangeCreateDate: {
immediate: true,
handler(newVal) {
if (newVal && newVal.length > 0) {
this.listQuery.startTime = newVal[0]
this.listQuery.endTime = newVal[1]
return
}
this.listQuery.startTime = ''
this.listQuery.endTime = ''
}
},
latestRangeDate: {
immediate: true,
handler(newVal) {
if (newVal && newVal.length > 0) {
this.listQuery.startLastDate = newVal[0]
this.listQuery.endLastDate = newVal[1]
return
}
this.listQuery.startLastDate = ''
this.listQuery.endLastDate = ''
}
}
},
created() {
this.renderData()
},
methods: {
renderData() {
const that = this
that.listLoading = true
pushTextStoreTable(that.listQuery).then(res => {
const { body } = res
that.total = body.total || 0
that.list = body.records
that.listLoading = false
})
},
handleSearch() {
this.renderData()
},
queryUserDetails(row) {
this.userDeatilsDrawer = true
this.thatSelectedUserId = row.id
},
handleCreate() {
this.textOptTitle = '添加推送文案'
this.formVisible = true
},
handlerFormClose() {
this.formVisible = false
this.resetForm()
},
submitForm() {
const that = this
if (!that.validForm()) {
return
}
// that.form.sysPushTextContents = that.languageMapToArraysFilterNullContent()
that.submitLoading = true
if (that.form.id) {
updatePushTextStore(that.form)
.then(res => {
that.submitLoading = false
that.formVisible = false
that.resetForm()
that.form.id = ''
that.renderData()
})
.catch(er => {
that.submitLoading = false
})
return
}
addPushTextStore(that.form)
.then(res => {
that.submitLoading = false
that.formVisible = false
that.resetForm()
that.form.id = ''
that.renderData()
})
.catch(er => {
that.submitLoading = false
})
},
languageMapToArraysFilterNullContent() {
const resultArrays = []
for (const key in this.languageMap) {
var langObj = this.languageMap[key]
if (langObj.title && langObj.content) {
langObj.language = key
resultArrays.push(langObj)
}
}
return resultArrays
},
validForm() {
if (!this.form.title) {
this.$opsMessage.fail('标题未录入!')
return false
}
if (!this.form.content) {
this.$opsMessage.fail('模板内容未录入!')
return false
}
return true
},
getSelectedLangItem(value) {
const language = this.language
for (let index = 0; index < language.length; index++) {
const item = language[index]
if (value === item.value) {
return Object.assign({ index }, item)
}
}
},
handleLanguageChange(value) {
const that = this
if (!that.form.title || !that.form.content) {
this.$opsMessage.warn(
`标题或内容存在空,${
that.getSelectedLangItem(that.prevSelectedVal).name
} 拒绝录入处理`
)
}
var selectLanguageMap = that.languageMap[value] || {}
that.form.title = selectLanguageMap.title
that.form.content = selectLanguageMap.content
that.prevSelectedVal = value
},
handleLanguageBlur() {
const language = this.form.language
const selectedItem = this.getSelectedLangItem(language)
let languageMapItem = this.languageMap[language]
if (!languageMapItem) {
languageMapItem = this.languageMap[language] = {
language: this.form.language,
languageName: selectedItem.name,
title: this.form.title,
content: this.form.content,
sort: selectedItem.index
}
} else {
languageMapItem.title = this.form.title
languageMapItem.content = this.form.content
}
if (this.form.title && this.form.content) {
this.languageNames = this.getLanguageMapNames()
}
},
getLanguageMapNames() {
const names = []
for (const key in this.languageMap) {
const obj = this.languageMap[key]
if (obj.title && obj.content) {
names.push(obj.languageName)
}
}
return names
},
resetForm() {
this.languageMap = {}
this.languageNames = []
this.prevSelectedVal = 'en'
this.$refs.form.resetFields()
},
handleUpdate(row) {
this.textOptTitle = '修改推送文案'
this.formVisible = true
this.form = Object.assign(this.form, row)
for (let index = 0; index < row.sysPushTextContents.length; index++) {
const item = row.sysPushTextContents[index]
if (index === 0) {
this.prevSelectedVal = item.language
this.form.title = item.title
this.form.content = item.content
}
this.languageMap[item.language] = item
}
this.languageNames = this.getLanguageMapNames()
},
handlePushTextHistory(row) {
const that = this
that.pushTextHistoryVisible = true
that.pushTextHistoryLoading = true
getPushTextHistory(row.id)
.then(res => {
that.pushTextHistory = res.body
that.pushTextHistoryLoading = false
})
.catch(er => {
that.pushTextHistoryLoading = false
})
},
handleSynchronize() {
synchronPushText().then(res => {
this.listLoading = false
this.$message({
message: '同步成功',
type: 'success'
})
this.renderData()
})
},
handlerPushTextHistoryClose() {
this.pushTextHistoryVisible = false
this.pushTextHistory = []
}
}
}
</script>

View File

@ -1,347 +0,0 @@
<template>
<div :class="queryBackOperation ? 'app-container-inside':'app-container'">
<div class="filter-container">
<el-select
v-model="sysOrigins"
placeholder="系统"
style="width: 200px"
class="filter-item"
multiple
collapse-tags
>
<el-option
v-for="item in permissionsSysOriginPlatformAlls"
:key="item.value"
:label="item.label"
:value="item.value"
>
<span style="float: left;"> <sys-origin-icon :icon="item.value" :desc="item.value" /></span>
<span style="float: left;margin-left:10px">{{ item.label }}</span>
</el-option>
</el-select>
<el-select
v-model="listQuery.type"
placeholder="类型"
clearable
style="width: 120px"
class="filter-item"
@change="handleSearch"
>
<el-option
v-for="item in candyPurchasingTypes"
:key="item.value"
:label="item.name"
:value="item.value"
/>
</el-select>
<div class="filter-item">
<el-autocomplete
v-model="listQuery.origin"
popper-class="my-autocomplete"
:fetch-suggestions="querySearch"
placeholder="请输入或选择内容"
clearable
@select="handleSelect"
@clear="handleSelect"
>
<i
slot="suffix"
class="el-icon-edit el-input__icon"
/>
<template slot-scope="{ item }">
<span :label="item.name">{{ item.name }}</span>
<div :key="item.value" :value="item.value" style="font-size:12px; color:#d8d0d0">{{ item.value }}</div>
</template>
</el-autocomplete>
</div>
<div class="filter-item">
<account-input v-model="listQuery.userId" :sys-origin="sysOrigins && sysOrigins.length === 1? sysOrigins[0] : ''" placeholder="用户ID" />
</div>
<el-input
v-model.trim="listQuery.trackId"
placeholder="跟踪ID"
style="width: 200px;"
class="filter-item"
/>
<el-input
v-model.trim="listQuery.id"
v-number
placeholder="记录ID"
style="width: 200px;"
class="filter-item"
/>
<div class="filter-item">
<el-date-picker
v-model="rangeDate"
value-format="timestamp"
type="datetimerange"
:picker-options="pickerOptions"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:clearable="false"
/>
</div>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
:disabled="listLoading"
@click="handleSearch"
>
搜索
</el-button>
</div>
<el-alert type="warning" :closable="false">
注意: 数据存在时间周期, 到期后系统会自动移除
</el-alert>
<el-table
:data="list"
element-loading-text="Loading"
fit
highlight-current-row
>
<el-table-column type="index" width="50" label="No" />
<el-table-column prop="sysOrigin" label="系统" align="center" min-width="80">
<template slot-scope="scope">
<sys-origin-icon :icon="scope.row.runningWater.sysOrigin" :desc="scope.row.runningWater.sysOrigin" />
</template>
</el-table-column>
<el-table-column label="用户" align="center" min-width="200">
<template slot-scope="scope">
<user-table-exhibit :user-profile="scope.row.userProfile" :query-details="true" :tag-name="scope.row.backOperationName" />
</template>
</el-table-column>
<el-table-column label="类型" align="center" min-width="80">
<template slot-scope="scope">
<div>
<span v-if="scope.row.runningWater.type === 0">收入</span>
<span v-else-if="scope.row.runningWater.type === 1">支出</span>
<span v-else>未知</span>
</div>
</template>
</el-table-column>
<el-table-column label="糖果数" align="center" min-width="80">
<template slot-scope="scope">
<div>
<span v-if="scope.row.runningWater.type === 0" class="font-danger">+{{ scope.row.runningWater.quantity }}</span>
<span v-else-if="scope.row.runningWater.type === 1">-{{ scope.row.runningWater.quantity }}</span>
<span v-else>{{ scope.row.runningWater.quantity }}</span>
</div>
</template>
</el-table-column>
<el-table-column prop="runningWater.balance" label="余额" align="center" />
<el-table-column label="来源" prop="runningWater.originName" align="center" show-overflow-tooltip min-width="300">
<template slot-scope="scope">
<el-tooltip class="item" effect="dark" :content="'标签:' + scope.row.runningWater.origin">
<div>
{{ scope.row.runningWater.originName }}
<span v-if="scope.row.runningWater.remark">({{ scope.row.runningWater.remark }})</span>
</div>
</el-tooltip>
</template>
</el-table-column>
<el-table-column prop="runningWater.createTime" label="创建时间" width="200" align="center">
<template slot-scope="scope">
<div>
{{ scope.row.runningWater.createTime | dateFormat('yyyy-MM-dd HH:mm:ss') }}
</div>
</template>
</el-table-column>
</el-table>
<div style="text-align: center; margin-top:20px;">
<el-button v-if="!notMore " size="mini" :disabled="listLoading" :loading="listLoading" @click="clickLoadMore">加载更多</el-button>
<span v-else>已加载全部</span>
</div>
</div>
</template>
<script>
import { listGoldRunningWater } from '@/api/purchase'
import { originPlatforms } from '@/constant/origin'
import { candyPurchasingTypes, currencyOrigins } from '@/constant/type'
import { mapGetters } from 'vuex'
import { beforeDateObject, datePlusDays, getMonthLastDate } from '@/utils'
export default {
name: 'GoldRunnigWater',
props: {
queryBackOperation: {
type: Boolean,
default: false
}
},
data() {
return {
searchDisabled: false,
minDate: null,
maxDate: null,
pickerOptions: {
disabledDate(date) {
return date.getTime() > datePlusDays(new Date(), 1).getTime()
}
},
thatSelectedUserId: '',
originPlatforms,
candyPurchasingTypes,
currencyOrigins,
list: [],
total: 0,
rangeDate: [],
listQuery: {
limit: 20,
userId: '',
type: '',
origin: '',
startTime: '',
endTime: '',
sysOrigin: '',
lastId: '',
id: '',
trackId: '',
queryBackOperationUser: false
},
sysOrigins: [],
listLoading: true,
clickUserId: '',
restaurants: [],
notMore: false,
notProccessRangeDate: false,
beforeIntervalDays: 1
}
},
computed: {
...mapGetters(['permissionsSysOriginPlatformAlls'])
},
watch: {
rangeDate: {
immediate: true,
deep: true,
handler(newVal) {
if (this.notProccessRangeDate === true) {
this.notProccessRangeDate = false
return
}
if (newVal && newVal.length > 0) {
this.listQuery.startTime = newVal[0]
this.listQuery.endTime = newVal[1]
return
}
this.notProccessRangeDate = true
const defaultRangeTime = this.defaultRangeTimestamp()
this.rangeDate = defaultRangeTime
this.listQuery.startTime = defaultRangeTime[0]
this.listQuery.endTime = defaultRangeTime[1]
}
},
queryBackOperation: {
immediate: true,
deep: true,
handler(newVal) {
this.listQuery.queryBackOperationUser = newVal === true
}
}
},
created() {
const that = this
const querySystem = this.permissionsSysOriginPlatformAlls[0]
if (!querySystem) {
return
}
that.sysOrigins.push(querySystem.value)
that.rangeDate = that.defaultRangeTimestamp()
that.renderData()
},
mounted() {
this.restaurants = this.currencyOrigins
},
methods: {
defaultRangeTimestamp() {
const defStartDate = beforeDateObject(this.beforeIntervalDays)
const mDate = datePlusDays(new Date(), 1)
mDate.setHours(23)
mDate.setMinutes(59)
mDate.setSeconds(59)
const monthLastDate = getMonthLastDate()
monthLastDate.setHours(23)
monthLastDate.setMinutes(59)
monthLastDate.setSeconds(59)
const nowDate = mDate.getMonth() !== monthLastDate.getMonth() ? monthLastDate : mDate
if (nowDate.getMonth() !== defStartDate.getMonth()) {
//
const startDate = nowDate.getTime() - 60 * 60 * 1000 * 2
if (startDate.getMonth() !== nowDate.getMonth()) {
// 2
return [nowDate.getTime() - 60 * 1000 * 2, nowDate.getTime()]
}
return [defStartDate.getTime(), nowDate.getTime()]
}
return [defStartDate.getTime(), nowDate.getTime()]
},
renderData(isClean) {
const that = this
const startMonth = new Date(that.listQuery.startTime).getMonth()
const endMonth = new Date(that.listQuery.endTime).getMonth()
if (startMonth !== endMonth) {
that.$opsMessage.warn('时间选项必须控制在1个月内, 不可跨月搜索!')
return
}
if (isClean === true) {
that.list = []
that.listQuery.lastId = ''
that.notMore = false
}
that.listQuery.sysOrigin = that.sysOrigins.length > 0 ? that.sysOrigins.join(',') : that.permissionsSysOriginPlatformAlls.map(item => item.value).join(',')
that.listLoading = true
listGoldRunningWater(that.listQuery).then(res => {
that.listLoading = false
const { result } = res
const list = result || []
that.notMore = list.length <= 0
that.list = that.list.concat(list)
if (that.list && that.list.length > 0) {
that.listQuery.lastId = that.list[that.list.length - 1].runningWater.id
}
}).catch(er => {
that.listLoading = false
console.error(er)
})
},
handleSearch() {
if (this.listQuery.origin !== '') {
const origins = this.currencyOrigins.filter(this.createFilter(this.listQuery.origin))
this.listQuery.origin = origins.length > 0 ? origins[0].value : this.listQuery.origin
}
this.renderData(true)
},
querySearch(queryString, cb) {
var restaurants = currencyOrigins
var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants
cb(results)
},
createFilter(queryString) {
return (restaurant) => {
return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) >= 0) || (restaurant.name.toLowerCase().indexOf(queryString.toLowerCase()) >= 0)
}
},
handleSelect(item) {
this.renderData(true)
},
clickLoadMore() {
this.renderData()
}
}
}
</script>

View File

@ -1,115 +0,0 @@
<template>
<div class="send-game-coupon">
<el-alert title="赠送:游戏券" style="margin-bottom: 10px;" :closable="false" />
<el-form ref="form" :model="propsGiveForm" :rules="formRules" label-width="85px">
<el-form-item label="接收人" prop="receiverAccounts">
<el-input v-model="propsGiveForm.receiverAccounts" placeholder="请输入用户 【短账号】 ,多个短账号用英文','分割;(一批最多15个)短账号" />
</el-form-item>
<el-form-item label="选择系统" prop="sysOrigin">
<el-form-item>
<el-select
v-model="propsGiveForm.sysOrigin"
placeholder="系统"
style="width:100%;"
class="filter-item"
>
<el-option v-for="item in permissionsSysOriginPlatforms" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
</el-form-item>
<el-form-item label="数量" prop="content">
<el-input v-model="propsGiveForm.content" v-number placeholder="请输入游戏券数量" />
</el-form-item>
<el-form-item>
<el-button type="primary" :loading="submitLoading" @click="onGiveSubmit">发送</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { sendPropsGiveUser } from '@/api/props'
import { mapGetters } from 'vuex'
export default {
name: 'SendGameCoupon',
data() {
const commonRules = [
{ required: true, message: '必填字段不可为空', trigger: 'blur' }
]
return {
formRules: {
// receiverId: commonRules,
receiverAccounts: commonRules,
content: commonRules,
sysOrigin: commonRules
},
propsGiveForm: {
// receiverId: '',
receiverAccounts: '',
type: 'GAME_COUPON',
content: '',
secondaryType: '',
sysOrigin: ''
},
userInfo: {},
submitLoading: false
}
},
computed: {
...mapGetters(['permissionsSysOriginPlatforms'])
},
created() {
},
methods: {
selectPropsSourcePopover(item) {
this.selectProps = item
this.propsGiveForm.content = item.id
},
onGiveSubmit() {
const that = this
that.$refs.form.validate(valid => {
if (!valid) {
console.error('error submit!!')
return
}
that.submitLoading = true
sendPropsGiveUser(that.propsGiveForm).then(res => {
if (res.errorCode === 0) {
if (res.body) {
that.$opsMessage.fail('无效短账号: ' + res.body + ' 请处理后再将当前批次所有短账号重新发送.')
that.submitLoading = false
return
}
that.$opsMessage.success()
that.selectProps = {}
that.propsGiveForm.content = ''
that.submitLoading = false
return
}
that.$opsMessage.fail(res.errorMsg)
that.submitLoading = false
}).catch(er => {
that.submitLoading = false
console.error(er)
})
})
}
}
}
</script>
<style scoped lang="scss">
.payer-source {
position: relative;
.paler-icon {
position:absolute;
left: 0px;
top: -10px;
}
img {
width: 100px;
height: 100px;
}
}
</style>

View File

@ -1,84 +0,0 @@
<template>
<el-popover
placement="bottom"
title="选中道具"
width="500"
trigger="click"
>
<div class="select-props">
<div v-for="item in 50" :key="item" class="item" :class="{'select-item': item === 1}">
<div class="img">
<div class="svgaplayer-preview">
<svgaplayer
type="popover"
:url="'http://dev.img.sugartimeapp.com/other/manager-186bfa08-9f81-47e6-8864-9a206e955c3c.svga'"
icon-size="28px"
/>
</div>
<el-image
style="width:100%;height:100%;"
:src="'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg'"
:lazy="item > 20"
/>
</div>
<div class="name nowrap-ellipsis">
<a title="1232">asdqweqweqweasdqweqweqweasdqweqweqwe</a>
</div>
</div>
</div>
<div class="opetion">
<el-form ref="form" :model="form" :rules="formRules" label-width="110px" style="margin:30px; 50px 0px 0px">
<el-form-item label="类型名称" prop="name">
<el-input v-model.trim="form.name" type="text" />
</el-form-item>
</el-form>
</div>
<el-button slot="reference">click</el-button>
</el-popover>
</template>
<script>
export default {
name: 'SearchUserInput',
data() {
return {
form: false,
formRules: []
}
},
methods: {
}
}
</script>
<style scoped lang="scss">
.select-props {
max-height: 300px;
overflow: auto;
display: flex;
flex-wrap: wrap;
justify-content: center;
.item {
padding: 5px;
position: relative;
width: 110px;
.img {
width: 100px;
height: 100px;
cursor: pointer;
}
.svgaplayer-preview {
position: absolute;
z-index: 999;
top: 0px;
right: 10px;
}
}
.select-item {
.img {
border: 5px solid #ff4949;
}
}
}
</style>

View File

@ -1,405 +0,0 @@
<template>
<div class="cp-cabin-form-edite">
<el-drawer
:title="textOptTitle"
:visible="true"
:before-close="handleClose"
:close-on-press-escape="false"
:wrapper-closable="false"
:modal-append-to-body="true"
:append-to-body="true"
custom-class="drawer-auto-layout"
>
<div v-loading="submitLoading">
<div class="drawer-form">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item prop="cover" label="小屋图标">
<el-upload
:disabled="coverUploadLoading"
:file-list="coverFileList"
:class="{'upload-but-hide': !isShowCoverUpload}"
action=""
list-type="picture-card"
:http-request="uploadCover"
:show-file-list="!isShowCoverUpload"
:on-remove="handleCoverFileRemove"
accept="image/*"
>
<i slot="default" v-loading="coverUploadLoading" class="el-icon-plus" />
</el-upload>
</el-form-item>
<el-form-item prop="lockCover" label="小屋图标加锁">
<el-upload
:disabled="lockCoverUploadLoading"
:file-list="lockCoverFileList"
:class="{'upload-but-hide': !isShowLockCoverUpload}"
action=""
list-type="picture-card"
:http-request="uploadLockCover"
:show-file-list="!isShowLockCoverUpload"
:on-remove="handleLockCoverFileRemove"
accept="image/*"
>
<i slot="default" v-loading="lockCoverUploadLoading" class="el-icon-plus" />
</el-upload>
</el-form-item>
<el-form-item prop="personCover" label="个人资料页图">
<el-upload
:disabled="personCoverUploadLoading"
:file-list="personUrlFileList"
:class="{'upload-but-hide': !isShowPersonCoverUpload}"
action=""
list-type="picture-card"
:http-request="uploadPersonCover"
:show-file-list="!isShowPersonCoverUpload"
:on-remove="handlePersonCoverFileRemove"
accept="image/*"
>
<i slot="default" v-loading="personCoverUploadLoading" class="el-icon-plus" />
</el-upload>
</el-form-item>
<el-form-item prop="cardCover" label="个人卡片">
<el-upload
:disabled="cardCoverUploadLoading"
:file-list="cardUrlFileList"
:class="{'upload-but-hide': !isShowCardCoverUpload}"
action=""
list-type="picture-card"
:http-request="uploadCardCover"
:show-file-list="!isShowCardCoverUpload"
:on-remove="handleCardCoverFileRemove"
accept="image/*"
>
<i slot="default" v-loading="cardCoverUploadLoading" class="el-icon-plus" />
</el-upload>
</el-form-item>
<el-form-item prop="backgroundCover" label="空间背景图">
<el-upload
:disabled="backgroundCoverUploadLoading"
:file-list="backgroundUrlFileList"
:class="{'upload-but-hide': !isShowBackgroundCoverUpload}"
action=""
list-type="picture-card"
:http-request="uploadBackgroundCover"
:show-file-list="!isShowBackgroundCoverUpload"
:on-remove="handleBackgroundCoverFileRemove"
accept="image/*"
>
<i slot="default" v-loading="backgroundCoverUploadLoading" class="el-icon-plus" />
</el-upload>
</el-form-item>
<el-form-item label="闪光mini资源" prop="sourceMiniUrl">
<el-upload
:disabled="sourceMiniUploadLoading"
:class="{'upload-but-hide': !isShowSourceMiniUpload}"
action=""
:http-request="sourceMiniUpload"
:on-remove="handleSourceMiniFileRemove"
:show-file-list="!isShowSourceMiniUpload"
:file-list="sourceMiniUrlFileList"
accept=".svga,.pag"
>
<div class="upload-but">
<el-button :loading="sourceMiniUploadLoading" size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">
只能上传svga/pag文件
</div>
</div>
</el-upload>
<svgaplayer v-if="!isShowSourceMiniUpload" :url="form.sourceMiniUrl" />
</el-form-item>
<el-form-item label="资源" prop="sourceUrl">
<el-upload
:disabled="sourceUploadLoading"
:class="{'upload-but-hide': !isShowSourceUpload}"
action=""
:http-request="sourceUpload"
:on-remove="handleSourceFileRemove"
:show-file-list="!isShowSourceUpload"
:file-list="sourceUrlFileList"
accept=".svga,.pag"
>
<div class="upload-but">
<el-button :loading="sourceUploadLoading" size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">
只能上传svga/pag文件
</div>
</div>
</el-upload>
<svgaplayer v-if="!isShowSourceUpload" :url="form.sourceUrl" />
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input v-model.trim="form.name" placeholder="名称" />
</el-form-item>
<el-form-item label="解锁小屋CP值" prop="cabinUnlockValue">
<el-input v-model.trim="form.cabinUnlockValue" v-number placeholder="解锁小屋CP值" />
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input v-model.trim="form.sort" v-number placeholder="降序排列(数字越大越靠前)" />
</el-form-item>
</el-form>
</div>
<div class="drawer-footer">
<el-button @click="handleClose()">取消</el-button>
<el-button type="primary" @click="submitForm()">保存</el-button>
</div>
</div>
</el-drawer>
</div>
</template>
<script>
import { updateCpCabin, addCpCabin } from '@/api/cp-cabin'
import { getElementUiUploadFile } from '@/utils'
import { mapGetters } from 'vuex'
export default {
props: {
row: {
type: Object,
default: null
},
sysOrigin: {
type: String,
require: false,
default: ''
}
},
data() {
const commonRules = [{ required: true, message: '必填字段', trigger: 'blur' }]
return {
coverUploadLoading: false,
sourceUploadLoading: false,
sourceMiniUploadLoading: false,
lockCoverUploadLoading: false,
personCoverUploadLoading: false,
cardCoverUploadLoading: false,
backgroundCoverUploadLoading: false,
coverFileList: [],
lockCoverFileList: [],
sourceUrlFileList: [],
sourceMiniUrlFileList: [],
personUrlFileList: [],
cardUrlFileList: [],
backgroundUrlFileList: [],
loading: false,
form: {
id: '',
name: '',
cover: '',
lockCover: '',
personCover: '',
cardCover: '',
backgroundCover: '',
sourceUrl: '',
sourceMiniUrl: '',
sysOrigin: '',
sort: '',
cabinUnlockValue: ''
},
submitLoading: false,
uploadLoading: false,
rules: {
cover: commonRules,
lockCover: commonRules,
personCover: commonRules,
cardCover: commonRules,
backgroundCover: commonRules,
sourceUrl: commonRules,
sourceMiniUrl: commonRules,
sort: commonRules,
name: commonRules,
cabinUnlockValue: commonRules
}
}
},
computed: {
textOptTitle() {
return `${(this.row && this.row.id ? '修改' : '新增')}(${this.sysOrigin})`
},
isShowCoverUpload() {
return !this.form.cover
},
isShowLockCoverUpload() {
return !this.form.lockCover
},
isShowPersonCoverUpload() {
return !this.form.personCover
},
isShowCardCoverUpload() {
return !this.form.cardCover
},
isShowBackgroundCoverUpload() {
return !this.form.backgroundCover
},
isShowSourceUpload() {
return !this.form.sourceUrl
},
isShowSourceMiniUpload() {
return !this.form.sourceMiniUrl
},
...mapGetters(['permissionsSysOriginPlatforms'])
},
watch: {
row: {
handler(val) {
if (!val) {
return
}
const form = Object.assign({}, val)
this.coverFileList = getElementUiUploadFile(form.cover)
this.lockCoverFileList = getElementUiUploadFile(form.lockCover)
this.sourceUrlFileList = getElementUiUploadFile(form.sourceUrl)
this.sourceMiniUrlFileList = getElementUiUploadFile(form.sourceMiniUrl)
this.personUrlFileList = getElementUiUploadFile(form.personCover)
this.cardUrlFileList = getElementUiUploadFile(form.cardCover)
this.backgroundUrlFileList = getElementUiUploadFile(form.backgroundCover)
this.form = Object.assign(this.form, form)
},
immediate: true
}
},
methods: {
uploadLockCover(file) {
const that = this
that.lockCoverUploadLoading = true
that.$simpleUploadFlie(file, that.$application.fileBucket.other).then(res => {
that.lockCoverUploadLoading = false
that.form.lockCover = that.$getAccessImgUrl(res.name)
}).catch(er => {
that.lockCoverUploadLoading = false
})
},
handleLockCoverFileRemove(file, fileList) {
this.form.lockCover = ''
this.lockCoverUploadLoading = false
},
uploadCover(file) {
const that = this
that.coverUploadLoading = true
that.$simpleUploadFlie(file, that.$application.fileBucket.other).then(res => {
that.coverUploadLoading = false
that.form.cover = that.$getAccessImgUrl(res.name)
}).catch(er => {
that.coverUploadLoading = false
})
},
handleCoverFileRemove(file, fileList) {
this.form.cover = ''
this.coverUploadLoading = false
},
uploadPersonCover(file) {
const that = this
that.personCoverUploadLoading = true
that.$simpleUploadFlie(file, that.$application.fileBucket.other).then(res => {
that.personCoverUploadLoading = false
that.form.personCover = that.$getAccessImgUrl(res.name)
}).catch(er => {
that.personCoverUploadLoading = false
})
},
handlePersonCoverFileRemove(file, fileList) {
this.form.personCover = ''
this.personCoverUploadLoading = false
},
uploadCardCover(file) {
const that = this
that.cardCoverUploadLoading = true
that.$simpleUploadFlie(file, that.$application.fileBucket.other).then(res => {
that.cardCoverUploadLoading = false
that.form.cardCover = that.$getAccessImgUrl(res.name)
}).catch(er => {
that.cardCoverUploadLoading = false
})
},
handleCardCoverFileRemove(file, fileList) {
this.form.cardCover = ''
this.cardCoverUploadLoading = false
},
uploadBackgroundCover(file) {
const that = this
that.backgroundCoverUploadLoading = true
that.$simpleUploadFlie(file, that.$application.fileBucket.other).then(res => {
that.backgroundCoverUploadLoading = false
that.form.backgroundCover = that.$getAccessImgUrl(res.name)
}).catch(er => {
that.backgroundCoverUploadLoading = false
})
},
handleBackgroundCoverFileRemove(file, fileList) {
this.form.backgroundCover = ''
this.backgroundCoverUploadLoading = false
},
sourceUpload(file) {
const that = this
that.sourceUploadLoading = true
that.$simpleUploadFlie(file, that.$application.fileBucket.other).then(res => {
that.sourceUploadLoading = false
that.form.sourceUrl = that.$getAccessImgUrl(res.name)
}).catch(er => {
that.sourceUploadLoading = false
})
},
handleSourceFileRemove(file, fileList) {
this.form.sourceUrl = ''
this.sourceUploadLoading = false
},
sourceMiniUpload(file) {
const that = this
that.sourceMiniUploadLoading = true
that.$simpleUploadFlie(file, that.$application.fileBucket.other).then(res => {
that.sourceMiniUploadLoading = false
that.form.sourceMiniUrl = that.$getAccessImgUrl(res.name)
}).catch(er => {
that.sourceMiniUploadLoading = false
})
},
handleSourceMiniFileRemove(file, fileList) {
this.form.sourceMiniUrl = ''
this.sourceMiniUploadLoading = false
},
handleClose() {
this.$emit('close')
},
submitForm() {
const that = this
that.$refs.form.validate(valid => {
if (!valid) {
console.error('error submit!!')
return
}
const submitForm = Object.assign({}, that.form)
that.submitLoading = true
if (!submitForm.sysOrigin) {
submitForm.sysOrigin = that.sysOrigin
}
if (!submitForm.sysOrigin) {
that.$message.error('系统错误, 没有平台信息!')
return
}
if (submitForm.id) {
updateCpCabin(submitForm).then(res => {
that.submitLoading = false
that.$emit('success', res)
}).catch(er => {
that.submitLoading = false
that.$emit('fial', er)
})
return
}
addCpCabin(submitForm).then(res => {
that.submitLoading = false
that.$emit('success', res)
}).catch(er => {
that.submitLoading = false
console.error(er)
that.$emit('fial', er)
})
})
}
}
}
</script>

View File

@ -1,196 +0,0 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-select
v-model="listQuery.sysOrigin"
placeholder="系统"
style="width:120px;"
class="filter-item"
@change="changeSysOrigin"
>
<el-option
v-for="item in permissionsSysOriginPlatforms"
:key="item.value"
:label="item.label"
:value="item.value"
>
<span style="float: left;"> <sys-origin-icon :icon="item.value" :desc="item.value" /></span>
<span style="float: left;margin-left:10px">{{ item.label }}</span>
</el-option>
</el-select>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleSearch"
>
搜索
</el-button>
<el-button
class="filter-item"
type="primary"
icon="el-icon-edit"
@click="handleCreate"
>
新增
</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
fit
highlight-current-row
@cell-mouse-enter="handleMouseEnter"
>
<el-table-column label="归属系统" align="center">
<template slot-scope="scope">
<sys-origin-icon :icon="scope.row.sysOrigin" :desc="scope.row.sysOrigin" />
</template>
</el-table-column>
<el-table-column prop="name" label="名称" align="center" />
<el-table-column label="封面" align="center" width="400">
<template slot-scope="scope">
<el-image
:lazy="true"
style="width: 400px; height: 150px"
:src="scope.row.cover"
:preview-src-list="[scope.row.cover]"
/>
</template>
</el-table-column>
<el-table-column prop="cabinUnlockValue" label="解锁小屋CP值" align="center" />
<el-table-column prop="sort" label="排序" align="center" />
<el-table-column fixed="right" label="操作" align="center" width="200">
<template slot-scope="scope">
<el-button type="text" @click.native="handleUpdate()">修改</el-button>
<el-button type="text" @click.native="handlDel(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="listQuery.cursor"
:limit.sync="listQuery.limit"
@pagination="renderData"
/>
<form-edit
v-if="formEditVisible"
:row="thatRow"
:sys-origin="listQuery.sysOrigin"
@close="formEditVisible = false"
@success="formEditSuccess"
/>
</div>
</template>
<script>
import { cpCabinTable, deleteCpCabin } from '@/api/cp-cabin'
import Pagination from '@/components/Pagination'
import { sysOriginPlatforms } from '@/constant/origin'
import FormEdit from './form-edit.vue'
import { mapGetters } from 'vuex'
export default {
components: { Pagination, FormEdit },
data() {
return {
thatRow: {},
sysOriginPlatforms,
loading: false,
list: [],
total: 0,
listQuery: {
cursor: 1,
limit: 20,
sysOrigin: 'HALAR'
},
formEditVisible: false,
listLoading: true
}
},
computed: {
...mapGetters(['permissionsSysOriginPlatforms'])
},
created() {
const that = this
const querySystem = this.permissionsSysOriginPlatforms[0]
if (!querySystem) {
return
}
that.listQuery.sysOrigin = querySystem.value
that.renderData()
},
methods: {
renderData(isClean) {
const that = this
if (isClean === true) {
this.listQuery.cursor = 1
this.listQuery.list = []
}
that.listLoading = true
cpCabinTable(that.listQuery).then(res => {
const { body } = res
that.total = body.total || 0
that.list = body.records
that.listLoading = false
})
},
handleSearch() {
this.renderData(true)
},
renderDataSuccess() {
this.$message({
message: '操作成功',
type: 'success'
})
this.renderData()
},
changeSysOrigin() {
this.handleSearch()
},
//
handlDel(row) {
this.$confirm('确认删除吗?', '提示', {
type: 'warning'
}).then(() => {
this.listLoading = true
deleteCpCabin(row.id).then((res) => {
this.listLoading = false
this.$message({
message: '删除成功',
type: 'success'
})
this.renderData()
})
}).catch(() => {
})
},
handleCreate() {
this.thatRow = null
this.formEditVisible = true
},
handleUpdate() {
this.formEditVisible = true
},
handleMouseEnter(row) {
this.thatRow = row
},
formEditSuccess() {
this.formEditVisible = false
this.renderData()
}
}
}
</script>
<style scoped lang="scss">
.popover-content {
max-width: 300px;
line-height: 20px;
}
</style>

View File

@ -1,144 +0,0 @@
<template>
<div class="edit-user-gold-coin-reward-form">
<el-dialog
title="配置奖项"
:visible="true"
:modal-append-to-body="true"
:append-to-body="true"
width="450px"
:before-close="handleClose"
:close-on-click-modal="false"
>
<el-form
ref="formData"
:rules="rules"
:model="formData"
label-position="left"
label-width="70px"
style="width: 300px; margin-left:50px;"
>
<el-form-item label="奖品" prop="type">
<el-select
v-model="formData.type"
placeholder="类型"
clearable
style="width:100%;"
class="filter-item"
>
<el-option label="美金" :value="'USD'" />
<el-option label="立即提现" :value="'WITHDRAWAL'" />
<el-option label="目标" :value="'TARGET'" />
<el-option label="钻石" :value="'DIAMOND'" />
</el-select>
</el-form-item>
<el-form-item v-if="formData.type === 'USD'" label="数量" prop="quantity">
<el-input
v-model.trim="formData.quantity"
maxlength="8"
placeholder="数量"
/>
</el-form-item>
<el-form-item v-if="formData.type === 'TARGET' || formData.type === 'DIAMOND'" label="数量" prop="quantity">
<el-input
v-model.trim="formData.quantity"
v-number
maxlength="8"
placeholder="数量"
/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="handleClose()">
取消
</el-button>
<el-button
v-loading="listLoading"
type="primary"
@click="handleSubmit()"
>
确定
</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { saveCarouselAwards } from '@/api/red-packet-invite-user'
export default {
name: 'RedPacketInviteUserTargetExchange',
props: {
row: {
type: Object,
required: true
}
},
data() {
return {
listLoading: false,
rules: {
quantity: [
{
required: true,
message: '必填字段不可为空',
trigger: 'blur'
}
],
type: [
{
required: true,
message: '请选择奖品类型',
trigger: 'blur'
}
]
},
formData: {
sysOrigin: '',
id: '',
type: '',
quantity: ''
}
}
},
watch: {
row: {
handler(val) {
console.log(!val.id)
if (!val.id) {
this.formData.sysOrigin = val.sysOrigin
return
}
const form = Object.assign({}, val)
this.formData = Object.assign(this.formData, form)
},
immediate: true
}
},
methods: {
handleSubmit() {
const that = this
if (that.formData.type === 'WITHDRAWAL') {
that.formData.quantity = 0
}
that.$refs.formData.validate((valid) => {
if (!valid) {
console.error('error submit!!')
return false
}
that.listLoading = true
saveCarouselAwards(that.formData).then(res => {
that.$emit('success', Object.assign({}, that.formData))
that.handleClose()
}).catch(err => {
that.listLoading = false
that.$emit('fial', err)
})
})
},
handleClose() {
this.$emit('close')
}
}
}
</script>

View File

@ -1,177 +0,0 @@
<template>
<div :class="'app-container'">
<div class="filter-container">
<el-select
v-model="listQuery.sysOrigin"
placeholder="系统"
style="width: 120px"
class="filter-item"
@change="handleSearch"
>
<el-option
v-for="item in permissionsSysOriginPlatforms"
:key="item.value"
:label="item.label"
:value="item.value"
>
<span style="float: left;"> <sys-origin-icon :icon="item.value" :desc="item.value" /></span>
<span style="float: left;margin-left:10px">{{ item.label }}</span>
</el-option>
</el-select>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleSearch"
>
搜索
</el-button>
<el-button
v-if="!(list && list.length >= 6)"
class="filter-item"
type="primary"
icon="el-icon-edit"
@click="handleCreate"
>
新增
</el-button>
</div>
<el-alert
title="务必配置六项奖励,不能多不能少且必须包含一个0.01的现金奖项"
type="warning"
/>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
fit
highlight-current-row
>
<el-table-column prop="sysOrigin" label="系统" align="center" width="80">
<template slot-scope="scope">
<sys-origin-icon :icon="scope.row.sysOrigin" :desc="scope.row.sysOrigin" />
</template>
</el-table-column>
<el-table-column prop="typeDesc" label="奖品类型" align="center" />
<el-table-column label="数量" align="center">
<template slot-scope="scope">
<span v-if="scope.row.type !== 'WITHDRAWAL'">{{ scope.row.quantity }}</span>
<span v-else>随机</span>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" align="center">
<template slot-scope="scope">
<el-button type="text" @click.native="edit(scope.row)">编辑</el-button>
<el-button type="text" @click.native="handleDelete(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<carousel-awards-edit
v-if="editFormVisible"
:row="thatSelectedRow"
@close="editFormVisible=false"
@success="renderDataSuccess"
/>
</div>
</template>
<script>
import { listCarouselAwards, deleteCarouselAwards } from '@/api/red-packet-invite-user'
import CarouselAwardsEdit from './edit'
import { mapGetters } from 'vuex'
export default {
name: 'RedPacketInviteCarouselAwards',
components: { CarouselAwardsEdit },
data() {
return {
thatSelectedRow: '',
editFormVisible: false,
listQuery: {
sysOrigin: 'HALAR'
},
listLoading: false,
list: []
}
},
computed: {
...mapGetters(['permissionsSysOriginPlatforms'])
},
created() {
const that = this
const querySystem = this.permissionsSysOriginPlatforms[0]
if (!querySystem) {
return
}
that.listQuery.sysOrigin = querySystem.value
that.renderData()
},
methods: {
renderData(isReset) {
const that = this
if (isReset === true) {
that.listQuery.cursor = 1
that.list = []
}
that.listLoading = true
listCarouselAwards(that.listQuery.sysOrigin).then(res => {
const { body } = res
that.list = body
that.listLoading = false
}).catch(er => {
that.listLoading = false
})
},
edit(item) {
this.thatSelectedRow = item
this.editFormVisible = true
},
handleCreate() {
const that = this
this.thatSelectedRow = { 'sysOrigin': that.listQuery.sysOrigin }
this.editFormVisible = true
},
handleDelete(id) {
this.$confirm('确认删除吗?', '提示', {
type: 'warning'
}).then(() => {
this.listLoading = true
deleteCarouselAwards(id).then((res) => {
this.listLoading = false
this.$message({
message: '删除成功',
type: 'success'
})
this.renderData()
})
}).catch(() => {
})
},
handleSearch() {
this.renderData(true)
},
renderDataSuccess() {
this.$message({
message: '操作成功',
type: 'success'
})
this.renderData()
}
}
}
</script>
<style scoped lang="scss">
.user-css {
display: flex;
align-items: center;
color: #909399;
font-size: .15rem;
line-height: .3rem;
padding: 0.02rem;
border-radius: 0.04rem;
}
.load-more {
padding: 20px;
text-align: center;
}
</style>

View File

@ -1,41 +0,0 @@
<template>
<div class="app-container">
<el-tabs v-model="activeName">
<el-tab-pane v-for="item in tables" :key="item.name" :label="item.title" :name="item.component" />
<component :is="activeName" />
</el-tabs>
</div>
</template>
<script>
import AswatInviteUserConfig from './red-packet-invite-user-aswat'
import TwoFunInviteUserConfig from './red-packet-invite-user-2fun'
import TarabInviteUserConfig from './red-packet-invite-user-tarab'
import HalarInviteUserConfig from './red-packet-invite-user-halar'
export default {
name: 'RedPacketInviteConfig',
components: { AswatInviteUserConfig, TwoFunInviteUserConfig, TarabInviteUserConfig, HalarInviteUserConfig},
data() {
return {
activeName: 'HalarInviteUserConfig',
tables: [
// {
// title: 'Aswat',
// component: 'AswatInviteUserConfig'
// },
// {
// title: '2Fun',
// component: 'TwoFunInviteUserConfig'
// },
// {
// title: 'Tarab',
// component: 'TarabInviteUserConfig'
// },
{
title: 'Halar',
component: 'HalarInviteUserConfig'
}
]
}
}
}
</script>

View File

@ -1,215 +0,0 @@
<template>
<div v-loading="listLoading" class="push-form">
<el-form ref="form" :model="form" style="padding: 0.3rem;">
金币余额多少可以参与活动 <span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
<el-form-item prop="goldCoinBalance" label="" style="display: inline-block;">
<el-input v-model="form.goldCoinBalance"/>
</el-form-item>
<span style="color: #8D0502">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;或者</span> <!-- 输出一个空格 -->
注册时间大于多少天可以参与活动 <span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
<el-form-item prop="regDateMax" label="" style="display: inline-block;">
<el-input v-model="form.regDateMax" v-number type="number"/>
</el-form-item>
<el-form-item prop="cashNumberMax" label="现金奖项人次(最少~最多)">
<el-col :span="2">
<el-input v-model="form.cashNumberMin" v-number type="number" />
</el-col>
<el-col :span="2" style="margin: 0rem .2rem;">
<el-input v-model="form.cashNumberMax" v-number type="number" />
</el-col>
</el-form-item>
<el-form-item prop="otherNumberMax" label="其他奖项人次(最少~最多)">
<el-col :span="2">
<el-input v-model="form.otherNumberMin" v-number type="number" />
</el-col>
<el-col :span="2" style="margin: 0rem .2rem;">
<el-input v-model="form.otherNumberMax" v-number type="number" />
</el-col>
</el-form-item>
<el-form-item prop="totalAmount" label="红包总金额">
<el-col :span="2">
<el-input v-model="form.totalAmount" v-number type="number" />
</el-col>
</el-form-item>
<el-form-item prop="openRedPacketMax" label="开红包金额(最少~最多)">
<el-col :span="2">
<el-input v-model="form.openRedPacketMin" />
</el-col>
<el-col :span="2" style="margin: 0rem .2rem;">
<el-input v-model="form.openRedPacketMax" />
</el-col>
</el-form-item>
<el-form-item prop="withdrawThresholdCount" label="‘直接提现’奖项用户最少邀请多少人才能有机会触发">
<el-col :span="2">
<el-input v-model="form.withdrawThresholdCount" v-number type="number" />
</el-col>
</el-form-item>
<el-form-item prop="withdrawTriggerProportion" label="‘直接提现’奖项多少次全局抽奖出一次">
<el-col :span="2">
<el-input v-model="form.withdrawTriggerProportion" v-number type="number" />
</el-col>
</el-form-item>
<el-form-item prop="ipFrequency" label="一个ip最多可集满红包次数">
<el-col :span="2">
<el-input v-model="form.ipFrequency" v-number type="number" />
</el-col>
</el-form-item>
<el-form-item prop="deviceFrequency" label="一个设备最多可集满红包次数">
<el-col :span="2">
<el-input v-model="form.deviceFrequency" v-number type="number" />
</el-col>
</el-form-item>
<el-form-item prop="dayFrequency" label="用户账号一天最多可集满红包次数">
<el-col :span="2">
<el-input v-model="form.dayFrequency" v-number type="number" />
</el-col>
</el-form-item>
<el-form-item prop="totalFrequency" label="用户账号总可集满次数">
<el-col :span="2">
<el-input v-model="form.totalFrequency" v-number type="number" />
</el-col>
</el-form-item>
<el-form-item prop="newUserHelpDays" label="新用户可助力天节点">
<el-col :span="4">
<el-input v-model="form.newUserHelpDays" placeholder="例如:1,7,14 多个用英语逗号分隔" />
</el-col>
</el-form-item>
<el-form-item prop="regionList" label="支持区域">
<el-select v-model="form.regionList" multiple placeholder="请选择" style="width: 100%;" @change="$forceUpdate()">
<el-option
v-for="(item, index) in regions"
:key="index"
:label="item.regionName"
:value="item.regionCode"
/>
</el-select>
</el-form-item>
<el-form-item prop="checkClose" label="活动状态">
<el-col :span="2">
<el-switch
v-model="form.checkClose"
active-color="#ff4949"
:active-text="form.checkClose ? '已结束' : '运行中'"
inactive-color="#13ce66"
/>
</el-col>
</el-form-item>
<el-form-item prop="bayWindow" label="红包飘窗开启状态">
<el-col :span="2">
<el-switch
v-model="form.bayWindow"
active-color="#ff4949"
:active-text="form.bayWindow ? '关闭' : '开启'"
inactive-color="#13ce66"
/>
</el-col>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">修改</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { regionConfigTable } from '@/api/sys'
import { getConfigBySysOrigin, saveConfig } from '@/api/red-packet-invite-user'
export default {
name: 'AswatInviteUserConfig',
data() {
return {
form: {
sysOrigin: 'TWO_FUN',
cashNumberMin: '',
cashNumberMax: '',
otherNumberMin: '',
otherNumberMax: '',
totalAmount: '',
openRedPacketMin: '',
openRedPacketMax: '',
withdrawThresholdCount: '',
regionCodeArray: '',
withdrawTriggerProportion: '',
checkClose: false,
bayWindow: false,
ipFrequency: '',
deviceFrequency: '',
dayFrequency: '',
totalFrequency: '',
newUserHelpDays: '',
regionList: []
},
listLoading: false,
loading: false,
regions: [],
sysOrigin: 'TWO_FUN'
}
},
created() {
const that = this
that.renderData()
that.listRegion()
},
methods: {
renderData() {
const that = this
getConfigBySysOrigin('TWO_FUN').then(res => {
if (res.body != null) {
that.form = res.body
that.form.regionList = res.body.regionCodeArray.split(',')
}
that.listLoading = false
}).catch(() => {
that.listLoading = false
})
},
listRegion() {
const that = this
that.loading = true
regionConfigTable({ 'sysOrigin': that.sysOrigin }).then(res => {
that.regions = res.body || []
that.loading = false
}).catch(er => {
that.loading = false
})
},
onSubmit() {
const that = this
that.$refs.form.validate((valid) => {
if (!valid) {
console.error('error submit!!')
return false
}
that.$confirm('确定修改配置值?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
saveConfig(that.form).then(res => {
that.$message({
type: 'success',
message: '操作成功'
})
}).catch(er => {
that.$message.error('操作失败')
})
}).catch(() => {
that.$message({
type: 'info',
message: '已取消操作'
})
})
})
}
}
}
</script>
<style scoped lang="scss">
input {
width: 2rem;
}
</style>

View File

@ -1,216 +0,0 @@
<template>
<div v-loading="listLoading" class="push-form">
<el-form ref="form" :model="form" style="padding: 0.3rem;">
金币余额多少可以参与活动 <span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
<el-form-item prop="goldCoinBalance" label="" style="display: inline-block;">
<el-input v-model="form.goldCoinBalance"/>
</el-form-item>
<span style="color: #8D0502">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;或者</span> <!-- 输出一个空格 -->
注册时间大于多少天可以参与活动 <span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
<el-form-item prop="regDateMax" label="" style="display: inline-block;">
<el-input v-model="form.regDateMax" v-number type="number"/>
</el-form-item>
<el-form-item prop="cashNumberMax" label="现金奖项人次(最少~最多)">
<el-col :span="2">
<el-input v-model="form.cashNumberMin" v-number type="number" />
</el-col>
<el-col :span="2" style="margin: 0rem .2rem;">
<el-input v-model="form.cashNumberMax" v-number type="number" />
</el-col>
</el-form-item>
<el-form-item prop="otherNumberMax" label="其他奖项人次(最少~最多)">
<el-col :span="2">
<el-input v-model="form.otherNumberMin" v-number type="number" />
</el-col>
<el-col :span="2" style="margin: 0rem .2rem;">
<el-input v-model="form.otherNumberMax" v-number type="number" />
</el-col>
</el-form-item>
<el-form-item prop="totalAmount" label="红包总金额">
<el-col :span="2">
<el-input v-model="form.totalAmount" v-number type="number" />
</el-col>
</el-form-item>
<el-form-item prop="openRedPacketMax" label="开红包金额(最少~最多)">
<el-col :span="2">
<el-input v-model="form.openRedPacketMin" />
</el-col>
<el-col :span="2" style="margin: 0rem .2rem;">
<el-input v-model="form.openRedPacketMax" />
</el-col>
</el-form-item>
<el-form-item prop="withdrawThresholdCount" label="‘直接提现’奖项用户最少邀请多少人才能有机会触发">
<el-col :span="2">
<el-input v-model="form.withdrawThresholdCount" v-number type="number" />
</el-col>
</el-form-item>
<el-form-item prop="withdrawTriggerProportion" label="‘直接提现’奖项多少次全局抽奖出一次">
<el-col :span="2">
<el-input v-model="form.withdrawTriggerProportion" v-number type="number" />
</el-col>
</el-form-item>
<el-form-item prop="ipFrequency" label="一个ip最多可集满红包次数">
<el-col :span="2">
<el-input v-model="form.ipFrequency" v-number type="number" />
</el-col>
</el-form-item>
<el-form-item prop="deviceFrequency" label="一个设备最多可集满红包次数">
<el-col :span="2">
<el-input v-model="form.deviceFrequency" v-number type="number" />
</el-col>
</el-form-item>
<el-form-item prop="dayFrequency" label="用户账号一天最多可集满红包次数">
<el-col :span="2">
<el-input v-model="form.dayFrequency" v-number type="number" />
</el-col>
</el-form-item>
<el-form-item prop="totalFrequency" label="用户账号总可集满次数">
<el-col :span="2">
<el-input v-model="form.totalFrequency" v-number type="number" />
</el-col>
</el-form-item>
<el-form-item prop="newUserHelpDays" label="新用户可助力天节点">
<el-col :span="4">
<el-input v-model="form.newUserHelpDays" placeholder="例如:1,7,14 多个用英语逗号分隔" />
</el-col>
</el-form-item>
<el-form-item prop="regionList" label="支持区域">
<el-select v-model="form.regionList" multiple placeholder="请选择" style="width: 100%;" @change="$forceUpdate()">
<el-option
v-for="(item, index) in regions"
:key="index"
:label="item.regionName"
:value="item.regionCode"
/>
</el-select>
</el-form-item>
<el-form-item prop="checkClose" label="活动状态">
<el-col :span="2">
<el-switch
v-model="form.checkClose"
active-color="#ff4949"
:active-text="form.checkClose ? '已结束' : '运行中'"
inactive-color="#13ce66"
/>
</el-col>
</el-form-item>
<el-form-item prop="bayWindow" label="红包飘窗开启状态">
<el-col :span="2">
<el-switch
v-model="form.bayWindow"
active-color="#ff4949"
:active-text="form.bayWindow ? '关闭' : '开启'"
inactive-color="#13ce66"
/>
</el-col>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">修改</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { regionConfigTable } from '@/api/sys'
import { getConfigBySysOrigin, saveConfig } from '@/api/red-packet-invite-user'
export default {
name: 'AswatInviteUserConfig',
data() {
return {
form: {
sysOrigin: 'ASWAT',
goldCoinBalance: '',
regDateMax: '',
cashNumberMin: '',
cashNumberMax: '',
otherNumberMin: '',
otherNumberMax: '',
totalAmount: '',
openRedPacketMin: '',
openRedPacketMax: '',
withdrawThresholdCount: '',
withdrawTriggerProportion: '',
checkClose: false,
ipFrequency: '',
deviceFrequency: '',
dayFrequency: '',
totalFrequency: '',
newUserHelpDays: '',
regionList: []
},
listLoading: false,
loading: false,
regions: [],
strList: [],
sysOrigin: 'ASWAT'
}
},
created() {
const that = this
that.renderData()
that.listRegion()
},
methods: {
renderData() {
const that = this
that.listLoading = false
getConfigBySysOrigin('ASWAT').then(res => {
if (res.body != null) {
that.form = res.body
that.form.regionList = res.body.regionCodeArray.split(',')
}
that.listLoading = false
}).catch(() => {
that.listLoading = false
})
},
listRegion() {
const that = this
that.loading = false
regionConfigTable({ 'sysOrigin': that.sysOrigin }).then(res => {
that.regions = res.body || []
that.loading = false
}).catch(er => {
that.loading = false
})
},
onSubmit() {
const that = this
that.$refs.form.validate((valid) => {
if (!valid) {
console.error('error submit!!')
return false
}
that.$confirm('确定修改配置值?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
saveConfig(that.form).then(res => {
that.$message({
type: 'success',
message: '操作成功'
})
}).catch(er => {
that.$message.error('操作失败')
})
}).catch(() => {
that.$message({
type: 'info',
message: '已取消操作'
})
})
})
}
}
}
</script>
<style scoped lang="scss">
input {
width: 2rem;
}
</style>

View File

@ -1,215 +0,0 @@
<template>
<div v-loading="listLoading" class="push-form">
<el-form ref="form" :model="form" style="padding: 0.3rem;">
金币余额多少可以参与活动 <span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
<el-form-item prop="goldCoinBalance" label="" style="display: inline-block;">
<el-input v-model="form.goldCoinBalance"/>
</el-form-item>
<span style="color: #8D0502">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;或者</span> <!-- 输出一个空格 -->
注册时间大于多少天可以参与活动 <span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
<el-form-item prop="regDateMax" label="" style="display: inline-block;">
<el-input v-model="form.regDateMax" v-number type="number"/>
</el-form-item>
<el-form-item prop="cashNumberMax" label="现金奖项人次(最少~最多)">
<el-col :span="2">
<el-input v-model="form.cashNumberMin" v-number type="number" />
</el-col>
<el-col :span="2" style="margin: 0rem .2rem;">
<el-input v-model="form.cashNumberMax" v-number type="number" />
</el-col>
</el-form-item>
<el-form-item prop="otherNumberMax" label="其他奖项人次(最少~最多)">
<el-col :span="2">
<el-input v-model="form.otherNumberMin" v-number type="number" />
</el-col>
<el-col :span="2" style="margin: 0rem .2rem;">
<el-input v-model="form.otherNumberMax" v-number type="number" />
</el-col>
</el-form-item>
<el-form-item prop="totalAmount" label="红包总金额">
<el-col :span="2">
<el-input v-model="form.totalAmount" v-number type="number" />
</el-col>
</el-form-item>
<el-form-item prop="openRedPacketMax" label="开红包金额(最少~最多)">
<el-col :span="2">
<el-input v-model="form.openRedPacketMin" />
</el-col>
<el-col :span="2" style="margin: 0rem .2rem;">
<el-input v-model="form.openRedPacketMax" />
</el-col>
</el-form-item>
<el-form-item prop="withdrawThresholdCount" label="‘直接提现’奖项用户最少邀请多少人才能有机会触发">
<el-col :span="2">
<el-input v-model="form.withdrawThresholdCount" v-number type="number" />
</el-col>
</el-form-item>
<el-form-item prop="withdrawTriggerProportion" label="‘直接提现’奖项多少次全局抽奖出一次">
<el-col :span="2">
<el-input v-model="form.withdrawTriggerProportion" v-number type="number" />
</el-col>
</el-form-item>
<el-form-item prop="ipFrequency" label="一个ip最多可集满红包次数">
<el-col :span="2">
<el-input v-model="form.ipFrequency" v-number type="number" />
</el-col>
</el-form-item>
<el-form-item prop="deviceFrequency" label="一个设备最多可集满红包次数">
<el-col :span="2">
<el-input v-model="form.deviceFrequency" v-number type="number" />
</el-col>
</el-form-item>
<el-form-item prop="dayFrequency" label="用户账号一天最多可集满红包次数">
<el-col :span="2">
<el-input v-model="form.dayFrequency" v-number type="number" />
</el-col>
</el-form-item>
<el-form-item prop="totalFrequency" label="用户账号总可集满次数">
<el-col :span="2">
<el-input v-model="form.totalFrequency" v-number type="number" />
</el-col>
</el-form-item>
<el-form-item prop="newUserHelpDays" label="新用户可助力天节点">
<el-col :span="4">
<el-input v-model="form.newUserHelpDays" placeholder="例如:1,7,14 多个用英语逗号分隔" />
</el-col>
</el-form-item>
<el-form-item prop="regionList" label="支持区域">
<el-select v-model="form.regionList" multiple placeholder="请选择" style="width: 100%;" @change="$forceUpdate()">
<el-option
v-for="(item, index) in regions"
:key="index"
:label="item.regionName"
:value="item.regionCode"
/>
</el-select>
</el-form-item>
<el-form-item prop="checkClose" label="活动状态">
<el-col :span="2">
<el-switch
v-model="form.checkClose"
active-color="#ff4949"
:active-text="form.checkClose ? '已结束' : '运行中'"
inactive-color="#13ce66"
/>
</el-col>
</el-form-item>
<el-form-item prop="bayWindow" label="红包飘窗开启状态">
<el-col :span="2">
<el-switch
v-model="form.bayWindow"
active-color="#ff4949"
:active-text="form.bayWindow ? '关闭' : '开启'"
inactive-color="#13ce66"
/>
</el-col>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">修改</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { regionConfigTable } from '@/api/sys'
import { getConfigBySysOrigin, saveConfig } from '@/api/red-packet-invite-user'
export default {
name: 'AswatInviteUserConfig',
data() {
return {
form: {
sysOrigin: 'HALAR',
cashNumberMin: '',
cashNumberMax: '',
otherNumberMin: '',
otherNumberMax: '',
totalAmount: '',
openRedPacketMin: '',
openRedPacketMax: '',
withdrawThresholdCount: '',
regionCodeArray: '',
withdrawTriggerProportion: '',
checkClose: false,
bayWindow: false,
ipFrequency: '',
deviceFrequency: '',
dayFrequency: '',
totalFrequency: '',
newUserHelpDays: '',
regionList: []
},
listLoading: false,
loading: false,
regions: [],
sysOrigin: 'HALAR'
}
},
created() {
const that = this
that.renderData()
that.listRegion()
},
methods: {
renderData() {
const that = this
getConfigBySysOrigin('HALAR').then(res => {
if (res.body != null) {
that.form = res.body
that.form.regionList = res.body.regionCodeArray.split(',')
}
that.listLoading = false
}).catch(() => {
that.listLoading = false
})
},
listRegion() {
const that = this
that.loading = true
regionConfigTable({ 'sysOrigin': that.sysOrigin }).then(res => {
that.regions = res.body || []
that.loading = false
}).catch(er => {
that.loading = false
})
},
onSubmit() {
const that = this
that.$refs.form.validate((valid) => {
if (!valid) {
console.error('error submit!!')
return false
}
that.$confirm('确定修改配置值?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
saveConfig(that.form).then(res => {
that.$message({
type: 'success',
message: '操作成功'
})
}).catch(er => {
that.$message.error('操作失败')
})
}).catch(() => {
that.$message({
type: 'info',
message: '已取消操作'
})
})
})
}
}
}
</script>
<style scoped lang="scss">
input {
width: 2rem;
}
</style>

View File

@ -1,215 +0,0 @@
<template>
<div v-loading="listLoading" class="push-form">
<el-form ref="form" :model="form" style="padding: 0.3rem;">
金币余额多少可以参与活动 <span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
<el-form-item prop="goldCoinBalance" label="" style="display: inline-block;">
<el-input v-model="form.goldCoinBalance"/>
</el-form-item>
<span style="color: #8D0502">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;或者</span> <!-- 输出一个空格 -->
注册时间大于多少天可以参与活动 <span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
<el-form-item prop="regDateMax" label="" style="display: inline-block;">
<el-input v-model="form.regDateMax" v-number type="number"/>
</el-form-item>
<el-form-item prop="cashNumberMax" label="现金奖项人次(最少~最多)">
<el-col :span="2">
<el-input v-model="form.cashNumberMin" v-number type="number" />
</el-col>
<el-col :span="2" style="margin: 0rem .2rem;">
<el-input v-model="form.cashNumberMax" v-number type="number" />
</el-col>
</el-form-item>
<el-form-item prop="otherNumberMax" label="其他奖项人次(最少~最多)">
<el-col :span="2">
<el-input v-model="form.otherNumberMin" v-number type="number" />
</el-col>
<el-col :span="2" style="margin: 0rem .2rem;">
<el-input v-model="form.otherNumberMax" v-number type="number" />
</el-col>
</el-form-item>
<el-form-item prop="totalAmount" label="红包总金额">
<el-col :span="2">
<el-input v-model="form.totalAmount" v-number type="number" />
</el-col>
</el-form-item>
<el-form-item prop="openRedPacketMax" label="开红包金额(最少~最多)">
<el-col :span="2">
<el-input v-model="form.openRedPacketMin" />
</el-col>
<el-col :span="2" style="margin: 0rem .2rem;">
<el-input v-model="form.openRedPacketMax" />
</el-col>
</el-form-item>
<el-form-item prop="withdrawThresholdCount" label="‘直接提现’奖项用户最少邀请多少人才能有机会触发">
<el-col :span="2">
<el-input v-model="form.withdrawThresholdCount" v-number type="number" />
</el-col>
</el-form-item>
<el-form-item prop="withdrawTriggerProportion" label="‘直接提现’奖项多少次全局抽奖出一次">
<el-col :span="2">
<el-input v-model="form.withdrawTriggerProportion" v-number type="number" />
</el-col>
</el-form-item>
<el-form-item prop="ipFrequency" label="一个ip最多可集满红包次数">
<el-col :span="2">
<el-input v-model="form.ipFrequency" v-number type="number" />
</el-col>
</el-form-item>
<el-form-item prop="deviceFrequency" label="一个设备最多可集满红包次数">
<el-col :span="2">
<el-input v-model="form.deviceFrequency" v-number type="number" />
</el-col>
</el-form-item>
<el-form-item prop="dayFrequency" label="用户账号一天最多可集满红包次数">
<el-col :span="2">
<el-input v-model="form.dayFrequency" v-number type="number" />
</el-col>
</el-form-item>
<el-form-item prop="totalFrequency" label="用户账号总可集满次数">
<el-col :span="2">
<el-input v-model="form.totalFrequency" v-number type="number" />
</el-col>
</el-form-item>
<el-form-item prop="newUserHelpDays" label="新用户可助力天节点">
<el-col :span="4">
<el-input v-model="form.newUserHelpDays" placeholder="例如:1,7,14 多个用英语逗号分隔" />
</el-col>
</el-form-item>
<el-form-item prop="regionList" label="支持区域">
<el-select v-model="form.regionList" multiple placeholder="请选择" style="width: 100%;" @change="$forceUpdate()">
<el-option
v-for="(item, index) in regions"
:key="index"
:label="item.regionName"
:value="item.regionCode"
/>
</el-select>
</el-form-item>
<el-form-item prop="checkClose" label="活动状态">
<el-col :span="2">
<el-switch
v-model="form.checkClose"
active-color="#ff4949"
:active-text="form.checkClose ? '已结束' : '运行中'"
inactive-color="#13ce66"
/>
</el-col>
</el-form-item>
<el-form-item prop="bayWindow" label="红包飘窗开启状态">
<el-col :span="2">
<el-switch
v-model="form.bayWindow"
active-color="#ff4949"
:active-text="form.bayWindow ? '关闭' : '开启'"
inactive-color="#13ce66"
/>
</el-col>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">修改</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { regionConfigTable } from '@/api/sys'
import { getConfigBySysOrigin, saveConfig } from '@/api/red-packet-invite-user'
export default {
name: 'AswatInviteUserConfig',
data() {
return {
form: {
sysOrigin: 'HALAR',
cashNumberMin: '',
cashNumberMax: '',
otherNumberMin: '',
otherNumberMax: '',
totalAmount: '',
openRedPacketMin: '',
openRedPacketMax: '',
withdrawThresholdCount: '',
regionCodeArray: '',
withdrawTriggerProportion: '',
checkClose: false,
bayWindow: false,
ipFrequency: '',
deviceFrequency: '',
dayFrequency: '',
totalFrequency: '',
newUserHelpDays: '',
regionList: []
},
listLoading: false,
loading: false,
regions: [],
sysOrigin: 'HALAR'
}
},
created() {
const that = this
that.renderData()
that.listRegion()
},
methods: {
renderData() {
const that = this
getConfigBySysOrigin('HALAR').then(res => {
if (res.body != null) {
that.form = res.body
that.form.regionList = res.body.regionCodeArray.split(',')
}
that.listLoading = false
}).catch(() => {
that.listLoading = false
})
},
listRegion() {
const that = this
that.loading = true
regionConfigTable({ 'sysOrigin': that.sysOrigin }).then(res => {
that.regions = res.body || []
that.loading = false
}).catch(er => {
that.loading = false
})
},
onSubmit() {
const that = this
that.$refs.form.validate((valid) => {
if (!valid) {
console.error('error submit!!')
return false
}
that.$confirm('确定修改配置值?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
saveConfig(that.form).then(res => {
that.$message({
type: 'success',
message: '操作成功'
})
}).catch(er => {
that.$message.error('操作失败')
})
}).catch(() => {
that.$message({
type: 'info',
message: '已取消操作'
})
})
})
}
}
}
</script>
<style scoped lang="scss">
input {
width: 2rem;
}
</style>

View File

@ -1,191 +0,0 @@
<template>
<div :class="'app-container'">
<div class="filter-container">
<el-select
v-model="listQuery.sysOrigin"
placeholder="系统"
style="width: 120px"
class="filter-item"
@change="handleSearch"
>
<el-option
v-for="item in permissionsSysOriginPlatforms"
:key="item.value"
:label="item.label"
:value="item.value"
>
<span style="float: left;"> <sys-origin-icon :icon="item.value" :desc="item.value" /></span>
<span style="float: left;margin-left:10px">{{ item.label }}</span>
</el-option>
</el-select>
<div class="filter-item">
<account-input v-model="listQuery.userId" :sys-origin="listQuery.sysOrigin" placeholder="用户ID" />
</div>
<div class="filter-item">
<el-input v-model="listQuery.redPacketId" placeholder="请输入红包ID" />
</div>
<el-select
v-model="listQuery.awardType"
placeholder="奖品类型"
style="width: 120px"
class="filter-item"
clearable
@change="handleSearch"
>
<el-option label="美金" value="USD" />
<el-option label="立即提现" value="WITHDRAWAL" />
<el-option label="目标" value="TARGET" />
<el-option label="钻石" value="DIAMOND" />
</el-select>
<div class="filter-item">
<el-date-picker
v-model="rangeDate"
value-format="timestamp"
type="datetimerange"
:picker-options="pickerOptions"
range-separator="至"
start-placeholder="日期开始"
end-placeholder="日期结束"
/>
</div>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleSearch"
>
搜索
</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
fit
highlight-current-row
>
<el-table-column prop="id" label="ID" align="center" />
<el-table-column label="用户" align="center" min-width="80">
<template slot-scope="scope">
<user-table-exhibit :user-profile="scope.row.userProfile" :query-details="true" />
</template>
</el-table-column>
<el-table-column prop="redPacketId" label="红包ID" align="center" />
<el-table-column prop="awardTypeName" label="奖励类型" align="center" />
<el-table-column prop="awardNumber" label="奖励数量" align="center" />
<el-table-column prop="totalAmount" label="红包总额" align="center" />
<el-table-column prop="currentAmount" label="当前红包进度额度" align="center" />
<el-table-column prop="remainFrequency" label="剩余抽奖次数" align="center" />
<el-table-column prop="imei" label="抽奖人设备号" align="center" />
<el-table-column prop="ip" label="抽奖人IP" align="center" />
<el-table-column prop="createTime" label="创建时间" align="center" width="160">
<template slot-scope="scope">
{{ scope.row.createTime | dateFormat }}
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="listQuery.cursor"
:limit.sync="listQuery.limit"
@pagination="renderData"
/>
</div>
</template>
<script>
import { pageRedPacketDrawLog } from '@/api/red-packet-invite-user'
import { pickerOptions } from '@/constant/el-const'
import { mapGetters } from 'vuex'
import Pagination from '@/components/Pagination'
export default {
name: 'RedPacketInviteDrawLog',
components: { Pagination },
data() {
return {
rangeDate: [],
pickerOptions,
total: 0,
listQuery: {
cursor: 1,
limit: 20,
userId: '',
type: '',
redPacketId: '',
sysOrigin: 'HALAR',
awardType: '',
startTime: '',
endTime: ''
},
listLoading: false,
list: []
}
},
computed: {
...mapGetters(['permissionsSysOriginPlatforms'])
},
watch: {
rangeDate: {
immediate: true,
deep: true,
handler(newVal) {
if (newVal && newVal.length > 0) {
this.listQuery.startTime = newVal[0]
this.listQuery.endTime = newVal[1]
return
}
this.listQuery.startTime = ''
this.listQuery.endTime = ''
}
}
},
created() {
const that = this
const querySystem = this.permissionsSysOriginPlatforms[0]
if (!querySystem) {
return
}
that.listQuery.sysOrigin = querySystem.value
that.renderData()
},
methods: {
renderData(isReset) {
const that = this
if (isReset === true) {
that.listQuery.cursor = 1
that.list = []
}
that.listLoading = true
pageRedPacketDrawLog(that.listQuery).then(res => {
const { body } = res
that.total = body.total || 0
that.list = body.records
that.listLoading = false
}).catch(er => {
that.listLoading = false
})
},
handleSearch() {
this.renderData(true)
}
}
}
</script>
<style scoped lang="scss">
.user-css {
display: flex;
align-items: center;
color: #909399;
font-size: .15rem;
line-height: .3rem;
padding: 0.02rem;
border-radius: 0.04rem;
}
.load-more {
padding: 20px;
text-align: center;
}
</style>

View File

@ -1,212 +0,0 @@
<template>
<div :class="'app-container'">
<div class="filter-container">
<el-select
v-model="listQuery.sysOrigin"
placeholder="系统"
style="width: 120px"
class="filter-item"
@change="handleSearch"
>
<el-option
v-for="item in permissionsSysOriginPlatforms"
:key="item.value"
:label="item.label"
:value="item.value"
>
<span style="float: left;"> <sys-origin-icon :icon="item.value" :desc="item.value" /></span>
<span style="float: left;margin-left:10px">{{ item.label }}</span>
</el-option>
</el-select>
<div class="filter-item">
<account-input v-model="listQuery.userId" :sys-origin="listQuery.sysOrigin" placeholder="用户ID" />
</div>
<div class="filter-item">
<account-input v-model="listQuery.inviteUserId" :sys-origin="listQuery.sysOrigin" placeholder="邀请人用户ID" />
</div>
<div class="filter-item">
<el-input v-model="listQuery.inviteImei" placeholder="请输入邀请人设备" />
</div>
<div class="filter-item">
<el-input v-model="listQuery.inviteIp" placeholder="请输入邀请人IP" />
</div>
<div class="filter-item">
<el-input v-model="listQuery.imei" placeholder="请输入助力人设备" />
</div>
<div class="filter-item">
<el-input v-model="listQuery.ip" placeholder="请输入助力人IP" />
</div>
<div class="filter-item">
<el-input v-model="listQuery.redPacketId" placeholder="请输入红包ID" />
</div>
<el-select
v-model="listQuery.userType"
placeholder="用户类型"
style="width: 120px"
class="filter-item"
clearable
@change="handleSearch"
>
<el-option label="新用户" value="NEW_USER" />
<el-option label="回归用户" value="RETURN_USER" />
<el-option label="其他" value="OTHER" />
</el-select>
<div class="filter-item">
<el-date-picker
v-model="rangeDate"
value-format="timestamp"
type="datetimerange"
:picker-options="pickerOptions"
range-separator="至"
start-placeholder="日期开始"
end-placeholder="日期结束"
/>
</div>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleSearch"
>
搜索
</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
fit
highlight-current-row
>
<el-table-column prop="id" label="ID" align="center" />
<el-table-column label="用户" align="center" min-width="80">
<template slot-scope="scope">
<user-table-exhibit :user-profile="scope.row.userProfile" :query-details="true" />
</template>
</el-table-column>
<el-table-column label="邀请人" align="center" min-width="80">
<template slot-scope="scope">
<user-table-exhibit :user-profile="scope.row.inviteUserProfile" :query-details="true" />
</template>
</el-table-column>
<el-table-column prop="redPacketId" label="红包ID" align="center" />
<el-table-column prop="userTypeName" label="用户类型" align="center" />
<el-table-column prop="inviteImei" label="邀请人设备号" align="center" />
<el-table-column prop="inviteIp" label="邀请人IP" align="center" />
<el-table-column prop="imei" label="助力人设备号" align="center" />
<el-table-column prop="ip" label="助力人IP" align="center" />
<el-table-column prop="createTime" label="创建时间" align="center" width="160">
<template slot-scope="scope">
{{ scope.row.createTime | dateFormat }}
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="listQuery.cursor"
:limit.sync="listQuery.limit"
@pagination="renderData"
/>
</div>
</template>
<script>
import { pageRedPacketHelpLog } from '@/api/red-packet-invite-user'
import { pickerOptions } from '@/constant/el-const'
import { mapGetters } from 'vuex'
import Pagination from '@/components/Pagination'
export default {
name: 'RedPacketInviteHelpLog',
components: { Pagination },
data() {
return {
rangeDate: [],
pickerOptions,
total: 0,
listQuery: {
cursor: 1,
limit: 20,
userId: '',
type: '',
redPacketId: '',
sysOrigin: 'HALAR',
awardType: '',
startTime: '',
endTime: '',
inviteImei: '',
inviteIp: '',
imei: '',
ip: ''
},
listLoading: false,
list: []
}
},
computed: {
...mapGetters(['permissionsSysOriginPlatforms'])
},
watch: {
rangeDate: {
immediate: true,
deep: true,
handler(newVal) {
if (newVal && newVal.length > 0) {
this.listQuery.startTime = newVal[0]
this.listQuery.endTime = newVal[1]
return
}
this.listQuery.startTime = ''
this.listQuery.endTime = ''
}
}
},
created() {
const that = this
const querySystem = this.permissionsSysOriginPlatforms[0]
if (!querySystem) {
return
}
that.listQuery.sysOrigin = querySystem.value
that.renderData()
},
methods: {
renderData(isReset) {
const that = this
if (isReset === true) {
that.listQuery.cursor = 1
that.list = []
}
that.listLoading = true
pageRedPacketHelpLog(that.listQuery).then(res => {
const { body } = res
that.total = body.total || 0
that.list = body.records
that.listLoading = false
}).catch(er => {
that.listLoading = false
})
},
handleSearch() {
this.renderData(true)
}
}
}
</script>
<style scoped lang="scss">
.user-css {
display: flex;
align-items: center;
color: #909399;
font-size: .15rem;
line-height: .3rem;
padding: 0.02rem;
border-radius: 0.04rem;
}
.load-more {
padding: 20px;
text-align: center;
}
</style>

View File

@ -1,232 +0,0 @@
<template>
<div :class="'app-container'">
<div class="filter-container">
<el-select
v-model="listQuery.sysOrigin"
placeholder="系统"
style="width: 120px"
class="filter-item"
@change="handleSearch"
>
<el-option
v-for="item in permissionsSysOriginPlatforms"
:key="item.value"
:label="item.label"
:value="item.value"
>
<span style="float: left;"> <sys-origin-icon :icon="item.value" :desc="item.value" /></span>
<span style="float: left;margin-left:10px">{{ item.label }}</span>
</el-option>
</el-select>
<div class="filter-item">
<account-input v-model="listQuery.userId" :sys-origin="listQuery.sysOrigin" placeholder="用户ID" />
</div>
<div class="filter-item">
<account-input v-model="listQuery.inviteUserId" :sys-origin="listQuery.sysOrigin" placeholder="邀请人用户ID" />
</div>
<div class="filter-item">
<el-input v-model="listQuery.id" placeholder="请输入红包ID" />
</div>
<div class="filter-item">
<el-input v-model="listQuery.imei" placeholder="请输入设备号" />
</div>
<div class="filter-item">
<el-input v-model="listQuery.ip" placeholder="请输入IP" />
</div>
<el-select
v-model="listQuery.status"
placeholder="红包状态"
style="width: 120px"
class="filter-item"
clearable
@change="handleSearch"
>
<el-option label="未完成" value="UNDONE" />
<el-option label="正常完成" value="COMPLETE" />
<el-option label="提前完成" value="BEFORE_COMPLETE" />
</el-select>
<el-select
v-model="listQuery.redPacketSource"
placeholder="红包来源"
style="width: 120px"
class="filter-item"
clearable
@change="handleSearch"
>
<el-option label="用户邀请" value="USER_INVITATION" />
<el-option label="房间" value="ROOM" />
<el-option label="首页" value="HOME" />
<el-option label="主播代理中心" value="TEAM" />
<el-option label="BD中心" value="BD" />
<el-option label="每日任务" value="TASK" />
<el-option label="礼物" value="GIFT" />
<el-option label="游戏" value="GAME" />
<el-option label="我的" value="ME" />
<el-option label="飘窗" value="BROADCAST" />
</el-select>
<div class="filter-item">
<el-date-picker
v-model="rangeDate"
value-format="timestamp"
type="datetimerange"
:picker-options="pickerOptions"
range-separator="至"
start-placeholder="日期开始"
end-placeholder="日期结束"
/>
</div>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleSearch"
>
搜索
</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
fit
highlight-current-row
>
<el-table-column prop="id" label="ID" align="center" />
<el-table-column label="用户" align="center" min-width="80">
<template slot-scope="scope">
<user-table-exhibit :user-profile="scope.row.userProfile" :query-details="true" />
</template>
</el-table-column>
<el-table-column label="邀请人" align="center" min-width="80">
<template slot-scope="scope">
<user-table-exhibit :user-profile="scope.row.inviteUserProfile" :query-details="true" />
</template>
</el-table-column>
<el-table-column prop="statusName" label="红包状态" align="center" />
<el-table-column prop="totalAmount" label="总额" align="center" />
<el-table-column prop="currentAmount" label="当前收集金额" align="center" />
<el-table-column prop="redPacketSourceName" label="开红包来源" align="center" />
<el-table-column prop="inviteMemberCount" label="当前红包邀请成员数" align="center" />
<el-table-column prop="imei" label="操作人设备号" align="center" />
<el-table-column prop="ip" label="操作人IP" align="center" />
<el-table-column prop="createTime" label="创建时间" align="center" width="200">
<template slot-scope="scope">
{{ scope.row.createTime | dateFormat }}
</template>
</el-table-column>
<el-table-column prop="violationOrNot" label="是否违规">
<template v-slot="{ row }">
<span v-if="row.violationOrNot==false"></span>
<span v-else></span>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="listQuery.cursor"
:limit.sync="listQuery.limit"
@pagination="renderData"
/>
</div>
</template>
<script>
import { pageRedPacket } from '@/api/red-packet-invite-user'
import { pickerOptions } from '@/constant/el-const'
import { mapGetters } from 'vuex'
import Pagination from '@/components/Pagination'
export default {
name: 'RedPacketInviteLog',
components: { Pagination },
data() {
return {
rangeDate: [],
pickerOptions,
total: 0,
listQuery: {
cursor: 1,
limit: 20,
userId: '',
inviteUserId: '',
status: '',
redPacketSource: '',
id: '',
sysOrigin: 'HALAR',
awardType: '',
startTime: '',
endTime: '',
imei: '',
ip: ''
},
listLoading: false,
list: []
}
},
computed: {
...mapGetters(['permissionsSysOriginPlatforms'])
},
watch: {
rangeDate: {
immediate: true,
deep: true,
handler(newVal) {
if (newVal && newVal.length > 0) {
this.listQuery.startTime = newVal[0]
this.listQuery.endTime = newVal[1]
return
}
this.listQuery.startTime = ''
this.listQuery.endTime = ''
}
}
},
created() {
const that = this
const querySystem = this.permissionsSysOriginPlatforms[0]
if (!querySystem) {
return
}
that.listQuery.sysOrigin = querySystem.value
that.renderData()
},
methods: {
renderData(isReset) {
const that = this
if (isReset === true) {
that.listQuery.cursor = 1
that.list = []
}
that.listLoading = true
pageRedPacket(that.listQuery).then(res => {
const { body } = res
that.total = body.total || 0
that.list = body.records
that.listLoading = false
}).catch(er => {
that.listLoading = false
})
},
handleSearch() {
this.renderData(true)
}
}
}
</script>
<style scoped lang="scss">
.user-css {
display: flex;
align-items: center;
color: #909399;
font-size: .15rem;
line-height: .3rem;
padding: 0.02rem;
border-radius: 0.04rem;
}
.load-more {
padding: 20px;
text-align: center;
}
</style>

View File

@ -1,100 +0,0 @@
<template>
<div class="edit-user-gold-coin-reward-form">
<el-dialog
title="兑换目标"
:visible="true"
:modal-append-to-body="true"
:append-to-body="true"
width="450px"
:before-close="handleClose"
:close-on-click-modal="false"
>
<el-form
ref="formData"
:rules="rules"
:model="formData"
label-position="left"
label-width="70px"
style="width: 300px; margin-left:50px;"
>
<el-form-item label="数量" prop="target">
<el-input
v-model.trim="formData.target"
v-number
maxlength="8"
placeholder="需要奖励的金币数量"
/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="handleClose()">
取消
</el-button>
<el-button
v-loading="listLoading"
type="primary"
@click="handleSubmit()"
>
兑换
</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { reduceTarget } from '@/api/red-packet-invite-user'
export default {
name: 'RedPacketInviteUserTargetExchange',
props: {
id: {
type: String,
required: true
}
},
data() {
return {
listLoading: false,
rules: {
target: [
{
required: true,
message: '必填字段不可为空',
trigger: 'blur'
}
]
},
formData: {
target: '',
id: ''
}
}
},
methods: {
handleSubmit() {
const that = this
that.$refs.formData.validate((valid) => {
if (!valid) {
console.error('error submit!!')
return false
}
that.listLoading = true
that.formData.id = that.id
reduceTarget(that.formData).then(res => {
that.$emit('success', Object.assign({}, that.formData))
that.handleClose()
}).catch(err => {
that.listLoading = false
that.$emit('fial', err)
})
})
},
handleClose() {
this.$emit('close')
}
}
}
</script>

View File

@ -1,163 +0,0 @@
<template>
<div :class="'app-container'">
<div class="filter-container">
<el-select
v-model="listQuery.sysOrigin"
placeholder="系统"
style="width: 120px"
class="filter-item"
@change="handleSearch"
>
<el-option
v-for="item in permissionsSysOriginPlatforms"
:key="item.value"
:label="item.label"
:value="item.value"
>
<span style="float: left;"> <sys-origin-icon :icon="item.value" :desc="item.value" /></span>
<span style="float: left;margin-left:10px">{{ item.label }}</span>
</el-option>
</el-select>
<div class="filter-item">
<account-input v-model="listQuery.userId" :sys-origin="listQuery.sysOrigin" placeholder="用户ID" />
</div>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleSearch"
>
搜索
</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
fit
highlight-current-row
>
<el-table-column prop="sysOrigin" label="系统" align="center" width="80">
<template slot-scope="scope">
<sys-origin-icon :icon="scope.row.sysOrigin" :desc="scope.row.sysOrigin" />
</template>
</el-table-column>
<el-table-column label="用户" align="center" min-width="80">
<template slot-scope="scope">
<user-table-exhibit :user-profile="scope.row.userProfile" :query-details="true" />
</template>
</el-table-column>
<el-table-column prop="incomeAmount" label="抽中目标" align="center" />
<el-table-column prop="expenditureBalance" label="已兑换目标" align="center" />
<el-table-column prop="balance" label="剩余目标" align="center" />
<el-table-column prop="createTime" label="创建时间" align="center" width="160">
<template slot-scope="scope">
{{ scope.row.createTime | dateFormat }}
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" align="center">
<template slot-scope="scope">
<el-button type="text" @click.native="editExchange(scope.row)">兑换目标</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="listQuery.cursor"
:limit.sync="listQuery.limit"
@pagination="renderData"
/>
<exchange
v-if="editExchangeFormVisible"
:id="thatSelectedId"
@close="editExchangeFormVisible=false"
@success="renderDataSuccess"
/>
</div>
</template>
<script>
import { pageTargetTransitBalance } from '@/api/red-packet-invite-user'
import { mapGetters } from 'vuex'
import Pagination from '@/components/Pagination'
import Exchange from './exchange'
export default {
name: 'RedPacketInviteUserTarget',
components: { Pagination, Exchange },
data() {
return {
thatSelectedId: '',
editExchangeFormVisible: false,
total: 0,
listQuery: {
cursor: 1,
limit: 20,
userId: '',
sysOrigin: 'HALAR'
},
listLoading: false,
list: []
}
},
computed: {
...mapGetters(['permissionsSysOriginPlatforms'])
},
created() {
const that = this
const querySystem = this.permissionsSysOriginPlatforms[0]
if (!querySystem) {
return
}
that.listQuery.sysOrigin = querySystem.value
that.renderData()
},
methods: {
renderData(isReset) {
const that = this
if (isReset === true) {
that.listQuery.cursor = 1
that.list = []
}
that.listLoading = true
pageTargetTransitBalance(that.listQuery).then(res => {
const { body } = res
that.total = body.total || 0
that.list = body.records
that.listLoading = false
}).catch(er => {
that.listLoading = false
})
},
handleSearch() {
this.renderData(true)
},
editExchange(item) {
this.thatSelectedId = item.id
this.editExchangeFormVisible = true
},
renderDataSuccess() {
this.$message({
message: '操作成功',
type: 'success'
})
this.renderData()
}
}
}
</script>
<style scoped lang="scss">
.user-css {
display: flex;
align-items: center;
color: #909399;
font-size: .15rem;
line-height: .3rem;
padding: 0.02rem;
border-radius: 0.04rem;
}
.load-more {
padding: 20px;
text-align: center;
}
</style>

View File

@ -1,139 +0,0 @@
<template>
<div :class="'app-container'">
<div class="filter-container">
<el-select
v-model="listQuery.sysOrigin"
placeholder="系统"
style="width: 120px"
class="filter-item"
@change="handleSearch"
>
<el-option
v-for="item in permissionsSysOriginPlatforms"
:key="item.value"
:label="item.label"
:value="item.value"
>
<span style="float: left;"> <sys-origin-icon :icon="item.value" :desc="item.value" /></span>
<span style="float: left;margin-left:10px">{{ item.label }}</span>
</el-option>
</el-select>
<div class="filter-item">
<account-input v-model="listQuery.userId" :sys-origin="listQuery.sysOrigin" placeholder="用户ID" />
</div>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleSearch"
>
搜索
</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
fit
highlight-current-row
>
<el-table-column prop="sysOrigin" label="系统" align="center" width="80">
<template slot-scope="scope">
<sys-origin-icon :icon="scope.row.sysOrigin" :desc="scope.row.sysOrigin" />
</template>
</el-table-column>
<el-table-column label="用户" align="center" min-width="80">
<template slot-scope="scope">
<user-table-exhibit :user-profile="scope.row.userProfile" :query-details="true" />
</template>
</el-table-column>
<el-table-column prop="incomeAmount" label="临时美元总额" align="center" />
<el-table-column prop="expenditureBalance" label="已转入银行账户金额" align="center" />
<el-table-column prop="balance" label="剩余临时额度" align="center" />
<el-table-column prop="createTime" label="创建时间" align="center" width="160">
<template slot-scope="scope">
{{ scope.row.createTime | dateFormat }}
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="listQuery.cursor"
:limit.sync="listQuery.limit"
@pagination="renderData"
/>
</div>
</template>
<script>
import { pageWithdrawTransitBalance } from '@/api/red-packet-invite-user'
import { mapGetters } from 'vuex'
import Pagination from '@/components/Pagination'
export default {
name: 'RedPacketInviteUserWithdrawTransit',
components: { Pagination },
data() {
return {
thatSelectedUserId: '',
total: 0,
listQuery: {
cursor: 1,
limit: 20,
userId: '',
sysOrigin: 'HALAR'
},
listLoading: false,
list: []
}
},
computed: {
...mapGetters(['permissionsSysOriginPlatforms'])
},
created() {
const that = this
const querySystem = this.permissionsSysOriginPlatforms[0]
if (!querySystem) {
return
}
that.listQuery.sysOrigin = querySystem.value
that.renderData()
},
methods: {
renderData(isReset) {
const that = this
if (isReset === true) {
that.listQuery.cursor = 1
that.list = []
}
that.listLoading = true
pageWithdrawTransitBalance(that.listQuery).then(res => {
const { body } = res
that.total = body.total || 0
that.list = body.records
that.listLoading = false
}).catch(er => {
that.listLoading = false
})
},
handleSearch() {
this.renderData(true)
}
}
}
</script>
<style scoped lang="scss">
.user-css {
display: flex;
align-items: center;
color: #909399;
font-size: .15rem;
line-height: .3rem;
padding: 0.02rem;
border-radius: 0.04rem;
}
.load-more {
padding: 20px;
text-align: center;
}
</style>

View File

@ -1,97 +0,0 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-button
class="filter-item"
type="primary"
icon="el-icon-edit"
@click="handleCreate()"
>
新增
</el-button>
</div>
<div v-loading="listLoading" class="content">
<div v-for="(item, index) in list" :key="index">
<div class="item">
{{ item }}
<i class="el-icon-delete-solid" @click="handlDel(item)" />
</div>
</div>
</div>
</div>
</template>
<script>
import { userRechargeBlackList, addUserRechargeBlackList, delUserRechargeBlackList } from '@/api/sys'
export default {
data() {
return {
list: [],
listLoading: true
}
},
created() {
const that = this
that.renderData()
},
methods: {
renderData() {
const that = this
that.listLoading = true
userRechargeBlackList().then(res => {
that.listLoading = false
const { body } = res
that.list = body || []
}).catch(er => {
that.listLoading = false
})
},
handlDel(content) {
this.$confirm('确认删除吗?', '提示', {
type: 'warning'
}).then(() => {
delUserRechargeBlackList(content).then((res) => {
this.$opsMessage.success()
this.renderData()
})
}).catch(() => {
})
},
handleCreate() {
const that = this
this.$prompt('输入用户id', {
confirmButtonText: '确定',
cancelButtonText: '取消'
}).then(({ value }) => {
addUserRechargeBlackList(value).then(res => {
that.$opsMessage.success()
that.renderData()
}).catch(er => {
})
}).catch(() => {})
}
}
}
</script>
<style scoped lang="scss">
.content {
.item {
background-color: #9e9ee64f;
color: #909399;
margin-bottom:5px;
padding:10px;
border-radius: 5px;
position: relative;
i {
font-size: 24px;
cursor: pointer;
color: #fa0e0e;
position: absolute;
right: 10px;
top: 5px;
}
}
}
</style>

View File

@ -1,141 +0,0 @@
<template>
<div class="team-member-add-drawer">
<el-drawer
title="添加成员"
:visible="true"
:before-close="handleClose"
:close-on-press-escape="false"
:wrapper-closable="false"
:modal-append-to-body="true"
:append-to-body="true"
custom-class="drawer-auto-layout"
>
<div slot="title" class="flex-l">
<sys-origin-icon :icon="sysOrigin" size="18px" />&nbsp;添加成员
</div>
<div class="team-member-add">
<div class="drawer-form">
<el-form ref="form" :model="form" :rules="formRules" label-width="80px" style="margin-right: 15px;">
<!-- <el-form-item prop="status" label="模式">
<el-radio-group v-model="addMolde">
<el-radio label="TEAM_OWN_USER_ID">团长ID</el-radio>
<el-radio label="TEAM_ACCOUNT">团队账号</el-radio>
</el-radio-group>
</el-form-item> -->
<el-form-item v-if="addMolde === 'TEAM_OWN_USER_ID'" prop="ownUserId" label="代理ID">
<account-input v-model="form.ownUserId" :sys-origin="sysOrigin" placeholder="代理ID" />
</el-form-item>
<el-form-item v-if="addMolde === 'TEAM_ACCOUNT'" prop="teamAccount" label="团队账号">
<el-input v-model="form.teamAccount" placeholder="请输入团队账号" maxlength="10" show-word-limit />
</el-form-item>
<el-form-item prop="memberUserId" label="成员ID">
<account-input v-model="form.memberUserId" :sys-origin="sysOrigin" placeholder="成员ID" />
</el-form-item>
<el-form-item prop="remarks" label="备注">
<el-input
v-model="form.remarks"
type="textarea"
placeholder="请输入备注"
maxlength="100"
show-word-limit
resize="none"
rows="5"
/>
</el-form-item>
</el-form>
</div>
<div class="drawer-footer">
<el-button @click="handleClose()">关闭</el-button>
<el-button type="primary" :disabled="submitLoading" :loading="submitLoading" @click="submit">保存</el-button>
</div>
</div>
</el-drawer>
</div>
</template>
<script>
import { addTeamMember } from '@/api/team'
export default {
name: 'TeamMemberAdd',
props: {
sysOrigin: {
type: String,
require: true,
default: ''
}
},
data() {
const commonRules = [
{ required: true, message: '必填字段不可为空', trigger: 'blur' }
]
return {
addMolde: 'TEAM_OWN_USER_ID',
submitLoading: false,
form: {
ownUserId: '',
sysOrigin: '',
teamAccount: '',
memberUserId: '',
remarks: ''
},
formRules: {
ownUserId: commonRules,
sysOrigin: commonRules,
teamAccount: commonRules,
memberUserId: commonRules
}
}
},
computed: {
},
watch: {
sysOrigin: {
handler(newVal) {
this.form.sysOrigin = newVal
},
immediate: true
},
addMolde: {
handler(newVal) {
if (newVal === 'TEAM_OWN_USER_ID') {
this.form.teamAccount = ''
}
if (newVal === 'TEAM_ACCOUNT') {
this.form.ownUserId = ''
}
},
immediate: true
}
},
methods: {
handleClose() {
if (this.submitLoading) {
this.$opsMessage.warn('正在提交!')
return
}
this.$emit('close')
},
submit() {
const that = this
that.$refs.form.validate(valid => {
if (!valid) {
console.error('error submit!!')
return false
}
that.submitLoading = true
addTeamMember(that.form).then(res => {
that.submitLoading = false
this.$emit('success', that.form)
}).catch(er => {
that.submitLoading = false
})
})
}
}
}
</script>

View File

@ -1,141 +0,0 @@
<template>
<div class="member-team-change-drawer">
<el-drawer
title="更换团队"
:visible="true"
:before-close="handleClose"
:close-on-press-escape="false"
:wrapper-closable="false"
:modal-append-to-body="true"
:append-to-body="true"
custom-class="drawer-auto-layout"
>
<div slot="title" class="flex-l">
<sys-origin-icon :icon="row.sysOrigin" size="18px" />&nbsp;添加成员
</div>
<div class="member-team-change">
<div class="drawer-form">
<el-form ref="form" :model="form" :rules="formRules" label-width="80px" style="margin-right: 15px;">
<!-- <el-form-item prop="status" label="模式">
<el-radio-group v-model="addMolde">
<el-radio label="TEAM_OWN_USER_ID">团长ID</el-radio>
<el-radio label="TEAM_ACCOUNT">团队账号</el-radio>
</el-radio-group>
</el-form-item> -->
<el-form-item v-if="addMolde === 'TEAM_OWN_USER_ID'" prop="ownUserId" label="代理ID">
<account-input v-model="form.ownUserId" :sys-origin="sysOrigin" placeholder="代理ID" />
</el-form-item>
<el-form-item v-if="addMolde === 'TEAM_ACCOUNT'" prop="teamAccount" label="团队账号">
<el-input v-model="form.teamAccount" placeholder="请输入团队账号" maxlength="10" show-word-limit />
</el-form-item>
<el-form-item prop="remarks" label="备注">
<el-input
v-model="form.remarks"
type="textarea"
placeholder="请输入备注"
maxlength="100"
show-word-limit
resize="none"
rows="5"
/>
</el-form-item>
</el-form>
</div>
<div class="drawer-footer">
<el-button :disabled="submitLoading" @click="handleClose()">关闭</el-button>
<el-button type="primary" :disabled="submitLoading" :loading="submitLoading" @click="submit">保存</el-button>
</div>
</div>
</el-drawer>
</div>
</template>
<script>
import { updateMemberTeam } from '@/api/team'
export default {
name: 'TeamMemberChangeTeam',
props: {
row: {
type: Object,
require: true,
default: () => {}
}
},
data() {
const commonRules = [
{ required: true, message: '必填字段不可为空', trigger: 'blur' }
]
return {
addMolde: 'TEAM_OWN_USER_ID',
submitLoading: false,
form: {
ownUserId: '',
sysOrigin: '',
teamAccount: '',
memberUserId: '',
remarks: ''
},
formRules: {
ownUserId: commonRules,
sysOrigin: commonRules,
teamAccount: commonRules,
memberUserId: commonRules
}
}
},
computed: {
},
watch: {
row: {
handler(newVal) {
if (newVal) {
this.form.sysOrigin = newVal.sysOrigin
this.form.memberUserId = newVal.userProfile.id
}
},
immediate: true
},
addMolde: {
handler(newVal) {
if (newVal === 'TEAM_OWN_USER_ID') {
this.form.teamAccount = ''
}
if (newVal === 'TEAM_ACCOUNT') {
this.form.ownUserId = ''
}
},
immediate: true
}
},
methods: {
handleClose() {
if (this.submitLoading) {
this.$opsMessage.warn('正在提交!')
return
}
this.$emit('close')
},
submit() {
const that = this
that.$refs.form.validate(valid => {
if (!valid) {
console.error('error submit!!')
return false
}
that.submitLoading = true
updateMemberTeam(that.form).then(res => {
that.submitLoading = false
this.$emit('success', res.body)
}).catch(er => {
that.submitLoading = false
})
})
}
}
}
</script>

View File

@ -1,186 +0,0 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-select
v-model="listQuery.sysOrigin"
placeholder="系统"
style="width: 120px"
class="filter-item"
@change="handleSearch"
>
<el-option
v-for="item in permissionsSysOriginPlatforms"
:key="item.value"
:label="item.label"
:value="item.value"
>
<span style="float: left;"> <sys-origin-icon :icon="item.value" :desc="item.value" /></span>
<span style="float: left;margin-left:10px">{{ item.label }}</span>
</el-option>
</el-select>
<div class="filter-item">
<account-input v-model="listQuery.userId" :sys-origin="listQuery.sysOrigin" placeholder="用户ID" />
</div>
<el-select
v-model="listQuery.status"
placeholder="状态"
style="width:120px;"
class="filter-item"
clearable
@change="handleSearch"
>
<el-option label="待审核" :value="'PENDING'" />
<el-option label="已通过" :value="'PASS'" />
<el-option label="不通过" :value="'NOT_PASS'" />
</el-select>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
:disabled="searchDisabled"
@click="handleSearch"
>
搜索
</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
fit
highlight-current-row
@cell-mouse-enter="handleMouseEnter"
>
<el-table-column prop="sysOrigin" label="系统" align="center" width="100">
<template slot-scope="scope">
<sys-origin-icon :icon="scope.row.sysOrigin" :desc="scope.row.sysOrigin" />
</template>
</el-table-column>
<el-table-column label="用户" align="center" min-width="100">
<template slot-scope="scope">
<user-table-exhibit :user-profile="scope.row.userProfile" :query-details="true" />
</template>
</el-table-column>
<el-table-column label="告白对象" align="center" min-width="100">
<template slot-scope="scope">
<user-table-exhibit :user-profile="scope.row.confessionUserProfile" :query-details="true" />
</template>
</el-table-column>
<el-table-column prop="content" label="内容" align="center" min-width="100" />
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.status === 'PENDING'">待审核</el-tag>
<el-tag v-if="scope.row.status === 'PASS'">已通过</el-tag>
<el-tag v-else-if="scope.row.status === 'NOT_PASS'">不通过</el-tag>
</div>
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间" align="center" width="160">
<template slot-scope="scope">
{{ scope.row.createTime | dateFormat }}
</template>
</el-table-column>
<el-table-column prop="updateTime" label="修改时间" align="center" width="160" />
<el-table-column fixed="right" label="操作" align="center" width="200">
<template slot-scope="scope">
<el-button v-if="scope.row.status === 'PENDING'" type="text" @click="auditSubmit(scope.row, true)">通过</el-button>
<el-button v-if="scope.row.status === 'PENDING'" type="text" @click="auditSubmit(scope.row, false)">不通过</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="listQuery.cursor"
:limit.sync="listQuery.limit"
@pagination="renderData"
/>
</div>
</template>
<script>
import { userConfessionRecordPage, auditUserConfession } from '@/api/cp-cabin'
import Pagination from '@/components/Pagination'
import { mapGetters } from 'vuex'
export default {
name: 'UserCpConfessionTable',
components: { Pagination },
data() {
return {
thatRow: null,
rangeDate: [],
userInfo: {},
searchDisabled: false,
thatSelectedUserId: '',
list: [],
total: 0,
listQuery: {
cursor: 1,
limit: 20,
userId: '',
status: '',
sysOrigin: 'HALAR'
},
formData: {
id: '',
status: ''
},
listLoading: true
}
},
computed: {
...mapGetters(['permissionsSysOriginPlatforms'])
},
created() {
const that = this
const querySystem = this.permissionsSysOriginPlatforms[0]
if (!querySystem) {
return
}
that.listQuery.sysOrigin = querySystem.value
that.renderData()
},
methods: {
renderData(isReset) {
const that = this
if (isReset === true) {
that.listQuery.cursor = 1
}
that.listLoading = true
userConfessionRecordPage(that.listQuery).then(res => {
const { body } = res
that.total = body.total || 0
that.list = body.records
that.listLoading = false
}).catch(er => {
that.listLoading = false
})
},
handleSearch() {
this.renderData(true)
},
handleMouseEnter(row) {
this.thatRow = row
},
auditSubmit(row, type) {
const that = this
that.formData = {
id: row.id,
status: type ? 'PASS' : 'NOT_PASS'
}
that.listLoading = true
auditUserConfession(that.formData).then(res => {
that.$message.success('操作成功')
that.listLoading = false
that.renderData()
}).catch(er => {
that.listLoading = false
that.$message.error('操作失败')
console.error(er)
})
}
}
}
</script>