|
|
@ -89,6 +89,14 @@ |
|
|
@on-change="p => changePage('landmark', p)" size="small" show-total></Page> |
|
|
@on-change="p => changePage('landmark', p)" size="small" show-total></Page> |
|
|
</Row> |
|
|
</Row> |
|
|
</TabPane> |
|
|
</TabPane> |
|
|
|
|
|
<TabPane label="学院配置" name="college"> |
|
|
|
|
|
<Button type="primary" icon="md-add" @click="openOperate('college')" style="margin-bottom:12px">新增学院</Button> |
|
|
|
|
|
<Table border :loading="college.loading" :columns="collegeColumns" :data="college.data"></Table> |
|
|
|
|
|
<Row type="flex" justify="end" class="page"> |
|
|
|
|
|
<Page :current="college.pageNumber" :total="college.total" :page-size="college.pageSize" |
|
|
|
|
|
@on-change="p => changePage('college', p)" size="small" show-total></Page> |
|
|
|
|
|
</Row> |
|
|
|
|
|
</TabPane> |
|
|
<TabPane label="经济审计" name="economy"> |
|
|
<TabPane label="经济审计" name="economy"> |
|
|
<Table border :loading="economy.loading" :columns="economyColumns" :data="economy.data"></Table> |
|
|
<Table border :loading="economy.loading" :columns="economyColumns" :data="economy.data"></Table> |
|
|
<Row type="flex" justify="end" class="page"> |
|
|
<Row type="flex" justify="end" class="page"> |
|
|
@ -97,6 +105,29 @@ |
|
|
</Row> |
|
|
</Row> |
|
|
</TabPane> |
|
|
</TabPane> |
|
|
|
|
|
|
|
|
|
|
|
<TabPane label="松鼠冒险事件" name="adventureEvent"> |
|
|
|
|
|
<Button type="primary" icon="md-add" @click="openAdventureEvent()" style="margin-bottom:12px">新增每日事件</Button> |
|
|
|
|
|
<Table border :loading="adventureEvent.loading" :columns="adventureEventColumns" :data="adventureEvent.data"></Table> |
|
|
|
|
|
<Row type="flex" justify="end" class="page"> |
|
|
|
|
|
<Page :current="adventureEvent.pageNumber" :total="adventureEvent.total" :page-size="adventureEvent.pageSize" |
|
|
|
|
|
@on-change="p => changePage('adventureEvent', p)" size="small" show-total></Page> |
|
|
|
|
|
</Row> |
|
|
|
|
|
</TabPane> |
|
|
|
|
|
<TabPane label="松鼠冒险榜" name="adventureRank"> |
|
|
|
|
|
<Table border :loading="adventureRank.loading" :columns="adventureRankColumns" :data="adventureRank.data"></Table> |
|
|
|
|
|
<Row type="flex" justify="end" class="page"> |
|
|
|
|
|
<Page :current="adventureRank.pageNumber" :total="adventureRank.total" :page-size="adventureRank.pageSize" |
|
|
|
|
|
@on-change="p => changePage('adventureRank', p)" size="small" show-total></Page> |
|
|
|
|
|
</Row> |
|
|
|
|
|
</TabPane> |
|
|
|
|
|
<TabPane label="冒险游戏记录" name="adventureSession"> |
|
|
|
|
|
<Table border :loading="adventureSession.loading" :columns="adventureSessionColumns" :data="adventureSession.data"></Table> |
|
|
|
|
|
<Row type="flex" justify="end" class="page"> |
|
|
|
|
|
<Page :current="adventureSession.pageNumber" :total="adventureSession.total" :page-size="adventureSession.pageSize" |
|
|
|
|
|
@on-change="p => changePage('adventureSession', p)" size="small" show-total></Page> |
|
|
|
|
|
</Row> |
|
|
|
|
|
</TabPane> |
|
|
|
|
|
|
|
|
<!-- 快讯 --> |
|
|
<!-- 快讯 --> |
|
|
<TabPane label="星球快讯" name="news"> |
|
|
<TabPane label="星球快讯" name="news"> |
|
|
<Button type="primary" icon="md-add" @click="openNews()" style="margin-bottom:12px">新增快讯</Button> |
|
|
<Button type="primary" icon="md-add" @click="openNews()" style="margin-bottom:12px">新增快讯</Button> |
|
|
@ -306,6 +337,29 @@ |
|
|
<Button type="primary" @click="saveOperate">保存</Button> |
|
|
<Button type="primary" @click="saveOperate">保存</Button> |
|
|
</div> |
|
|
</div> |
|
|
</Modal> |
|
|
</Modal> |
|
|
|
|
|
|
|
|
|
|
|
<Modal v-model="adventureEventModal" :title="adventureEventForm.id ? '编辑每日宇宙事件' : '新增每日宇宙事件'" :mask-closable="false"> |
|
|
|
|
|
<Form :label-width="110"> |
|
|
|
|
|
<FormItem label="所属校区"><Input v-model="adventureEventForm.regionId" disabled /></FormItem> |
|
|
|
|
|
<FormItem label="事件日期"><DatePicker type="date" v-model="adventureEventForm.eventDate" format="yyyy-MM-dd" style="width:100%" /></FormItem> |
|
|
|
|
|
<FormItem label="事件类型"> |
|
|
|
|
|
<Select v-model="adventureEventForm.eventType"> |
|
|
|
|
|
<Option value="harvest">松子丰收日</Option> |
|
|
|
|
|
<Option value="meteor">流星雨</Option> |
|
|
|
|
|
<Option value="double_score">双倍积分日</Option> |
|
|
|
|
|
<Option value="box_party">宝箱狂欢日</Option> |
|
|
|
|
|
</Select> |
|
|
|
|
|
</FormItem> |
|
|
|
|
|
<FormItem label="名称"><Input v-model="adventureEventForm.name" /></FormItem> |
|
|
|
|
|
<FormItem label="描述"><Input v-model="adventureEventForm.description" type="textarea" /></FormItem> |
|
|
|
|
|
<FormItem label="效果值"><InputNumber v-model="adventureEventForm.effectValue" :min="0" :step="0.1" style="width:100%" /></FormItem> |
|
|
|
|
|
<FormItem label="是否启用"><i-switch v-model="adventureEventForm.enabled" :true-value="1" :false-value="0" /></FormItem> |
|
|
|
|
|
</Form> |
|
|
|
|
|
<div slot="footer"> |
|
|
|
|
|
<Button @click="adventureEventModal=false">取消</Button> |
|
|
|
|
|
<Button type="primary" @click="saveAdventureEvent">保存</Button> |
|
|
|
|
|
</div> |
|
|
|
|
|
</Modal> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
@ -324,7 +378,10 @@ |
|
|
planetSearchPage, planetSearchSave, planetSearchDelete, |
|
|
planetSearchPage, planetSearchSave, planetSearchDelete, |
|
|
planetStaminaPage, planetStaminaSave, planetStaminaDelete, |
|
|
planetStaminaPage, planetStaminaSave, planetStaminaDelete, |
|
|
planetLandmarkPage, planetLandmarkSave, planetLandmarkDelete, |
|
|
planetLandmarkPage, planetLandmarkSave, planetLandmarkDelete, |
|
|
planetEconomyPage |
|
|
planetCollegePage, planetCollegeSave, planetCollegeDelete, |
|
|
|
|
|
planetEconomyPage, |
|
|
|
|
|
planetAdventureEventPage, planetAdventureEventSave, planetAdventureEventDelete, |
|
|
|
|
|
planetAdventureRankPage, planetAdventureSessionPage |
|
|
} from '@/api/planet'; |
|
|
} from '@/api/planet'; |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
@ -347,7 +404,11 @@ |
|
|
search: { loading: false, data: [], total: 0, pageNumber: 1, pageSize: 10 }, |
|
|
search: { loading: false, data: [], total: 0, pageNumber: 1, pageSize: 10 }, |
|
|
stamina: { loading: false, data: [], total: 0, pageNumber: 1, pageSize: 10 }, |
|
|
stamina: { loading: false, data: [], total: 0, pageNumber: 1, pageSize: 10 }, |
|
|
landmark: { loading: false, data: [], total: 0, pageNumber: 1, pageSize: 10 }, |
|
|
landmark: { loading: false, data: [], total: 0, pageNumber: 1, pageSize: 10 }, |
|
|
|
|
|
college: { loading: false, data: [], total: 0, pageNumber: 1, pageSize: 10 }, |
|
|
economy: { loading: false, data: [], total: 0, pageNumber: 1, pageSize: 10 }, |
|
|
economy: { loading: false, data: [], total: 0, pageNumber: 1, pageSize: 10 }, |
|
|
|
|
|
adventureEvent: { loading: false, data: [], total: 0, pageNumber: 1, pageSize: 10 }, |
|
|
|
|
|
adventureRank: { loading: false, data: [], total: 0, pageNumber: 1, pageSize: 10 }, |
|
|
|
|
|
adventureSession: { loading: false, data: [], total: 0, pageNumber: 1, pageSize: 10 }, |
|
|
// 弹窗 |
|
|
// 弹窗 |
|
|
poolModal: false, |
|
|
poolModal: false, |
|
|
poolForm: {}, |
|
|
poolForm: {}, |
|
|
@ -364,12 +425,14 @@ |
|
|
newsForm: {}, |
|
|
newsForm: {}, |
|
|
operateModal: false, |
|
|
operateModal: false, |
|
|
operateType: '', |
|
|
operateType: '', |
|
|
operateForm: {} |
|
|
operateForm: {}, |
|
|
|
|
|
adventureEventModal: false, |
|
|
|
|
|
adventureEventForm: {} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
computed: { |
|
|
computed: { |
|
|
operateTitle() { |
|
|
operateTitle() { |
|
|
const map = { tree: '券树周期', warehouse: '仓库等级', tower: '防御塔等级', search: '搜查规则', stamina: '体力道具', landmark: '校园地标' } |
|
|
const map = { tree: '券树周期', warehouse: '仓库等级', tower: '防御塔等级', search: '搜查规则', stamina: '体力道具', landmark: '校园地标', college: '学院配置' } |
|
|
return (this.operateForm.id ? '编辑' : '新增') + (map[this.operateType] || '经营配置') |
|
|
return (this.operateForm.id ? '编辑' : '新增') + (map[this.operateType] || '经营配置') |
|
|
}, |
|
|
}, |
|
|
operateFields() { |
|
|
operateFields() { |
|
|
@ -432,6 +495,14 @@ |
|
|
{ key: 'settleTime', label: '结算时间' }, |
|
|
{ key: 'settleTime', label: '结算时间' }, |
|
|
{ key: 'sort', label: '排序', type: 'number' }, |
|
|
{ key: 'sort', label: '排序', type: 'number' }, |
|
|
{ key: 'enabled', label: '是否启用', type: 'switch' } |
|
|
{ key: 'enabled', label: '是否启用', type: 'switch' } |
|
|
|
|
|
], |
|
|
|
|
|
college: [ |
|
|
|
|
|
{ key: 'collegeName', label: '学院名称' }, |
|
|
|
|
|
{ key: 'shortName', label: '简称' }, |
|
|
|
|
|
{ key: 'icon', label: '图标/Emoji' }, |
|
|
|
|
|
{ key: 'themeColor', label: '主题色' }, |
|
|
|
|
|
{ key: 'sort', label: '排序', type: 'number' }, |
|
|
|
|
|
{ key: 'enabled', label: '是否启用', type: 'switch' } |
|
|
] |
|
|
] |
|
|
} |
|
|
} |
|
|
return fields[this.operateType] || [] |
|
|
return fields[this.operateType] || [] |
|
|
@ -644,6 +715,17 @@ |
|
|
this.operateActionColumn('landmark') |
|
|
this.operateActionColumn('landmark') |
|
|
] |
|
|
] |
|
|
}, |
|
|
}, |
|
|
|
|
|
collegeColumns() { |
|
|
|
|
|
return [ |
|
|
|
|
|
{ title: '学院名称', key: 'collegeName', minWidth: 150 }, |
|
|
|
|
|
{ title: '简称', key: 'shortName', width: 100 }, |
|
|
|
|
|
{ title: '图标', key: 'icon', width: 90 }, |
|
|
|
|
|
{ title: '主题色', key: 'themeColor', width: 100 }, |
|
|
|
|
|
{ title: '排序', key: 'sort', width: 80 }, |
|
|
|
|
|
{ title: '启用', width: 70, render: (h, p) => this.enabledTag(h, p.row.enabled) }, |
|
|
|
|
|
this.operateActionColumn('college') |
|
|
|
|
|
] |
|
|
|
|
|
}, |
|
|
economyColumns() { |
|
|
economyColumns() { |
|
|
return [ |
|
|
return [ |
|
|
{ title: '日期', key: 'auditDate', width: 120 }, |
|
|
{ title: '日期', key: 'auditDate', width: 120 }, |
|
|
@ -656,6 +738,46 @@ |
|
|
{ title: '活跃持券用户', key: 'activeUserCount', width: 120 }, |
|
|
{ title: '活跃持券用户', key: 'activeUserCount', width: 120 }, |
|
|
{ title: '预警', width: 80, render: (h, p) => h('Tag', { props: { color: p.row.warning === 1 ? 'red' : 'green' } }, p.row.warning === 1 ? '净增' : '平衡') } |
|
|
{ title: '预警', width: 80, render: (h, p) => h('Tag', { props: { color: p.row.warning === 1 ? 'red' : 'green' } }, p.row.warning === 1 ? '净增' : '平衡') } |
|
|
] |
|
|
] |
|
|
|
|
|
}, |
|
|
|
|
|
adventureEventColumns() { |
|
|
|
|
|
return [ |
|
|
|
|
|
{ title: '日期', key: 'eventDate', width: 120 }, |
|
|
|
|
|
{ title: '类型', key: 'eventType', width: 130 }, |
|
|
|
|
|
{ title: '名称', key: 'name', minWidth: 130 }, |
|
|
|
|
|
{ title: '描述', key: 'description', minWidth: 180 }, |
|
|
|
|
|
{ title: '效果值', key: 'effectValue', width: 90 }, |
|
|
|
|
|
{ title: '启用', width: 70, render: (h, p) => this.enabledTag(h, p.row.enabled) }, |
|
|
|
|
|
{ title: '操作', width: 150, align: 'center', render: (h, p) => h('div', [ |
|
|
|
|
|
h('Button', { props: { type: 'text', size: 'small' }, on: { click: () => this.openAdventureEvent(p.row) } }, '编辑'), |
|
|
|
|
|
h('Button', { props: { type: 'text', size: 'small' }, style: { color: '#ed4014' }, on: { click: () => this.delAdventureEvent(p.row) } }, '删除') |
|
|
|
|
|
]) } |
|
|
|
|
|
] |
|
|
|
|
|
}, |
|
|
|
|
|
adventureRankColumns() { |
|
|
|
|
|
return [ |
|
|
|
|
|
{ title: '日期', key: 'rankDate', width: 120 }, |
|
|
|
|
|
{ title: '名次', key: 'rankNo', width: 80 }, |
|
|
|
|
|
{ title: '昵称', key: 'nickname', minWidth: 120 }, |
|
|
|
|
|
{ title: '学院', key: 'college', minWidth: 120 }, |
|
|
|
|
|
{ title: '分数', key: 'score', width: 90 }, |
|
|
|
|
|
{ title: '次数', key: 'playCount', width: 80 }, |
|
|
|
|
|
{ title: '奖励券', key: 'rewardTickets', width: 90 }, |
|
|
|
|
|
{ title: '称号', key: 'titleName', width: 120 }, |
|
|
|
|
|
{ title: '结算', width: 80, render: (h, p) => h('Tag', { props: { color: p.row.settled === 1 ? 'green' : 'orange' } }, p.row.settled === 1 ? '已结算' : '未结算') } |
|
|
|
|
|
] |
|
|
|
|
|
}, |
|
|
|
|
|
adventureSessionColumns() { |
|
|
|
|
|
return [ |
|
|
|
|
|
{ title: '用户', key: 'nickname', minWidth: 120 }, |
|
|
|
|
|
{ title: '日期', key: 'playDate', width: 120 }, |
|
|
|
|
|
{ title: '分数', key: 'score', width: 90 }, |
|
|
|
|
|
{ title: '耗时', key: 'durationSeconds', width: 80 }, |
|
|
|
|
|
{ title: '免费局', width: 80, render: (h, p) => h('span', p.row.freeUsed === 1 ? '是' : '否') }, |
|
|
|
|
|
{ title: '扣券', key: 'costTickets', width: 80 }, |
|
|
|
|
|
{ title: '异常', width: 80, render: (h, p) => h('Tag', { props: { color: p.row.cheatFlag === 'Y' ? 'red' : 'green' } }, p.row.cheatFlag === 'Y' ? '异常' : '正常') }, |
|
|
|
|
|
{ title: '原因', key: 'cheatReason', minWidth: 160 }, |
|
|
|
|
|
{ title: '时间', key: 'createTime', minWidth: 160 } |
|
|
|
|
|
] |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
mounted() { |
|
|
mounted() { |
|
|
@ -689,7 +811,8 @@ |
|
|
draw: this.loadDraw, winner: this.loadWinner, |
|
|
draw: this.loadDraw, winner: this.loadWinner, |
|
|
tree: this.loadTree, warehouse: this.loadWarehouse, tower: this.loadTower, |
|
|
tree: this.loadTree, warehouse: this.loadWarehouse, tower: this.loadTower, |
|
|
search: this.loadSearch, stamina: this.loadStamina, landmark: this.loadLandmark, |
|
|
search: this.loadSearch, stamina: this.loadStamina, landmark: this.loadLandmark, |
|
|
economy: this.loadEconomy |
|
|
college: this.loadCollege, economy: this.loadEconomy, adventureEvent: this.loadAdventureEvent, |
|
|
|
|
|
adventureRank: this.loadAdventureRank, adventureSession: this.loadAdventureSession |
|
|
} |
|
|
} |
|
|
map[name] && map[name]() |
|
|
map[name] && map[name]() |
|
|
}, |
|
|
}, |
|
|
@ -749,7 +872,11 @@ |
|
|
loadSearch() { if (!this.guardRegion('search')) return; this.search.loading = true; planetSearchPage(this.baseParams('search')).then(r => this.fill('search', r)) }, |
|
|
loadSearch() { if (!this.guardRegion('search')) return; this.search.loading = true; planetSearchPage(this.baseParams('search')).then(r => this.fill('search', r)) }, |
|
|
loadStamina() { if (!this.guardRegion('stamina')) return; this.stamina.loading = true; planetStaminaPage(this.baseParams('stamina')).then(r => this.fill('stamina', r)) }, |
|
|
loadStamina() { if (!this.guardRegion('stamina')) return; this.stamina.loading = true; planetStaminaPage(this.baseParams('stamina')).then(r => this.fill('stamina', r)) }, |
|
|
loadLandmark() { if (!this.guardRegion('landmark')) return; this.landmark.loading = true; planetLandmarkPage(this.baseParams('landmark')).then(r => this.fill('landmark', r)) }, |
|
|
loadLandmark() { if (!this.guardRegion('landmark')) return; this.landmark.loading = true; planetLandmarkPage(this.baseParams('landmark')).then(r => this.fill('landmark', r)) }, |
|
|
|
|
|
loadCollege() { if (!this.guardRegion('college')) return; this.college.loading = true; planetCollegePage(this.baseParams('college')).then(r => this.fill('college', r)) }, |
|
|
loadEconomy() { if (!this.guardRegion('economy')) return; this.economy.loading = true; planetEconomyPage(this.baseParams('economy')).then(r => this.fill('economy', r)) }, |
|
|
loadEconomy() { if (!this.guardRegion('economy')) return; this.economy.loading = true; planetEconomyPage(this.baseParams('economy')).then(r => this.fill('economy', r)) }, |
|
|
|
|
|
loadAdventureEvent() { if (!this.guardRegion('adventureEvent')) return; this.adventureEvent.loading = true; planetAdventureEventPage(this.baseParams('adventureEvent')).then(r => this.fill('adventureEvent', r)) }, |
|
|
|
|
|
loadAdventureRank() { if (!this.guardRegion('adventureRank')) return; this.adventureRank.loading = true; planetAdventureRankPage(this.baseParams('adventureRank')).then(r => this.fill('adventureRank', r)) }, |
|
|
|
|
|
loadAdventureSession() { if (!this.guardRegion('adventureSession')) return; this.adventureSession.loading = true; planetAdventureSessionPage(this.baseParams('adventureSession')).then(r => this.fill('adventureSession', r)) }, |
|
|
// ---- 奖池 ---- |
|
|
// ---- 奖池 ---- |
|
|
openPool(row) { |
|
|
openPool(row) { |
|
|
this.poolForm = row ? Object.assign({}, row) : { regionId: this.regionId || '', poolAmount: 88.88, status: 0 } |
|
|
this.poolForm = row ? Object.assign({}, row) : { regionId: this.regionId || '', poolAmount: 88.88, status: 0 } |
|
|
@ -865,7 +992,8 @@ |
|
|
tower: { save: planetTowerSave, del: planetTowerDelete, load: this.loadTower, defaults: { level: 1, interceptRate: 5, damage: 5, counterRate: 2, upgradeCost: 10, enabled: 1 } }, |
|
|
tower: { save: planetTowerSave, del: planetTowerDelete, load: this.loadTower, defaults: { level: 1, interceptRate: 5, damage: 5, counterRate: 2, upgradeCost: 10, enabled: 1 } }, |
|
|
search: { save: planetSearchSave, del: planetSearchDelete, load: this.loadSearch, defaults: { dailyLimit: 3, staminaCost: 30, minGain: 1, maxGain: 3, targetBalanceRate: 0.1, dailyGainLimit: 8, targetProtectMinutes: 30, enabled: 1 } }, |
|
|
search: { save: planetSearchSave, del: planetSearchDelete, load: this.loadSearch, defaults: { dailyLimit: 3, staminaCost: 30, minGain: 1, maxGain: 3, targetBalanceRate: 0.1, dailyGainLimit: 8, targetProtectMinutes: 30, enabled: 1 } }, |
|
|
stamina: { save: planetStaminaSave, del: planetStaminaDelete, load: this.loadStamina, defaults: { name: '松果能量', recoverStamina: 30, costTickets: 2, dailyBuyLimit: 2, sort: 0, enabled: 1 } }, |
|
|
stamina: { save: planetStaminaSave, del: planetStaminaDelete, load: this.loadStamina, defaults: { name: '松果能量', recoverStamina: 30, costTickets: 2, dailyBuyLimit: 2, sort: 0, enabled: 1 } }, |
|
|
landmark: { save: planetLandmarkSave, del: planetLandmarkDelete, load: this.loadLandmark, defaults: { name: '图书馆', icon: 'LIB', benefitType: 'ticket', benefitValue: 5, dailyOutputLimit: 5, openStartTime: '08:00', openEndTime: '22:00', settleTime: '22:00', sort: 0, enabled: 1 } } |
|
|
landmark: { save: planetLandmarkSave, del: planetLandmarkDelete, load: this.loadLandmark, defaults: { name: '图书馆', icon: 'LIB', benefitType: 'ticket', benefitValue: 5, dailyOutputLimit: 5, openStartTime: '08:00', openEndTime: '22:00', settleTime: '22:00', sort: 0, enabled: 1 } }, |
|
|
|
|
|
college: { save: planetCollegeSave, del: planetCollegeDelete, load: this.loadCollege, defaults: { collegeName: '计算机学院', shortName: '计院', icon: '💻', themeColor: '#4FB7FF', sort: 0, enabled: 1 } } |
|
|
}[type] |
|
|
}[type] |
|
|
}, |
|
|
}, |
|
|
openOperate(type, row) { |
|
|
openOperate(type, row) { |
|
|
@ -894,6 +1022,28 @@ |
|
|
onOk: () => api.del(row.id).then(() => { this.$Message.success('删除成功'); api.load() }) |
|
|
onOk: () => api.del(row.id).then(() => { this.$Message.success('删除成功'); api.load() }) |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
openAdventureEvent(row) { |
|
|
|
|
|
this.adventureEventForm = row ? Object.assign({}, row) : { regionId: this.regionId || '', eventDate: new Date(), eventType: 'harvest', name: '松子丰收日', description: '普通松子出现更多', effectValue: 1, enabled: 1 } |
|
|
|
|
|
this.adventureEventModal = true |
|
|
|
|
|
}, |
|
|
|
|
|
saveAdventureEvent() { |
|
|
|
|
|
const form = Object.assign({}, this.adventureEventForm) |
|
|
|
|
|
if (form.eventDate instanceof Date) { |
|
|
|
|
|
const p = n => (n < 10 ? '0' + n : n) |
|
|
|
|
|
form.eventDate = `${form.eventDate.getFullYear()}-${p(form.eventDate.getMonth() + 1)}-${p(form.eventDate.getDate())}` |
|
|
|
|
|
} |
|
|
|
|
|
planetAdventureEventSave(form).then(r => { |
|
|
|
|
|
if (r && r.success) { this.$Message.success('保存成功'); this.adventureEventModal = false; this.loadAdventureEvent() } |
|
|
|
|
|
else { this.$Message.error((r && r.message) || '保存失败') } |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
delAdventureEvent(row) { |
|
|
|
|
|
this.$Modal.confirm({ |
|
|
|
|
|
title: '确认删除', |
|
|
|
|
|
content: '确认删除该每日宇宙事件?', |
|
|
|
|
|
onOk: () => planetAdventureEventDelete(row.id).then(() => { this.$Message.success('删除成功'); this.loadAdventureEvent() }) |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
fmt(d) { |
|
|
fmt(d) { |
|
|
const p = n => (n < 10 ? '0' + n : n) |
|
|
const p = n => (n < 10 ? '0' + n : n) |
|
|
return `${d.getFullYear()}-${p(d.getMonth() + 1)}-${p(d.getDate())} ${p(d.getHours())}:${p(d.getMinutes())}:${p(d.getSeconds())}` |
|
|
return `${d.getFullYear()}-${p(d.getMonth() + 1)}-${p(d.getDate())} ${p(d.getHours())}:${p(d.getMinutes())}:${p(d.getSeconds())}` |
|
|
|