Browse Source

fix-更新一下

wangqin
IAMHERE 11 months ago
parent
commit
22499896c7
  1. 3
      ruoyi-ui/src/views/index.vue
  2. 635
      ruoyi-ui/src/views/information/board/addinfo.vue
  3. 587
      ruoyi-ui/src/views/information/board/editInfo.vue
  4. 104
      ruoyi-ui/src/views/map/index.vue
  5. 7
      ruoyi-ui/vue.config.js

3
ruoyi-ui/src/views/index.vue

@ -418,7 +418,8 @@ export default {
.con_ec_cen {
width: 40%;
height: 100%;
background-color: orange;
// TODO
// background-color: orange;
}
.con_ec_right {
width: 30%;

635
ruoyi-ui/src/views/information/board/addinfo.vue

@ -1,30 +1,17 @@
<template>
<div class="container infoBoardDialog">
<!-- 添加信息弹窗 -->
<el-dialog
title="新增"
:visible.sync="dialogVisible"
width="42%"
:before-close="handleClose"
:close-on-click-modal="false"
>
<el-dialog title="新增" :visible.sync="dialogVisible" width="42%" :before-close="handleClose" :close-on-click-modal="false">
<div class="dialogStyleBox">
<div class="dialogLine"></div>
<div class="dialogCloseButton"></div>
</div>
<el-card class="box-card">
<div
v-on:ondragenter="ondragenter"
v-on:drop="faceDrop"
v-on:dragover="allowDrop"
:style="{
<div v-on:ondragenter="ondragenter" v-on:drop="faceDrop" v-on:dragover="allowDrop" :style="{
width: boardWidth + 'px',
height: boardHeight + 'px',
}"
class="blackBoard2"
>
<span
:style="{
}" class="blackBoard2">
<span :style="{
color: getColorStyle(dataForm.COLOR),
fontSize: dataForm.FONT_SIZE,
fontFamily: dataForm.FONT,
@ -36,53 +23,29 @@
? dataForm.COORDINATE.substring(3, 6) + 'px'
: '',
maxHeight:boardHeight + 'px',
}"
class="textBoard2 boardTextStyle"
v-html="
}" class="textBoard2 boardTextStyle" v-html="
dataForm.CONTENT
? dataForm.CONTENT.replace(/\n|\r\n/g, '<br>').replace(
/ /g,
'&nbsp'
)
: ''
"
></span>
"></span>
</div>
</el-card>
<el-card>
<el-form
:model="dataForm"
:rules="dataRule"
label-width="90px"
ref="dataForm"
size="mini"
>
<el-form :model="dataForm" :rules="dataRule" label-width="90px" ref="dataForm" size="mini">
<el-row :gutter="24" style="height: 45px;">
<el-col :span="8">
<el-form-item
prop="category"
label="所属类别"
:rules="[
<el-form-item prop="category" label="所属类别" :rules="[
{
required: categoryRules ? true : false,
message: '请选择所属类别',
trigger: 'blur',
},
]"
v-show="infoType == 2"
>
<el-select
v-model="dataForm.category"
placeholder="请选择所属类别"
clearable
size="mini"
>
<el-option
v-for="item in iotTemplateCategoryList"
:key="item.dictValue"
:label="item.dictLabel"
:value="item.dictValue"
>
]" v-show="infoType == 2">
<el-select v-model="dataForm.category" placeholder="请选择所属类别" clearable size="mini">
<el-option v-for="item in iotTemplateCategoryList" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue">
</el-option>
</el-select>
</el-form-item>
@ -110,63 +73,29 @@
flex-wrap: wrap;width:100%">
<el-col :span="24">
<el-form-item label="详细内容" prop="CONTENT">
<el-input
type="textarea"
clearable
id="textContent"
placeholder="详细内容"
v-model="dataForm.CONTENT"
@keyup.native="keyDown($event)"
></el-input>
<el-input type="textarea" clearable id="textContent" placeholder="详细内容" v-model="dataForm.CONTENT" @keyup.native="keyDown($event)"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item prop="COLOR" label="字体颜色">
<el-select
v-model="dataForm.COLOR"
filterable
placeholder="请选择"
>
<el-option
v-for="item in colorOptions"
:key="item.cssClass"
:label="item.dictLabel"
:value="item.cssClass"
>
<el-select v-model="dataForm.COLOR" filterable placeholder="请选择">
<el-option v-for="item in colorOptions" :key="item.cssClass" :label="item.dictLabel" :value="item.cssClass">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item prop="FONT_SIZE" label="字体大小">
<el-select
v-model="dataForm.FONT_SIZE"
style="width: 100%"
@change="changeFontSize"
>
<el-option
v-for="item in fontSizeOpt"
:key="item.dictValue"
:label="item.dictLabel"
:value="item.dictValue"
>
<el-select v-model="dataForm.FONT_SIZE" style="width: 100%" @change="changeFontSize">
<el-option v-for="item in fontSizeOpt" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item prop="FONT" label="字体类型">
<el-select
v-model="dataForm.FONT"
filterable
placeholder="请选择"
>
<el-option
v-for="item in fontTypeOptions"
:key="item.dictLabel"
:label="item.dictLabel"
:value="item.dictLabel"
>
<el-select v-model="dataForm.FONT" filterable placeholder="请选择">
<el-option v-for="item in fontTypeOptions" :key="item.dictLabel" :label="item.dictLabel" :value="item.dictLabel">
</el-option>
</el-select>
</el-form-item>
@ -174,53 +103,24 @@
<el-col :span="8">
<el-form-item prop="STAY" label="停留时间(秒)">
<el-input-number
:min="0"
controls-position="right"
v-model="dataForm.STAY"
style="width: 100%"
/>
<el-input-number :min="0" controls-position="right" v-model="dataForm.STAY" style="width: 100%" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item prop="ACTION" label="入屏方式">
<el-select
v-model="dataForm.ACTION"
filterable
placeholder="请选择"
>
<el-option
v-for="item in inScreenModeOptions"
:key="item.dictValue"
:label="item.dictLabel"
:value="item.dictValue"
>
<el-select v-model="dataForm.ACTION" filterable placeholder="请选择">
<el-option v-for="item in inScreenModeOptions" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item prop="screenSize" label="屏幕尺寸">
<el-select
v-model="dataForm.screenSize"
filterable
placeholder="请选择"
v-if="!devicePixelBoolean"
>
<el-option
v-for="item in screenSizeOptions"
:key="item.device_pixel"
:label="item.device_pixel"
:value="item.device_pixel"
@click.native="changeScreenSize(item.device_pixel)"
>
<el-select v-model="dataForm.screenSize" filterable placeholder="请选择" v-if="!devicePixelBoolean">
<el-option v-for="item in screenSizeOptions" :key="item.device_pixel" :label="item.device_pixel" :value="item.device_pixel" @click.native="changeScreenSize(item.device_pixel)">
</el-option>
</el-select>
<el-input
disabled
v-model="dataForm.screenSize"
v-if="devicePixelBoolean"
></el-input>
<el-input disabled v-model="dataForm.screenSize" v-if="devicePixelBoolean"></el-input>
</el-form-item>
</el-col>
@ -229,72 +129,55 @@
</el-card>
<div slot="footer" class="dialog-footer">
<el-button
@click="dataFormSubmitHandle()"
v-loading="loading"
class="submitButton"
>确认
<el-button @click="dataFormSubmitHandle()" v-loading="loading" class="submitButton">确认
</el-button>
<el-button class="closeButton" @click="handleClose"
>取消</el-button
>
<el-button class="closeButton" @click="handleClose">取消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
getTemplateInfo,
addTemplate,
addTemplateContent,
editTemplateContent,
editTemplate,
deleteTemplate,
getTemplateContent,
getGalleryList,
getFontSizeByDevicePixel,
uploadBoardEditInfo,
} from "@/api/board/template";
import { devicessize } from "@/api/information/api.js";
import { checkIotBoardContent } from "@/api/board/vocabulary";
import { getTemplateInfo, addTemplate, addTemplateContent, editTemplateContent, editTemplate, deleteTemplate, getTemplateContent, getGalleryList, getFontSizeByDevicePixel, uploadBoardEditInfo } from '@/api/board/template'
import { devicessize } from '@/api/information/api.js'
import { checkIotBoardContent } from '@/api/board/vocabulary'
export default {
data() {
return {
radio1: '0',
alignmentNum: 2,
content: "",
boardWidth: "",
boardHeight: "",
content: '',
boardWidth: '',
boardHeight: '',
checkList: [], //
obj: "",
obj: '',
imgUrl: [],
imgUrlOther: [],
dialogVisible: false,
fileList: [
{
name: "food.jpeg",
url: "https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100",
name: 'food.jpeg',
url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'
},
{
name: "food2.jpeg",
url: "https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100",
},
name: 'food2.jpeg',
url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'
}
],
listquery: [], //
curDragImgItem: "",
curDragImgItem: '',
visible: false,
startTxt_x: "000",
startTxt_y: "000",
width: "400",
height: "40",
startTxt_x: '000',
startTxt_y: '000',
width: '400',
height: '40',
// content: "",
fontColor: "yellow",
fontSize: "24",
fontType: "KaiTi",
fontColor: 'yellow',
fontSize: '24',
fontType: 'KaiTi',
fontSpacing: 0,
coordinate: "000000",
url: "",
previewContent: "", //
coordinate: '000000',
url: '',
previewContent: '', //
ispreviewContent: -1,
dataForm: {},
templateContent: [],
@ -303,100 +186,100 @@ export default {
screenSize: [
{
required: true,
message: "请选择分辨率",
trigger: "blur",
},
message: '请选择分辨率',
trigger: 'blur'
}
],
CONTENT: [
{
required: true,
message: "请输入详细内容",
trigger: "blur",
},
message: '请输入详细内容',
trigger: 'blur'
}
],
fontColor: [
{
required: true,
message: "请填写字体颜色",
trigger: "blur",
},
message: '请填写字体颜色',
trigger: 'blur'
}
],
fontSize: [
{
required: true,
message: "请填写字体大小",
trigger: "blur",
},
message: '请填写字体大小',
trigger: 'blur'
}
],
fontType: [
{
required: true,
message: "请选择字体类型",
trigger: "change",
},
message: '请选择字体类型',
trigger: 'change'
}
],
fontSpacing: [
{
required: true,
message: "请选择字体间距",
trigger: "change",
},
message: '请选择字体间距',
trigger: 'change'
}
],
rollSpeed: [
{
required: true,
message: "请填写滚动速度",
trigger: "blur",
},
message: '请填写滚动速度',
trigger: 'blur'
}
],
stopTime: [
{
required: true,
message: "请填写停留时间",
trigger: "blur",
},
message: '请填写停留时间',
trigger: 'blur'
}
],
inScreenMode: [
{
required: true,
message: "请选择入屏方式",
trigger: "blur",
},
],
message: '请选择入屏方式',
trigger: 'blur'
}
]
},
fontTypeOptions: [],
screenSizeOptions: [],
colorOptions: [],
isCurrencyOptions: [
{
code: "0",
content: "通用",
code: '0',
content: '通用'
},
{
code: "1",
content: "仅为智能推荐模板",
},
code: '1',
content: '仅为智能推荐模板'
}
],
inScreenModeOptions: [],
imgSize: [
{
type: "1024*128",
name: "全屏",
type: '1024*128',
name: '全屏'
},
{
type: "",
name: "正常",
},
type: '',
name: '正常'
}
],
fontSizeOpt: [],
title: "选择图片",
title: '选择图片',
loading: false,
isAdd: false,
iotTemplateCategoryList: [],
infoType: "",
infoType: '',
devicePixelBoolean: false,
categoryRules: false,
};
categoryRules: false
}
},
// directives: {
// drag: function (el, binding, vnode) {
@ -442,10 +325,10 @@ export default {
computed: {
divStyle: function () {
return {
width: this.width + "px",
height: this.height + "px",
};
},
width: this.width + 'px',
height: this.height + 'px'
}
}
},
watch: {
// "dataForm.CONTENT": {
@ -476,88 +359,87 @@ export default {
// },
},
mounted() {
this.getDicts("iot_template_category").then((res) => {
this.iotTemplateCategoryList = res.data;
this.getDicts('iot_template_category').then(res => {
this.iotTemplateCategoryList = res.data
// console.log(this.iotTemplateCategoryList, "this.iotTemplateCategoryList");
});
})
},
created() {
this.getDicts("iot_device_font_type").then((res) => {
this.fontTypeOptions = res.data;
this.getDicts('iot_device_font_type').then(res => {
this.fontTypeOptions = res.data
// console.log(this.fontTypeOptions, "");
});
this.getDicts("iot_devices_font_color").then((res) => {
this.colorOptions = res.data;
})
this.getDicts('iot_devices_font_color').then(res => {
this.colorOptions = res.data
// console.log(this.colorOptions, "");
});
this.getDicts("iot_device_font_inScreen_mode").then((res) => {
this.inScreenModeOptions = res.data;
})
this.getDicts('iot_device_font_inScreen_mode').then(res => {
this.inScreenModeOptions = res.data
// console.log(this.inScreenModeOptions, "");
});
this.getdevicessize();
})
this.getdevicessize()
},
methods: {
init(devicePixel, type, mode) {
if (devicePixel) {
this.devicePixelBoolean = true;
this.dataForm.screenSize = devicePixel;
this.boardWidth = devicePixel.split("*")[0];
this.boardHeight = devicePixel.split("*")[1];
this.devicePixelBoolean = true
this.dataForm.screenSize = devicePixel
this.boardWidth = devicePixel.split('*')[0]
this.boardHeight = devicePixel.split('*')[1]
} else {
this.devicePixelBoolean = false;
(this.boardWidth = "400"), (this.boardHeight = "40");
this.devicePixelBoolean = false
;(this.boardWidth = '400'), (this.boardHeight = '40')
}
// type 1: 2:
// mode 1: 2
this.infoType = type;
this.infoType = type
if (mode == 1 || type == 1) {
this.categoryRules = false;
this.categoryRules = false
} else {
this.categoryRules = true;
this.categoryRules = true
}
// this.title = "";
this.isAdd = !this.dataForm.id;
this.dialogVisible = true;
this.templateDelContent = [];
this.isAdd = !this.dataForm.id
this.dialogVisible = true
this.templateDelContent = []
this.$nextTick(() => {
if (this.isAdd) {
this.$refs["dataForm"] && this.$refs["dataForm"].resetFields();
this.dataForm.id = "";
this.dataForm = {};
this.width = "400";
this.height = "40";
this.$refs['dataForm'] && this.$refs['dataForm'].resetFields()
this.dataForm.id = ''
this.dataForm = {}
this.width = '400'
this.height = '40'
this.dataForm = {
CONTENT: "请输入内容",
COLOR: "yellow",
FONT: "黑体",
SPEED: "1",
ACTION: "1",
CONTENT: '请输入内容',
COLOR: 'yellow',
FONT: '黑体',
SPEED: '1',
ACTION: '1',
// COORDINATE: "",
STATE: "true",
STAY: "5",
screenSize: devicePixel,
};
this.content = "请输入内容";
STATE: 'true',
STAY: '5',
screenSize: devicePixel
}
this.content = '请输入内容'
} else {
// this.getInfo();
// this.$refs["dataForm"] && this.$refs["dataForm"].clearValidate();
}
});
})
if (this.dataForm.screenSize) {
this.getFontSizeList(1);
this.getFontSizeList(1)
}
this.$forceUpdate();
this.$forceUpdate()
},
getFontSizeList(type) {
this.getDicts("iot_device_font_size").then((res) => {
this.fontSizeOpt = res.data;
this.getDicts('iot_device_font_size').then(res => {
this.fontSizeOpt = res.data
this.dataForm.FONT_SIZE = res.data[3].dictValue
if (type) {
this.alignment(2)
}
});
})
//TODO
/*getFontSizeByDevicePixel(this.dataForm.screenSize).then((res) => {
@ -571,17 +453,16 @@ export default {
},
//
getdevicessize() {
//TODO
this.screenSizeOptions = [
{
"device_pixel": "192*160"
device_pixel: '192*160'
},
{
"device_pixel": "480*48"
device_pixel: '480*48'
},
{
"device_pixel": "768*64"
device_pixel: '768*64'
}
]
@ -592,10 +473,10 @@ export default {
});*/
},
changeScreenSize(size) {
this.boardWidth = size.split("*")[0];
this.boardHeight = size.split("*")[1];
this.getFontSizeList();
this.$forceUpdate();
this.boardWidth = size.split('*')[0]
this.boardHeight = size.split('*')[1]
this.getFontSizeList()
this.$forceUpdate()
},
changeFontSize() {
console.log(this.dataForm.FONT_SIZE)
@ -608,19 +489,19 @@ export default {
//
close() {
this.checkList = [];
this.dialogVisible = false;
this.checkList = []
this.dialogVisible = false
},
faceDrop(e) {
e.preventDefault(); //
this.listquery.push(this.curDragImgItem);
e.preventDefault() //
this.listquery.push(this.curDragImgItem)
},
//
allowDrop(e) {
e.preventDefault(); //
e.preventDefault() //
},
ondragenter(e) {
e.preventDefault(); //
e.preventDefault() //
},
//
// getInfo() {
@ -653,80 +534,76 @@ export default {
// });
// if (!valid) return;
if (!this.dataForm.CONTENT.trim()) {
return this.$modal.msgError("当前输入内容为空");
return this.$modal.msgError('当前输入内容为空')
} else if (!this.dataForm.category && this.infoType == 2) {
return this.$modal.msgError("情报板所属类别不能为空");
return this.$modal.msgError('情报板所属类别不能为空')
}
//
checkIotBoardContent(this.dataForm.CONTENT).then((response) => {
checkIotBoardContent(this.dataForm.CONTENT).then(response => {
if (response.data == 0) {
return this.$modal.msgError("当前发布内容包含敏感字段,请修改");
return this.$modal.msgError('当前发布内容包含敏感字段,请修改')
} else if (response.data == 2) {
return this.$modal.msgError("当前输入内容为空");
}
else {
this.loading = true;
return this.$modal.msgError('当前输入内容为空')
} else {
this.loading = true
// let templateId = "";
let method = "put";
let method = 'put'
if (this.isAdd) {
if (this.infoType == 1) {
//
this.dataForm.STAY = Number(this.dataForm.STAY) * 100;
this.$emit("addInfo", this.dataForm);
this.dataForm.STAY = Number(this.dataForm.STAY) * 100
this.$emit('addInfo', this.dataForm)
} else {
//
const params1 = {
applyType: "",
applyType: '',
category: this.dataForm.category,
coordinate: "",
height: "",
id: "",
imageUrl: "",
imgSizeFrom: "",
coordinate: '',
height: '',
id: '',
imageUrl: '',
imgSizeFrom: '',
inScreenMode: this.dataForm.ACTION,
remark: "",
remark: '',
screenSize: this.dataForm.screenSize,
stopTime: Number(this.dataForm.STAY) * 100,
vmsType: "",
width: "",
};
const templateContent = [];
vmsType: '',
width: ''
}
const templateContent = []
templateContent.push({
content: this.dataForm.CONTENT,
coordinate: this.dataForm.COORDINATE,
fontColor: this.getColorStyle(this.dataForm.COLOR),
fontSize: this.dataForm.FONT_SIZE.substring(0, 2),
fontSpacing: this.dataForm.SPEED,
fontType: this.getFontStyle(this.dataForm.FONT),
});
fontType: this.getFontStyle(this.dataForm.FONT)
})
// this.$emit("addInfoMode", this.dataForm);
addTemplate(params1, method).then((data) => {
console.log(data, "新增口");
addTemplate(params1, method).then(data => {
console.log(data, '新增口')
let params2 = {
templateContent: templateContent,
templateId: data,
};
templateId: data
}
addTemplateContent(params2)
.then((res) => {
.then(res => {
if (res.code == 200) {
this.$emit("getActiveNames");
this.$message.success("添加成功");
this.$emit('getActiveNames')
this.$message.success('添加成功')
}
})
.catch((err) => {
throw err;
});
});
.catch(err => {
throw err
})
})
}
} else {
// //
// editTemplate(this.dataForm).then((data) => {});
// this.templateContent.forEach((e) => {
// e.img = e.imageName;
// });
// var params = {
// templateContent: this.templateContent,
// templateId: this.dataForm.id,
@ -736,47 +613,47 @@ export default {
// // console.log(response, "");
// });
}
this.loading = false;
this.dialogVisible = false;
this.isAdd = false;
this.$emit("refreshDataList", this.dataForm);
var textBoard2 = document.getElementsByClassName("textBoard2");
textBoard2[0].style.position = "absolute";
this.loading = false
this.dialogVisible = false
this.isAdd = false
this.$emit('refreshDataList', this.dataForm)
var textBoard2 = document.getElementsByClassName('textBoard2')
textBoard2[0].style.position = 'absolute'
}
});
})
},
/*********************************************业务代码***********************************************/
getFontStyle(font) {
if (font == "宋体") {
return "Simsun";
} else if (font == "黑体") {
return "SimHei";
} else if (font == "楷体") {
return "KaiTi";
} else if(font == "仿宋"){
return "FangSong";
} else if(font == "隶书"){
return 'LiSu';
if (font == '宋体') {
return 'Simsun'
} else if (font == '黑体') {
return 'SimHei'
} else if (font == '楷体') {
return 'KaiTi'
} else if (font == '仿宋') {
return 'FangSong'
} else if (font == '隶书') {
return 'LiSu'
}
},
getColorStyle(font) {
if (font == "黄色" ) {
return "yellow";
} else if (font == "红色" ) {
return "red";
} else if (font == "绿色" || font == 'GreenYellow') {
return "#00FF00";
} else if (font == "蓝色") {
return "blue";
if (font == '黄色') {
return 'yellow'
} else if (font == '红色') {
return 'red'
} else if (font == '绿色' || font == 'GreenYellow') {
return '#00FF00'
} else if (font == '蓝色') {
return 'blue'
} else {
return font;
return font
}
},
//
alignment(alignmentNum) {
this.alignmentNum = alignmentNum;
var divContent2 = document.getElementsByClassName("blackBoard2");
var textBoard2 = document.getElementsByClassName("textBoard2");
this.alignmentNum = alignmentNum
var divContent2 = document.getElementsByClassName('blackBoard2')
var textBoard2 = document.getElementsByClassName('textBoard2')
//
// let textWidth = textBoard2[0].offsetWidth;
// let textHeight = textBoard2[0].offsetHeight;
@ -788,58 +665,58 @@ export default {
switch (alignmentNum) {
//
case 1:
divContent2[0].style.justifyContent = "left";
divContent2[0].style.alignItems = "center";
divContent2[0].style.justifyContent = 'left'
divContent2[0].style.alignItems = 'center'
// textBoard2[0].style.textAlign = "left";
textBoard2[0].style.position = "static";
textBoard2[0].style.position = 'static'
break;
break
//
case 2:
divContent2[0].style.justifyContent = "center";
divContent2[0].style.alignItems = "center";
divContent2[0].style.justifyContent = 'center'
divContent2[0].style.alignItems = 'center'
// textBoard2[0].style.textAlign = "center";
textBoard2[0].style.position = "static";
textBoard2[0].style.position = 'static'
break;
break
//
case 3:
divContent2[0].style.justifyContent = "right";
divContent2[0].style.alignItems = "center";
divContent2[0].style.justifyContent = 'right'
divContent2[0].style.alignItems = 'center'
// textBoard2[0].style.textAlign = "right";
textBoard2[0].style.position = "static";
textBoard2[0].style.position = 'static'
break;
break
//
case 4:
divContent2[0].style.alignItems = "flex-start";
textBoard2[0].style.position = "static";
divContent2[0].style.alignItems = 'flex-start'
textBoard2[0].style.position = 'static'
break;
break
//
case 5:
divContent2[0].style.alignItems = "center";
textBoard2[0].style.position = "static";
divContent2[0].style.alignItems = 'center'
textBoard2[0].style.position = 'static'
break;
break
//
case 6:
divContent2[0].style.alignItems = "flex-end";
textBoard2[0].style.position = "static";
divContent2[0].style.alignItems = 'flex-end'
textBoard2[0].style.position = 'static'
break;
break
}
if (!alignmentNum) {
divContent2[0].style.alignItems = "center";
textBoard2[0].style.position = "static";
divContent2[0].style.alignItems = 'center'
textBoard2[0].style.position = 'static'
}
var textLeft = this.addZero(textBoard2[0].offsetLeft);
var textTop = this.addZero(textBoard2[0].offsetTop);
this.dataForm.COORDINATE = textLeft + textTop;
var textLeft = this.addZero(textBoard2[0].offsetLeft)
var textTop = this.addZero(textBoard2[0].offsetTop)
this.dataForm.COORDINATE = textLeft + textTop
// console.log(this.dataForm.COORDINATE, "this.dataForm.COORDINATE");
},
addZero(num) {
return ("000" + num).slice(-3);
return ('000' + num).slice(-3)
},
/*增加新的内容*/
@ -862,31 +739,27 @@ export default {
// }
// },
cliTest(data) {
this.ispreviewContent = this.templateContent.indexOf(data);
this.ispreviewContent = this.templateContent.indexOf(data)
},
/********************图片上传*********************/
handleRemove(file, fileList) {},
handlePreview(file) {},
handleExceed(files, fileList) {
this.$modal.msgError(
`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
files.length + fileList.length
} 个文件`
);
this.$modal.msgError(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`)
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
return this.$confirm(`确定移除 ${file.name}`)
},
handleClose(done) {
var textBoard2 = document.getElementsByClassName("textBoard2");
textBoard2[0].style.position = "absolute";
this.dialogVisible = false;
},
},
};
var textBoard2 = document.getElementsByClassName('textBoard2')
textBoard2[0].style.position = 'absolute'
this.dialogVisible = false
}
}
}
</script>
<style lang="less" scoped>
<style lang="scss" scoped>
.infoBoardButton {
::v-deep .el-radio-button--medium .el-radio-button__inner {
height: 3vh;

587
ruoyi-ui/src/views/information/board/editInfo.vue

@ -1,31 +1,17 @@
<template>
<div class="container infoBoardDialog">
<!-- 添加信息弹窗 -->
<el-dialog
title="修改"
:visible.sync="dialogVisible"
width="42%"
:before-close="closeDialog"
:close-on-click-modal="false"
>
<el-dialog title="修改" :visible.sync="dialogVisible" width="42%" :before-close="closeDialog" :close-on-click-modal="false">
<div class="dialogStyleBox">
<div class="dialogLine"></div>
<div class="dialogCloseButton"></div>
</div>
<el-card class="box-card">
<div
class="blackBoard1"
v-on:ondragenter="ondragenter"
v-on:drop="faceDrop"
v-on:dragover="allowDrop"
:style="{
<div class="blackBoard1" v-on:ondragenter="ondragenter" v-on:drop="faceDrop" v-on:dragover="allowDrop" :style="{
width: getDevicePixel(boardWidth, 0),
height: getDevicePixel(boardHeight, 1),
}"
>
<span
class="textBoard1 boardTextStyle"
:style="{
}">
<span class="textBoard1 boardTextStyle" :style="{
color: getColorStyle(dataForm.COLOR),
fontSize: getFontSize(dataForm.FONT_SIZE),
fontFamily: dataForm.FONT,
@ -33,40 +19,22 @@
left: getCoordinate(dataForm.COORDINATE.substring(0, 3), 0),
top: getCoordinate(dataForm.COORDINATE.substring(3, 6), 1),
maxHeight:getDevicePixel(boardHeight, 1),
}"
v-html="
}" v-html="
dataForm.CONTENT.replace(/\n|\r\n/g, '<br>').replace(
/ /g,
'&nbsp'
)
"
></span>
"></span>
</div>
</el-card>
<el-card>
<el-form
:model="dataForm"
:rules="dataRule"
label-width="90px"
ref="dataForm"
size="mini"
>
<el-form :model="dataForm" :rules="dataRule" label-width="90px" ref="dataForm" size="mini">
<el-row :gutter="24" style="height: 45px">
<el-col :span="8" v-show="this.boardEmitItem.type == 2 || this.dataForm.category">
<el-form-item prop="category" label="所属类别">
<el-select
v-model="dataForm.category"
placeholder="请选择所属类别"
size="mini"
disabled
>
<el-option
v-for="item in iotTemplateCategoryList"
:key="item.dictValue"
:label="item.dictLabel"
:value="item.dictValue"
>
<el-select v-model="dataForm.category" placeholder="请选择所属类别" size="mini" disabled>
<el-option v-for="item in iotTemplateCategoryList" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue">
</el-option>
</el-select>
</el-form-item>
@ -97,63 +65,29 @@
flex-wrap: wrap;width:100%">
<el-col :span="24">
<el-form-item label="详细内容" prop="CONTENT">
<el-input
type="textarea"
clearable
id="textContent"
placeholder="详细内容"
v-model="dataForm.CONTENT"
@keyup.native="keyDown($event)"
></el-input>
<el-input type="textarea" clearable id="textContent" placeholder="详细内容" v-model="dataForm.CONTENT" @keyup.native="keyDown($event)"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item prop="COLOR" label="字体颜色">
<el-select
v-model="dataForm.COLOR"
filterable
placeholder="请选择"
>
<el-option
v-for="item in colorOptions"
:key="item.cssClass"
:label="item.dictLabel"
:value="item.cssClass"
>
<el-select v-model="dataForm.COLOR" filterable placeholder="请选择">
<el-option v-for="item in colorOptions" :key="item.cssClass" :label="item.dictLabel" :value="item.cssClass">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item prop="FONT_SIZE" label="字体大小">
<el-select
v-model="dataForm.FONT_SIZE"
style="width: 100%"
@change="changeFontSize"
>
<el-option
v-for="item in fontSizeOpt"
:key="item.dictLabel"
:label="item.dictLabel"
:value="item.dictLabel"
>
<el-select v-model="dataForm.FONT_SIZE" style="width: 100%" @change="changeFontSize">
<el-option v-for="item in fontSizeOpt" :key="item.dictLabel" :label="item.dictLabel" :value="item.dictLabel">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item prop="FONT" label="字体类型">
<el-select
v-model="dataForm.FONT"
filterable
placeholder="请选择"
>
<el-option
v-for="item in fontTypeOptions"
:key="item.cssClass"
:label="item.dictLabel"
:value="item.cssClass"
>
<el-select v-model="dataForm.FONT" filterable placeholder="请选择">
<el-option v-for="item in fontTypeOptions" :key="item.cssClass" :label="item.dictLabel" :value="item.cssClass">
</el-option>
</el-select>
</el-form-item>
@ -184,27 +118,13 @@
</el-col> -->
<el-col :span="8">
<el-form-item prop="STAY" label="停留时间(秒)">
<el-input-number
:min="0"
controls-position="right"
v-model="dataForm.STAY"
style="width: 100%"
/>
<el-input-number :min="0" controls-position="right" v-model="dataForm.STAY" style="width: 100%" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item prop="ACTION" label="入屏方式">
<el-select
v-model="dataForm.ACTION"
filterable
placeholder="请选择"
>
<el-option
v-for="item in inScreenModeOptions"
:key="item.dictValue"
:label="item.dictLabel"
:value="item.dictValue"
>
<el-select v-model="dataForm.ACTION" filterable placeholder="请选择">
<el-option v-for="item in inScreenModeOptions" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue">
</el-option>
</el-select>
</el-form-item>
@ -239,15 +159,9 @@
</el-card>
<div slot="footer" class="dialog-footer">
<el-button
@click="dataFormSubmitHandle()"
v-loading="loading"
class="submitButton"
>确认
<el-button @click="dataFormSubmitHandle()" v-loading="loading" class="submitButton">确认
</el-button>
<el-button @click="closeDialog()" class="closeButton"
>取消</el-button
>
<el-button @click="closeDialog()" class="closeButton">取消</el-button>
</div>
</el-dialog>
</div>
@ -265,40 +179,40 @@ import {
editTemplateContent,
getGalleryList,
uploadBoardEditInfo,
getFontSizeByDevicePixel,
} from "@/api/board/template";
import { checkIotBoardContent } from "@/api/board/vocabulary";
import { HashMap } from "@/api/board/informationBoard";
getFontSizeByDevicePixel
} from '@/api/board/template'
import { checkIotBoardContent } from '@/api/board/vocabulary'
import { HashMap } from '@/api/board/informationBoard'
//
export const deepClone = (data) => {
export const deepClone = data => {
//
var type = typeof data;
var obj;
if (type === "array") {
obj = [];
} else if (type === "object") {
obj = {};
var type = typeof data
var obj
if (type === 'array') {
obj = []
} else if (type === 'object') {
obj = {}
} else {
//
return data;
return data
}
if (type === "array") {
if (type === 'array') {
for (var i = 0, len = data.length; i < len; i++) {
obj.push(deepClone(data[i]));
obj.push(deepClone(data[i]))
}
} else if (type === "object") {
} else if (type === 'object') {
for (var key in data) {
obj[key] = deepClone(data[key]);
obj[key] = deepClone(data[key])
}
}
return obj
}
return obj;
};
export default {
props: {
boardEmitItem: {
required: true,
type: Object,
},
type: Object
}
},
data() {
@ -306,48 +220,48 @@ export default {
radio1: '0',
alignmentNum: 2,
iotTemplateCategoryList: [],
content: "",
content: '',
boardWidth: "",
boardHeight: "",
boardWidth: '',
boardHeight: '',
// boardEmitItem:this.boardEmitItem,
disabled: true,
checkList: [], //
obj: "",
obj: '',
imgUrl: [],
imgUrlOther: [],
dialogVisible: false,
fileList: [
{
name: "food.jpeg",
url: "https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100",
name: 'food.jpeg',
url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'
},
{
name: "food2.jpeg",
url: "https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100",
},
name: 'food2.jpeg',
url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'
}
],
listquery: [], //
curDragImgItem: "",
curDragImgItem: '',
visible: false,
startTxt_x: "000",
startTxt_y: "000",
width: "400",
height: "40",
content: "",
fontColor: "yellow",
fontSize: "24",
fontType: "KaiTi",
startTxt_x: '000',
startTxt_y: '000',
width: '400',
height: '40',
content: '',
fontColor: 'yellow',
fontSize: '24',
fontType: 'KaiTi',
fontSpacing: 0,
coordinate: "000000",
url: "",
previewContent: "", //
coordinate: '000000',
url: '',
previewContent: '', //
ispreviewContent: -1,
dataForm: {
CONTENT: '',
STAY: '',
FONT: '',
COORDINATE:'',
COORDINATE: ''
// id: "",
// screenSize: "400*40", //
@ -363,45 +277,45 @@ export default {
// width: "",
// coordinate: "", //;3x3y
},
templateContentModel: "",
templateContentModel: '',
templateContent: [],
templateDelContent: [],
fontTypeOptions: [],
screenSizeOptions: [
{
type: "400*40",
type: '400*40'
},
{
type: "128*64",
},
type: '128*64'
}
],
colorOptions: [],
isCurrencyOptions: [
{
code: "0",
content: "通用",
code: '0',
content: '通用'
},
{
code: "1",
content: "仅为智能推荐模板",
},
code: '1',
content: '仅为智能推荐模板'
}
],
inScreenModeOptions: [],
imgSize: [
{
type: "1024*128",
name: "全屏",
type: '1024*128',
name: '全屏'
},
{
type: "",
name: "正常",
},
type: '',
name: '正常'
}
],
fontSizeOpt: [],
title: "选择图片",
title: '选择图片',
loading: false,
isAdd: false,
};
isAdd: false
}
},
// directives: {
// drag: function (el, binding, vnode) {
@ -451,67 +365,67 @@ export default {
CONTENT: [
{
required: true,
message: "请输入详细内容",
trigger: "blur",
},
message: '请输入详细内容',
trigger: 'blur'
}
],
fontColor: [
{
required: true,
message: "请填写字体颜色",
trigger: "blur",
},
message: '请填写字体颜色',
trigger: 'blur'
}
],
fontSize: [
{
required: true,
message: "请填写字体大小",
trigger: "blur",
},
message: '请填写字体大小',
trigger: 'blur'
}
],
fontType: [
{
required: true,
message: "请选择字体类型",
trigger: "blur",
},
message: '请选择字体类型',
trigger: 'blur'
}
],
fontSpacing: [
{
required: true,
message: "请选择字体间距",
trigger: "blur",
},
message: '请选择字体间距',
trigger: 'blur'
}
],
rollSpeed: [
{
required: true,
message: "请填写滚动速度",
trigger: "blur",
},
message: '请填写滚动速度',
trigger: 'blur'
}
],
stopTime: [
{
required: true,
message: "请填写停留时间",
trigger: "blur",
},
message: '请填写停留时间',
trigger: 'blur'
}
],
inScreenMode: [
{
required: true,
message: "请选择入屏方式",
trigger: "blur",
},
],
};
message: '请选择入屏方式',
trigger: 'blur'
}
]
}
},
divStyle: function () {
return {
width: this.width + "px",
height: this.height + "px",
};
},
width: this.width + 'px',
height: this.height + 'px'
}
}
},
watch: {
// boardEmitItem(newval){
@ -526,53 +440,47 @@ export default {
// },
},
created() {
console.log(this.boardEmitItem, "this.boardEmitItem");
this.getDicts("iot_template_category").then((res) => {
this.iotTemplateCategoryList = res.data;
console.log(this.iotTemplateCategoryList, "this.iotTemplateCategoryList");
});
this.getDicts("iot_device_font_type").then((res) => {
this.fontTypeOptions = res.data;
console.log(this.fontTypeOptions, "字体类型");
});
this.getDicts("iot_devices_font_color").then((res) => {
this.colorOptions = res.data;
console.log(this.colorOptions, "字体颜色");
});
console.log(this.boardEmitItem, 'this.boardEmitItem')
this.getDicts('iot_template_category').then(res => {
this.iotTemplateCategoryList = res.data
console.log(this.iotTemplateCategoryList, 'this.iotTemplateCategoryList')
})
this.getDicts('iot_device_font_type').then(res => {
this.fontTypeOptions = res.data
console.log(this.fontTypeOptions, '字体类型')
})
this.getDicts('iot_devices_font_color').then(res => {
this.colorOptions = res.data
console.log(this.colorOptions, '字体颜色')
})
// this.getDicts("iot_device_font_size").then((res) => {
// this.fontSizeOpt = res.data;
// console.log(this.fontSizeOpt, "");
// });
this.getDicts("iot_device_font_inScreen_mode").then((res) => {
this.inScreenModeOptions = res.data;
console.log(this.inScreenModeOptions, "入屏方式");
});
this.getDicts('iot_device_font_inScreen_mode').then(res => {
this.inScreenModeOptions = res.data
console.log(this.inScreenModeOptions, '入屏方式')
})
if (this.boardEmitItem) {
this.boardWidth = this.boardEmitItem.screenSize.split("*")[0];
this.boardHeight = this.boardEmitItem.screenSize.split("*")[1];
this.init();
this.boardWidth = this.boardEmitItem.screenSize.split('*')[0]
this.boardHeight = this.boardEmitItem.screenSize.split('*')[1]
this.init()
}
},
methods: {
init() {
this.title = "修改";
this.title = '修改'
this.dialogVisible = true;
this.itemPropertyMap = new HashMap();
this.dialogVisible = true
this.itemPropertyMap = new HashMap()
this.alignmentNum = 2
this.dataForm = JSON.parse(JSON.stringify(this.boardEmitItem));
this.dataForm = JSON.parse(JSON.stringify(this.boardEmitItem))
this.dataForm.COLOR = this.getColorValue(this.boardEmitItem.COLOR)
console.log(this.dataForm,"this.dataForm")
console.log(this.dataForm, 'this.dataForm')
// this.dataForm.FONT = this.getFont(this.boardEmitItem.FONT)
this.dataForm.CONTENT = JSON.parse(
JSON.stringify(
this.boardEmitItem.CONTENT.replace("<br>", "\n").replace(/ /g, " ").replace("<r><n>", "\n")
)
);
this.dataForm.STAY = JSON.parse(
JSON.stringify(Number(this.boardEmitItem.STAY) / 100)
);
this.getFontSizeList();
this.dataForm.CONTENT = JSON.parse(JSON.stringify(this.boardEmitItem.CONTENT.replace('<br>', '\n').replace(/ /g, ' ').replace('<r><n>', '\n')))
this.dataForm.STAY = JSON.parse(JSON.stringify(Number(this.boardEmitItem.STAY) / 100))
this.getFontSizeList()
},
getColorValue(color) {
if (color == '#00FF00') {
@ -582,9 +490,9 @@ export default {
}
},
getFontSizeList() {
this.getDicts("iot_device_font_size").then((res) => {
this.fontSizeOpt = res.data;
});
this.getDicts('iot_device_font_size').then(res => {
this.fontSizeOpt = res.data
})
/* getFontSizeByDevicePixel(this.dataForm.screenSize).then((res) => {
console.log(res, "根据分辨率筛字体大小");
@ -594,66 +502,66 @@ export default {
changeFontSize() {
setTimeout(() => {
this.alignment(this.alignmentNum)
},100);
}, 100)
},
alignment(alignmentNum) {
var divContent1 = document.getElementsByClassName("blackBoard1");
var textBoard1 = document.getElementsByClassName("textBoard1");
var divContent1 = document.getElementsByClassName('blackBoard1')
var textBoard1 = document.getElementsByClassName('textBoard1')
switch (alignmentNum) {
//
case 1:
textBoard1[0].style.position = "static";
divContent1[0].style.justifyContent = "left";
divContent1[0].style.alignItems = "center";
break;
textBoard1[0].style.position = 'static'
divContent1[0].style.justifyContent = 'left'
divContent1[0].style.alignItems = 'center'
break
//
case 2:
textBoard1[0].style.position = "static";
divContent1[0].style.justifyContent = "center";
divContent1[0].style.alignItems = "center";
break;
textBoard1[0].style.position = 'static'
divContent1[0].style.justifyContent = 'center'
divContent1[0].style.alignItems = 'center'
break
//
case 3:
divContent1[0].style.justifyContent = "right";
divContent1[0].style.alignItems = "center";
textBoard1[0].style.position = "static";
break;
divContent1[0].style.justifyContent = 'right'
divContent1[0].style.alignItems = 'center'
textBoard1[0].style.position = 'static'
break
//
case 4:
divContent1[0].style.alignItems = "flex-start";
textBoard1[0].style.position = "static";
divContent1[0].style.alignItems = 'flex-start'
textBoard1[0].style.position = 'static'
break;
break
//
case 5:
divContent1[0].style.alignItems = "center";
textBoard1[0].style.position = "static";
divContent1[0].style.alignItems = 'center'
textBoard1[0].style.position = 'static'
break;
break
//
case 6:
divContent1[0].style.alignItems = "flex-end";
textBoard1[0].style.position = "static";
divContent1[0].style.alignItems = 'flex-end'
textBoard1[0].style.position = 'static'
break;
break
}
var textLeft = this.addZero(JSON.parse(JSON.stringify(textBoard1[0].offsetLeft)));
var textTop = this.addZero(textBoard1[0].offsetTop);
var textLeft = this.addZero(JSON.parse(JSON.stringify(textBoard1[0].offsetLeft)))
var textTop = this.addZero(textBoard1[0].offsetTop)
this.dataForm.COORDINATE = textLeft + textTop;
this.dataForm.COORDINATE = textLeft + textTop
},
addZero(num) {
if (num < 0) {
return '000'
} else {
return ("000" + num).slice(-3);
return ('000' + num).slice(-3)
}
},
faceDrop(e) {
e.preventDefault(); //
this.listquery.push(this.curDragImgItem);
e.preventDefault() //
this.listquery.push(this.curDragImgItem)
},
/* 拆分分辨率大小 */
// resolvingPowerType(data) {
@ -664,36 +572,35 @@ export default {
// },
//
allowDrop(e) {
e.preventDefault(); //
e.preventDefault() //
},
ondragenter(e) {
e.preventDefault(); //
e.preventDefault() //
},
keyDown(ev) {
this.alignment(this.alignmentNum)
},
//
dataFormSubmitHandle() {
console.log(this.dataForm.type, "this.dataForm.type");
console.log(this.dataForm.type, 'this.dataForm.type')
if (!this.dataForm.CONTENT.trim()) {
return this.$modal.msgError("当前输入内容为空");
return this.$modal.msgError('当前输入内容为空')
}
checkIotBoardContent(this.dataForm.CONTENT).then((response) => {
checkIotBoardContent(this.dataForm.CONTENT).then(response => {
if (response.data == 0) {
return this.$modal.msgError("当前发布内容包含敏感字段,请修改");
return this.$modal.msgError('当前发布内容包含敏感字段,请修改')
} else if (response.data == 2) {
return this.$modal.msgError("当前输入内容为空");
}
else {
this.loading = true;
console.log(this.dataForm, "点击修改 表单");
return this.$modal.msgError('当前输入内容为空')
} else {
this.loading = true
console.log(this.dataForm, '点击修改 表单')
this.loading = false;
this.isAdd = false;
this.loading = false
this.isAdd = false
if (this.dataForm.type == 1) {
this.dataForm.STAY = Number(this.dataForm.STAY) * 100;
this.$emit("receiveForm", this.dataForm);
console.log(this.dataForm, "this.dataForm修改后给父组件传表单内容");
this.dataForm.STAY = Number(this.dataForm.STAY) * 100
this.$emit('receiveForm', this.dataForm)
console.log(this.dataForm, 'this.dataForm修改后给父组件传表单内容')
} else {
const tcontent = {
content: this.dataForm.CONTENT,
@ -714,10 +621,10 @@ export default {
templateId: this.dataForm.id,
updateBy: null,
updateTime: null,
width: null,
};
width: null
}
const param = {
applyType: "",
applyType: '',
category: this.dataForm.category,
createBy: null,
createTime: null,
@ -726,7 +633,7 @@ export default {
inScreenMode: this.dataForm.ACTION,
isCurrency: null,
params: {},
remark: "",
remark: '',
screenSize: this.dataForm.screenSize,
searchValue: null,
stopTime: Number(this.dataForm.STAY) * 100,
@ -734,12 +641,12 @@ export default {
templateType: null,
updateBy: null,
updateTime: null,
vmsType: "",
vmsType: '',
tcontent: tcontent,
templateId: this.dataForm.id,
};
editTemplate(param).then((data) => {});
let templateContent = [];
templateId: this.dataForm.id
}
editTemplate(param).then(data => {})
let templateContent = []
templateContent.push({
content: this.dataForm.CONTENT,
fontColor: this.dataForm.COLOR,
@ -748,101 +655,101 @@ export default {
fontSpacing: this.dataForm.SPEED,
coordinate: this.dataForm.COORDINATE,
id: this.dataForm.tcontentsId,
templateId: this.dataForm.id,
});
templateId: this.dataForm.id
})
var params = {
templateContent: templateContent,
templateId: this.dataForm.id,
templateDelContent: [],
};
console.log(params,"params")
editTemplateContent(params).then((response) => {
console.log(response, "返回结果");
this.$modal.msgSuccess("修改成功");
});
this.$forceUpdate();
templateDelContent: []
}
this.closeDialog();
console.log(params, 'params')
editTemplateContent(params).then(response => {
console.log(response, '返回结果')
this.$modal.msgSuccess('修改成功')
})
this.$forceUpdate()
}
});
this.closeDialog()
}
})
},
getFontStyle(font) {
if (font == "宋体") {
return "Simsun";
} else if (font == "黑体") {
return "SimHei";
} else if (font == "楷体") {
return "KaiTi";
} else if(font == "仿宋"){
return "FangSong";
} else if(font == "隶书"){
return 'LiSu';
if (font == '宋体') {
return 'Simsun'
} else if (font == '黑体') {
return 'SimHei'
} else if (font == '楷体') {
return 'KaiTi'
} else if (font == '仿宋') {
return 'FangSong'
} else if (font == '隶书') {
return 'LiSu'
}
},
getColorStyle(font) {
if (font == "黄色" ) {
return "yellow";
} else if (font == "红色" ) {
return "red";
} else if (font == "绿色" || font == 'GreenYellow') {
return "#00FF00";
} else if (font == "蓝色") {
return "blue";
if (font == '黄色') {
return 'yellow'
} else if (font == '红色') {
return 'red'
} else if (font == '绿色' || font == 'GreenYellow') {
return '#00FF00'
} else if (font == '蓝色') {
return 'blue'
} else {
return font;
return font
}
},
closeDialog() {
this.dialogVisible = false;
this.$emit("dialogClose");
this.dialogVisible = false
this.$emit('dialogClose')
},
getDevicePixel(devicePixel, num) {
if (num == 0) {
if (devicePixel > 768) {
return 768 + "px";
return 768 + 'px'
} else {
return devicePixel + "px";
return devicePixel + 'px'
}
} else if (num == 1) {
if (devicePixel > 128) {
return 128 + "px";
return 128 + 'px'
} else {
return devicePixel + "px";
return devicePixel + 'px'
}
}
},
getCoordinate(coordinate, num) {
if (num == 0) {
if (this.boardWidth > 768) {
let i = this.boardWidth / 768;
console.log(coordinate / i,"width")
return coordinate / i + "px";
let i = this.boardWidth / 768
console.log(coordinate / i, 'width')
return coordinate / i + 'px'
} else {
return coordinate + "px";
return coordinate + 'px'
}
} else if (num == 1) {
if (this.boardHeight > 128) {
let i = this.boardHeight / 128;
console.log(coordinate / i,"height")
return coordinate / i + "px";
let i = this.boardHeight / 128
console.log(coordinate / i, 'height')
return coordinate / i + 'px'
} else {
return coordinate + "px";
return coordinate + 'px'
}
}
},
getFontSize(size) {
if (this.boardWidth > 768) {
let i = this.boardWidth / 768;
return size.substring(0, 2) / i - 2 + "px";
let i = this.boardWidth / 768
return size.substring(0, 2) / i - 2 + 'px'
} else {
return size;
return size
}
}
}
}
},
},
};
</script>
<style lang="less" scoped>
<style lang="scss" scoped>
.previewContentCSS {
border: yellow 1px dashed;
}

104
ruoyi-ui/src/views/map/index.vue

@ -220,6 +220,110 @@ export default {
//
// 线
const path = [
new AMap.LngLat(116.865165, 36.579797),
new AMap.LngLat(116.836089, 36.58322),
new AMap.LngLat(116.831626, 36.583237),
new AMap.LngLat(116.825747, 36.582531),
new AMap.LngLat(116.821176, 36.581377),
new AMap.LngLat(116.813001, 36.578309),
new AMap.LngLat(116.808194, 36.575242),
new AMap.LngLat(116.803409, 36.571175),
new AMap.LngLat(116.799568, 36.566195),
new AMap.LngLat(116.786029, 36.538219),
new AMap.LngLat(116.783625, 36.534615),
new AMap.LngLat(116.77618, 36.526029),
new AMap.LngLat(116.76691, 36.517855),
new AMap.LngLat(116.762168, 36.513095),
new AMap.LngLat(116.751074, 36.49966),
new AMap.LngLat(116.730174, 36.48108),
new AMap.LngLat(116.726291, 36.476957),
new AMap.LngLat(116.722922, 36.472747),
new AMap.LngLat(116.707901, 36.451365),
new AMap.LngLat(116.705069, 36.44667),
new AMap.LngLat(116.702065, 36.440732),
new AMap.LngLat(116.699833, 36.435173),
new AMap.LngLat(116.69419, 36.417166),
new AMap.LngLat(116.69419, 36.417166),
new AMap.LngLat(116.688976, 36.408756),
new AMap.LngLat(116.684405, 36.404611),
new AMap.LngLat(116.677024, 36.400242),
new AMap.LngLat(116.66593, 36.39677),
new AMap.LngLat(116.658463, 36.394266),
new AMap.LngLat(116.65076, 36.390483),
new AMap.LngLat(116.644644, 36.387028),
new AMap.LngLat(116.637155, 36.384057),
new AMap.LngLat(116.625783, 36.381224),
new AMap.LngLat(116.617092, 36.378615),
new AMap.LngLat(116.609175, 36.375022),
new AMap.LngLat(116.595485, 36.364949),
new AMap.LngLat(116.58688, 36.35662),
new AMap.LngLat(116.58025, 36.351989),
new AMap.LngLat(116.571795, 36.348117),
new AMap.LngLat(116.55435, 36.342846),
new AMap.LngLat(116.545853, 36.338318),
new AMap.LngLat(116.53742, 36.331265),
new AMap.LngLat(116.521777, 36.309619),
new AMap.LngLat(116.516713, 36.305867),
new AMap.LngLat(116.503989, 36.300887),
new AMap.LngLat(116.497509, 36.2962),
new AMap.LngLat(116.486801, 36.27797),
new AMap.LngLat(116.484935, 36.271068),
new AMap.LngLat(116.484505, 36.264736),
new AMap.LngLat(116.483669, 36.261033),
new AMap.LngLat(116.480729, 36.251759),
new AMap.LngLat(116.479849, 36.246343),
new AMap.LngLat(116.480364, 36.24283),
new AMap.LngLat(116.481866, 36.235578),
new AMap.LngLat(116.48178, 36.231666),
new AMap.LngLat(116.479463, 36.225868),
new AMap.LngLat(116.459293, 36.203396),
new AMap.LngLat(116.456267, 36.198029),
new AMap.LngLat(116.454872, 36.192868),
new AMap.LngLat(116.4541, 36.169088),
new AMap.LngLat(116.452791, 36.163389),
new AMap.LngLat(116.450495, 36.158313),
new AMap.LngLat(116.445152, 36.150136),
new AMap.LngLat(116.442663, 36.145076),
new AMap.LngLat(116.441676, 36.133223),
new AMap.LngLat(116.439037, 36.124159),
new AMap.LngLat(116.438071, 36.116862),
new AMap.LngLat(116.438736, 36.111072),
new AMap.LngLat(116.442169, 36.09956),
new AMap.LngLat(116.442084, 36.084285),
new AMap.LngLat(116.441182, 36.070046),
new AMap.LngLat(116.447276, 36.045223),
new AMap.LngLat(116.445023, 36.048536),
new AMap.LngLat(116.432203, 36.018583),
new AMap.LngLat(116.431001, 36.01414),
new AMap.LngLat(116.430658, 36.002336),
new AMap.LngLat(116.412634, 35.974001),
new AMap.LngLat(116.407827, 35.946768),
new AMap.LngLat(116.416754, 35.904509),
new AMap.LngLat(116.411775, 35.887822),
new AMap.LngLat(116.357702, 35.807675),
new AMap.LngLat(116.339849, 35.790828),
new AMap.LngLat(116.33161, 35.780941),
new AMap.LngLat(116.311868, 35.769103),
new AMap.LngLat(116.298822, 35.751969),
new AMap.LngLat(116.261743, 35.724799),
new AMap.LngLat(116.238912, 35.695249),
new AMap.LngLat(116.205782, 35.669314),
new AMap.LngLat(116.182436, 35.640023),
new AMap.LngLat(116.160463, 35.625792),
new AMap.LngLat(116.143297, 35.607651)
]
const polyline = new AMap.Polyline({
path: path,
// showDir: true,
strokeWeight: 10, // 线 1
// strokeColor: '#00ff94', // 线
// fillColor: ['#FF0000', '#00FF00'], // 绿
lineJoin: 'round' // 线
})
this.map.add(polyline)
this.addMarkDataList = []
this.infoWindow = new window.AMap.InfoWindow({ offset: new AMap.Pixel(0, 0), anchor: 'middle-right' })
this.markDataList.forEach((item, index) => {

7
ruoyi-ui/vue.config.js

@ -34,7 +34,12 @@ module.exports = {
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
target: `http://127.0.0.1:8080`,
// target: `http://127.0.0.1:8080`,
// target: `http://10.168.66.196:8080`,
// target: `http://10.168.77.128:8080`,
// target: `http://192.168.0.182:8080`,
target: `http://192.168.0.194:8080`,
// target: `http://10.0.81.201:8080`,
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''

Loading…
Cancel
Save