|
@@ -2,24 +2,27 @@
|
|
|
<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" @onSubmit="search" @toReset="toClose"></search-1>
|
|
|
- </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"
|
|
|
- >
|
|
|
- </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" @onSubmit="search" @toReset="toClose"></search-1>
|
|
|
+ </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"
|
|
|
+ >
|
|
|
+ </data-table>
|
|
|
+ </el-col>
|
|
|
+ </span>
|
|
|
+ <detail v-if="view === 'info'" :id="id" @toBack="toBack"></detail>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
@@ -35,10 +38,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' }],
|
|
|
fields: [
|
|
@@ -51,7 +56,6 @@ export default {
|
|
|
searchForm: {},
|
|
|
// 多选值
|
|
|
selected: [],
|
|
|
- shop: {},
|
|
|
};
|
|
|
},
|
|
|
async created() {
|
|
@@ -61,6 +65,7 @@ export default {
|
|
|
methods: {
|
|
|
...dictData({ getDict: 'query' }),
|
|
|
...goods(['query', 'delete', 'fetch', 'update', 'create']),
|
|
|
+ // 查询
|
|
|
async search({ skip = 0, limit = this.$limit, ...info } = {}) {
|
|
|
let condition = _.cloneDeep(this.searchForm);
|
|
|
let res = await this.query({ skip, limit, ...condition, ...info });
|
|
@@ -71,7 +76,12 @@ export default {
|
|
|
},
|
|
|
// 修改
|
|
|
async toEdit({ data }) {
|
|
|
- this.$router.push({ path: '/platmanag/goodsRate/detail', query: { id: data.id } });
|
|
|
+ this.$set(this, `id`, data.id);
|
|
|
+ this.$set(this, `view`, 'info');
|
|
|
+ },
|
|
|
+
|
|
|
+ toBack() {
|
|
|
+ this.view = 'list';
|
|
|
},
|
|
|
// 重置
|
|
|
toClose() {
|