Commit fb421d8e by crushh

update: dist

parent 25ac2d36
......@@ -72,6 +72,14 @@ let gameApi = {
method: 'post',
url: '/game-config/get-game-template-list'
},
initTemplate: {
method: 'post',
url: '/game-config/init-template'
},
batchupdateTemplateSort: {
method: 'post',
url: '/game-config/batch-Update-Template-sort'
},
updateTemplateStatus: '/game-config/update-template-status'
};
......
......@@ -59,7 +59,7 @@ export const routes = [
component: _import('activity', 'template-list')
},
{
path: 'template-detail/:id',
path: 'template-detail/:type',
name: '新建游戏模板',
component: _import('activity', 'template-detail')
}
......
......@@ -44,6 +44,18 @@
.w140{
width: 140px;
}
.pl20{
padding-left: 20px;
}
.pt10{
padding-top: 10px;
}
.pb10{
padding-bottom: 10px;
}
.border-bottom{
border-bottom: 1px solid #E4E7ED;
}
.image-tip {
margin: 6px 0 14px;
font-size: 12px;
......
......@@ -39,7 +39,7 @@ const request = (opt, params) => {
return new Promise((resolve, reject) => {
axios(requestConfig).then(res => {
let resp = res.data;
if (resp.errorCode != 0) {
if (resp.errorCode != 0 && resp.code != 0) {
Message({
message: resp.message || '未知错误',
type: 'warning'
......
......@@ -27,45 +27,9 @@ console.log(fetch);
export default {
data() {
return {
list: [
{
templateType: 1,
configNum: 18
},
{
templateType: 2,
configNum: 18
},
{
templateType: 3,
configNum: 0
},
{
templateType: 4,
configNum: 18
},
{
templateType: 5,
configNum: 18
},
{
templateType: 6,
configNum: 18
},
{
templateType: 7,
configNum: 18
}
],
list: [],
typeMap: {
1: '盲盒1',
2: '盲盒2',
3: '盲盒3',
4: '盲盒4',
5: '盲盒5',
6: '盲盒6',
7: '盲盒7'
1: '盲盒'
}
};
},
......@@ -75,7 +39,8 @@ export default {
methods: {
getList() {
fetch.getGameTemplateConfig().then((res) => {
console.log(res);
const { result } = res;
this.list = result;
});
}
}
......
<template>
<div style="padding: 20px">
<el-row type="flex" justify="space-between">
<el-row type="flex" align="middle" style="margin-right: 10px">
<el-input @change="getList" placeholder="请输入模板名称" prefix-icon="el-icon-search" v-model="searchParams.templateName" clearable style="width: 260px; margin-right: 10px"> </el-input>
<el-select v-model="searchParams.statusFlag" clearable placeholder="模板状态" @change="getList">
<el-option v-for="item in categoryList" :key="item" :label="item" :value="item.activityCategoryId"> </el-option>
</el-select>
<div>
<div class="pt10 pb10 pl20 border-bottom">
<el-breadcrumb separator-class="el-icon-arrow-right">
<el-breadcrumb-item :to="{ path: '/activity/template-config' }">营销游戏配置</el-breadcrumb-item>
<el-breadcrumb-item>模板列表</el-breadcrumb-item>
</el-breadcrumb>
</div>
<div style="padding: 20px">
<el-row type="flex" justify="space-between">
<el-row type="flex" align="middle" style="margin-right: 10px">
<el-input @change="getList" placeholder="请输入模板名称" prefix-icon="el-icon-search" v-model="searchParams.templateName" clearable style="width: 260px; margin-right: 10px"> </el-input>
<el-select v-model="searchParams.statusFlag" clearable placeholder="模板状态" @change="getList">
<el-option v-for="item in statusList" :key="item.label" :label="item.label" :value="item.val"> </el-option>
</el-select>
</el-row>
<el-row type="flex" align="middle">
<el-button type="primary" @click="addTemplate()">新增模板</el-button>
</el-row>
</el-row>
<el-row type="flex" align="middle">
<el-button type="primary" @click="addTemplate()">新增模板</el-button>
</el-row>
</el-row>
<el-table row-key="sort" ref="sortTable" row-class-name="table-row" :data="list" style="margin-top: 20px" v-loading="loading">
<el-table-column width="40" label-class-name="tag-head">
<template>
<el-tooltip placement="top" content="拖动排序" trigger="hover" effect="dark" popper-class="drag-tooltip">
<i class="iconfont-components3 icon-cp-tuozhuaipaixu deactive" />
</el-tooltip>
</template>
</el-table-column>
<el-table-column label="模板名称" min-width="290px" prop="templateName"> </el-table-column>
<el-table-column label="展示数量" min-width="310px" prop="prizeMax"> </el-table-column>
<el-table-column label="模板状态" min-width="306px" prop="statusFlag">
<template slot-scope="{ row }">
<el-switch v-model="row.statusFlag" @change="handleSwitch(row.statusFlag, row.templateId)" :active-value="1" :inactive-value="0"></el-switch>
</template>
</el-table-column>
<el-table-column label="操作" min-width="255px">
<template slot-scope="{ row }">
<el-row type="flex">
<el-button type="text" @click="edit(row)">编辑</el-button>
</el-row>
</template>
</el-table-column>
</el-table>
<el-table row-key="sort" ref="sortTable" row-class-name="table-row" :data="list" style="margin-top: 20px" v-loading="loading">
<el-table-column width="40" label-class-name="tag-head">
<template>
<el-tooltip placement="top" content="拖动排序" trigger="hover" effect="dark" popper-class="drag-tooltip">
<i class="iconfont-components3 icon-cp-tuozhuaipaixu deactive" />
</el-tooltip>
</template>
</el-table-column>
<el-table-column label="模板名称" min-width="290px" prop="templateName"> </el-table-column>
<el-table-column label="展示数量" min-width="310px" prop="prizeMax"> </el-table-column>
<el-table-column label="模板状态" min-width="306px" prop="statusFlag">
<template slot-scope="{ row }">
<el-switch v-model="row.statusFlag" @change="handleSwitch(row.statusFlag, row.templateId)" :active-value="1" :inactive-value="0"></el-switch>
</template>
</el-table-column>
<el-table-column label="操作" min-width="255px">
<template slot-scope="{ row }">
<el-row type="flex">
<el-button type="text" @click="edit(row)">编辑</el-button>
</el-row>
</template>
</el-table-column>
</el-table>
</div>
</div>
</template>
......@@ -48,21 +56,15 @@ export default {
statusFlag: ''
},
loading: false,
list: [
{
statusFlag: 0,
prizeMax: 9,
templateName: '盲盒11111'
},
list: [],
statusList: [
{
statusFlag: 1,
prizeMax: 9,
templateName: '盲盒2222'
label: '关闭',
val: 0
},
{
statusFlag: 0,
prizeMax: 8,
templateName: '盲盒3333'
label: '开启',
val: 1
}
]
};
......@@ -77,7 +79,8 @@ export default {
fetch
.getGameTemplatList(this.searchParams)
.then((res) => {
console.log(res);
const { result } = res;
this.list = result;
})
.finally((_) => {
this.loading = false;
......@@ -112,10 +115,23 @@ export default {
sort.option('sort', isSortIcon);
},
onEnd({ newIndex, oldIndex }) {
const currRow = that.list.splice(oldIndex, 1)[0];
that.list.splice(newIndex, 0, currRow);
console.log(newIndex);
// const currRow = that.list.splice(oldIndex, 1)[0];
// that.list.splice(newIndex, 0, currRow);
const arr = that.list.map((item, index) => {
return { sort: index, templateId: item.templateId };
});
console.log(arr);
// that.batchupdateTemplateSort({ sort: newIndex, templateId: currRow.templateId });
that.batchupdateTemplateSort(arr);
}
});
},
batchupdateTemplateSort(arr) {
fetch.batchupdateTemplateSort(arr).then((res) => {
console.log(res);
this.getList();
});
}
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment