抗战-书房

master
lion 4 months ago
parent ea8a9ca58e
commit e358a99a63

@ -15,6 +15,20 @@
</el-select>
</div>
</div>
</template>
<template v-slot:is_show>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red; font-weight: 600; padding-right: 4px"></span>
反法西斯是否显示
</div>
<div class="xy-table-item-content">
<el-select style="width: 300px" v-model="form.is_show" placeholder="请选择">
<el-option v-for="item in [{id:0,value:'否'},{id:1,value:'是'}]" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:theme_id>
<div class="xy-table-item">
@ -304,7 +318,8 @@
listActivity: [],
listTheme: [],
form: {
activity_list_id: '',
activity_list_id: '',
is_show:0,
theme_id: '',
name: "",
iswx: '',
@ -460,7 +475,8 @@
key: 'time',
name: '开放时间',
value: ''
}]
}],
this.form.is_show = res.is_show?res.is_show:0
this.image_id = res.image ? [{
url: res.image?.url,
name: res.image?.original_name,

@ -0,0 +1,255 @@
<template>
<div>
<lx-header
icon="md-apps"
style="margin-bottom: 10px; border: 0px; margin-top: 15px"
text="文章内容"
>
<div slot="content"></div>
<slot>
<div class="selects">
<div>
<span style="padding: 0 6px; word-break: keep-all"> 关键字 </span>
<Input
v-model="select.keyword"
placeholder="请输入关键字"
style="width: 180px"
clearable
></Input>
</div>
<div v-show="!sysInfo">
<span style="padding: 0 6px; word-break: keep-all"> 项目 </span>
<Select v-model="select.activity_list_id" style="width:200px" @on-change="changeActivity">
<Option v-for="item in listActivity" :value="item.id" :key="item.id">{{ item.name }}</Option>
</Select>
</div>
<Button
v-show="!sysInfo"
style="margin-left: 10px"
type="primary"
@click="select = { page: 1, keyword: '',activity_list_id:'' }"
>重置
</Button>
<Button style="margin-left: 10px" type="primary" @click="doSearch"
>查询</Button
>
<Button
style="margin-left: 10px"
type="primary"
@click="
$refs['addArticle'].setForm(['activity_list_id'],[select.activity_list_id||'']),
$refs['addArticle'].setType('add'),
$refs['addArticle'].setList(listActivity),
$refs['addArticle'].show()
"
>新增</Button
>
</div>
</slot>
</lx-header>
<xy-table
:list="list"
:total="total"
:table-item="table"
@pageSizeChange="pageSizeChange"
@pageIndexChange="pageChange"
>
<template v-slot:btns>
<template>
<el-table-column label="操作" width="260" fixed="right">
<template #default="{ row }">
<Poptip confirm transfer title="确认删除?" @on-ok="deleteitem(row)">
<Button size="small" type="error">删除</Button>
</Poptip>
<Button
size="small"
type="primary"
style="margin-left: 4px"
@click="
$refs['addArticle'].setForm(['activity_list_id'],[row.activity_list_id]);
$refs['addArticle'].setId(row.id);
$refs['addArticle'].setType('editor');
$refs['addArticle'].setList(listActivity)
$refs['addArticle'].show();
"
>编辑</Button
>
</template>
</el-table-column>
</template>
</template>
</xy-table>
<addArticle ref="addArticle" @refresh="load"></addArticle>
</div>
</template>
<script>
import { index, destroy, show } from "@/api/index";
import { index as activityIndex } from "@/api/activity/index";
import addArticle from "@/views/book/components/addArticle.vue";
export default {
components: {
addArticle,
},
data() {
return {
select: {
page: 1,
page_size: 10,
with_relations: ['image'],
table_name: "map_point_image_articles",
activity_list_id: '',
keyword:'',
filter: [],
sort_type:'ASC',
sort_name:'sort'
},
sysInfo:false,
listActivity: [],
typeList:[{id:1,value:'反法西斯战争胜利80周年'},{id:2,value:'文心书房'}],
total: 0,
list: [],
table: [
{
prop: "title",
label: "名称",
minWidth: 220,
align: "left",
},
{
prop: "type",
label: "类型",
minWidth: 220,
align: "left",
customFn: (row) => {
return(
this.typeList.map(item=>{
if(item.id==row.type){
return (<div>{item.value}</div>)
}
})
)
}
},
{
prop: "img",
label: "图片",
minWidth: 200,
align: "center",
customFn: (row) => {
return ( <div><img src={row.image?.url} style = 'width:180px;' /> </div>
)
}
},
{
prop: "created_at",
label: "创建信息",
width: 190,
formatter: (v1, v2, value) => {
return this.$moment(value).format("YYYY-MM-DD HH:mm:ss");
},
},
{
prop: "updated_at",
label: "更新时间",
align: "left",
width: 190,
formatter: (v1, v2, value) => {
return this.$moment(value).format("YYYY-MM-DD HH:mm:ss");
},
},
],
};
},
methods: {
async loadActivity() {
const res = await activityIndex({
page: 1,
page_size: 999,
});
this.listActivity = res.data;
},
doSearch() {
this.select.page = 1;
this.load();
},
pageSizeChange(e) {
this.select.page_size = e;
this.select.page = 1;
this.load();
},
async load() {
if(!this.select.activity_list_id){
this.$message({
type:'warning',
message:'请先选择项目'
})
return
}
const res = await index({
...this.select,
filter:[
{
key:'title',
op:'like',
value:this.select.keyword
}
]
});
this.total = res.total;
this.list = res.data;
},
changeActivity(e){
if(e){
this.select.activity_list_id = e
this.load()
}
},
deleteitem(row) {
destroy({
id: row.id,
activity_list_id: row.activity_list_id,
table_name: this.select.table_name
}).then((res) => {
this.load();
this.$Message.success("操作成功");
});
},
pageChange(e) {
this.select.page = e;
this.load();
},
},
mounted() {
let that = this;
let sysInfo = sessionStorage.getItem('sys_info')
if (sysInfo && sysInfo != "") {
let _sys = JSON.parse(sysInfo);
if(_sys.tag!='h5'){
that.select.activity_list_id = _sys.id;
that.sysInfo=_sys;
}
}
this.load();
},
created() {
let type = parseInt(this.$route.path.split("_")[1] || 0);
this.type = this.select.is_auth = type;
this.loadActivity()
},
};
</script>
<style lang="scss" scoped>
.selects {
display: flex;
flex-wrap: wrap;
& > div {
margin-bottom: 6px;
}
}
</style>

@ -0,0 +1,302 @@
<template>
<div>
<xy-dialog ref="dialog" :is-show.sync="isShow" type="form" :title="type === 'add' ? '新增' : '编辑'"
:form="form" :rules="rules" @submit="submit">
<template v-slot:activity_list_id>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red; font-weight: 600; padding-right: 4px">*</span>
项目
</div>
<div class="xy-table-item-content">
<el-select :disabled="hasActiveId" style="width: 300px" v-model="form.activity_list_id" placeholder="请选择">
<el-option v-for="item in listActivity" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:type>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red; font-weight: 600; padding-right: 4px"></span>
类型
</div>
<div class="xy-table-item-content">
<el-select style="width: 300px" v-model="form.type" placeholder="请选择">
<el-option v-for="item in typeList" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:title>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red; font-weight: 600; padding-right: 4px">*</span>
名称
</div>
<div class="xy-table-item-content">
<el-input v-model="form.title" clearable placeholder="请输入名称" style="width: 300px"></el-input>
</div>
</div>
</template>
<template v-slot:sort>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red; font-weight: 600; padding-right: 4px">*</span>
排序
</div>
<div class="xy-table-item-content">
<el-input v-model="form.sort" clearable placeholder="请输入" style="width: 300px"></el-input>
</div>
</div>
</template>
<template v-slot:image_id>
<div class="xy-table-item">
<div class="xy-table-item-label">封面图 </div>
<div class="xy-table-item-content">
<el-upload style="width: 600px" class="upload-demo" :action="action" :on-success="
(response, file, fileList) =>
successHandle(response, file, fileList, 'image_id')
" :before-upload="uploadBefore" :file-list="image_id" :on-remove="
(file, fileList) => removeHande(file, fileList, 'image_id')
" :limit="1" list-type="picture-card">
<i slot="default" class="el-icon-plus"></i>
<div slot="tip" class="el-upload__tip">
只能上传jpg/png文件且不超过500kb
</div>
</el-upload>
</div>
</div>
</template>
<template v-slot:content>
<div class="xy-table-item">
<div class="xy-table-item-label">内容 </div>
<div class="xy-table-item-content">
<tinymce style="width: 700px;" v-model="form.content"></tinymce>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
show,
save
} from "@/api/index";
import {
index as activityIndex
} from "@/api/activity/index";
import tinymce from "@/components/XyTinymce"
export default {
components: {
tinymce
},
props: {},
data() {
return {
isShow: false,
hasActiveId: false,
id: "",
type: "",
typeList:[{id:1,value:'反法西斯战争胜利80周年'},{id:2,value:'文心书房'}],
image_id: [],
action: process.env.VUE_APP_UPLOAD_API,
video_id: [],
listActivity: [],
form: {
activity_list_id: '',
type:'',
title: "",
sort:'',
image_id: "",
content:''
},
rules: {
title: [{
required: true,
message: "请填写名称",
}],
},
};
},
created() {
},
methods: {
async loadActivity() {
const res = await activityIndex({
page: 1,
page_size: 999,
});
this.listActivity = res.data;
},
show() {
this.isShow = true;
},
hidden() {
this.isShow = false;
},
init() {
for (let key in this.form) {
if (this.form[key] instanceof Array) {
this.form[key] = [];
} else {
this.form[key] = "";
}
}
this.$refs["dialog"].clearValidate();
},
setId(id) {
if (typeof id == "number") {
this.id = id;
} else {
console.error("error typeof id: " + typeof id);
}
},
setList(e) {
if (e) {
this.listActivity = e
} else {
this.loadActivity()
}
},
getId() {
return this.id;
},
setType(type = "add") {
let types = ["add", "editor"];
if (types.includes(type)) {
this.type = type;
} else {
console.warn("Unknown type: " + type);
}
},
setForm(key = [], value = []) {
if (key instanceof Array) {
key.forEach((key, index) => {
this.form[key] = value[index] ?? "";
});
}
if (typeof key === "string") {
this.form[key] = value;
}
if (!key) {
this.init();
}
if (this.form.activity_list_id) {
this.hasActiveId = true
}
},
//
successHandle(response, file, fileList, key) {
this[key] = fileList;
},
removeHande(file, fileList, key) {
console.log("fileList", fileList)
console.log("key", key)
this[key] = fileList;
this.form[key] = "";
},
uploadBefore(file) {
console.log(file);
if (file.size / 1000 > 300 * 1024) {
this.$message({
type: "warning",
message: "上传大小超过300MB",
});
return false;
}
},
async getDetail() {
const res = await show({
id: this.id,
table_name: "map_point_image_articles",
with_relations: ['image']
});
this.$integrateData(this.form, res);
this.form.sort = res.sort?res.sort:0
this.image_id = res.image ? [{
url: res.image?.url,
name: res.image?.original_name,
response: res.image
}] : []
},
submit() {
if (this.type === "add") {
if (this.form.hasOwnProperty("id")) {
delete this.form.id;
}
}
if (this.type === "editor") {
Object.defineProperty(this.form, "id", {
value: this.id,
enumerable: true,
configurable: true,
writable: true,
});
}
this.form.image_id = this.image_id.length == 0 ? "" : (this.image_id[0]?.response?.id);
save(Object.assign(this.form, {
table_name: "map_point_image_articles"
})).then(
(res) => {
this.$message({
type: "success",
message: this.type === "add" ? "新增" : "编辑" + "成功",
});
this.isShow = false;
this.$emit("refresh");
}
);
},
},
watch: {
isShow(val) {
if (val) {
console.log("form", this.form.activity_list_id)
if (this.type === "editor") {
this.getDetail();
}
} else {
this.id = "";
this.type = "";
this.image_id = [];
this.video_id = [];
this.init();
this.$refs["dialog"].clearValidate();
delete this.form.id;
}
},
},
};
</script>
<style scoped lang="scss">
::v-deep .el-input__inner {
text-align: left;
}
.xy-table-item-price-per {
position: relative;
&::after {
position: absolute;
right: 10px;
top: 0;
content: "%";
}
::v-deep .el-input__clear {
position: relative;
right: 46px;
z-index: 2;
}
}
</style>

@ -0,0 +1,322 @@
<template>
<div>
<xy-dialog ref="dialog" :is-show.sync="isShow" type="form" :title="type === 'add' ? '新增' : '编辑'"
:form="form" :rules="rules" @submit="submit">
<template v-slot:activity_list_id>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red; font-weight: 600; padding-right: 4px">*</span>
项目
</div>
<div class="xy-table-item-content">
<el-select :disabled="hasActiveId" style="width: 300px" v-model="form.activity_list_id" placeholder="请选择">
<el-option v-for="item in listActivity" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:type>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red; font-weight: 600; padding-right: 4px"></span>
类型
</div>
<div class="xy-table-item-content">
<el-select style="width: 300px" v-model="form.type" placeholder="请选择">
<el-option v-for="item in typeList" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:title>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red; font-weight: 600; padding-right: 4px">*</span>
名称
</div>
<div class="xy-table-item-content">
<el-input v-model="form.title" clearable placeholder="请输入名称" style="width: 300px"></el-input>
</div>
</div>
</template>
<template v-slot:sort>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red; font-weight: 600; padding-right: 4px">*</span>
排序
</div>
<div class="xy-table-item-content">
<el-input v-model="form.sort" clearable placeholder="请输入" style="width: 300px"></el-input>
</div>
</div>
</template>
<template v-slot:image_id>
<div class="xy-table-item">
<div class="xy-table-item-label">封面图 </div>
<div class="xy-table-item-content">
<el-upload style="width: 600px" class="upload-demo" :action="action" :on-success="
(response, file, fileList) =>
successHandle(response, file, fileList, 'image_id')
" :before-upload="uploadBefore" :file-list="image_id" :on-remove="
(file, fileList) => removeHande(file, fileList, 'image_id')
" :limit="1" list-type="picture-card">
<i slot="default" class="el-icon-plus"></i>
<div slot="tip" class="el-upload__tip">
只能上传jpg/png文件且不超过500kb
</div>
</el-upload>
</div>
</div>
</template>
<template v-slot:video_id>
<div class="xy-table-item">
<div class="xy-table-item-label">视频 </div>
<div class="xy-table-item-content">
<el-upload style="width: 300px" ref="upload" multiple :on-success="
(response, file, fileList) =>
successHandle(response, file, fileList, 'video_id')
" :before-upload="uploadBefore" accept=".mp4,.avi,.wmv,.mp3" :action="action" :file-list="video_id"
:auto-upload="false" :on-remove="
(file, fileList) => removeHande(file, fileList, 'video_id')
">
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
<el-button style="margin-left: 10px" size="small" type="success"
@click="$refs['upload'].submit()">开始上传</el-button>
<div slot="tip" class="el-upload__tip">
支持文件格式.mp4 .avi .wmv .mp3
<br />单个文件不能超过300M
</div>
</el-upload>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
show,
save
} from "@/api/index";
import {
index as activityIndex
} from "@/api/activity/index";
export default {
components: {
},
props: {},
data() {
return {
isShow: false,
hasActiveId: false,
id: "",
type: "",
typeList:[{id:1,value:'反法西斯战争胜利80周年'},{id:2,value:'文心书房'}],
image_id: [],
action: process.env.VUE_APP_UPLOAD_API,
video_id: [],
listActivity: [],
form: {
activity_list_id: '',
type:1,
title: "",
sort:0,
image_id: "",
video_id: "",
},
rules: {
title: [{
required: true,
message: "请填写名称",
}],
},
};
},
created() {
},
methods: {
async loadActivity() {
const res = await activityIndex({
page: 1,
page_size: 999,
});
this.listActivity = res.data;
},
show() {
this.isShow = true;
},
hidden() {
this.isShow = false;
},
init() {
for (let key in this.form) {
if (this.form[key] instanceof Array) {
this.form[key] = [];
} else {
this.form[key] = "";
}
}
this.$refs["dialog"].clearValidate();
},
setId(id) {
if (typeof id == "number") {
this.id = id;
} else {
console.error("error typeof id: " + typeof id);
}
},
setList(e) {
if (e) {
this.listActivity = e
} else {
this.loadActivity()
}
},
getId() {
return this.id;
},
setType(type = "add") {
let types = ["add", "editor"];
if (types.includes(type)) {
this.type = type;
} else {
console.warn("Unknown type: " + type);
}
},
setForm(key = [], value = []) {
if (key instanceof Array) {
key.forEach((key, index) => {
this.form[key] = value[index] ?? "";
});
}
if (typeof key === "string") {
this.form[key] = value;
}
if (!key) {
this.init();
}
if (this.form.activity_list_id) {
this.hasActiveId = true
}
},
//
successHandle(response, file, fileList, key) {
this[key] = fileList;
},
removeHande(file, fileList, key) {
console.log("fileList", fileList)
console.log("key", key)
this[key] = fileList;
this.form[key] = "";
},
uploadBefore(file) {
console.log(file);
if (file.size / 1000 > 300 * 1024) {
this.$message({
type: "warning",
message: "上传大小超过300MB",
});
return false;
}
},
async getDetail() {
const res = await show({
id: this.id,
table_name: "map_point_videos",
with_relations: ['video', 'image']
});
this.$integrateData(this.form, res);
this.form.sort = res.sort?res.sort:0
this.image_id = res.image ? [{
url: res.image?.url,
name: res.image?.original_name,
response: res.image
}] : []
this.video_id = res.video ? [{
url: res.video?.url,
name: res.video?.original_name,
response: res.video
}] : []
},
submit() {
if (this.type === "add") {
if (this.form.hasOwnProperty("id")) {
delete this.form.id;
}
}
if (this.type === "editor") {
Object.defineProperty(this.form, "id", {
value: this.id,
enumerable: true,
configurable: true,
writable: true,
});
}
this.form.image_id = this.image_id.length == 0 ? "" : (this.image_id[0]?.response?.id);
this.form.video_id = this.video_id.length == 0 ? "" : (this.video_id[0]?.response?.id);
save(Object.assign(this.form, {
table_name: "map_point_videos"
})).then(
(res) => {
this.$message({
type: "success",
message: this.type === "add" ? "新增" : "编辑" + "成功",
});
this.isShow = false;
this.$emit("refresh");
}
);
},
},
watch: {
isShow(val) {
if (val) {
console.log("form", this.form.activity_list_id)
if (this.type === "editor") {
this.getDetail();
}
} else {
this.id = "";
this.type = "";
this.image_id = [];
this.video_id = [];
this.init();
this.$refs["dialog"].clearValidate();
delete this.form.id;
}
},
},
};
</script>
<style scoped lang="scss">
::v-deep .el-input__inner {
text-align: left;
}
.xy-table-item-price-per {
position: relative;
&::after {
position: absolute;
right: 10px;
top: 0;
content: "%";
}
::v-deep .el-input__clear {
position: relative;
right: 46px;
z-index: 2;
}
}
</style>

