Browse Source

Merge branch 'master' of ssh://101.201.226.163:50022/binbin0314/datang-admin

master
song 3 years ago
parent
commit
a19971be5d
  1. 14
      src/api/otherPage.js
  2. 7
      src/router/menus/others.js
  3. 29
      src/views/lists/form.vue
  4. 85
      src/views/lists/index.vue

14
src/api/otherPage.js

@ -0,0 +1,14 @@
import request from '@/utils/request'
const constant = '/back/constant'
/**
* 获取其他常量列表
*/
export function GET_LIST(params) {
return request({
url: `${constant}/list`,
method: 'post',
data: params
}).then(res => res.data)
}

7
src/router/menus/others.js

@ -5,6 +5,13 @@ const others = {
component: Layout, component: Layout,
meta: {title: '其他', icon: 'dingdan', noCache: true, affix: false}, meta: {title: '其他', icon: 'dingdan', noCache: true, affix: false},
children: [ children: [
{
path: '/others0',
code: '9904',
component: () => import('@/views/lists/index'),
name: '页面配置',
meta: {title: '页面配置', noCache: false, affix: false},
},
{ {
path: '/others1', path: '/others1',
code: '9902', code: '9902',

29
src/views/lists/form.vue

@ -1,14 +1,17 @@
<template> <template>
<div class="form-container"> <div class="form-container">
<el-form :inline="true" :model="formInline" class="demo-form-inline"> <el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item label="场地"> <el-form-item label="类别">
<el-select v-model="formInline.locationId" value="" placeholder="场地"> <el-select v-model="formInline.locationId" value="" placeholder="场地">
<el-option label="全部" value=""></el-option> <el-option label="全部" value=""></el-option>
<el-option v-for="item in locationId" :label="item.name" :value="item.id"></el-option> <el-option label="其他链接" value="otherLink"></el-option>
<el-option label="漂浮窗" value="piaochuang"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="描述">
<el-input v-model="formInline.distribution" placeholder="描述" />
</el-form-item>
<el-form-item style="padding-left:30px"> <el-form-item style="padding-left:30px">
<el-button type="default" @click="resetForm1('formInline')">重置</el-button>
<el-button type="primary" @click="onSubmit">查询</el-button> <el-button type="primary" @click="onSubmit">查询</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -16,38 +19,22 @@
</template> </template>
<script> <script>
import {GET_LOCATIONS} from '@/api/common'
export default { export default {
name: 'form-container', name: 'form-container',
props: ['label'], props: ['label'],
data() { data() {
return { return {
formInline: { formInline: {
locationId: '' locationId: '',
distribution: '',
}, },
locationId: '' locationId: ''
} }
}, },
mounted() {
this.getLocationId();
},
methods: { methods: {
getLocationId() {
GET_LOCATIONS().then(res => {
this.locationId = res
})
},
onSubmit() { onSubmit() {
this.$emit('submit', this.formInline) this.$emit('submit', this.formInline)
}, },
resetForm1() {
this.formInline = {
name: ''
};
this.$emit('resetForm');
}
} }
} }
</script> </script>

85
src/views/lists/index.vue

@ -12,42 +12,30 @@
<img :src="lists.row.image" width="70" height="70" alt=""> <img :src="lists.row.image" width="70" height="70" alt="">
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="name" label="名称">
prop="name"
label="名称">
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="locationName" label="场地地址">
prop="locationName"
label="场地地址">
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="users" label="分润人数">
prop="users"
label="分润人数">
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="stateText" label="状态">
prop="stateText"
label="状态">
</el-table-column> </el-table-column>
<el-table-column fixed="right" label="操作">
<el-table-column
fixed="right"
label="操作"
>
<template slot-scope="lists"> <template slot-scope="lists">
<span <span
type="text" type="text"
size="small" size="small"
class="option-span" class="option-span"
@click="suspensionOfRelease(lists.row.id,lists.row.enabled)" @click="suspensionOfRelease(lists.row.id,lists.row.enabled)"
> >
<span>{{lists.row.enabled==true?"暂停":"发布"}}</span> <span>{{lists.row.enabled==true?"暂停":"发布"}}</span>
</span> </span>
<span <span
type="text" type="text"
size="small" size="small"
style="margin: 0 5px;" style="margin: 0 5px;"
class="option-span" class="option-span"
@click="editModal(lists.row.id)" @click="editModal(lists.row.id)"
> >
<span>编辑</span> <span>编辑</span>
</span> </span>
@ -56,20 +44,21 @@
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination <el-pagination
background background
:page-size="params.size" :page-size="params.size"
layout="prev, pager, next" layout="prev, pager, next"
:total="count" :total="count"
@current-change="currentChange" @current-change="currentChange"
> >
</el-pagination> </el-pagination>
</div> </div>
</div> </div>
<el-dialog <el-dialog
width="400px" width="400px"
:show-close="false" :show-close="false"
:visible.sync="isEdit"> :visible.sync="isEdit"
>
<details-of-distribution ref="distribution" :currId="id" v-if="isEdit"></details-of-distribution> <details-of-distribution ref="distribution" :currId="id" v-if="isEdit"></details-of-distribution>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="isEdit = false">取消</el-button> <el-button @click="isEdit = false">取消</el-button>
@ -83,13 +72,7 @@
<script> <script>
const FormContainer = () => import('./form.vue'); const FormContainer = () => import('./form.vue');
const DetailsOfDistribution = () => import('./detailsOfDistribution.vue'); const DetailsOfDistribution = () => import('./detailsOfDistribution.vue');
import { import { GET_LIST } from '@/api/otherPage';
GET_FIELD_LIST,
POST_FIELD_LIST,
ENABLE_FIELD_LIST,
DISABLE_FIELD_LIST,
COUNT_FIELD_LIST
} from '@/api/distribution'
import Alert from "@/utils/alert"; import Alert from "@/utils/alert";
import {pageSize} from '../../config'; import {pageSize} from '../../config';
@ -120,6 +103,7 @@
this.params = { this.params = {
...this.params, ...this.params,
locationId: res.locationId, locationId: res.locationId,
description: res.description,
}; };
this.getList() this.getList()
}, },
@ -132,18 +116,15 @@
this.getList() this.getList()
}, },
getList() { getList() {
GET_FIELD_LIST(this.params).then(res => { GET_LIST(this.params).then(res => {
res.map((item) => { console.log('res: ', res);
item.stateText = item.enabled ? '生效中' : '失效中'; // res.map((item) => {
item.locationName = item.province + item.city + item.district + item.name; // item.stateText = item.enabled ? '' : '';
return item // item.locationName = item.province + item.city + item.district + item.name;
}); // return item
this.lists = res // });
// this.lists = res
}); });
COUNT_FIELD_LIST(this.params).then(res => {
this.count = res
})
}, },
/** /**

Loading…
Cancel
Save