点位 二维码

master
lion 2 years ago
parent 191b29a2dc
commit 9c48fabd68

@ -1,42 +1,34 @@
<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: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>
: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: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">
@ -48,66 +40,84 @@
<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="1"></el-radio>
<el-radio :label="0"></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:logo_id>
<div class="xy-table-item">
<div class="xy-table-item-label">logo(100*100) </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, 'logo_id')
" :before-upload="uploadBefore" :file-list="logo_id" :on-remove="
(file, fileList) => removeHande(file, fileList, 'logo_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: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="1"></el-radio>
<el-radio :label="0"></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:qrcode_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, 'qrcode_id')
" :before-upload="uploadBefore" :file-list="qrcode_id" :on-remove="
(file, fileList) => removeHande(file, fileList, 'qrcode_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:logo_id>
<div class="xy-table-item">
<div class="xy-table-item-label">logo(100*100) </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, 'logo_id')
" :before-upload="uploadBefore" :file-list="logo_id" :on-remove="
(file, fileList) => removeHande(file, fileList, 'logo_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: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="
<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="
@ -206,49 +216,49 @@
</el-upload>
</div>
</div>
</template>
<template v-slot:config>
<div class="xy-table-item">
<div class="xy-table-item-label">配置 </div>
<div class="xy-table-item-content">
<div class="table-tree">
<div style="display: flex;justify-content: flex-end;margin-right: 20px;margin-bottom: 10px;">
<Button type="primary" @click="addRow()" size="small" style="margin-left: 10px;" ghost>新增参数</Button>
</div>
<el-table :data="form.config" height="200" class="v-table" style="width: 100%;margin-bottom: 20px;">
<el-table-column type="index" align="center">
</el-table-column>
<el-table-column prop="key" label="标识" width="120">
<template slot-scope="scope">
<el-input v-model="scope.row.key">
</el-input>
</template>
</el-table-column>
<el-table-column prop="name" label="名称" width="120">
<template slot-scope="scope">
<el-input v-model="scope.row.name">
</el-input>
</template>
</el-table-column>
<el-table-column prop="value" label="数据值" width="280">
<template slot-scope="scope">
<el-input v-model="scope.row.value">
</el-input>
</template>
</el-table-column>
<el-table-column label="操作" width="100" align="center">
<template slot-scope="scope">
<Button type="error" @click="delRow(scope.row,scope.$index)" size="small" style="margin-left: 10px;"
ghost>删除</Button>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
</template>
<template v-slot:config>
<div class="xy-table-item">
<div class="xy-table-item-label">配置 </div>
<div class="xy-table-item-content">
<div class="table-tree">
<div style="display: flex;justify-content: flex-end;margin-right: 20px;margin-bottom: 10px;">
<Button type="primary" @click="addRow()" size="small" style="margin-left: 10px;" ghost>新增参数</Button>
</div>
<el-table :data="form.config" height="200" class="v-table" style="width: 100%;margin-bottom: 20px;">
<el-table-column type="index" align="center">
</el-table-column>
<el-table-column prop="key" label="标识" width="120">
<template slot-scope="scope">
<el-input v-model="scope.row.key">
</el-input>
</template>
</el-table-column>
<el-table-column prop="name" label="名称" width="120">
<template slot-scope="scope">
<el-input v-model="scope.row.name">
</el-input>
</template>
</el-table-column>
<el-table-column prop="value" label="数据值" width="280">
<template slot-scope="scope">
<el-input v-model="scope.row.value">
</el-input>
</template>
</el-table-column>
<el-table-column label="操作" width="100" align="center">
<template slot-scope="scope">
<Button type="error" @click="delRow(scope.row,scope.$index)" size="small" style="margin-left: 10px;"
ghost>删除</Button>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
</template>
<template v-slot:content>
<div class="xy-table-item">
@ -266,10 +276,14 @@
import {
show,
save
} from "@/api/index";
import { index as activityIndex } from "@/api/activity/index";
import tinymce from "@/components/XyTinymce"
import {getparameteritem} from "@/api/system/dictionary.js"
} from "@/api/index";
import {
index as activityIndex
} from "@/api/activity/index";
import tinymce from "@/components/XyTinymce"
import {
getparameteritem
} from "@/api/system/dictionary.js"
export default {
components: {
tinymce
@ -277,25 +291,27 @@
props: {},
data() {
return {
isShow: false,
hasActiveId:false,
isShow: false,
hasActiveId: false,
id: "",
type: "",
image_id: [],
logo_id:[],
image_id: [],
logo_id: [],
qrcode_id: [],
video_image_id: [],
action: process.env.VUE_APP_UPLOAD_API,
video_id: [],
listActivity:[],
listTheme:[],
listActivity: [],
listTheme: [],
form: {
activity_list_id: '',
theme_id:'',
name: "",
iswx:'',
appid:'',
path:'',
logo_id:'',
activity_list_id: '',
theme_id: '',
name: "",
iswx: '',
appid: '',
path: '',
logo_id: '',
qrcode_id: '',
image_id: "",
lat: "",
lng: "",
@ -303,15 +319,15 @@
y: "",
jiaodu: "",
video_id: "",
video_image_id: "",
config:[{
key:'address',
name:'详细地址',
value:''
},{
key:'time',
name:'开放时间',
value:''
video_image_id: "",
config: [{
key: 'address',
name: '详细地址',
value: ''
}, {
key: 'time',
name: '开放时间',
value: ''
}],
content: "",
},
@ -322,24 +338,24 @@
}, ],
},
};
},
created(){
// this.loadActivity()
this.getTheme()
},
methods: {
async loadActivity() {
const res = await activityIndex({
page: 1,
page_size: 999,
});
this.listActivity = res.data;
},
getTheme(){
getparameteritem('theme').then(res=>{
this.listTheme = res.detail
})
created() {
// this.loadActivity()
this.getTheme()
},
methods: {
async loadActivity() {
const res = await activityIndex({
page: 1,
page_size: 999,
});
this.listActivity = res.data;
},
getTheme() {
getparameteritem('theme').then(res => {
this.listTheme = res.detail
})
},
show() {
this.isShow = true;
@ -363,13 +379,13 @@
} else {
console.error("error typeof id: " + typeof id);
}
},
setList(e){
if(e){
this.listActivity = e
}else{
this.loadActivity()
}
},
setList(e) {
if (e) {
this.listActivity = e
} else {
this.loadActivity()
}
},
getId() {
return this.id;
@ -393,9 +409,9 @@
}
if (!key) {
this.init();
}
if(this.form.activity_list_id){
this.hasActiveId = true
}
if (this.form.activity_list_id) {
this.hasActiveId = true
}
},
@ -419,48 +435,53 @@
return false;
}
},
addRow() {
this.form.config.push({
name: "",
key: "",
value: ""
})
},
delRow(obj, index) {
this.form.config.splice(index, 1);
addRow() {
this.form.config.push({
name: "",
key: "",
value: ""
})
},
delRow(obj, index) {
this.form.config.splice(index, 1);
},
async getDetail() {
const res = await show({
id: this.id,
table_name: "map_points",
with_relations: ['video', 'image', "videoImage","logo"]
with_relations: ['video', 'image', "videoImage", "logo",'qrcode']
});
this.$integrateData(this.form, res);
this.form.config = res.config && res.config.length>0?res.config:[{
key:'address',
name:'详细地址',
value:''
},{
key:'time',
name:'开放时间',
value:''
}]
this.$integrateData(this.form, res);
this.form.config = res.config && res.config.length > 0 ? res.config : [{
key: 'address',
name: '详细地址',
value: ''
}, {
key: 'time',
name: '开放时间',
value: ''
}]
this.image_id = res.image ? [{
url: res.image?.url,
name: res.image?.original_name,
response: res.image
}] : [],
this.logo_id = res.logo ? [{
url: res.logo?.url,
name: res.logo?.original_name,
response: res.logo
}] : [],
url: res.image?.url,
name: res.image?.original_name,
response: res.image
}] : [],
this.logo_id = res.logo ? [{
url: res.logo?.url,
name: res.logo?.original_name,
response: res.logo
}] : [],
this.qrcode_id = res.qrcode ? [{
url: res.qrcode?.url,
name: res.qrcode?.original_name,
response: res.qrcode
}] : [],
this.video_id = res.video ? [{
url: res.video?.url,
name: res.video?.original_name,
response: res.video
}] : []
this.video_id = res.video ? [{
url: res.video?.url,
name: res.video?.original_name,
response: res.video
}] : []
this.video_image_id = res.video_image ? [{
@ -470,7 +491,7 @@
}] : [];
},
submit() {
submit() {
if (this.type === "add") {
if (this.form.hasOwnProperty("id")) {
@ -487,10 +508,12 @@
}
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);
this.form.video_image_id = this.video_image_id.length == 0 ? "" : (this.video_image_id[0]?.response?.id);
this.form.logo_id = this.logo_id.length == 0 ? "" : (this.logo_id[0]?.response?.id);
this.form.video_image_id = this.video_image_id.length == 0 ? "" : (this.video_image_id[0]?.response?.id);
this.form.logo_id = this.logo_id.length == 0 ? "" : (this.logo_id[0]?.response?.id);
this.form.qrcode_id = this.qrcode_id.length == 0 ? "" : (this.qrcode_id[0]?.response?.id);
save(Object.assign(this.form, {
table_name: "map_points"
})).then(
@ -504,20 +527,21 @@
}
);
},
},
},
watch: {
isShow(val) {
if (val) {
console.log("form",this.form.activity_list_id)
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.image_id = [];
this.logo_id = []
this.qrcode_id = []
this.video_id = [];
this.video_image_id = [];
this.init();

@ -41,8 +41,17 @@
点位场馆
</div>
<div class="xy-table-item-content">
<el-autocomplete v-model="form.pointName" value-key="name" clearable placeholder="请输入点位场馆"
style="width: 300px" :fetch-suggestions="querySearchAsync" @select="handleSelect"></el-autocomplete>
<!-- <el-autocomplete v-model="form.pointName" value-key="name" clearable placeholder="请输入点位场馆"
style="width: 300px" :fetch-suggestions="querySearchAsync" @select="handleSelect"></el-autocomplete>
-->
<el-select v-model="form.pointer_list" @change="changePoints" multiple placeholder="请选择" style="width: 300px">
<el-option
v-for="item in pointList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
@ -103,15 +112,18 @@
activity_list_id: '',
filter: [],
},
listActivity:[],
listActivity:[],
pointList:[],
form: {
// activity_list_id: '',
title: "",
title: "",
pointer_list:[],
point_id: "",
activity_list_id:'',
activity_list_name:'',
pointName: "",
option_list: [],
option_list: [],
},
rules: {
title: [{
@ -125,7 +137,10 @@
},
};
},
methods: {
methods: {
changePoints(e){
console.log(e)
},
querySearchAsync(queryString, cb) {
if(!this.form.activity_list_id){
this.$message({
@ -134,15 +149,14 @@
});
return
}
this.select.filter = [{
"key": "name",
"op": "like",
"value": queryString ? queryString : ''
}]
// this.select.filter = [{
// "key": "name",
// "op": "like",
// "value": queryString ? queryString : ''
// }]
index(this.select).then(res=>{
console.log(res.data)
cb(res.data)
this.pointList = res.data
// cb(res.data)
});
},
createStateFilter(queryString) {
@ -177,6 +191,7 @@
console.log(item);
this.select.activity_list_id = item;
this.form.activity_list_id=item;
this.querySearchAsync()
// this.form.activity_list_name=item?.name;
},
@ -228,6 +243,7 @@
}
if(this.form.activity_list_id){
this.hasActiveId = true
this.querySearchAsync()
}
},
setSelectId(value){
@ -239,6 +255,7 @@
});
this.$integrateData(this.form, res);
this.form.pointName=res.point?.name;
this.form.pointer_list = res.pointer_list?res.pointer_list:[res.point_id]
// activity_list_id:'',
// activity_list_name:'',
this.form.activity_list_name = res.activity_list?.name
@ -252,8 +269,7 @@
},
submit() {
console.log(this.form)
// return
if (this.type === "add") {
if (this.form.hasOwnProperty("id")) {
delete this.form.id;
@ -266,15 +282,32 @@
configurable: true,
writable: true,
});
}
save(this.form).then((res) => {
this.$message({
type: "success",
message: this.type === "add" ? "新增题目" : "编辑题目" + "成功",
});
this.isShow = false;
this.$emit("refresh");
});
}
let saveForm = []
this.form.pointer_list.map(item=>{
this.form.point_id = item
saveForm.push({
...this.form,
point_id:item
})
})
console.log(saveForm)
// return
saveForm.map((item,index)=>{
console.log(item,index)
save(item).then((res) => {
this.$message({
type: "success",
message: this.type === "add" ? "新增题目" : "编辑题目" + "成功",
});
if(index==saveForm.length-1){
this.isShow = false;
this.$emit("refresh");
}
});
})
},

