master
parent
a8be4c2720
commit
d553fa8f1b
@ -1,140 +1,142 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<Drawer width="46" title="图片集合" :closable="false" v-model="drawer">
|
<Drawer width="46" title="图片集合" :closable="false" v-model="drawer">
|
||||||
<Button
|
<Button @click="
|
||||||
@click="
|
$refs['addImg'].setForm(
|
||||||
$refs['addImg'].setForm(
|
['map_point_id', 'activity_list_id'],
|
||||||
['map_point_id', 'activity_list_id'],
|
[select.filter[0].value, 7]
|
||||||
[select.filter[0].value, 7]
|
),
|
||||||
),
|
$refs['addImg'].setType('add'),
|
||||||
$refs['addImg'].setType('add'),
|
$refs['addImg'].show()
|
||||||
$refs['addImg'].show()
|
">新增</Button>
|
||||||
"
|
|
||||||
>新增</Button
|
<xy-table style="margin-top: 20px" :total="total" :list="list" :table-item="talbe" :is-page="false"
|
||||||
>
|
@pageSizeChange="pageSizeChange" @pageIndexChange="pageChange" @delete="row => destroy({
|
||||||
|
table_name: 'map_point_images',
|
||||||
<xy-table
|
id: row.id,
|
||||||
style="margin-top: 20px"
|
activity_list_id: 7
|
||||||
:total="total"
|
}).then(_ => getList())" @editor="
|
||||||
:list="list"
|
(row) => {
|
||||||
:table-item="talbe"
|
$refs['addImg'].setForm(
|
||||||
:is-page="false"
|
['map_point_id', 'activity_list_id'],
|
||||||
@pageSizeChange="pageSizeChange"
|
[select.filter[0].value, 7]
|
||||||
@pageIndexChange="pageChange"
|
);
|
||||||
@delete="row => destroy({
|
$refs['addImg'].setId(row.id);
|
||||||
table_name: 'map_point_images',
|
$refs['addImg'].setType('editor');
|
||||||
id: row.id,
|
$refs['addImg'].show();
|
||||||
activity_list_id: 7
|
}
|
||||||
}).then(_ => getList())"
|
">
|
||||||
@editor="
|
</xy-table>
|
||||||
(row) => {
|
</Drawer>
|
||||||
$refs['addImg'].setForm(
|
|
||||||
['map_point_id', 'activity_list_id'],
|
<add-img ref="addImg" @refresh="getList"></add-img>
|
||||||
[select.filter[0].value, 7]
|
</div>
|
||||||
);
|
</template>
|
||||||
$refs['addImg'].setId(row.id);
|
|
||||||
$refs['addImg'].setType('editor');
|
<script>
|
||||||
$refs['addImg'].show();
|
import {
|
||||||
}
|
index,
|
||||||
"
|
destroy
|
||||||
>
|
} from "@/api/index";
|
||||||
</xy-table>
|
|
||||||
</Drawer>
|
import addImg from "./addImg.vue";
|
||||||
|
export default {
|
||||||
<add-img ref="addImg" @refresh="getList"></add-img>
|
components: {
|
||||||
</div>
|
addImg,
|
||||||
</template>
|
},
|
||||||
|
data() {
|
||||||
<script>
|
return {
|
||||||
import { index, destroy } from "@/api/index";
|
drawer: false,
|
||||||
|
select: {
|
||||||
import addImg from "./addImg.vue";
|
page: 1,
|
||||||
export default {
|
page_size: 999,
|
||||||
components: {
|
activity_list_id: 7,
|
||||||
addImg,
|
table_name: "map_point_images",
|
||||||
},
|
with_relations:["image"],
|
||||||
data() {
|
filter: [{
|
||||||
return {
|
key: "map_point_id",
|
||||||
drawer: false,
|
value: 7,
|
||||||
select: {
|
op: "eq",
|
||||||
page: 1,
|
}, ],
|
||||||
page_size: 999,
|
},
|
||||||
activity_list_id: 7,
|
total: 0,
|
||||||
table_name: "map_point_images",
|
list: [],
|
||||||
filter: [
|
talbe: [{
|
||||||
{
|
prop: "name",
|
||||||
key: "map_point_id",
|
label: "标题",
|
||||||
value: 7,
|
minWidth: 220,
|
||||||
op: "eq",
|
align: "left",
|
||||||
},
|
},
|
||||||
],
|
|
||||||
},
|
{
|
||||||
total: 0,
|
prop: "img",
|
||||||
list: [],
|
label: "图片",
|
||||||
talbe: [
|
minWidth: 130,
|
||||||
{
|
align: "center",
|
||||||
prop: "name",
|
customFn: (row) => {
|
||||||
label: "标题",
|
return ( <div><img src={row.image?.url} style = 'width:120px;' /> </div>
|
||||||
minWidth: 220,
|
)
|
||||||
align: "left",
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
prop: "created_at",
|
|
||||||
label: "创建信息",
|
{
|
||||||
width: 190,
|
prop: "created_at",
|
||||||
formatter: (v1, v2, value) => {
|
label: "创建信息",
|
||||||
return this.$moment(value).format("YYYY-MM-DD HH:mm:ss");
|
width: 190,
|
||||||
},
|
formatter: (v1, v2, value) => {
|
||||||
},
|
return this.$moment(value).format("YYYY-MM-DD HH:mm:ss");
|
||||||
{
|
},
|
||||||
prop: "updated_at",
|
},
|
||||||
label: "更新时间",
|
{
|
||||||
align: "left",
|
prop: "updated_at",
|
||||||
width: 190,
|
label: "更新时间",
|
||||||
formatter: (v1, v2, value) => {
|
align: "left",
|
||||||
return this.$moment(value).format("YYYY-MM-DD HH:mm:ss");
|
width: 190,
|
||||||
},
|
formatter: (v1, v2, value) => {
|
||||||
},
|
return this.$moment(value).format("YYYY-MM-DD HH:mm:ss");
|
||||||
],
|
},
|
||||||
};
|
},
|
||||||
},
|
],
|
||||||
methods: {
|
};
|
||||||
destroy,
|
},
|
||||||
show() {
|
methods: {
|
||||||
this.drawer = true;
|
destroy,
|
||||||
},
|
show() {
|
||||||
hidden() {
|
this.drawer = true;
|
||||||
this.drawer = false;
|
},
|
||||||
},
|
hidden() {
|
||||||
setMapPointId(value) {
|
this.drawer = false;
|
||||||
this.select.filter[0].value = value;
|
},
|
||||||
},
|
setMapPointId(value) {
|
||||||
|
this.select.filter[0].value = value;
|
||||||
async getList() {
|
},
|
||||||
const res = await index(this.select);
|
|
||||||
this.total = res.total;
|
async getList() {
|
||||||
this.list = res.data;
|
const res = await index(this.select);
|
||||||
},
|
this.total = res.total;
|
||||||
|
this.list = res.data;
|
||||||
pageSizeChange(e) {
|
},
|
||||||
this.select.page_size = e;
|
|
||||||
this.select.page = 1;
|
pageSizeChange(e) {
|
||||||
this.getList();
|
this.select.page_size = e;
|
||||||
},
|
this.select.page = 1;
|
||||||
pageChange(e) {
|
this.getList();
|
||||||
this.select.page = e
|
},
|
||||||
this.getList()
|
pageChange(e) {
|
||||||
},
|
this.select.page = e
|
||||||
},
|
this.getList()
|
||||||
computed: {},
|
},
|
||||||
watch: {
|
},
|
||||||
drawer(newVal) {
|
computed: {},
|
||||||
if (newVal) {
|
watch: {
|
||||||
this.getList();
|
drawer(newVal) {
|
||||||
}
|
if (newVal) {
|
||||||
},
|
this.getList();
|
||||||
},
|
}
|
||||||
};
|
},
|
||||||
</script>
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss"></style>
|
<style scoped lang="scss"></style>
|
||||||
|
|||||||
Loading…
Reference in new issue