行走红色苏州路线 区域

master
lion 2 years ago
parent cb56fab956
commit ff8458415c

@ -0,0 +1,320 @@
<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 style="width: 300px" @change="changeActive" 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:name>
<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.name" clearable placeholder="请输入名称" style="width: 300px"></el-input>
</div>
</div>
</template>
<template v-slot:pointer_list>
<div class="xy-table-item">
<div class="xy-table-item-label">点位 </div>
<div class="xy-table-item-content">
<el-select v-model="form.pointer_list" style="width: 300px" multiple placeholder="请选择">
<el-option
v-for="item in listPointer"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</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: 300px" 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">
<el-input v-model="form.content" style="width: 300px" type="textarea"></el-input>
<!-- <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 { index as pointerIndex } from "@/api/index";
import tinymce from "@/components/XyTinymce"
export default {
components: {
tinymce
},
props: {},
data() {
return {
isShow: false,
id: "",
type: "",
image_id: [],
action: process.env.VUE_APP_UPLOAD_API,
listActivity:[],
listPointer:[],
form: {
activity_list_id: '',
name: "",
pointer_list:[],
image_id: "",
content: "",
},
rules: {
name: [{
required: true,
message: "请填写名称",
}, ],
},
};
},
created(){
// this.loadActivity()
},
methods: {
async load() {
if(!this.form.activity_list_id){
this.$message({
type:'warning',
message:'请先选择项目,获取点位'
})
return
}
const res =await pointerIndex({
page: 1,
page_size: 999,
table_name: "map_points",
activity_list_id: this.form.activity_list_id,
});
this.listPointer = res.data;
},
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()
}
},
changeActive(e){
if(e){
this.form.activity_list_id = e
this.load()
}
},
setActivityId(e){
if(e){
this.form.activity_list_id = e
console.log("123")
this.load()
}
},
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();
}
},
//
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: "circuits",
with_relations: ['image']
});
this.$integrateData(this.form, res);
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: "circuits"
})).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.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>

