|
@@ -2,28 +2,31 @@
|
|
|
<div id="index">
|
|
|
<el-row>
|
|
|
<el-col :span="24" class="main animate__animated animate__backInRight">
|
|
|
- <el-col :span="24" class="one"> <span>首页广告图标设置</span> </el-col>
|
|
|
- <el-col :span="24" class="two">
|
|
|
- <search-1 :form="searchForm" :typeList="typeList" @onSubmit="search" @toReset="toClose"></search-1>
|
|
|
- </el-col>
|
|
|
- <el-col :span="24" class="thr">
|
|
|
- <el-button type="primary" size="mini" @click="toAdd()">新增</el-button>
|
|
|
- </el-col>
|
|
|
- <el-col :span="24" class="four">
|
|
|
- <data-table
|
|
|
- :select="true"
|
|
|
- :selected="selected"
|
|
|
- @handleSelect="handleSelect"
|
|
|
- :fields="fields"
|
|
|
- :opera="opera"
|
|
|
- @query="search"
|
|
|
- :data="list"
|
|
|
- :total="total"
|
|
|
- @edit="toEdit"
|
|
|
- @del="toDel"
|
|
|
- >
|
|
|
- </data-table>
|
|
|
- </el-col>
|
|
|
+ <span v-show="view === 'list'">
|
|
|
+ <el-col :span="24" class="one"> <span>首页广告图标设置</span> </el-col>
|
|
|
+ <el-col :span="24" class="two">
|
|
|
+ <search-1 :form="searchForm" :typeList="typeList" @onSubmit="search" @toReset="toClose"></search-1>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="thr">
|
|
|
+ <el-button type="primary" size="mini" @click="toAdd()">新增</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="four">
|
|
|
+ <data-table
|
|
|
+ :select="true"
|
|
|
+ :selected="selected"
|
|
|
+ @handleSelect="handleSelect"
|
|
|
+ :fields="fields"
|
|
|
+ :opera="opera"
|
|
|
+ @query="search"
|
|
|
+ :data="list"
|
|
|
+ :total="total"
|
|
|
+ @edit="toEdit"
|
|
|
+ @del="toDel"
|
|
|
+ >
|
|
|
+ </data-table>
|
|
|
+ </el-col>
|
|
|
+ </span>
|
|
|
+ <detail v-if="view === 'info'" :id="id" @toBack="toBack"></detail>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
@@ -39,10 +42,12 @@ export default {
|
|
|
props: {},
|
|
|
components: {
|
|
|
search1: () => import('./parts/search-1.vue'),
|
|
|
+ detail: () => import('./detail.vue'),
|
|
|
},
|
|
|
data: function () {
|
|
|
const that = this;
|
|
|
return {
|
|
|
+ view: 'list',
|
|
|
// 列表
|
|
|
opera: [
|
|
|
{ label: '修改', method: 'edit' },
|
|
@@ -80,6 +85,7 @@ export default {
|
|
|
typeList: [],
|
|
|
// 是否使用
|
|
|
statusList: [],
|
|
|
+ id: '',
|
|
|
};
|
|
|
},
|
|
|
async created() {
|
|
@@ -90,7 +96,7 @@ export default {
|
|
|
...dictData({ dictQuery: 'query' }),
|
|
|
...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
|
|
|
// 查询
|
|
|
- async search({ skip = 0,limit = this.$limit, ...info } = {}) {
|
|
|
+ async search({ skip = 0, limit = this.$limit, ...info } = {}) {
|
|
|
const condition = _.cloneDeep(this.searchForm);
|
|
|
let res = await this.query({ skip, limit, ...condition, ...info });
|
|
|
if (this.$checkRes(res)) {
|
|
@@ -100,11 +106,15 @@ export default {
|
|
|
},
|
|
|
// 新增
|
|
|
toAdd() {
|
|
|
- this.$router.push({ path: '/platSettings/indexModule/detail' });
|
|
|
+ this.$set(this, `view`, 'info');
|
|
|
},
|
|
|
// 修改
|
|
|
async toEdit({ data }) {
|
|
|
- this.$router.push({ path: '/platSettings/indexModule/detail', query: { id: data.id } });
|
|
|
+ this.$set(this, `id`, data.id);
|
|
|
+ this.$set(this, `view`, 'info');
|
|
|
+ },
|
|
|
+ toBack() {
|
|
|
+ this.view = 'list';
|
|
|
},
|
|
|
// 删除
|
|
|
async toDel({ data }) {
|