feat(资源组配置): 修复荣誉活动的保存数据问题

This commit is contained in:
hzj 2025-11-24 17:21:01 +08:00
parent 48eeefa8c1
commit 3a41bbed52
3 changed files with 306 additions and 150 deletions

View File

@ -1,13 +1,36 @@
<template> <template>
<div class="props-row"> <div class="props-row">
<div v-for="(item, index) in list" :key="index" class="props-item"> <div v-for="(item, index) in list" :key="index" class="props-item">
<el-tooltip class="item" effect="dark" :content="formatPropsContent(item)" placement="top-start"> <el-tooltip
<div class="quantity nowrap-ellipsis">{{ formatPropsContent(item) }} </div> class="item"
effect="dark"
:content="formatPropsContent(item)"
placement="top-start"
>
<div class="quantity nowrap-ellipsis">
{{ formatPropsContent(item) }}
</div>
</el-tooltip> </el-tooltip>
<img v-if="item.type === 'GOLD'" src="@/assets/gold_icon.png" style="width:50px;height50px;cursor: pointer;"> <img
<img v-else-if="item.type === 'DIAMOND'" src="@/assets/diamond_icon.png" style="width:50px;height50px;cursor: pointer;"> v-if="item.type === 'GOLD'"
<img v-else-if="item.type === 'GAME_COUPON'" src="@/assets/game_coupon.png" style="width:50px;height50px;cursor: pointer;"> src="@/assets/gold_icon.png"
<img v-else-if="item.type === 'SPECIAL_ID'" src="@/assets/special_id.png" style="width:50px;height:50px;cursor: pointer;"> style="width:50px;height:50px;cursor: pointer;"
/>
<img
v-else-if="item.type === 'DIAMOND'"
src="@/assets/diamond_icon.png"
style="width:50px;height:50px;cursor: pointer;"
/>
<img
v-else-if="item.type === 'GAME_COUPON'"
src="@/assets/game_coupon.png"
style="width:50px;height:50px;cursor: pointer;"
/>
<img
v-else-if="item.type === 'SPECIAL_ID'"
src="@/assets/special_id.png"
style="width:50px;height:50px;cursor: pointer;"
/>
<div v-else class="preview-img"> <div v-else class="preview-img">
<el-image <el-image
style="width: 50px; height: 50px" style="width: 50px; height: 50px"
@ -19,10 +42,7 @@
</div> </div>
</el-image> </el-image>
<div class="preview-svga"> <div class="preview-svga">
<svgaplayer <svgaplayer type="popover" :url="item.sourceUrl" />
type="popover"
:url="item.sourceUrl"
/>
</div> </div>
</div> </div>
</div> </div>
@ -30,7 +50,7 @@
</template> </template>
<script> <script>
export default { export default {
name: 'PropsRow', name: "PropsRow",
props: { props: {
list: { list: {
type: Array, type: Array,
@ -41,122 +61,134 @@ export default {
data() { data() {
return { return {
propsTypeFormat: { propsTypeFormat: {
'GIFT': { GIFT: {
prefix: 'x', prefix: "x",
field: 'quantity', field: "quantity",
suffix: '' suffix: ""
}, },
'DIAMOND': { DIAMOND: {
prefix: '', prefix: "",
field: 'content', field: "content",
suffix: '' suffix: ""
}, },
'GOLD': { GOLD: {
prefix: '', prefix: "",
field: 'content', field: "content",
suffix: '' suffix: ""
}, },
'ROOM_BADGE': { ROOM_BADGE: {
prefix: '', prefix: "",
field: 'quantity', field: "quantity",
suffix: 'D', suffix: "D",
forever: true forever: true
}, },
'BADGE': { BADGE: {
prefix: '', prefix: "",
field: 'quantity', field: "quantity",
suffix: 'D', suffix: "D",
forever: true forever: true
}, },
'SPECIAL_ID': { SPECIAL_ID: {
prefix: '', prefix: "",
field: 'content', field: "content",
suffix: '' suffix: ""
}, },
'NOBLE_VIP': { NOBLE_VIP: {
prefix: '', prefix: "",
field: 'quantity', field: "quantity",
suffix: 'D' suffix: "D"
}, },
'AVATAR_FRAME': { AVATAR_FRAME: {
prefix: '', prefix: "",
field: 'quantity', field: "quantity",
suffix: 'D' suffix: "D"
}, },
'DATA_CARD': { DATA_CARD: {
prefix: '', prefix: "",
field: 'quantity', field: "quantity",
suffix: 'D' suffix: "D"
}, },
'RIDE': { RIDE: {
prefix: '', prefix: "",
field: 'quantity', field: "quantity",
suffix: 'D' suffix: "D"
}, },
'THEME': { THEME: {
prefix: '', prefix: "",
field: 'quantity', field: "quantity",
suffix: 'D' suffix: "D"
}, },
'EMOJI': { EMOJI: {
prefix: 'x', prefix: "x",
field: 'quantity', field: "quantity",
suffix: '' suffix: ""
}, },
'CHAT_BUBBLE': { CHAT_BUBBLE: {
prefix: '', prefix: "",
field: 'quantity', field: "quantity",
suffix: 'D' suffix: "D"
}, },
'GAME_COUPON': { GAME_COUPON: {
prefix: '', prefix: "",
field: 'quantity', field: "quantity",
suffix: '' suffix: ""
}, },
'FRAGMENTS': { FRAGMENTS: {
prefix: 'x', prefix: "x",
field: 'quantity', field: "quantity",
suffix: '' suffix: ""
}, },
'FLOAT_PICTURE': { FLOAT_PICTURE: {
prefix: '', prefix: "",
field: 'quantity', field: "quantity",
suffix: 'D' suffix: "D"
}, },
'LAYOUT': { LAYOUT: {
prefix: 'x', prefix: "x",
field: 'quantity', field: "quantity",
suffix: '' suffix: ""
},
//
PROP_COUPON: {
prefix: "x",
field: "quantity",
suffix: ""
},
//
HONOR_ACTIVITY: {
prefix: "",
field: "quantity",
suffix: "D"
} }
} }
} };
},
computed: {
},
created() {
}, },
computed: {},
created() {},
methods: { methods: {
formatPropsContent(item) { formatPropsContent(item) {
if (item.detailType === 'CUSTOMIZE' && item.remark) { if (item.detailType === "CUSTOMIZE" && item.remark) {
return item.remark return item.remark;
} }
const format = this.propsTypeFormat[item.detailType] || this.propsTypeFormat[item.type] const format =
this.propsTypeFormat[item.detailType] ||
this.propsTypeFormat[item.type];
if (!format) { if (!format) {
return '?' return "?";
} }
const val = item[format.field] const val = item[format.field];
if (format.forever === true && val <= 0) { if (format.forever === true && val <= 0) {
return '永久' return "永久";
} }
return `${format.prefix}${val}${format.suffix}` return `${format.prefix}${val}${format.suffix}`;
} }
} }
};
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.props-row { .props-row {
@ -171,7 +203,7 @@ export default {
.quantity { .quantity {
position: absolute; position: absolute;
background-color: rgba(21, 21, 21, 0.6); background-color: rgba(21, 21, 21, 0.6);
color: #FFFFFF; color: #ffffff;
border-radius: 2px; border-radius: 2px;
right: 0px; right: 0px;
left: 0px; left: 0px;
@ -182,5 +214,4 @@ export default {
} }
} }
} }
</style> </style>

View File

@ -18,6 +18,7 @@
label-width="110px" label-width="110px"
style="margin-right:50px;" style="margin-right:50px;"
> >
<!-- 类型名称 -->
<el-form-item label="类型名称" prop="name"> <el-form-item label="类型名称" prop="name">
<el-input <el-input
v-model.trim="form.name" v-model.trim="form.name"
@ -25,12 +26,16 @@
placeholder="类别名称" placeholder="类别名称"
/> />
</el-form-item> </el-form-item>
<!-- 上下架开关 -->
<el-form-item label="上/下架" prop="shelfStatus"> <el-form-item label="上/下架" prop="shelfStatus">
<el-radio-group v-model="form.shelfStatus"> <el-radio-group v-model="form.shelfStatus">
<el-radio :label="true">上架</el-radio> <el-radio :label="true">上架</el-radio>
<el-radio :label="false">下架</el-radio> <el-radio :label="false">下架</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<!-- 配置列表 -->
<div class="dr-content"> <div class="dr-content">
<div ref="rewardContent"> <div ref="rewardContent">
<el-row <el-row
@ -38,9 +43,12 @@
:key="index" :key="index"
style="cursor:pointer;line-height:30px;" style="cursor:pointer;line-height:30px;"
> >
<!-- 序号 -->
<el-col :span="3"> <el-col :span="3">
<div class="sort">{{ index + 1 }}</div> <div class="sort">{{ index + 1 }}</div>
</el-col> </el-col>
<!-- 展示图 -->
<el-col :span="3" style="text-align:center;"> <el-col :span="3" style="text-align:center;">
<div v-if="item.type === 'GOLD'"> <div v-if="item.type === 'GOLD'">
<img <img
@ -85,6 +93,8 @@
</div> </div>
</div> </div>
</el-col> </el-col>
<!-- 按类型展示信息 -->
<el-col :span="15"> <el-col :span="15">
<span style="font-weight:bold;"> <span style="font-weight:bold;">
{{ getTypeName(item) }}</span {{ getTypeName(item) }}</span
@ -118,6 +128,8 @@
{{ item.quantity }}</span {{ item.quantity }}</span
> >
</el-col> </el-col>
<!-- 删除按钮 -->
<el-col :span="3" style="text-align: right;"> <el-col :span="3" style="text-align: right;">
<i <i
class="del el-icon-delete-solid" class="del el-icon-delete-solid"
@ -127,13 +139,20 @@
</el-row> </el-row>
</div> </div>
</div> </div>
<!-- 添加配置 -->
<el-form-item label="添加配置"> <el-form-item label="添加配置">
<!-- 对新增的选项进行配置 -->
<div class="content-list"> <div class="content-list">
<el-row v-for="(item, index) in form.tmpConfigList" :key="index"> <el-row v-for="(item, index) in form.tmpConfigList" :key="index">
<div class="content-box"> <div class="content-box">
<!-- 名称 -->
<div class="content-box-label"> <div class="content-box-label">
<span>{{ item.ext.title }}</span> <span>{{ item.ext.title }}</span>
</div> </div>
<!-- 各类型自定义配置 -->
<!-- 靓号 -->
<el-row v-if="item.clickType === 'SPECIAL_ID'" :gutter="10"> <el-row v-if="item.clickType === 'SPECIAL_ID'" :gutter="10">
<el-col :span="13"> <el-col :span="13">
<el-form-item <el-form-item
@ -180,6 +199,7 @@
/> />
</el-col> </el-col>
</el-row> </el-row>
<el-row v-else-if="isCurrency(item.clickType)" :gutter="10"> <el-row v-else-if="isCurrency(item.clickType)" :gutter="10">
<el-col :span="19"> <el-col :span="19">
<el-form-item <el-form-item
@ -209,6 +229,8 @@
/> />
</el-col> </el-col>
</el-row> </el-row>
<!-- 游戏券 -->
<el-row v-else-if="isGameCoupon(item.clickType)" :gutter="10"> <el-row v-else-if="isGameCoupon(item.clickType)" :gutter="10">
<el-col :span="19"> <el-col :span="19">
<el-form-item <el-form-item
@ -238,6 +260,8 @@
/> />
</el-col> </el-col>
</el-row> </el-row>
<!-- 道具券 -->
<el-row v-else-if="isPROPCOUPON(item.clickType)" :gutter="10"> <el-row v-else-if="isPROPCOUPON(item.clickType)" :gutter="10">
<el-col :span="13"> <el-col :span="13">
<el-form-item <el-form-item
@ -285,6 +309,8 @@
/> />
</el-col> </el-col>
</el-row> </el-row>
<!-- 徽章 -->
<el-row v-else-if="isBadge(item.clickType)" :gutter="10"> <el-row v-else-if="isBadge(item.clickType)" :gutter="10">
<el-col :span="13"> <el-col :span="13">
<el-form-item <el-form-item
@ -360,6 +386,8 @@
/> />
</el-col> </el-col>
</el-row> </el-row>
<!-- 荣誉-活动 -->
<el-row <el-row
v-else-if="isHONORACTIVITY(item.clickType)" v-else-if="isHONORACTIVITY(item.clickType)"
:gutter="10" :gutter="10"
@ -438,6 +466,8 @@
/> />
</el-col> </el-col>
</el-row> </el-row>
<!-- 自定义 -->
<el-row v-else-if="isCustomize(item.clickType)" :gutter="10"> <el-row v-else-if="isCustomize(item.clickType)" :gutter="10">
<el-col :span="3"> <el-col :span="3">
<div <div
@ -528,6 +558,8 @@
/> />
</el-col> </el-col>
</el-row> </el-row>
<!-- 其他 -->
<el-row v-else :gutter="10"> <el-row v-else :gutter="10">
<el-col :span="3"> <el-col :span="3">
<div <div
@ -622,6 +654,8 @@
</div> </div>
</el-row> </el-row>
</div> </div>
<!-- 资源选项 -->
<div> <div>
<el-button <el-button
type="text" type="text"
@ -961,7 +995,8 @@ export default {
}, },
HONOR_ACTIVITY: { HONOR_ACTIVITY: {
value: "HONOR_ACTIVITY", // value: "HONOR_ACTIVITY",
value: "BADGE",
name: "荣誉-活动" name: "荣誉-活动"
} }
}, },
@ -1069,6 +1104,7 @@ export default {
}); });
}); });
}, },
methods: { methods: {
querySearchBadgeRestaurants(queryString, cb) { querySearchBadgeRestaurants(queryString, cb) {
var badgeRestaurants = this.badgeRestaurants; var badgeRestaurants = this.badgeRestaurants;
@ -1083,6 +1119,7 @@ export default {
: badgeRestaurants; : badgeRestaurants;
cb(results); cb(results);
}, },
changeContent(item, val) { changeContent(item, val) {
const that = this; const that = this;
const typeData = that.propsTypeData[item.clickType]; const typeData = that.propsTypeData[item.clickType];
@ -1101,13 +1138,18 @@ export default {
item.ext.selectVal.cover = data.cover; item.ext.selectVal.cover = data.cover;
item.ext.selectVal.sourceUrl = data.sourceUrl; item.ext.selectVal.sourceUrl = data.sourceUrl;
}, },
//
submitItem(index) { submitItem(index) {
const that = this; const that = this;
that.$refs.form.validate(valid => { that.$refs.form.validate(valid => {
//
if (!valid) { if (!valid) {
console.error("error submit!!"); console.error("error submit!!");
return; return;
} }
const item = that.form.tmpConfigList[0]; const item = that.form.tmpConfigList[0];
const itemExt = item.ext; const itemExt = item.ext;
that.form.rewardConfigList.push({ that.form.rewardConfigList.push({
@ -1122,6 +1164,8 @@ export default {
that.form.tmpConfigList.splice(index, 1); that.form.tmpConfigList.splice(index, 1);
}); });
}, },
//
getTypeName(item) { getTypeName(item) {
const typeData = this.propsTypeMap[item.detailType]; const typeData = this.propsTypeMap[item.detailType];
if (typeData) { if (typeData) {
@ -1129,43 +1173,65 @@ export default {
} }
return ""; return "";
}, },
//
deleteUpdateItem(index) { deleteUpdateItem(index) {
this.form.rewardConfigList.splice(index, 1); this.form.rewardConfigList.splice(index, 1);
}, },
//
addContent(type) { addContent(type) {
const that = this; const that = this;
that.$refs.form.validate(valid => { that.$refs.form.validate(valid => {
//
if (!valid) { if (!valid) {
console.error("error submit!!"); console.error("error submit!!");
return; return;
} }
//
if (that.form.tmpConfigList && that.form.tmpConfigList.length > 0) { if (that.form.tmpConfigList && that.form.tmpConfigList.length > 0) {
that.submitItem(0); that.submitItem(0); //
} }
//
if (that.isGoldOrDiamond(type) || type === "SPECIAL_ID") { if (that.isGoldOrDiamond(type) || type === "SPECIAL_ID") {
that.addContentData(type); that.addContentData(type);
return; return;
} }
//
if (that.isGameCoupon(type)) { if (that.isGameCoupon(type)) {
that.addContentData(type); that.addContentData(type);
return; return;
} }
//
if (that.isPROPCOUPON(type)) { if (that.isPROPCOUPON(type)) {
that.addContentData(type); that.addContentData(type);
return; return;
} }
//
// if (that.isHONORACTIVITY(type)) { // if (that.isHONORACTIVITY(type)) {
// that.addContentData(type); // that.addContentData(type);
// return; // return;
// } // }
//
if (that.propsTypeData[type].loadData === true) { if (that.propsTypeData[type].loadData === true) {
that.addContentData(type); that.addContentData(type);
return; return;
} }
//
that.propsTypeData[type].loading = true; that.propsTypeData[type].loading = true;
//
if (that.isGift(type)) { if (that.isGift(type)) {
that.disableAddContent = true; that.disableAddContent = true;
//
listGiftBySysOrigin(that.form.sysOrigin) listGiftBySysOrigin(that.form.sysOrigin)
.then(res => { .then(res => {
that.disableAddContent = false; that.disableAddContent = false;
@ -1192,9 +1258,11 @@ export default {
return; return;
} }
//
const badgeType = that.getBadgeType(type); const badgeType = that.getBadgeType(type);
if (badgeType) { if (badgeType) {
that.disableAddContent = true; that.disableAddContent = true;
//
listBadgePictureBySysOrigin(that.form.sysOrigin, badgeType) listBadgePictureBySysOrigin(that.form.sysOrigin, badgeType)
.then(res => { .then(res => {
that.disableAddContent = false; that.disableAddContent = false;
@ -1221,6 +1289,7 @@ export default {
return; return;
} }
// VIP
if (type === "NOBLE_VIP") { if (type === "NOBLE_VIP") {
that.disableAddContent = true; that.disableAddContent = true;
listNotFamilyBySysOriginType(that.form.sysOrigin, "NOBLE_VIP") listNotFamilyBySysOriginType(that.form.sysOrigin, "NOBLE_VIP")
@ -1249,6 +1318,7 @@ export default {
return; return;
} }
//
if (type === "EMOJI") { if (type === "EMOJI") {
listGroupBySysOrigin(that.form.sysOrigin) listGroupBySysOrigin(that.form.sysOrigin)
.then(res => { .then(res => {
@ -1275,6 +1345,8 @@ export default {
} }
that.disableAddContent = true; that.disableAddContent = true;
//
listSysOriginTypeList(that.sysOrigin, type) listSysOriginTypeList(that.sysOrigin, type)
.then(res => { .then(res => {
that.disableAddContent = false; that.disableAddContent = false;
@ -1301,6 +1373,8 @@ export default {
}); });
}); });
}, },
//
getBadgeType(type) { getBadgeType(type) {
if (this.isUserBadge(type)) { if (this.isUserBadge(type)) {
return "ACTIVITY"; return "ACTIVITY";
@ -1312,42 +1386,62 @@ export default {
if (this.isHONORACTIVITY(type)) { if (this.isHONORACTIVITY(type)) {
return "HONOR_ACTIVITY"; return "HONOR_ACTIVITY";
// return "BADGE";
} }
return null; return null;
}, },
//
isCurrency(type) { isCurrency(type) {
return type === "GOLD" || type === "DIAMOND"; return type === "GOLD" || type === "DIAMOND";
}, },
// //
isGameCoupon(type) { isGameCoupon(type) {
return type === "GAME_COUPON"; return type === "GAME_COUPON";
}, },
// //
isPROPCOUPON(type) { isPROPCOUPON(type) {
return type === "PROP_COUPON"; return type === "PROP_COUPON";
}, },
// //
isHONORACTIVITY(type) { isHONORACTIVITY(type) {
return type === "HONOR_ACTIVITY"; return type === "HONOR_ACTIVITY";
}, },
//
isBadge(type) { isBadge(type) {
return this.isRoomBadge(type) || this.isUserBadge(type); return this.isRoomBadge(type) || this.isUserBadge(type);
}, },
//
isUserBadge(type) { isUserBadge(type) {
return type === "BADGE"; return type === "BADGE";
}, },
//
isCustomize(type) { isCustomize(type) {
return type === "CUSTOMIZE"; return type === "CUSTOMIZE";
}, },
//
isRoomBadge(type) { isRoomBadge(type) {
return type === "ROOM_BADGE"; return type === "ROOM_BADGE";
}, },
//
isGift(type) { isGift(type) {
return type === "GIFT"; return type === "GIFT";
}, },
//
isTheme(type) { isTheme(type) {
return type === "THEME"; return type === "THEME";
}, },
//
addContentData(type) { addContentData(type) {
const that = this; const that = this;
that.form.tmpConfigList.push({ that.form.tmpConfigList.push({
@ -1362,19 +1456,24 @@ export default {
} }
}); });
}, },
//
isGoldOrDiamond(type) { isGoldOrDiamond(type) {
return type === "GOLD" || type === "DIAMOND"; return type === "GOLD" || type === "DIAMOND";
}, },
clickChangeSource() { clickChangeSource() {
this.isChangeSource = !this.isChangeSource; this.isChangeSource = !this.isChangeSource;
if (this.isChangeSource === true && this.isLoadSourceTypeList === false) { if (this.isChangeSource === true && this.isLoadSourceTypeList === false) {
this.loadSourceType(); this.loadSourceType();
} }
}, },
changeType(index) { changeType(index) {
this.selectType = this.sourceTypeList[index]; this.selectType = this.sourceTypeList[index];
this.form.sourceId = this.selectType.id; this.form.sourceId = this.selectType.id;
}, },
loadSourceType() { loadSourceType() {
const that = this; const that = this;
that.listTypeLoading = true; that.listTypeLoading = true;
@ -1389,10 +1488,12 @@ export default {
console.error(er); console.error(er);
}); });
}, },
handleCoverFileRemove(file, fileList) { handleCoverFileRemove(file, fileList) {
this.form.cover = ""; this.form.cover = "";
this.coverUploadLoading = false; this.coverUploadLoading = false;
}, },
sourceUpload(file) { sourceUpload(file) {
const that = this; const that = this;
that.sourceUploadLoading = true; that.sourceUploadLoading = true;
@ -1406,13 +1507,18 @@ export default {
that.sourceUploadLoading = false; that.sourceUploadLoading = false;
}); });
}, },
handleSourceFileRemove(file, fileList) { handleSourceFileRemove(file, fileList) {
this.form.sourceUrl = ""; this.form.sourceUrl = "";
this.sourceUploadLoading = false; this.sourceUploadLoading = false;
}, },
//
handleClose() { handleClose() {
this.$emit("close"); this.$emit("close");
}, },
//
submitForm() { submitForm() {
const that = this; const that = this;
that.$refs.form.validate(valid => { that.$refs.form.validate(valid => {
@ -1453,6 +1559,7 @@ export default {
}); });
}); });
}, },
clickSvgaplayer() { clickSvgaplayer() {
this.svgaplayerVisable = true; this.svgaplayerVisable = true;
} }

View File

@ -14,7 +14,9 @@
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
> >
<span style="float: left;"> <sys-origin-icon :icon="item.value" :desc="item.value" /></span> <span style="float: left;">
<sys-origin-icon :icon="item.value" :desc="item.value"
/></span>
<span style="float: left;margin-left:10px">{{ item.label }}</span> <span style="float: left;margin-left:10px">{{ item.label }}</span>
</el-option> </el-option>
</el-select> </el-select>
@ -26,7 +28,12 @@
clearable clearable
@change="handleSearch" @change="handleSearch"
> >
<el-option v-for="item in showcaseTypes" :key="item.value" :label="item.name" :value="item.value" /> <el-option
v-for="item in showcaseTypes"
:key="item.value"
:label="item.name"
:value="item.value"
/>
</el-select> </el-select>
<el-input <el-input
@ -70,7 +77,12 @@
@cell-mouse-enter="handleMouseEnter" @cell-mouse-enter="handleMouseEnter"
> >
<el-table-column prop="id" width="200" label="ID" align="center" /> <el-table-column prop="id" width="200" label="ID" align="center" />
<el-table-column width="100" prop="name" label="类型名称" align="center" /> <el-table-column
width="100"
prop="name"
label="类型名称"
align="center"
/>
<el-table-column width="200" label="上/下架" align="center"> <el-table-column width="200" label="上/下架" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch
@ -94,7 +106,9 @@
</el-table-column> </el-table-column>
<el-table-column fixed="right" label="操作" align="center" width="150"> <el-table-column fixed="right" label="操作" align="center" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click.native="handleUpdate(scope.row)">编辑</el-button> <el-button type="text" @click.native="handleUpdate(scope.row)"
>编辑</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -107,33 +121,37 @@
@pagination="renderData" @pagination="renderData"
/> />
<!-- 添加或修改窗口 -->
<form-edit <form-edit
v-if="formEditVisable" v-if="formEditVisable"
:row="thisRow" :row="thisRow"
:sys-origin="editSysOrigin" :sys-origin="editSysOrigin"
@success="formEditSuccess" @success="formEditSuccess"
@close="formEditVisable=false" @close="formEditVisable = false"
/> />
</div> </div>
</template> </template>
<script> <script>
import { pagePropsActivityRewardGroup, offPropsActivityRewardGroup } from '@/api/props' import {
import Pagination from '@/components/Pagination' pagePropsActivityRewardGroup,
import { propsTypes } from '@/constant/type' offPropsActivityRewardGroup
import FormEdit from './form-edit' } from "@/api/props";
import { sysOriginPlatforms } from '@/constant/origin' import Pagination from "@/components/Pagination";
import { mapGetters } from 'vuex' import { propsTypes } from "@/constant/type";
import PropsRow from '@/components/data/PropsRow' import FormEdit from "./form-edit"; //
import { sysOriginPlatforms } from "@/constant/origin";
import { mapGetters } from "vuex";
import PropsRow from "@/components/data/PropsRow";
export default { export default {
components: { Pagination, FormEdit, PropsRow }, components: { Pagination, FormEdit, PropsRow },
data() { data() {
return { return {
editSysOrigin: '', editSysOrigin: "",
sysOriginPlatforms, sysOriginPlatforms,
showcaseTypes: [ showcaseTypes: [
{ value: false, name: '下架' }, { value: false, name: "下架" },
{ value: true, name: '上架' } { value: true, name: "上架" }
], ],
formEditVisable: false, formEditVisable: false,
thisRow: {}, thisRow: {},
@ -144,78 +162,78 @@ export default {
listQuery: { listQuery: {
cursor: 1, cursor: 1,
limit: 20, limit: 20,
id: '', id: "",
name: '', name: "",
shelfStatus: true, shelfStatus: true,
sysOrigin: 'HALAR' sysOrigin: "HALAR"
}, },
listLoading: true listLoading: true
} };
}, },
computed: { computed: {
...mapGetters(['permissionsSysOriginPlatforms']) ...mapGetters(["permissionsSysOriginPlatforms"])
}, },
created() { created() {
const that = this const that = this;
const querySystem = this.permissionsSysOriginPlatforms[0] const querySystem = this.permissionsSysOriginPlatforms[0];
if (!querySystem) { if (!querySystem) {
return return;
} }
that.listQuery.sysOrigin = querySystem.value that.listQuery.sysOrigin = querySystem.value;
that.renderData() that.renderData();
}, },
methods: { methods: {
renderData(isClean) { renderData(isClean) {
const that = this const that = this;
that.listLoading = true that.listLoading = true;
if (isClean === true) { if (isClean === true) {
that.listQuery.cursor = 1 that.listQuery.cursor = 1;
} }
pagePropsActivityRewardGroup(that.listQuery).then(res => { pagePropsActivityRewardGroup(that.listQuery).then(res => {
const { body } = res const { body } = res;
that.total = body.total || 0 that.total = body.total || 0;
that.list = body.records that.list = body.records;
that.listLoading = false that.listLoading = false;
}) });
}, },
handleCreate() { handleCreate() {
this.thisRow = null this.thisRow = null;
this.formEditVisable = true this.formEditVisable = true;
this.editSysOrigin = this.listQuery.sysOrigin this.editSysOrigin = this.listQuery.sysOrigin;
}, },
handleUpdate(row) { handleUpdate(row) {
this.formEditVisable = true this.formEditVisable = true;
}, },
handleSwitchChange(row) { handleSwitchChange(row) {
offPropsActivityRewardGroup(row.id, row.shelfStatus) offPropsActivityRewardGroup(row.id, row.shelfStatus)
.then(res => {}) .then(res => {})
.catch(er => { .catch(er => {
row.shelfStatus = !row.shelfStatus row.shelfStatus = !row.shelfStatus;
}) });
}, },
handleSearch() { handleSearch() {
this.renderData(true) this.renderData(true);
}, },
queryUserDetails(row) { queryUserDetails(row) {
this.userDeatilsDrawer = true this.userDeatilsDrawer = true;
this.thatSelectedUserId = row.id this.thatSelectedUserId = row.id;
}, },
handleMouseEnter(row) { handleMouseEnter(row) {
this.thisRow = row this.thisRow = row;
this.thatSelectedUserId = row.id this.thatSelectedUserId = row.id;
this.editSysOrigin = row.sysOrigin this.editSysOrigin = row.sysOrigin;
}, },
formEditSuccess() { formEditSuccess() {
this.formEditVisable = false this.formEditVisable = false;
this.renderData(false) this.renderData(false);
} }
} }
} };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.store-table-expand { .store-table-expand {
font-size: 0; font-size: 0;
label { label {
width: 90px; width: 90px;
color: #99a9bf; color: #99a9bf;
.el-form-item { .el-form-item {
@ -223,6 +241,6 @@ export default {
margin-bottom: 0; margin-bottom: 0;
width: 50%; width: 50%;
} }
} }
} }
</style> </style>