@ -19,6 +19,24 @@
</el-select>
</div>
</div>
</template>
<template v-slot:theme_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 style="width: 300px" v-model="form.theme_id" placeholder="请选择">
<el-option
v-for="item in listTheme"
:key="item.id"
:label="item.value"
:value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:name>
<div class="xy-table-item">
@ -30,6 +48,42 @@
<el-input v-model="form.name" clearable placeholder="请输入名称" style="width: 300px"></el-input>
</div>
</div>
</template>
<template v-slot:iswx>
<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-radio-group v-model="form.iswx">
<el-radio label="是"></el-radio>
<el-radio label="否"></el-radio>
</el-radio-group>
</div>
</div>
</template>
<template v-slot:appId>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red; font-weight: 600; padding-right: 4px"></span>
小程序appId
</div>
<div class="xy-table-item-content">
<el-input v-model="form.appId" clearable placeholder="请输入小程序appId" style="width: 300px"></el-input>
</div>
</div>
</template>
<template v-slot:path>
<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.path" clearable placeholder="请输入小程序路径" style="width: 300px"></el-input>
</div>
</div>
</template>
<template v-slot:image_id>
<div class="xy-table-item">
@ -153,7 +207,8 @@
save
} from "@/api/index";
import { index as activityIndex } from "@/api/activity/index";
import tinymce from "@/components/XyTinymce"
import tinymce from "@/components/XyTinymce"
import {getparameteritem} from "@/api/system/dictionary.js"
export default {
components: {
tinymce
@ -168,10 +223,15 @@
video_image_id: [],
action: process.env.VUE_APP_UPLOAD_API,
video_id: [],
listActivity:[],
listActivity:[],
listTheme:[],
form: {
activity_list_id: '',
name: "",
activity_list_id: '',
theme_id:'',
name: "",
iswx:'',
appId:'',
path:'',
image_id: "",
lat: "",
lng: "",
@ -189,6 +249,11 @@
}, ],
},
};
},
created(){
// this.loadActivity()
this.getTheme()
},
methods: {
async loadActivity() {
@ -197,6 +262,11 @@
page_size: 999,
});
this.listActivity = res.data;
},
getTheme(){
getparameteritem('theme').then(res=>{
this.listTheme = res.detail
})
},
show() {
this.isShow = true;
@ -220,6 +290,13 @@
} else {
console.error("error typeof id: " + typeof id);
}
},
setList(e){
if(e){
this.listActivity = e
}else{
this.loadActivity()
}
},
getId() {
return this.id;
@ -325,9 +402,7 @@
);
},
},
created(){
this.loadActivity()
},
watch: {
isShow(val) {
if (val) {

@ -0,0 +1,226 @@
<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"
></Input>
</div>
<div>
<span style="padding: 0 6px; word-break: keep-all"> 项目 </span>
<Select v-model="select.activity_list_id" style="width:200px">
<Option v-for="item in listActivity" :value="item.id" :key="item.id">{{ item.name }}</Option>
</Select>
</div>
<Button
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['addLine'].setActivityId(select.activity_list_id),
$refs['addLine'].setType('add'),
$refs['addLine'].setList(listActivity),
$refs['addLine'].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['addLine'].setActivityId(select.activity_list_id)
$refs['addLine'].setId(row.id)
$refs['addLine'].setType('editor')
$refs['addLine'].setList(listActivity)
$refs['addLine'].show()
"
>编辑</Button
>
</template>
</el-table-column>
</template>
</template>
</xy-table>
<addLine ref="addLine" @refresh="load"></addLine>
</div>
</template>
<script>
import { index, destroy, show } from "@/api/index";
import { index as activityIndex } from "@/api/activity/index";
import addLine from "@/views/PartyshistoryRecoder/components/addLine.vue";
export default {
components: {
addLine
},
data() {
return {
select: {
page: 1,
page_size: 10,
table_name: "circuits",
with_relations: ['image'],
activity_list_id: '',
filter: [],
},
listActivity: [],
total: 0,
list: [],
table: [
{
prop: "name",
label: "名称",
minWidth: 220,
align: "left",
},
{
prop: "img",
label: "图片",
minWidth: 200,
align: "center",
customFn: (row) => {
return ( <div><img src={row.image?.url} style = 'width:180px;' /> </div>
)
}
},
{
prop: "name",
label: "简介",
minWidth: 220,
align: "left",
},
// {
// prop: "pointers",
// 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);
this.total = res.total;
this.list = res.data;
},
deleteitem(row) {
destroy({
id: row.id,
activity_list_id: row.activity_list_id,
table_name: 'circuits'
}).then((res) => {
this.load();
this.$Message.success("操作成功");
});
},
pageChange(e) {
this.select.page = e;
this.load();
},
},
mounted() {
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>

@ -36,7 +36,10 @@
style="margin-left: 10px"
type="primary"
@click="
$refs['addPointer'].setForm(['activity_list_id'],[select.activity_list_id||'']),$refs['addPointer'].setType('add'), $refs['addPointer'].show()
$refs['addPointer'].setForm(['activity_list_id'],[select.activity_list_id||'']),
$refs['addPointer'].setType('add'),
$refs['addPointer'].setList(listActivity),
$refs['addPointer'].show()
"
>新增</Button
>
@ -67,6 +70,7 @@
$refs['addPointer'].setForm(['activity_list_id'],[row.activity_list_id]);
$refs['addPointer'].setId(row.id);
$refs['addPointer'].setType('editor');
$refs['addPointer'].setList(listActivity)
$refs['addPointer'].show();
"
>编辑</Button

@ -1,7 +1,39 @@
<template>
<div>
<div class="boxlist">
<div class="box box1">
<div class="boxlist">
<div class="box box1">
<div class="boxtitle">
<span>百步芳草与理同行-通安党员冬训</span>
<!-- <i class="el-icon-data-line statIcon"></i> -->
</div>
<div class="bline"></div>
<div class="boxcontentsubtitle"></div>
<div class="boxcontent">
<div class="boxcontentitem">
<div class="boxcontentitem-big">
<!-- {{totaldata.business.server_money_total}} -->
</div>
<div style="display: flex;justify-content: space-around;align-items: baseline;">
<div class="boxcontentitem-small">
<span></span>
<span>今日</span>
<span>历史</span>
</div>
<div class="boxcontentitem-small">
<span>页面浏览量</span>
<span>14879</span>
<span>50789</span>
</div>
<div class="boxcontentitem-small">
<span>IP</span>
<span>12567</span>
<span>49385</span>
</div>
</div>
</div>
</div>
</div>
<!-- <div class="box box1">
<div class="boxtitle">
<span>营业统计</span>
<i class="el-icon-data-line statIcon"></i>
@ -25,9 +57,9 @@
</div>
</div>
</div>
</div>
</div> -->
<div class="box box2">
<!-- <div class="box box2">
<div class="boxtitle">
<span>人效统计</span>
@ -54,9 +86,9 @@
</div>
</div>
</div>
</div>
</div> -->
<div class="box box3">
<!-- <div class="box box3">
<div class="boxtitle">
<span>客户统计</span>
<i class="el-icon-s-custom statIcon"></i>
@ -80,9 +112,9 @@
</div>
</div>
</div>
</div>
</div> -->
<div class="box box4">
<!-- <div class="box box4">
<div class="boxtitle">
<span>订单统计</span>
@ -106,7 +138,7 @@
</div>
</div>
</div>
</div>
</div> -->
</div>
</div>
</template>
@ -187,13 +219,17 @@
.boxcontentitem-small {
font-size: 16px;
display: flex;
flex-direction: column;
flex-direction: column;
span{
margin-bottom:15px;
font-size:25px;
}
}
.box {
position: relative;
width: 33%;
width: 100%;
margin-left: 0.5%;
margin-right: 0.5%;
margin-bottom: 2.375rem;
@ -222,7 +258,7 @@
}
.boxtitle {
font-size: 20px;
font-size: 25px;
font-family: Source Han Sans CN;
font-weight: 400;
color: #FFFFFF;

@ -1,16 +1,21 @@
<template>
<div>
<div class="statistics">
<!-- <div>百步芳草与理同行-通安党员冬训</div> -->
<panel-group :totaldata="totaldata" />
</div>
<div>
</div>
</div>
</template>
<script>
import PanelGroup from './components/PanelGroup'
export default {
components: {
PanelGroup
},
data() {
return {
@ -19,6 +24,7 @@
business_data: [],
collect_data: [],
list: {},
totaldata:{},
customerArr: [],
orderArr: [],
chartData: {},

Loading…
Cancel
Save