@ -211,11 +211,10 @@ export default {
let sysInfo = sessionStorage.getItem('sys_info')
if (sysInfo && sysInfo != "") {
let _sys = JSON.parse(sysInfo);
if(_sys.tag==='h5'){
return
}
this.select.activity_list_id = _sys.id;
that.sysInfo=_sys;
if(_sys.tag!='h5'){
that.select.activity_list_id = _sys.id;
that.sysInfo=_sys;
}
}
this.load();
},

@ -240,11 +240,10 @@ export default {
let sysInfo = sessionStorage.getItem('sys_info')
if (sysInfo && sysInfo != "") {
let _sys = JSON.parse(sysInfo);
if(_sys.tag==='h5'){
return
}
this.select.activity_list_id = _sys.id;
that.sysInfo=_sys;
if(_sys.tag!='h5'){
that.select.activity_list_id = _sys.id;
that.sysInfo=_sys;
}
}
this.load();
},

@ -175,11 +175,10 @@ export default {
let sysInfo = sessionStorage.getItem('sys_info')
if (sysInfo && sysInfo != "") {
let _sys = JSON.parse(sysInfo);
if(_sys.tag==='h5'){
return
if(_sys.tag!='h5'){
that.select.activity_list_id = _sys.id;
that.sysInfo=_sys;
}
this.select.activity_list_id = _sys.id;
that.sysInfo=_sys;
}
this.loadActivity();

@ -156,14 +156,14 @@
},
},
mounted() {
let that = this
let sysInfo = sessionStorage.getItem('sys_info')
if (sysInfo && sysInfo != "") {
let _sys = JSON.parse(sysInfo);
if(_sys.tag==='h5'){
return
if(_sys.tag!='h5'){
that.select.activity_list_id = _sys.id;
that.sysInfo=_sys;
}
that.select.activity_list_id = _sys.id;
that.sysInfo=_sys;
}
this.load();
this.loadActivity()

@ -159,11 +159,11 @@
let sysInfo = sessionStorage.getItem('sys_info')
if (sysInfo && sysInfo != "") {
let _sys = JSON.parse(sysInfo);
if(_sys.tag==='h5'){
return
if(_sys.tag!='h5'){
that.select.activity_list_id = _sys.id;
that.sysInfo=_sys;
}
that.select.activity_list_id = _sys.id;
that.sysInfo=_sys;
}
this.load();
this.loadActivity()

@ -158,11 +158,10 @@
let sysInfo = sessionStorage.getItem('sys_info')
if (sysInfo && sysInfo != "") {
let _sys = JSON.parse(sysInfo);
if(_sys.tag==='h5'){
return
if(_sys.tag!='h5'){
that.select.activity_list_id = _sys.id;
that.sysInfo=_sys;
}
this.detail.activity_list_id = _sys.id;
that.sysInfo=_sys;
}
}
}

@ -270,11 +270,10 @@
console.log(sysInfo)
if (sysInfo && sysInfo != "") {
let _sys = JSON.parse(sysInfo);
if(_sys.tag==='h5'){
return
if(_sys.tag!='h5'){
that.select.activity_list_id = _sys.id;
that.sysInfo=_sys;
}
that.detail.activity_list_id = _sys.id;
that.sysInfo = _sys;
}
},
mounted() {

@ -213,11 +213,10 @@
console.log(sysInfo)
if (sysInfo && sysInfo != "") {
let _sys = JSON.parse(sysInfo);
if(_sys.tag==='h5'){
return
if(_sys.tag!='h5'){
that.select.activity_list_id = _sys.id;
that.sysInfo=_sys;
}
that.select.activity_list_id = _sys.id;
that.sysInfo = _sys;
}
}
}

@ -225,11 +225,10 @@
let sysInfo = sessionStorage.getItem('sys_info')
if (sysInfo && sysInfo != "") {
let _sys = JSON.parse(sysInfo);
if(_sys.tag==='h5'){
return
if(_sys.tag!='h5'){
that.select.activity_list_id = _sys.id;
that.sysInfo=_sys;
}
that.select.activity_list_id = _sys.id;
that.sysInfo=_sys;
}
}
}

@ -347,10 +347,10 @@ import { index as menulist} from "@/api/index";
console.log(sysInfo)
if (sysInfo && sysInfo != "") {
let _sys = JSON.parse(sysInfo);
if(_sys.tag==='h5'){
return
if(_sys.tag!='h5'){
that.select.activity_list_id = _sys.id;
// that.sysInfo=_sys;
}
that.detail.activity_list_id = _sys.id;
}
}
}

Loading…
Cancel
Save