@ -0,0 +1,254 @@
<template>
<div>
<lx-header
icon="md-apps"
style="margin-bottom: 10px; border: 0px; margin-top: 15px"
text="视频内容"
>
<div slot="content"></div>
<slot>
<div class="selects">
<div>
<span style="padding: 0 6px; word-break: keep-all"> 关键字 </span>
<Input
v-model="select.keyword"
placeholder="请输入关键字"
style="width: 180px"
clearable
></Input>
</div>
<div v-show="!sysInfo">
<span style="padding: 0 6px; word-break: keep-all"> 项目 </span>
<Select v-model="select.activity_list_id" style="width:200px" @on-change="changeActivity">
<Option v-for="item in listActivity" :value="item.id" :key="item.id">{{ item.name }}</Option>
</Select>
</div>
<Button
v-show="!sysInfo"
style="margin-left: 10px"
type="primary"
@click="select = { page: 1, keyword: '',activity_list_id:'' }"
>重置
</Button>
<Button style="margin-left: 10px" type="primary" @click="doSearch"
>查询</Button
>
<Button
style="margin-left: 10px"
type="primary"
@click="
$refs['addVideo'].setForm(['activity_list_id'],[select.activity_list_id||'']),
$refs['addVideo'].setType('add'),
$refs['addVideo'].setList(listActivity),
$refs['addVideo'].show()
"
>新增</Button
>
</div>
</slot>
</lx-header>
<xy-table
:list="list"
:total="total"
:table-item="table"
@pageSizeChange="pageSizeChange"
@pageIndexChange="pageChange"
>
<template v-slot:btns>
<template>
<el-table-column label="操作" width="260" fixed="right">
<template #default="{ row }">
<Poptip confirm transfer title="确认删除?" @on-ok="deleteitem(row)">
<Button size="small" type="error">删除</Button>
</Poptip>
<Button
size="small"
type="primary"
style="margin-left: 4px"
@click="
$refs['addVideo'].setForm(['activity_list_id'],[row.activity_list_id]);
$refs['addVideo'].setId(row.id);
$refs['addVideo'].setType('editor');
$refs['addVideo'].setList(listActivity)
$refs['addVideo'].show();
"
>编辑</Button
>
</template>
</el-table-column>
</template>
</template>
</xy-table>
<addVideo ref="addVideo" @refresh="load"></addVideo>
</div>
</template>
<script>
import { index, destroy, show } from "@/api/index";
import { index as activityIndex } from "@/api/activity/index";
import addVideo from "@/views/book/components/addVideo.vue";
export default {
components: {
addVideo,
},
data() {
return {
select: {
page: 1,
page_size: 10,
with_relations: ['video','image'],
table_name: "map_point_videos",
activity_list_id: '',
keyword:'',
filter: [],
sort_type:'ASC',
sort_name:'sort'
},
sysInfo:false,
listActivity: [],
total: 0,
list: [],
typeList:[{id:1,value:'反法西斯战争胜利80周年'},{id:2,value:'文心书房'}],
table: [
{
prop: "title",
label: "名称",
minWidth: 220,
align: "left",
},
{
prop: "type",
label: "类型",
minWidth: 220,
align: "left",
customFn: (row) => {
return(
this.typeList.map(item=>{
if(item.id==row.type){
return (<div>{item.value}</div>)
}
})
)
}
},
{
prop: "img",
label: "图片",
minWidth: 200,
align: "center",
customFn: (row) => {
return ( <div><img src={row.image?.url} style = 'width:180px;' /> </div>
)
}
},
{
prop: "created_at",
label: "创建信息",
width: 190,
formatter: (v1, v2, value) => {
return this.$moment(value).format("YYYY-MM-DD HH:mm:ss");
},
},
{
prop: "updated_at",
label: "更新时间",
align: "left",
width: 190,
formatter: (v1, v2, value) => {
return this.$moment(value).format("YYYY-MM-DD HH:mm:ss");
},
},
],
};
},
methods: {
async loadActivity() {
const res = await activityIndex({
page: 1,
page_size: 999,
});
this.listActivity = res.data;
},
doSearch() {
this.select.page = 1;
this.load();
},
pageSizeChange(e) {
this.select.page_size = e;
this.select.page = 1;
this.load();
},
async load() {
if(!this.select.activity_list_id){
this.$message({
type:'warning',
message:'请先选择项目'
})
return
}
const res = await index({
...this.select,
filter:[
{
key:'title',
op:'like',
value:this.select.keyword
}
]
});
this.total = res.total;
this.list = res.data;
},
changeActivity(e){
if(e){
this.select.activity_list_id = e
this.load()
}
},
deleteitem(row) {
destroy({
id: row.id,
activity_list_id: row.activity_list_id,
table_name: this.select.table_name
}).then((res) => {
this.load();
this.$Message.success("操作成功");
});
},
pageChange(e) {
this.select.page = e;
this.load();
},
},
mounted() {
let that = this;
let sysInfo = sessionStorage.getItem('sys_info')
if (sysInfo && sysInfo != "") {
let _sys = JSON.parse(sysInfo);
if(_sys.tag!='h5'){
that.select.activity_list_id = _sys.id;
that.sysInfo=_sys;
}
}
this.load();
},
created() {
let type = parseInt(this.$route.path.split("_")[1] || 0);
this.type = this.select.is_auth = type;
this.loadActivity()
},
};
</script>
<style lang="scss" scoped>
.selects {
display: flex;
flex-wrap: wrap;
& > div {
margin-bottom: 6px;
}
}
</style>
Loading…
Cancel
Save