斜塘冬训点位答题

master
lion 2 years ago
parent 49bd49331c
commit 311b6773c4

@ -124,6 +124,15 @@ export default {
prop: "company_name",
label: "奖品名称",
width: 220
},
{
prop: "created_at",
label: "创建时间",
width: 220,
formatter:(d1, d2, v) => {
return v ? (new Date(v)).toLocaleString().replaceAll('/','-') : ""
}
}
],
select: {

@ -0,0 +1,254 @@
<template>
<div>
<xy-dialog ref="dialog"
:is-show.sync="isShow"
type="form"
:title="type === 'add' ? '新增图片' : '编辑图片'"
:form="form"
:rules="rules"
@submit="submit">
<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: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"
:limit="1"
: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')"
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"
: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
<br />单个文件不能超过20M
</div>
</el-upload>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
show,
save
} from '@/api/index';
export default {
props:{
},
data() {
return {
isShow: false,
id: '',
type: '',
action: process.env.VUE_APP_UPLOAD_API,
image_id: [],
video_id: [],
form: {
activity_list_id: 9,
name: "",
image_id: "",
map_point_id: "",
video_id: "",
},
rules: {
name: [{
required: true,
message: "请填写名称"
}]
}
}
},
methods: {
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)
}
},
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()
}
},
//
uploadBefore(file) {
console.log(file);
if (file.size / 1000 > 20 * 1024) {
this.$message({
type: "warning",
message: "上传图片大小超过20MB",
});
return false;
}
},
successHandle(response, file, fileList, key) {
this[key] = fileList;
},
removeHande(file, fileList, key) {
this[key] = fileList;
},
async getDetail() {
const res = await show({ id:this.id, table_name: 'map_point_images', with_relations: ['video','image'] })
this.$integrateData(this.form, res)
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[0]?.response?.id
this.form.video_id = this.video_id[0]?.response?.id
save(Object.assign(this.form,{table_name: 'map_point_images'})).then(res => {
this.$message({
type: 'success',
message: this.type === 'add' ? '新增vr看展' : '编辑vr看展' + '成功'
});
this.isShow = false
this.$emit('refresh')
})
}
},
watch: {
isShow(val) {
if (val) {
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;
}
</style>

@ -0,0 +1,343 @@
<template>
<div>
<xy-dialog ref="dialog" :is-show.sync="isShow" type="form" :title="type === 'add' ? '新增点位场馆' : '编辑点位场馆'"
:form="form" :rules="rules" @submit="submit">
<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: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:lat>
<div class="xy-table-item">
<div class="xy-table-item-label">纬度 </div>
<div class="xy-table-item-content">
<el-input-number v-model="form.lat" clearable placeholder="请输入纬度" style="width: 300px"
:controls="false"></el-input-number>
</div>
</div>
</template>
<template v-slot:lng>
<div class="xy-table-item">
<div class="xy-table-item-label">经度 </div>
<div class="xy-table-item-content">
<el-input-number v-model="form.lng" clearable placeholder="请输入经度" style="width: 300px"
:controls="false"></el-input-number>
</div>
</div>
</template>
<template #jiaodu>
<div class="xy-table-item">
<div class="xy-table-item-label">旋转角度 </div>
<div class="xy-table-item-content">
<el-input-number v-model="form.jiaodu" clearable :precision="2" placeholder="请输入旋转角度" style="width: 300px"
:controls="false"></el-input-number>
</div>
</div>
</template>
<template v-slot:x>
<div class="xy-table-item">
<div class="xy-table-item-label">x轴位置 </div>
<div class="xy-table-item-content xy-table-item-price-per">
<el-input-number v-model="form.x" clearable :precision="2" placeholder="请输入x轴位置" style="width: 300px"
:controls="false"></el-input-number>
</div>
</div>
</template>
<template v-slot:y>
<div class="xy-table-item">
<div class="xy-table-item-label">y轴位置 </div>
<div class="xy-table-item-content xy-table-item-price-per">
<el-input-number v-model="form.y" :precision="2" clearable placeholder="请输入y轴位置" style="width: 300px"
:controls="false"></el-input-number>
</div>
</div>
</template>
<template v-slot:video_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, 'video_image_id')
" :before-upload="uploadBefore" :file-list="video_image_id" :on-remove="
(file, fileList) => removeHande(file, fileList, 'video_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" :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
<br />单个文件不能超过300M
</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 tinymce from "@/components/XyTinymce"
export default {
components: {
tinymce
},
props: {},
data() {
return {
isShow: false,
id: "",
type: "",
image_id: [],
video_image_id: [],
action: process.env.VUE_APP_UPLOAD_API,
video_id: [],
form: {
activity_list_id: 9,
name: "",
image_id: "",
lat: "",
lng: "",
x: "",
y: "",
jiaodu: "",
video_id: "",
video_image_id: "",
content: "",
},
rules: {
name: [{
required: true,
message: "请填写名称",
}, ],
},
};
},
methods: {
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);
}
},
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: "map_points",
with_relations: ['video', 'image', "videoImage"]
});
this.$integrateData(this.form, res);
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
}] : []
this.video_image_id = res.video_image ? [{
url: res.video_image?.url,
name: res.video_image?.original_name,
response: res.video_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);
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);
save(Object.assign(this.form, {
table_name: "map_points"
})).then(
(res) => {
this.$message({
type: "success",
message: this.type === "add" ? "新增点位场馆" : "编辑点位场馆" + "成功",
});
this.isShow = false;
this.$emit("refresh");
}
);
},
},
watch: {
isShow(val) {
if (val) {
if (this.type === "editor") {
this.getDetail();
}
} else {
this.id = "";
this.type = "";
this.image_id = [];
this.video_id = [];
this.video_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>

@ -0,0 +1,306 @@
<template>
<div>
<xy-dialog ref="dialog" :is-show.sync="isShow" type="form" :title="type === 'add' ? '新增题目' : '编辑题目'" :form="form"
:rules="rules" @submit="submit">
<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:activity_list_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-autocomplete v-model="form.activity_list_name" value-key="name" clearable placeholder="请输入项目名称"
style="width: 300px" :fetch-suggestions="queryActiveSearchAsync" @select="handleActiveSelect"></el-autocomplete>
</div>
</div>
</template>
<template v-slot:pointName>
<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-autocomplete v-model="form.pointName" value-key="name" clearable placeholder="请输入点位场馆"
style="width: 300px" :fetch-suggestions="querySearchAsync" @select="handleSelect"></el-autocomplete>
</div>
</div>
</template>
<template #option_list>
<div class="xy-table-item">
<div class="xy-table-item-label">
选项
</div>
<div class="xy-table-item-content">
<el-button @click="addOptions"></el-button>
<div style="width: 300px;margin-bottom: 20px;" v-for="(item, index) in form.option_list"
:key="item.myindex">
<div style="font-weight: 600;display: flex;align-items: center;justify-content: space-between;">
选项{{ indexFormat(item.myindex) }}
<el-button size="mini" type="danger" icon="el-icon-delete" circle
@click="form.option_list.splice(index, 1)"></el-button>
</div>
<el-input style="flex: 2;" v-model="item.title" placeholder="选项"></el-input>
<div style="margin-top: 6px;display: flex;justify-content: space-between;align-items: center;">
<el-switch v-model="item.is_correct" active-text="" inactive-text="" :active-value="1"
:inactive-value="0"></el-switch>
<el-input-number class="myindex-tip" placeholder="排序" style="width: 140px;" :min="0" :max="26"
controls-position="right" v-model="item.myindex" :precision="0"></el-input-number>
</div>
</div>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
show,
save
} from "@/api/party/studyQuestion";
import {
index as activeIndex
} from "@/api/activity/index";
import {
index
} from "@/api/index";
export default {
props: {},
data() {
return {
isShow: false,
id: "",
type: "",
select: {
page: 1,
page_size: 999,
table_name: "map_points",
activity_list_id: 9,
filter: [],
},
form: {
// activity_list_id: '',
title: "",
point_id: "",
activity_list_id:'',
activity_list_name:'',
pointName: "",
option_list: [],
},
rules: {
title: [{
required: true,
message: "请填写题目",
}, ],
},
};
},
methods: {
querySearchAsync(queryString, cb) {
this.select.filter = [{
"key": "name",
"op": "like",
"value": queryString ? queryString : ''
}]
index(this.select).then(res=>{
console.log(res.data)
cb(res.data)
});
},
createStateFilter(queryString) {
return (state) => {
return (state.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
};
},
handleSelect(item) {
console.log(item);
this.form.point_id=item.id;
this.form.point=item?.name;
},
queryActiveSearchAsync(queryString, cb) {
let select = {
page: 1,
page_size: 999,
keyword:queryString ? queryString : ''
}
activeIndex(select).then(res=>{
console.log(res.data)
cb(res.data)
});
},
handleActiveSelect(item) {
console.log(item);
this.form.activity_list_id=item.id;
this.form.activity_list_name=item?.name;
},
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);
}
},
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();
}
},
async getDetail() {
const res = await show({
id: this.id
});
this.$integrateData(this.form, res);
this.form.pointName=res.point?.name;
// activity_list_id:'',
// activity_list_name:'',
this.form.activity_list_name = res.activity_list?.name
this.form.option_list = res?.options.map(i => {
return {
title: i.title,
is_correct: i.is_correct,
myindex: i.myindex,
}
})
},
submit() {
console.log(this.form)
// return
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,
});
}
save(this.form).then((res) => {
this.$message({
type: "success",
message: this.type === "add" ? "新增题目" : "编辑题目" + "成功",
});
this.isShow = false;
this.$emit("refresh");
});
},
addOptions() {
this.form.option_list.push({
title: '',
is_correct: 0,
myindex: this.form.option_list.length + 1,
});
}
},
computed: {
indexFormat() {
return function(myindex) {
if (myindex < 1 || myindex > 26) {
throw new Error("Invalid number");
}
return String.fromCharCode(myindex + 64);
}
}
},
watch: {
isShow(val) {
if (val) {
if (this.type === "editor") {
this.getDetail();
}
} else {
this.id = "";
this.type = "";
this.init();
this.$refs["dialog"].clearValidate();
delete this.form.id;
}
},
},
};
</script>
<style scoped lang="scss">
::v-deep .el-input__inner {
text-align: left;
}
.myindex-tip {
position: relative;
&::after {
text-align: end;
color: red;
font-size: 12px;
line-height: 20px;
zoom: .9;
content: '选项排序例1为选项A';
transform: translateY(100%);
position: absolute;
right: 0;
bottom: 0;
}
}
</style>

