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. 53
      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,
meta: {title: '其他', icon: 'dingdan', noCache: true, affix: false},
children: [
{
path: '/others0',
code: '9904',
component: () => import('@/views/lists/index'),
name: '页面配置',
meta: {title: '页面配置', noCache: false, affix: false},
},
{
path: '/others1',
code: '9902',

29
src/views/lists/form.vue

@ -1,14 +1,17 @@
<template>
<div class="form-container">
<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-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-form-item>
<el-form-item label="描述">
<el-input v-model="formInline.distribution" placeholder="描述" />
</el-form-item>
<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-form-item>
</el-form>
@ -16,38 +19,22 @@
</template>
<script>
import {GET_LOCATIONS} from '@/api/common'
export default {
name: 'form-container',
props: ['label'],
data() {
return {
formInline: {
locationId: ''
locationId: '',
distribution: '',
},
locationId: ''
}
},
mounted() {
this.getLocationId();
},
methods: {
getLocationId() {
GET_LOCATIONS().then(res => {
this.locationId = res
})
},
onSubmit() {
this.$emit('submit', this.formInline)
},
resetForm1() {
this.formInline = {
name: ''
};
this.$emit('resetForm');
}
}
}
</script>

53
src/views/lists/index.vue

@ -12,27 +12,15 @@
<img :src="lists.row.image" width="70" height="70" alt="">
</template>
</el-table-column>
<el-table-column
prop="name"
label="名称">
<el-table-column prop="name" label="名称">
</el-table-column>
<el-table-column
prop="locationName"
label="场地地址">
<el-table-column prop="locationName" label="场地地址">
</el-table-column>
<el-table-column
prop="users"
label="分润人数">
<el-table-column prop="users" label="分润人数">
</el-table-column>
<el-table-column
prop="stateText"
label="状态">
<el-table-column prop="stateText" label="状态">
</el-table-column>
<el-table-column
fixed="right"
label="操作"
>
<el-table-column fixed="right" label="操作">
<template slot-scope="lists">
<span
type="text"
@ -69,7 +57,8 @@
<el-dialog
width="400px"
:show-close="false"
:visible.sync="isEdit">
:visible.sync="isEdit"
>
<details-of-distribution ref="distribution" :currId="id" v-if="isEdit"></details-of-distribution>
<div slot="footer" class="dialog-footer">
<el-button @click="isEdit = false">取消</el-button>
@ -83,13 +72,7 @@
<script>
const FormContainer = () => import('./form.vue');
const DetailsOfDistribution = () => import('./detailsOfDistribution.vue');
import {
GET_FIELD_LIST,
POST_FIELD_LIST,
ENABLE_FIELD_LIST,
DISABLE_FIELD_LIST,
COUNT_FIELD_LIST
} from '@/api/distribution'
import { GET_LIST } from '@/api/otherPage';
import Alert from "@/utils/alert";
import {pageSize} from '../../config';
@ -120,6 +103,7 @@
this.params = {
...this.params,
locationId: res.locationId,
description: res.description,
};
this.getList()
},
@ -132,18 +116,15 @@
this.getList()
},
getList() {
GET_FIELD_LIST(this.params).then(res => {
res.map((item) => {
item.stateText = item.enabled ? '生效中' : '失效中';
item.locationName = item.province + item.city + item.district + item.name;
return item
GET_LIST(this.params).then(res => {
console.log('res: ', res);
// res.map((item) => {
// item.stateText = item.enabled ? '' : '';
// 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