刘翔宇-旅管家 3 years ago
parent 6fbe0c317f
commit 30de835b79

@ -26,12 +26,12 @@
"normalize.css": "7.0.0",
"nprogress": "0.2.0",
"path-to-regexp": "2.4.0",
"tinymce": "^5.10.7",
"view-design": "^4.7.0",
"vue": "2.6.10",
"vue-count-to": "^1.0.13",
"vue-router": "3.0.6",
"vuex": "3.1.0",
"tinymce": "^5.10.7"
"vuex": "3.1.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "4.4.4",

@ -1,10 +1,32 @@
import request from "@/utils/request";
function customParamsSerializer(params) {
let result = "";
for (let key in params) {
if (params.hasOwnProperty(key)) {
if (Array.isArray(params[key])) {
if (typeof params[key] === "object") {
params[key].forEach((item, index) => {
if (typeof item === "object") {
result += `${key}[${index}][key]=${item.key}&${key}[${index}][op]=${item.op}&${key}[${index}][value]=${item.value}&`;
} else {
result += `${key}[${index}]=${item}&`;
}
});
}
} else {
result += `${key}=${params[key]}&`;
}
}
}
return result.slice(0, -1);
}
export function index(params) {
return request({
method: 'get',
url: '/api/admin/study-point/index',
params
params:params,
paramsSerializer: customParamsSerializer,
})
}

@ -4,7 +4,7 @@ export function index(params) {
return request({
method: 'get',
url: '/api/admin/study-question/index',
params
params:params,
})
}

@ -0,0 +1,253 @@
<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: 7,
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.init();
this.$refs['dialog'].clearValidate();
delete this.form.id
}
},
}
}
</script>
<style scoped lang="scss">
::v-deep .el-input__inner {
text-align: left;
}
</style>

@ -156,7 +156,7 @@
<div class="xy-table-item">
<div class="xy-table-item-label">内容 </div>
<div class="xy-table-item-content">
<tinymce style="width: 500px;" v-model="form.content"></tinymce>
<tinymce style="width: 700px;" v-model="form.content"></tinymce>
</div>
</div>
</template>
@ -322,6 +322,8 @@ export default {
} else {
this.id = "";
this.type = "";
this.image_id=[];
this.video_id=[];
this.init();
this.$refs["dialog"].clearValidate();
delete this.form.id;

@ -1,226 +1,269 @@
<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 #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>
<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: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
} 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: 7,
filter: [],
},
form: {
activity_list_id: 7,
title: "",
point_id: "",
pointName: "",
option_list: [],
},
rules: {
title: [{
required: true,
message: "请填写题目",
}, ],
},
};
},
methods: {
querySearchAsync(queryString, cb) {
this.select.filter = [{
"key": "name",
"op": "like",
"value": queryString
}]
index(this.select).then(res=>{
<script>
import { show, save } from "@/api/party/studyQuestion";
export default {
props: {},
data() {
return {
isShow: false,
id: "",
type: "",
form: {
activity_list_id: 7,
title: "",
option_list: [],
},
rules: {
title: [
{
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();
}
},
async getDetail() {
const res = await show({ id: this.id });
this.$integrateData(this.form, res);
this.form.option_list = res?.options.map(i => {
return {
title: i.title,
is_correct: i.is_correct,
myindex: i.myindex,
}
})
},
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,
});
}
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;
}
}
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;
},
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;
this.form.option_list = res?.options.map(i => {
return {
title: i.title,
is_correct: i.is_correct,
myindex: i.myindex,
}
})
},
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,
});
}
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>

@ -22,6 +22,23 @@
</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">
@ -106,6 +123,7 @@ export default {
form: {
activity_list_id: 7,
name: "",
url: "",
image_id: "",
map_point_id: "",
video_id: "",
@ -115,6 +133,10 @@ export default {
required: true,
message: "请填写名称"
}],
url: [{
required: true,
message: "请填写链接地址"
}],
}
}
},

@ -0,0 +1,140 @@
<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, 7]
),
$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_contents',
id: row.id,
activity_list_id: 7
}).then(_ => getList())"
@editor="
(row) => {
$refs['addImg'].setForm(
['map_point_id', 'activity_list_id'],
[select.filter[0].value, 7]
);
$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: 7,
table_name: "map_point_images",
filter: [
{
key: "map_point_id",
value: 7,
op: "eq",
},
],
},
total: 0,
list: [],
talbe: [
{
prop: "name",
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>

@ -1,140 +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, 7]
),
$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: 7
}).then(_ => getList())"
@editor="
(row) => {
$refs['addVr'].setForm(
['map_point_id', 'activity_list_id'],
[select.filter[0].value, 7]
);
$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: 7,
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: "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>
<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, 7]
),
$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: 7
}).then(_ => getList())" @editor="
(row) => {
$refs['addVr'].setForm(
['map_point_id', 'activity_list_id'],
[select.filter[0].value, 7]
);
$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: 7,
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>

@ -48,7 +48,7 @@
<template v-slot:btns>
<template v-if="type == 0"> </template>
<template v-else>
<el-table-column label="操作" width="200" fixed="right">
<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>
@ -71,6 +71,12 @@
"
>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>
@ -78,6 +84,7 @@
</xy-table>
<addPointer ref="addPointer" @refresh="load"></addPointer>
<vr ref="vr"></vr>
<imgBox ref="imgBox"></imgBox>
</div>
</template>
@ -85,11 +92,13 @@
import { index, destroy, show } from "@/api/index";
import vr from './components/vr.vue';
import imgBox from './components/imgBox.vue';
import addPointer from "@/views/PartyshistoryRecoder/components/addPointer.vue";
export default {
components: {
addPointer,
vr
vr,
imgBox
},
data() {
return {

@ -79,6 +79,12 @@ export default {
total: 0,
list: [],
table: [
{
prop: "point.name",
label: "关联点位",
minWidth: 220,
align: "left",
},
{
prop: "title",
label: "题目",

Loading…
Cancel
Save