@ -0,0 +1,274 @@
<template>
<div>
<xy-dialog ref="dialog"
:is-show.sync="isShow"
type="form"
:title="type === 'add' ? '新增vr看展' : '编辑vr看展'"
:form="form"
:rules="rules"
@submit="submit">
<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:url>
<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.url"
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: 300px;"
class="upload-demo"
:action="action"
:limit="1"
: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')"
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"
: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
<br />单个文件不能超过20M
</div>
</el-upload>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
show,
save
} from '@/api/index';
export default {
props:{
},
data() {
return {
isShow: false,
id: '',
type: '',
action: process.env.VUE_APP_UPLOAD_API,
image_id: [],
video_id: [],
form: {
activity_list_id: 9,
name: "",
url: "",
image_id: "",
map_point_id: "",
video_id: "",
},
rules: {
name: [{
required: true,
message: "请填写名称"
}],
url: [{
required: true,
message: "请填写链接地址"
}],
}
}
},
methods: {
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)
}
},
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()
}
},
//
uploadBefore(file) {
console.log(file);
if (file.size / 1000 > 20 * 1024) {
this.$message({
type: "warning",
message: "上传图片大小超过20MB",
});
return false;
}
},
successHandle(response, file, fileList, key) {
this[key] = fileList;
},
removeHande(file, fileList, key) {
this[key] = fileList;
},
async getDetail() {
const res = await show({ id:this.id, table_name: 'map_point_contents', with_relations: ['video','image'] })
this.$integrateData(this.form, res)
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[0]?.response?.id
this.form.video_id = this.video_id[0]?.response?.id
save(Object.assign(this.form,{table_name: 'map_point_contents'})).then(res => {
this.$message({
type: 'success',
message: this.type === 'add' ? '新增vr看展' : '编辑vr看展' + '成功'
});
this.isShow = false
this.$emit('refresh')
})
}
},
watch: {
isShow(val) {
if (val) {
if (this.type === 'editor') {
this.getDetail()
}
} else {
this.id = ''
this.type = ''
this.init();
this.$refs['dialog'].clearValidate();
delete this.form.id
}
},
}
}
</script>
<style scoped lang="scss">
::v-deep .el-input__inner {
text-align: left;
}
</style>

