|
|
|
@ -4,21 +4,19 @@
|
|
|
|
|
<el-card shadow="hover" header="总览"> |
|
|
|
|
<template #header> |
|
|
|
|
总览 |
|
|
|
|
<el-button size="default" v-show="item.topShow == false" @click="item.topShow = true" class="button-caret" |
|
|
|
|
type="text"> |
|
|
|
|
<el-button size="default" v-show="item.topShow == false" @click="item.topShow = true" class="button-caret" type="text"> |
|
|
|
|
<el-icon> |
|
|
|
|
<ele-CaretBottom /> |
|
|
|
|
</el-icon> |
|
|
|
|
</el-button> |
|
|
|
|
<el-button size="default" v-show="item.topShow == true" @click="item.topShow = false" class="button-caret" |
|
|
|
|
type="text"> |
|
|
|
|
<el-button size="default" v-show="item.topShow == true" @click="item.topShow = false" class="button-caret" type="text"> |
|
|
|
|
<el-icon> |
|
|
|
|
<ele-CaretTop /> |
|
|
|
|
</el-icon> |
|
|
|
|
</el-button> |
|
|
|
|
</template> |
|
|
|
|
<div v-show="item.topShow"> |
|
|
|
|
<div class="flex-warp" style="float: right;"> |
|
|
|
|
<div class="flex-warp" style="float: right"> |
|
|
|
|
<div class="flex-warp-item"> |
|
|
|
|
<div class="flex-warp-item-box"> |
|
|
|
|
<el-tag type="info" effect="dark">已过期</el-tag> |
|
|
|
@ -51,9 +49,8 @@
|
|
|
|
|
<div v-for="(item, index) in data" :key="index"> |
|
|
|
|
<div class="flex-warp-item"> |
|
|
|
|
<div class="flex-warp-item-box"> |
|
|
|
|
<el-tag :type="getType(item)" :effect="getEffect(item)" style="cursor:default" |
|
|
|
|
@click="onEditMarket(item)"> |
|
|
|
|
【{{item.index}}{{item.StringId == market.id ? "正在修改":""}}】 {{item.month+1}}月{{item.date}}日 |
|
|
|
|
<el-tag :type="getType(item)" :effect="getEffect(item)" style="cursor: default" @click="onEditMarket(item)"> |
|
|
|
|
【{{ item.index }}{{ item.StringId == market.id ? '正在修改' : '' }}】 {{ item.month + 1 }}月{{ item.date }}日 |
|
|
|
|
</el-tag> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
@ -62,7 +59,7 @@
|
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div style="padding-bottom: 20px"> |
|
|
|
|
<div class="flex-warp" style="float: right;"> |
|
|
|
|
<div class="flex-warp" style="float: right"> |
|
|
|
|
<el-button size="default" type="primary" class="ml10" @click="autoConfig"> |
|
|
|
|
<el-icon> |
|
|
|
|
<ele-Plus /> |
|
|
|
@ -90,20 +87,20 @@
|
|
|
|
|
<div v-show="item.timeShow"> |
|
|
|
|
<div class="flex-warp"> |
|
|
|
|
<el-form-item label="年份" prop="year"> |
|
|
|
|
<el-select v-model="market.year" class="m-2" placeholder="选择年份" @change="yearChange" |
|
|
|
|
size="default"> |
|
|
|
|
<el-select v-model="market.year" class="m-2" placeholder="选择年份" @change="yearChange" size="default"> |
|
|
|
|
<el-option v-for="item in fullYears" :key="item.value" :label="item.label" :value="item.value" /> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="日期" prop="monday"> |
|
|
|
|
<el-select v-model="market.monday" class="m-2" placeholder="选择日期" @change="weekChange()" filterable |
|
|
|
|
size="default"> |
|
|
|
|
<el-option v-for="item in mondays" :key="item.index" |
|
|
|
|
<el-select v-model="market.monday" class="m-2" placeholder="选择日期" @change="weekChange()" filterable size="default"> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in mondays" |
|
|
|
|
:key="item.index" |
|
|
|
|
:label="'【' + item.index + '】 ' + (item.month + 1) + '月' + item.date + '日'" |
|
|
|
|
:value="item.index"> |
|
|
|
|
:value="item.index" |
|
|
|
|
> |
|
|
|
|
<span style="float: left">【{{ item.index }}】</span> |
|
|
|
|
<span |
|
|
|
|
style="float: right; color: #8492a6; font-size: 13px">{{(item.month+1) + '月' + item.date+'日' }}</span> |
|
|
|
|
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.month + 1 + '月' + item.date + '日' }}</span> |
|
|
|
|
</el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
@ -123,12 +120,15 @@
|
|
|
|
|
<ele-CaretTop /> |
|
|
|
|
</el-icon> |
|
|
|
|
</el-button> |
|
|
|
|
<el-select size="default" class="button-caret" v-model="selectModel" filterable @change="choiceModel" |
|
|
|
|
placeholder="请选择配置"> |
|
|
|
|
<el-select size="default" class="button-caret" v-model="selectModel" filterable @change="choiceModel" placeholder="请选择配置"> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in listDbs.filter(d => Number(d.Year + getZero4Fill(d.Date)) > lastDate && Number(d.Year + getZero4Fill(d.Date)) < curDate)" |
|
|
|
|
:key="item.StringId" :label="item.Year+'-'+item.Date+'【'+item.Name+'】'" |
|
|
|
|
:value="item.StringId"/> |
|
|
|
|
v-for="item in listDbs.filter( |
|
|
|
|
(d) => Number(d.Year + getZero4Fill(d.Date)) > lastDate && Number(d.Year + getZero4Fill(d.Date)) < curDate |
|
|
|
|
)" |
|
|
|
|
:key="item.StringId" |
|
|
|
|
:label="item.Year + '-' + item.Date + '【' + item.Name + '】'" |
|
|
|
|
:value="item.StringId" |
|
|
|
|
/> |
|
|
|
|
</el-select> |
|
|
|
|
</template> |
|
|
|
|
<div v-show="item.show"> |
|
|
|
@ -142,18 +142,16 @@
|
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="普通出售摊位" prop="sale" v-show="false"> |
|
|
|
|
<el-select v-model="market.sale" size="default" multiple placeholder="请选择"> |
|
|
|
|
<el-option v-for="item in bazaar.filter(r=>r.Type==1)" :key="item.StallId" :label="item.StallId" |
|
|
|
|
:value="item.StallId"> |
|
|
|
|
{{item.StallId+ " " +item.Remark}} |
|
|
|
|
<el-option v-for="item in bazaar.filter((r) => r.Type == 1)" :key="item.StallId" :label="item.StallId" :value="item.StallId"> |
|
|
|
|
{{ item.StallId + ' ' + item.Remark }} |
|
|
|
|
</el-option> |
|
|
|
|
</el-select> |
|
|
|
|
<span v-show="check && (!market.sale || market.sale.length == 0)" style="color: red">*</span> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="普通收购摊位" prop="purchase" v-show="false"> |
|
|
|
|
<el-select v-model="market.purchase" size="default" multiple placeholder="请选择"> |
|
|
|
|
<el-option v-for="item in bazaar.filter(r=>r.Type==2)" :key="item.StallId" :label="item.StallId" |
|
|
|
|
:value="item.StallId"> |
|
|
|
|
{{item.StallId+ " " +item.Remark}} |
|
|
|
|
<el-option v-for="item in bazaar.filter((r) => r.Type == 2)" :key="item.StallId" :label="item.StallId" :value="item.StallId"> |
|
|
|
|
{{ item.StallId + ' ' + item.Remark }} |
|
|
|
|
</el-option> |
|
|
|
|
</el-select> |
|
|
|
|
<span v-show="check && (!market.purchase || market.purchase.length == 0)" style="color: red">*</span> |
|
|
|
@ -326,30 +324,25 @@
|
|
|
|
|
</template> |
|
|
|
|
<div v-show="item.highShow"> |
|
|
|
|
<el-form-item label="高价摊位" prop="purchase"> |
|
|
|
|
<el-select v-model="HighPriceRecycle.StallId" size="default" placeholder="请选择" |
|
|
|
|
@change="selectStall(HighPriceRecycle.StallId)"> |
|
|
|
|
<el-select v-model="HighPriceRecycle.StallId" size="default" placeholder="请选择" @change="selectStall(HighPriceRecycle.StallId)"> |
|
|
|
|
<el-option label="空摊位" :value="-1"> |
|
|
|
|
{{-1+ " 空摊位"}} |
|
|
|
|
{{ -1 + ' 空摊位' }} |
|
|
|
|
</el-option> |
|
|
|
|
<el-option v-for="item in bazaar.filter(r=>r.Type==4)" :key="item.StallId" :label="item.Remark" |
|
|
|
|
:value="item.StallId"> |
|
|
|
|
{{item.StallId+ " " +item.Remark}} |
|
|
|
|
<el-option v-for="item in bazaar.filter((r) => r.Type == 4)" :key="item.StallId" :label="item.Remark" :value="item.StallId"> |
|
|
|
|
{{ item.StallId + ' ' + item.Remark }} |
|
|
|
|
</el-option> |
|
|
|
|
</el-select> |
|
|
|
|
<span v-show="check&&(!HighPriceRecycle.StallId)" style="color: red">*</span> |
|
|
|
|
<span v-show="check && !HighPriceRecycle.StallId" style="color: red">*</span> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="摊位详情"> |
|
|
|
|
<el-input type="textarea" v-model="HighPriceRecycle.IntroduceItem" placeholder="摊位详情" :rows="5" |
|
|
|
|
style="width: 400px;" disabled> |
|
|
|
|
<el-input type="textarea" v-model="HighPriceRecycle.IntroduceItem" placeholder="摊位详情" :rows="5" style="width: 400px" disabled> |
|
|
|
|
</el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="摊位介绍"> |
|
|
|
|
<el-input type="textarea" v-model="HighPriceRecycle.Introduce" placeholder="摊位介绍" style="width: 400px"> |
|
|
|
|
</el-input> |
|
|
|
|
<el-input type="textarea" v-model="HighPriceRecycle.Introduce" placeholder="摊位介绍" style="width: 400px"></el-input> |
|
|
|
|
<span v-show="check && !HighPriceRecycle.Introduce" style="color: red">*</span> |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
</el-card> |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-button size="default" type="primary" class="ml10" @click="onSubmit" :disabled="checkSubmit()"> |
|
|
|
@ -368,15 +361,15 @@
|
|
|
|
|
gameGMGetBazaarActivity, |
|
|
|
|
gameGMUpdateBazaarActivity, |
|
|
|
|
gameGMInsertBazaarActivity, |
|
|
|
|
gameGMInsertBatchBazaarActivity, |
|
|
|
|
gameGMGetModel, |
|
|
|
|
gameGMInsertBatchBazaarActivity |
|
|
|
|
} from '/@/api/game'; |
|
|
|
|
import {random, zeroFill, zero4Fill} from '/@/utils/utils' |
|
|
|
|
import NpcConfigCategory from "/@/api/config/NpcConfigCategory.json"; |
|
|
|
|
import AllItemConfigCategory from "/@/api/config/AllItemConfigCategory.json"; |
|
|
|
|
import StructureConfigCategory from "/@/api/config/StructureConfigCategory.json"; |
|
|
|
|
import RegionConfigCategory from "/@/api/config/RegionConfigCategory.json"; |
|
|
|
|
import {ElLoading, ElMessage} from "element-plus"; |
|
|
|
|
} from '/@/api/game/gameConfig'; |
|
|
|
|
import { random, zeroFill, zero4Fill } from '/@/utils/utils'; |
|
|
|
|
import NpcConfigCategory from '/@/api/config/NpcConfigCategory.json'; |
|
|
|
|
import AllItemConfigCategory from '/@/api/config/AllItemConfigCategory.json'; |
|
|
|
|
import StructureConfigCategory from '/@/api/config/StructureConfigCategory.json'; |
|
|
|
|
import RegionConfigCategory from '/@/api/config/RegionConfigCategory.json'; |
|
|
|
|
import { ElLoading, ElMessage } from 'element-plus'; |
|
|
|
|
|
|
|
|
|
interface TableItemRow { |
|
|
|
|
day: number; |
|
|
|
@ -391,33 +384,33 @@
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
interface TableDataRow { |
|
|
|
|
StartTime: string |
|
|
|
|
Interval: number |
|
|
|
|
times: number |
|
|
|
|
Day: number |
|
|
|
|
dayTime: string |
|
|
|
|
StartTime: string; |
|
|
|
|
Interval: number; |
|
|
|
|
times: number; |
|
|
|
|
Day: number; |
|
|
|
|
dayTime: string; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
interface market { |
|
|
|
|
serverId: number[] |
|
|
|
|
id: number |
|
|
|
|
name: string |
|
|
|
|
title: string |
|
|
|
|
year: number |
|
|
|
|
friday: number |
|
|
|
|
monday: number |
|
|
|
|
date: string |
|
|
|
|
serverId: number[]; |
|
|
|
|
id: number; |
|
|
|
|
name: string; |
|
|
|
|
title: string; |
|
|
|
|
year: number; |
|
|
|
|
friday: number; |
|
|
|
|
monday: number; |
|
|
|
|
date: string; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
interface Auction { |
|
|
|
|
StallId: number |
|
|
|
|
datas: Array<TableDataRow> |
|
|
|
|
items: Array<TableItemRow> |
|
|
|
|
StallId: number; |
|
|
|
|
datas: Array<TableDataRow>; |
|
|
|
|
items: Array<TableItemRow>; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
interface HighPriceRecycle { |
|
|
|
|
StallId: number |
|
|
|
|
Introduce: string |
|
|
|
|
StallId: number; |
|
|
|
|
Introduce: string; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
interface TableDataState { |
|
|
|
@ -463,7 +456,7 @@
|
|
|
|
|
const formRef = ref<HTMLElement | null>(null); |
|
|
|
|
const menuRef = ref(); |
|
|
|
|
const state = reactive<TableDataState>({ |
|
|
|
|
selectModel: "", |
|
|
|
|
selectModel: '', |
|
|
|
|
model: {}, |
|
|
|
|
check: false, |
|
|
|
|
item: { highShow: true, snatchShow: true, show: true, topShow: true, timeShow: true }, |
|
|
|
@ -479,21 +472,21 @@
|
|
|
|
|
listDbs: [], |
|
|
|
|
HighPriceRecycle: { |
|
|
|
|
StallId: 0, |
|
|
|
|
Introduce: "", |
|
|
|
|
Introduce: '', |
|
|
|
|
}, |
|
|
|
|
market: { |
|
|
|
|
serverId: [], |
|
|
|
|
title: "", |
|
|
|
|
name: "", |
|
|
|
|
date: "", |
|
|
|
|
title: '', |
|
|
|
|
name: '', |
|
|
|
|
date: '', |
|
|
|
|
year: 0, |
|
|
|
|
friday: 0, |
|
|
|
|
monday: 0, |
|
|
|
|
id: 0 |
|
|
|
|
id: 0, |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
bazaar: [], |
|
|
|
|
NPC: NpcConfigCategory.filter((r: {Type: number;}) => r.Type == 4), |
|
|
|
|
NPC: NpcConfigCategory.filter((r: { Type: number }) => r.Type == 4), |
|
|
|
|
ItemConfig: AllItemConfigCategory, |
|
|
|
|
fullYears: [], |
|
|
|
|
mondays: [], |
|
|
|
@ -501,17 +494,20 @@
|
|
|
|
|
editProp: ['date', 'name', 'food'], |
|
|
|
|
copyData: {}, |
|
|
|
|
copyItem: {}, |
|
|
|
|
currencyType: [{Id: 1, Name: "铜币"}, {Id: 2, Name: "桃花石"}], |
|
|
|
|
currencyType: [ |
|
|
|
|
{ Id: 1, Name: '铜币' }, |
|
|
|
|
{ Id: 2, Name: '桃花石' }, |
|
|
|
|
], |
|
|
|
|
// week: [{Id: 1, Name: "周一"}, {Id: 2, Name: "周二"}, {Id: 3, Name: "周三"}, {Id: 4, Name: "周四"}, |
|
|
|
|
// {Id: 5, Name: "周五"}, {Id: 6, Name: "周六"}, {Id: 7, Name: "周日"}], |
|
|
|
|
rules: {}, |
|
|
|
|
modelItem: {}, |
|
|
|
|
modelId: "", |
|
|
|
|
modelId: '', |
|
|
|
|
page: 0, |
|
|
|
|
pageSize: 2, |
|
|
|
|
lastDate: 0, |
|
|
|
|
curDate: 0, |
|
|
|
|
Introduce: "", |
|
|
|
|
Introduce: '', |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
const onSubmit = () => { |
|
|
|
@ -525,7 +521,7 @@
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
// console.log("bazaar0:", bazaar); |
|
|
|
|
if(bazaar.Name == "" || bazaar.Title == "" || !bazaar.Year || !bazaar.Date || !bazaar.HighPriceRecycle){ |
|
|
|
|
if (bazaar.Name == '' || bazaar.Title == '' || !bazaar.Year || !bazaar.Date || !bazaar.HighPriceRecycle) { |
|
|
|
|
ElMessage.error('保存失败,请检查表单是否填写完整'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
@ -536,35 +532,39 @@
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!state.market.id) { |
|
|
|
|
gameGMInsertBazaarActivity({bazaar: bazaar}).then((res) => { |
|
|
|
|
gameGMInsertBazaarActivity({ bazaar: bazaar }) |
|
|
|
|
.then((res) => { |
|
|
|
|
if (!res || Number(res.code) != 0) { |
|
|
|
|
ElMessage.success('活动更新失败'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
ElMessage.success('活动更新成功'); |
|
|
|
|
}).finally(() => { |
|
|
|
|
}) |
|
|
|
|
.finally(() => { |
|
|
|
|
totalYearChange(); |
|
|
|
|
totalYearChange1(); |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
gameGMUpdateBazaarActivity({bazaar: bazaar}).then((res) => { |
|
|
|
|
gameGMUpdateBazaarActivity({ bazaar: bazaar }) |
|
|
|
|
.then((res) => { |
|
|
|
|
if (!res || Number(res.code) != 0) { |
|
|
|
|
ElMessage.success('活动更新失败'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
ElMessage.success('活动更新成功'); |
|
|
|
|
}).finally(() => { |
|
|
|
|
}) |
|
|
|
|
.finally(() => { |
|
|
|
|
totalYearChange(); |
|
|
|
|
totalYearChange1(); |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const checkSubmit = () => { |
|
|
|
|
let bazaar = onState(); |
|
|
|
|
console.log("checkSubmit", bazaar); |
|
|
|
|
if(bazaar.Name == "" || bazaar.Title == "" || !bazaar.Year || !bazaar.Date || !bazaar.HighPriceRecycle){ |
|
|
|
|
console.log('checkSubmit', bazaar); |
|
|
|
|
if (bazaar.Name == '' || bazaar.Title == '' || !bazaar.Year || !bazaar.Date || !bazaar.HighPriceRecycle) { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -580,7 +580,7 @@
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const choiceModel = () => { |
|
|
|
|
let mark = state.listDbs.find(dbs => dbs.StringId == state.selectModel); |
|
|
|
|
let mark = state.listDbs.find((dbs) => dbs.StringId == state.selectModel); |
|
|
|
|
if (mark) { |
|
|
|
|
onBazaar(mark); |
|
|
|
|
state.market.id = 0; |
|
|
|
@ -612,19 +612,24 @@
|
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
data.index = index++; |
|
|
|
|
if(new Date().getFullYear() === date.getFullYear() && new Date().getMonth() >= data.month && new Date().getDate() >= data.date && state.market.monday < data.index){ |
|
|
|
|
if ( |
|
|
|
|
new Date().getFullYear() === date.getFullYear() && |
|
|
|
|
new Date().getMonth() >= data.month && |
|
|
|
|
new Date().getDate() >= data.date && |
|
|
|
|
state.market.monday < data.index |
|
|
|
|
) { |
|
|
|
|
state.market.monday = data.index + 1; |
|
|
|
|
} |
|
|
|
|
state.mondays.push(data); |
|
|
|
|
date.setDate(date.getDate() + 1); |
|
|
|
|
} |
|
|
|
|
console.log("state.mondays", state.mondays); |
|
|
|
|
console.log('state.mondays', state.mondays); |
|
|
|
|
}; |
|
|
|
|
onMounted(() => { |
|
|
|
|
let year = new Date().getFullYear(); |
|
|
|
|
state.market.year = year; |
|
|
|
|
for (let i = 0; i < 3; i++) { |
|
|
|
|
state.fullYears.push({value: year + i, label: year + i}) |
|
|
|
|
state.fullYears.push({ value: year + i, label: year + i }); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
getDBModel(); |
|
|
|
@ -635,15 +640,16 @@
|
|
|
|
|
getDBModel(); |
|
|
|
|
}); |
|
|
|
|
var getDBModel = () => { |
|
|
|
|
gameGMGetModel({mType: 0}).then((res) => { |
|
|
|
|
console.log("gameGMGetModel: ", res); |
|
|
|
|
gameGMGetModel({ mType: 0 }) |
|
|
|
|
.then((res) => { |
|
|
|
|
console.log('gameGMGetModel: ', res); |
|
|
|
|
state.stallDbs = res.data.model; |
|
|
|
|
listStall(0) |
|
|
|
|
}).finally(() => { |
|
|
|
|
}); |
|
|
|
|
listStall(0); |
|
|
|
|
}) |
|
|
|
|
.finally(() => {}); |
|
|
|
|
}; |
|
|
|
|
const onEditMarket = (item: string) => { |
|
|
|
|
let bazaar = state.dbs.find(db => db.Date == Number((item.month + 1) + "" + zeroFill(item.date))); |
|
|
|
|
let bazaar = state.dbs.find((db) => db.Date == Number(item.month + 1 + '' + zeroFill(item.date))); |
|
|
|
|
console.log(bazaar); |
|
|
|
|
if (bazaar) { |
|
|
|
|
state.market.monday = item.index; |
|
|
|
@ -652,7 +658,7 @@
|
|
|
|
|
state.market.monday = item.index; |
|
|
|
|
initMarket(); |
|
|
|
|
} |
|
|
|
|
listChoose() |
|
|
|
|
listChoose(); |
|
|
|
|
}; |
|
|
|
|
const onBazaar = (bazaar: any) => { |
|
|
|
|
state.market.id = bazaar._id; |
|
|
|
@ -660,16 +666,15 @@
|
|
|
|
|
state.market.title = bazaar.Title; |
|
|
|
|
state.HighPriceRecycle = { |
|
|
|
|
StallId: bazaar.HighPriceRecycle.StallId, |
|
|
|
|
Introduce: bazaar.HighPriceRecycle.Introduce |
|
|
|
|
Introduce: bazaar.HighPriceRecycle.Introduce, |
|
|
|
|
}; |
|
|
|
|
selectStall(bazaar.HighPriceRecycle.StallId); |
|
|
|
|
|
|
|
|
|
}; |
|
|
|
|
const getCurDate = () => { |
|
|
|
|
for (let i in state.mondays) { |
|
|
|
|
let friday = state.mondays[i]; |
|
|
|
|
if (friday.index == state.market.monday) { |
|
|
|
|
return Number((friday.month + 1) + "" + zeroFill(friday.date)); |
|
|
|
|
return Number(friday.month + 1 + '' + zeroFill(friday.date)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
@ -692,7 +697,7 @@
|
|
|
|
|
HighPriceRecycle: { |
|
|
|
|
StallId: state.HighPriceRecycle.StallId, |
|
|
|
|
Introduce: state.HighPriceRecycle.Introduce, |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
return bazaar; |
|
|
|
@ -835,7 +840,7 @@
|
|
|
|
|
// } |
|
|
|
|
// }; |
|
|
|
|
const weekChange = () => { |
|
|
|
|
state.selectModel = ""; |
|
|
|
|
state.selectModel = ''; |
|
|
|
|
let year = state.market.year; |
|
|
|
|
listChoose(); |
|
|
|
|
gameGMGetBazaarActivity({ Year: year, Date: getCurDate() }).then((res) => { |
|
|
|
@ -849,8 +854,8 @@
|
|
|
|
|
}; |
|
|
|
|
const yearChange = () => { |
|
|
|
|
let year = state.market.year; |
|
|
|
|
console.log("year:", year); |
|
|
|
|
getFriday(new Date(year + "-01-01")); |
|
|
|
|
console.log('year:', year); |
|
|
|
|
getFriday(new Date(year + '-01-01')); |
|
|
|
|
weekChange(); |
|
|
|
|
totalYearChange(); |
|
|
|
|
totalYearChange1(); |
|
|
|
@ -859,48 +864,52 @@
|
|
|
|
|
state.check = false; |
|
|
|
|
|
|
|
|
|
state.market.id = 0; |
|
|
|
|
state.market.title = ""; |
|
|
|
|
state.market.name = ""; |
|
|
|
|
state.market.title = ''; |
|
|
|
|
state.market.name = ''; |
|
|
|
|
state.HighPriceRecycle = { |
|
|
|
|
StallId: 0, |
|
|
|
|
Introduce: "", |
|
|
|
|
Introduce: '', |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
const getType = (item: any) => { |
|
|
|
|
let now = new Date(); |
|
|
|
|
if(state.market.year < now.getFullYear() || |
|
|
|
|
if ( |
|
|
|
|
state.market.year < now.getFullYear() || |
|
|
|
|
(state.market.year == now.getFullYear() && item.month < now.getMonth()) || |
|
|
|
|
(state.market.year == now.getFullYear() && item.month == now.getMonth() && item.date <= now.getDate())){ |
|
|
|
|
return "info"; |
|
|
|
|
(state.market.year == now.getFullYear() && item.month == now.getMonth() && item.date <= now.getDate()) |
|
|
|
|
) { |
|
|
|
|
return 'info'; |
|
|
|
|
} |
|
|
|
|
for (let i in state.dbs) { |
|
|
|
|
let db = state.dbs[i]; |
|
|
|
|
if(db && db.Date && Number((item.month + 1) + "" + zeroFill(item.date)) == db.Date){ |
|
|
|
|
if (db && db.Date && Number(item.month + 1 + '' + zeroFill(item.date)) == db.Date) { |
|
|
|
|
if (now > new Date(db.BeginTime)) { |
|
|
|
|
return "info"; |
|
|
|
|
return 'info'; |
|
|
|
|
} |
|
|
|
|
return ""; |
|
|
|
|
return ''; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return "danger"; |
|
|
|
|
return 'danger'; |
|
|
|
|
}; |
|
|
|
|
const getEffect = (item: any) => { |
|
|
|
|
let now = new Date(); |
|
|
|
|
if(state.market.year < now.getFullYear() || |
|
|
|
|
if ( |
|
|
|
|
state.market.year < now.getFullYear() || |
|
|
|
|
(state.market.year == now.getFullYear() && item.month < now.getMonth()) || |
|
|
|
|
(state.market.year == now.getFullYear() && item.month == now.getMonth() && item.date <= now.getDate())){ |
|
|
|
|
return "dark"; |
|
|
|
|
(state.market.year == now.getFullYear() && item.month == now.getMonth() && item.date <= now.getDate()) |
|
|
|
|
) { |
|
|
|
|
return 'dark'; |
|
|
|
|
} |
|
|
|
|
for (let i in state.dbs) { |
|
|
|
|
let db = state.dbs[i]; |
|
|
|
|
if(db && db.Date && Number((item.month + 1) + "" + zeroFill(item.date)) == db.Date){ |
|
|
|
|
if (db && db.Date && Number(item.month + 1 + '' + zeroFill(item.date)) == db.Date) { |
|
|
|
|
if (now > new Date(db.BeginTime)) { |
|
|
|
|
return "dark"; |
|
|
|
|
return 'dark'; |
|
|
|
|
} |
|
|
|
|
return "plain"; |
|
|
|
|
return 'plain'; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return "dark"; |
|
|
|
|
return 'dark'; |
|
|
|
|
}; |
|
|
|
|
const totalYearChange = () => { |
|
|
|
|
const loading = ElLoading.service({ |
|
|
|
@ -909,15 +918,16 @@
|
|
|
|
|
background: 'rgba(0, 0, 0, 0.7)', |
|
|
|
|
}); |
|
|
|
|
let year = state.market.year; |
|
|
|
|
console.log("year:", year); |
|
|
|
|
gameGMGetBazaarActivity({Year: year}).then((res) => { |
|
|
|
|
console.log('year:', year); |
|
|
|
|
gameGMGetBazaarActivity({ Year: year }) |
|
|
|
|
.then((res) => { |
|
|
|
|
let bazaar = res.data.bazaar || []; |
|
|
|
|
console.log("gameGMGetBazaarActivity:", res); |
|
|
|
|
console.log('gameGMGetBazaarActivity:', res); |
|
|
|
|
state.dbs = bazaar.sort((a: any, b: any) => Number(a.Year + zero4Fill(a.Date)) - Number(b.Year + zero4Fill(b.Date))); |
|
|
|
|
}).finally(() => { |
|
|
|
|
loading.close() |
|
|
|
|
}) |
|
|
|
|
.finally(() => { |
|
|
|
|
loading.close(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
}; |
|
|
|
|
const totalYearChange1 = () => { |
|
|
|
|
const loading = ElLoading.service({ |
|
|
|
@ -926,25 +936,28 @@
|
|
|
|
|
background: 'rgba(0, 0, 0, 0.7)', |
|
|
|
|
}); |
|
|
|
|
let year = state.market.year; |
|
|
|
|
console.log("year:", year); |
|
|
|
|
gameGMGetBazaarActivity({Year: year}).then((res) => { |
|
|
|
|
console.log("gameGMGetBazaarActivity:", res); |
|
|
|
|
console.log('year:', year); |
|
|
|
|
gameGMGetBazaarActivity({ Year: year }) |
|
|
|
|
.then((res) => { |
|
|
|
|
console.log('gameGMGetBazaarActivity:', res); |
|
|
|
|
state.dbs = res.data.bazaar || []; |
|
|
|
|
gameGMGetBazaarActivity({ Year: year - 1 }).then((res) => { |
|
|
|
|
state.listDbs = res.data.bazaar || []; |
|
|
|
|
state.listDbs = state.listDbs.concat(state.dbs).sort((a: any, b: any) => Number(a.Year + a.Date) - Number(b.Year + b.Date)); |
|
|
|
|
console.log("gameGMGetBazaarActivity: state.listDbs ", state.listDbs); |
|
|
|
|
console.log('gameGMGetBazaarActivity: state.listDbs ', state.listDbs); |
|
|
|
|
listChoose(); |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
}).finally(() => { |
|
|
|
|
loading.close() |
|
|
|
|
.finally(() => { |
|
|
|
|
loading.close(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const listChoose = () => { |
|
|
|
|
state.selectModel = ""; |
|
|
|
|
let year = state.market.year, month = 1, date = 1; |
|
|
|
|
state.selectModel = ''; |
|
|
|
|
let year = state.market.year, |
|
|
|
|
month = 1, |
|
|
|
|
date = 1; |
|
|
|
|
for (let i in state.mondays) { |
|
|
|
|
let friday = state.mondays[i]; |
|
|
|
|
if (friday.index == state.market.monday) { |
|
|
|
@ -959,22 +972,35 @@
|
|
|
|
|
} |
|
|
|
|
state.lastDate = Number('' + year + zeroFill(month) + zeroFill(date)); |
|
|
|
|
state.curDate = Number('' + state.market.year + zero4Fill(getCurDate())) + 1; |
|
|
|
|
console.log("listChoose: ",state.lastDate, state.curDate); |
|
|
|
|
console.log('listChoose: ', state.lastDate, state.curDate); |
|
|
|
|
}; |
|
|
|
|
const selectStall = (value: any) => { |
|
|
|
|
console.log("selectStall:", value); |
|
|
|
|
console.log('selectStall:', value); |
|
|
|
|
|
|
|
|
|
let stall = state.stallDbs.find(r => r.StallId == value); |
|
|
|
|
console.log("stall: ", value, state.stallDbs, stall); |
|
|
|
|
let stall = state.stallDbs.find((r) => r.StallId == value); |
|
|
|
|
console.log('stall: ', value, state.stallDbs, stall); |
|
|
|
|
if (!stall) { |
|
|
|
|
return state.HighPriceRecycle.IntroduceItem = ""; |
|
|
|
|
return (state.HighPriceRecycle.IntroduceItem = ''); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
state.HighPriceRecycle.IntroduceItem = `物品:` + (AllItemConfigCategory.find(r => r.Id == stall.ItemId) ? AllItemConfigCategory.find(r => r.Id == stall.ItemId).DetailsPageName:stall.ItemId) + |
|
|
|
|
`;货币:` + (state.currencyType.find(r => r.Id == stall.CurrencyType) ? state.currencyType.find(r => r.Id == stall.CurrencyType).Name:stall.CurrencyType) + |
|
|
|
|
`;价格:` + (stall.Prices && stall.Prices[0]) + `-` + (stall.Prices && stall.Prices[1]) + |
|
|
|
|
`元;数量:` + stall.ItemNum + |
|
|
|
|
`个;这条配置ID是:` + stall.StallId + `。`; |
|
|
|
|
state.HighPriceRecycle.IntroduceItem = |
|
|
|
|
`物品:` + |
|
|
|
|
(AllItemConfigCategory.find((r) => r.Id == stall.ItemId) |
|
|
|
|
? AllItemConfigCategory.find((r) => r.Id == stall.ItemId).DetailsPageName |
|
|
|
|
: stall.ItemId) + |
|
|
|
|
`;货币:` + |
|
|
|
|
(state.currencyType.find((r) => r.Id == stall.CurrencyType) |
|
|
|
|
? state.currencyType.find((r) => r.Id == stall.CurrencyType).Name |
|
|
|
|
: stall.CurrencyType) + |
|
|
|
|
`;价格:` + |
|
|
|
|
(stall.Prices && stall.Prices[0]) + |
|
|
|
|
`-` + |
|
|
|
|
(stall.Prices && stall.Prices[1]) + |
|
|
|
|
`元;数量:` + |
|
|
|
|
stall.ItemNum + |
|
|
|
|
`个;这条配置ID是:` + |
|
|
|
|
stall.StallId + |
|
|
|
|
`。`; |
|
|
|
|
}; |
|
|
|
|
const getMonthList = () => { |
|
|
|
|
let list = []; |
|
|
|
@ -995,17 +1021,18 @@
|
|
|
|
|
return list; |
|
|
|
|
}; |
|
|
|
|
const listStall = (type: number) => { |
|
|
|
|
if(state.stallDbs) state.stallDbs.sort((a, b) => { |
|
|
|
|
if (state.stallDbs) |
|
|
|
|
state.stallDbs.sort((a, b) => { |
|
|
|
|
return a.StallId < b.StallId ? -1 : 1; |
|
|
|
|
}); |
|
|
|
|
state.bazaar = state.stallDbs; |
|
|
|
|
if (!type) { |
|
|
|
|
return |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
state.listModelVisible = true; |
|
|
|
|
state.modelType = type; |
|
|
|
|
if (state.stallDbs) { |
|
|
|
|
state.stalls = state.stallDbs.filter(r => r.Type == type); |
|
|
|
|
state.stalls = state.stallDbs.filter((r) => r.Type == type); |
|
|
|
|
state.stallTotal = state.stalls.length; |
|
|
|
|
state.stalls = state.stalls.slice(state.page * state.pageSize, (state.page + 1) * state.pageSize); |
|
|
|
|
} |
|
|
|
@ -1020,7 +1047,7 @@
|
|
|
|
|
const destroyListData = () => { |
|
|
|
|
state.page = 0; |
|
|
|
|
state.modelType = 0; |
|
|
|
|
state.modelId = ""; |
|
|
|
|
state.modelId = ''; |
|
|
|
|
state.stalls = []; |
|
|
|
|
state.stallTotal = 0; |
|
|
|
|
}; |
|
|
|
@ -1041,47 +1068,55 @@
|
|
|
|
|
background: 'rgba(0, 0, 0, 0.7)', |
|
|
|
|
}); |
|
|
|
|
let bazaars = []; |
|
|
|
|
console.log("----------------mondays----------------", state.mondays); |
|
|
|
|
console.log('----------------mondays----------------', state.mondays); |
|
|
|
|
for (let i in state.mondays) { |
|
|
|
|
let friday = state.mondays[i]; |
|
|
|
|
if (friday) { |
|
|
|
|
if(new Date().getFullYear() > friday.year || new Date().getMonth() > friday.month || (new Date().getMonth() == friday.month && new Date().getDate() > friday.date)){ |
|
|
|
|
console.log("----------------friday----------------", new Date().getMonth(), new Date().getDate(), friday); |
|
|
|
|
if ( |
|
|
|
|
new Date().getFullYear() > friday.year || |
|
|
|
|
new Date().getMonth() > friday.month || |
|
|
|
|
(new Date().getMonth() == friday.month && new Date().getDate() > friday.date) |
|
|
|
|
) { |
|
|
|
|
console.log('----------------friday----------------', new Date().getMonth(), new Date().getDate(), friday); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
let date = Number((friday.month + 1) + "" + zeroFill(friday.date)); |
|
|
|
|
if(state.listDbs.find(r => r.Date == date)){ |
|
|
|
|
console.log("----------------state.listDbs----------------", state.listDbs, date); |
|
|
|
|
let date = Number(friday.month + 1 + '' + zeroFill(friday.date)); |
|
|
|
|
if (state.listDbs.find((r) => r.Date == date)) { |
|
|
|
|
console.log('----------------state.listDbs----------------', state.listDbs, date); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
let bazaar = { |
|
|
|
|
Name: "热闹夜市", |
|
|
|
|
Title: "夕阳西下,夜市灯起,热热闹闹赶集,开开心心购物", |
|
|
|
|
Name: '热闹夜市', |
|
|
|
|
Title: '夕阳西下,夜市灯起,热热闹闹赶集,开开心心购物', |
|
|
|
|
Year: friday.year, |
|
|
|
|
Date: date, |
|
|
|
|
// Week: friday.index, |
|
|
|
|
HighPriceRecycle: {} |
|
|
|
|
HighPriceRecycle: {}, |
|
|
|
|
}; |
|
|
|
|
let index = random(state.stallDbs.length); |
|
|
|
|
let stall = state.stallDbs[index]; |
|
|
|
|
// console.log("--------------------------------", index, bazaar); |
|
|
|
|
bazaar.HighPriceRecycle.StallId = stall.StallId; |
|
|
|
|
bazaar.HighPriceRecycle.Introduce = AllItemConfigCategory.find(r => r.Id == stall.ItemId) ? AllItemConfigCategory.find(r => r.Id == stall.ItemId).Name:stall.ItemId; |
|
|
|
|
bazaar.HighPriceRecycle.Introduce = AllItemConfigCategory.find((r) => r.Id == stall.ItemId) |
|
|
|
|
? AllItemConfigCategory.find((r) => r.Id == stall.ItemId).Name |
|
|
|
|
: stall.ItemId; |
|
|
|
|
|
|
|
|
|
bazaars.push(bazaar); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (bazaars.length > 0) { |
|
|
|
|
console.log("--------------------------------", bazaars); |
|
|
|
|
gameGMInsertBatchBazaarActivity({bazaars: bazaars}).then((res) => { |
|
|
|
|
console.log('--------------------------------', bazaars); |
|
|
|
|
gameGMInsertBatchBazaarActivity({ bazaars: bazaars }) |
|
|
|
|
.then((res) => { |
|
|
|
|
if (!res || Number(res.code) != 0) { |
|
|
|
|
ElMessage.success('活动更新失败'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
ElMessage.success('活动更新成功'); |
|
|
|
|
}).finally(() => { |
|
|
|
|
}) |
|
|
|
|
.finally(() => { |
|
|
|
|
totalYearChange(); |
|
|
|
|
totalYearChange1(); |
|
|
|
|
setTimeout(function () { |
|
|
|
@ -1093,7 +1128,7 @@
|
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
const getZero4Fill = (date: any) => { |
|
|
|
|
return zero4Fill(date) |
|
|
|
|
return zero4Fill(date); |
|
|
|
|
}; |
|
|
|
|
return { |
|
|
|
|
onSubmit, |
|
|
|
|