@ -0,0 +1,142 @@
<template>
<div>
<Drawer width="46" title="图片集合" :closable="false" v-model="drawer">
<Button @click="
$refs['addImg'].setForm(
['map_point_id', 'activity_list_id'],
[select.filter[0].value, 9]
),
$refs['addImg'].setType('add'),
$refs['addImg'].show()
">新增</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',
id: row.id,
activity_list_id: 9
}).then(_ => getList())" @editor="
(row) => {
$refs['addImg'].setForm(
['map_point_id', 'activity_list_id'],
[select.filter[0].value, 9]
);
$refs['addImg'].setId(row.id);
$refs['addImg'].setType('editor');
$refs['addImg'].show();
}
">
</xy-table>
</Drawer>
<add-img ref="addImg" @refresh="getList"></add-img>
</div>
</template>
<script>
import {
index,
destroy
} from "@/api/index";
import addImg from "./addImg.vue";
export default {
components: {
addImg,
},
data() {
return {
drawer: false,
select: {
page: 1,
page_size: 999,
activity_list_id: 9,
table_name: "map_point_images",
with_relations:["image"],
filter: [{
key: "map_point_id",
value: 9,
op: "eq",
}, ],
},
total: 0,
list: [],
talbe: [{
prop: "name",
label: "标题",
minWidth: 220,
align: "left",
},
{
prop: "img",
label: "图片",
minWidth: 130,
align: "center",
customFn: (row) => {
return ( <div><img src={row.image?.url} style = 'width:120px;' /> </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: {
destroy,
show() {
this.drawer = true;
},
hidden() {
this.drawer = false;
},
setMapPointId(value) {
this.select.filter[0].value = value;
},
async getList() {
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;
this.getList();
},
pageChange(e) {
this.select.page = e
this.getList()
},
},
computed: {},
watch: {
drawer(newVal) {
if (newVal) {
this.getList();
}
},
},
};
</script>
<style scoped lang="scss"></style>

@ -0,0 +1,134 @@
<template>
<div>
<Drawer width="46" title="vr看展" :closable="false" v-model="drawer">
<Button @click="
$refs['addVr'].setForm(
['map_point_id', 'activity_list_id'],
[select.filter[0].value, 9]
),
$refs['addVr'].setType('add'),
$refs['addVr'].show()
">新增</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_contents',
id: row.id,
activity_list_id: 9
}).then(_ => getList())" @editor="
(row) => {
$refs['addVr'].setForm(
['map_point_id', 'activity_list_id'],
[select.filter[0].value, 9]
);
$refs['addVr'].setId(row.id);
$refs['addVr'].setType('editor');
$refs['addVr'].show();
}
">
</xy-table>
</Drawer>
<add-vr ref="addVr" @refresh="getList"></add-vr>
</div>
</template>
<script>
import {
index,
destroy
} from "@/api/index";
import addVr from "./addVr.vue";
export default {
components: {
addVr,
},
data() {
return {
drawer: false,
select: {
page: 1,
page_size: 999,
activity_list_id: 9,
table_name: "map_point_contents",
filter: [{
key: "map_point_id",
value: 7,
op: "eq",
}, ],
},
total: 0,
list: [],
talbe: [{
prop: "name",
label: "标题",
minWidth: 220,
align: "left",
},
{
prop: "url",
label: "跳转地址",
minWidth: 220,
align: "left",
},
{
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: {
destroy,
show() {
this.drawer = true;
},
hidden() {
this.drawer = false;
},
setMapPointId(value) {
this.select.filter[0].value = value;
},
async getList() {
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;
this.getList();
},
pageChange(e) {
this.select.page = e
this.getList()
},
},
computed: {},
watch: {
drawer(newVal) {
if (newVal) {
this.getList();
}
},
},
};
</script>
<style scoped lang="scss"></style>

@ -0,0 +1,228 @@
<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>
<Button
style="margin-left: 10px"
type="primary"
@click="select = { page: 1, keyword: '' }"
>重置
</Button>
<Button style="margin-left: 10px" type="primary" @click="doSearch"
>查询</Button
>
<Button
style="margin-left: 10px"
type="primary"
@click="
$refs['addPointer'].setForm(['activity_list_id'],[9]),$refs['addPointer'].setType('add'), $refs['addPointer'].show()
"
>新增</Button
>
</div>
</slot>
</lx-header>
<xy-table
:list="list"
:total="total"
:table-item="table"
@pageSizeChange="pageSizeChange"
@pageIndexChange="pageChange"
>
<template v-slot:btns>
<template v-if="type == 0"> </template>
<template v-else>
<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['addPointer'].setForm(['activity_list_id'],[9]);
$refs['addPointer'].setId(row.id);
$refs['addPointer'].setType('editor');
$refs['addPointer'].show();
"
>编辑</Button
>
<Button size="small" type="primary" style="margin-left: 4px" @click="
$refs['vr'].setMapPointId(row.id);
$refs['vr'].show();
"
>vr看展</Button
>
<Button size="small" type="primary" style="margin-left: 4px" @click="
$refs['imgBox'].setMapPointId(row.id);
$refs['imgBox'].show();
"
>图集</Button
>
</template>
</el-table-column>
</template>
</template>
</xy-table>
<addPointer ref="addPointer" @refresh="load"></addPointer>
<vr ref="vr"></vr>
<imgBox ref="imgBox"></imgBox>
</div>
</template>
<script>
import { index, destroy, show } from "@/api/index";
import vr from './components/vr.vue';
import imgBox from './components/imgBox.vue';
import addPointer from "@/views/xtdxhistoryRecoder/components/addPointer.vue";
export default {
components: {
addPointer,
vr,
imgBox
},
data() {
return {
select: {
page: 1,
page_size: 10,
with_relations: ['video','image'],
table_name: "map_points",
activity_list_id: 9,
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: "lng,lat",
label: "经度,纬度",
width: 160,
customFn: (row) => {
return (
<span>
{row.lng} {row.lat}
</span>
);
},
},
{
prop: "x,y",
label: "x轴y轴",
width: 160,
customFn: (row) => {
return (
<span>
{row.x} {row.y}
</span>
);
},
},
{
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: {
doSearch() {
this.select.page = 1;
this.load();
},
pageSizeChange(e) {
this.select.page_size = e;
this.select.page = 1;
this.load();
},
async load() {
const res = await index(this.select);
this.total = res.total;
this.list = res.data;
},
deleteitem(row) {
destroy({
id: row.id,
activity_list_id: 9,
table_name: 'map_points'
}).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;
},
};
</script>
<style lang="scss" scoped>
.selects {
display: flex;
flex-wrap: wrap;
& > div {
margin-bottom: 6px;
}
}
</style>

@ -0,0 +1,178 @@
<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>
<Button
style="margin-left: 10px"
type="primary"
@click="select = { page: 1, keyword: '' }"
>重置
</Button>
<Button style="margin-left: 10px" type="primary" @click="doSearch"
>查询</Button
>
<Button
style="margin-left: 10px"
type="primary"
@click=" $refs['addQuestions'].setType('add'), $refs['addQuestions'].setForm(['activity_list_id'],[9]),$refs['addQuestions'].show()"
>新增</Button
>
</div>
</slot>
</lx-header>
<xy-table
:list="list"
:total="total"
:table-item="table"
@delete="deleteitem"
@editor="
(row) => {
$refs['addQuestions'].setForm(['activity_list_id'],[9]);
$refs['addQuestions'].setId(row.id);
$refs['addQuestions'].setType('editor')
$refs['addQuestions'].show();
}
"
@pageSizeChange="pageSizeChange"
@pageIndexChange="pageChange"
>
<template v-slot:btns v-if="type == 0"> </template>
</xy-table>
<addQuestions ref="addQuestions" @refresh="load"></addQuestions>
</div>
</template>
<script>
import { index, destroy, show } from "@/api/party/studyQuestion";
import { index as activityIndex } from "@/api/activity/index";
import addQuestions from "@/views/xtdxhistoryRecoder/components/addQuestions.vue";
export default {
components: {
addQuestions,
},
data() {
return {
select: {
page: 1,
page_size: 20,
keyword: "",
// activity_list_id: 7,
activity_list_id: 9,
},
listActivity: [],
total: 0,
list: [],
table: [
{
prop: "point.name",
label: "关联点位",
minWidth: 220,
align: "left",
},
{
prop: "activity_list.name",
label: "项目名称",
minWidth: 220,
align: "left",
},
{
prop: "title",
label: "题目",
minWidth: 220,
align: "left",
},
{
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() {
const res = await index(this.select);
this.total = res.total;
this.list = res.data;
},
deleteitem(row) {
destroy({
id: row.id,
}).then((res) => {
this.load();
this.$Message.success("操作成功");
});
},
pageChange(e) {
this.select.page = e;
this.load();
},
},
mounted() {
this.load();
this.loadActivity();
},
created() {
let type = parseInt(this.$route.path.split("_")[1] || 0);
this.type = this.select.is_auth = type;
},
};
</script>
<style lang="scss" scoped>
.selects {
display: flex;
flex-wrap: wrap;
& > div {
margin-bottom: 6px;
}
}
</style>

@ -25,7 +25,7 @@ module.exports = {
* Detail: https://cli.vuejs.org/config/#publicpath
*/
publicPath: '/admin/',
outputDir: '/Users/liuxiangyu/Work/g-guangdian/app/h-h5-service/h5-service/public/admin',
outputDir: '/Users/mac/Documents/朗业/0-朗业基础库/h5/public/admin',
assetsDir: 'static',
css: {
loaderOptions: { // 向 CSS 相关的 loader 传递选项

Loading…
Cancel
Save