装饰部分()未完成

yanzili 4 years ago
parent 36dd7d9555
commit e2d67d6bfd

Binary file not shown.

@ -54,6 +54,12 @@
<div class="content unicode" style="display: block;"> <div class="content unicode" style="display: block;">
<ul class="icon_lists dib-box"> <ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont">&#xe646;</span>
<div class="name">个性装扮</div>
<div class="code-name">&amp;#xe646;</div>
</li>
<li class="dib"> <li class="dib">
<span class="icon iconfont">&#xe72e;</span> <span class="icon iconfont">&#xe72e;</span>
<div class="name">仪表盘-抄表</div> <div class="name">仪表盘-抄表</div>
@ -678,9 +684,9 @@
<pre><code class="language-css" <pre><code class="language-css"
>@font-face { >@font-face {
font-family: 'iconfont'; font-family: 'iconfont';
src: url('iconfont.woff2?t=1624933667537') format('woff2'), src: url('iconfont.woff2?t=1624957634973') format('woff2'),
url('iconfont.woff?t=1624933667537') format('woff'), url('iconfont.woff?t=1624957634973') format('woff'),
url('iconfont.ttf?t=1624933667537') format('truetype'); url('iconfont.ttf?t=1624957634973') format('truetype');
} }
</code></pre> </code></pre>
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3> <h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
@ -706,6 +712,15 @@
<div class="content font-class"> <div class="content font-class">
<ul class="icon_lists dib-box"> <ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont icongexingzhuangban"></span>
<div class="name">
个性装扮
</div>
<div class="code-name">.icongexingzhuangban
</div>
</li>
<li class="dib"> <li class="dib">
<span class="icon iconfont iconyibiaopan-chaobiao"></span> <span class="icon iconfont iconyibiaopan-chaobiao"></span>
<div class="name"> <div class="name">
@ -1642,6 +1657,14 @@
<div class="content symbol"> <div class="content symbol">
<ul class="icon_lists dib-box"> <ul class="icon_lists dib-box">
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icongexingzhuangban"></use>
</svg>
<div class="name">个性装扮</div>
<div class="code-name">#icongexingzhuangban</div>
</li>
<li class="dib"> <li class="dib">
<svg class="icon svg-icon" aria-hidden="true"> <svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#iconyibiaopan-chaobiao"></use> <use xlink:href="#iconyibiaopan-chaobiao"></use>

@ -1,8 +1,8 @@
@font-face { @font-face {
font-family: "iconfont"; /* Project id 1513211 */ font-family: "iconfont"; /* Project id 1513211 */
src: url('iconfont.woff2?t=1624933667537') format('woff2'), src: url('iconfont.woff2?t=1624957634973') format('woff2'),
url('iconfont.woff?t=1624933667537') format('woff'), url('iconfont.woff?t=1624957634973') format('woff'),
url('iconfont.ttf?t=1624933667537') format('truetype'); url('iconfont.ttf?t=1624957634973') format('truetype');
} }
.iconfont { .iconfont {
@ -13,6 +13,10 @@
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.icongexingzhuangban:before {
content: "\e646";
}
.iconyibiaopan-chaobiao:before { .iconyibiaopan-chaobiao:before {
content: "\e72e"; content: "\e72e";
} }

File diff suppressed because one or more lines are too long

@ -5,6 +5,13 @@
"css_prefix_text": "icon", "css_prefix_text": "icon",
"description": "", "description": "",
"glyphs": [ "glyphs": [
{
"icon_id": "13087633",
"name": "个性装扮",
"font_class": "gexingzhuangban",
"unicode": "e646",
"unicode_decimal": 58950
},
{ {
"icon_id": "16466332", "icon_id": "16466332",
"name": "仪表盘-抄表", "name": "仪表盘-抄表",

@ -6,23 +6,21 @@
!--> !-->
<template> <template>
<div class="layout"> <div class="layout">
<div <div v-if="toolIsShow"
v-if="toolIsShow" class="layout-left"
class="layout-left" :style="{ width: widthLeftForTools + 'px' }">
:style="{ width: widthLeftForTools + 'px' }" <el-tabs type="border-card"
> :stretch="true">
<el-tabs type="border-card" :stretch="true">
<!-- 左侧组件栏--> <!-- 左侧组件栏-->
<el-tab-pane label="工具栏"> <el-tab-pane label="工具栏">
<!-- <el-divider content-position="center">html</el-divider>--> <!-- <el-divider content-position="center">html</el-divider>-->
<draggable <draggable v-for="widget in widgetTools"
v-for="widget in widgetTools" :key="widget.code"
:key="widget.code" @end="evt => widgetOnDragged(evt, widget.code)">
@end="evt => widgetOnDragged(evt, widget.code)"
>
<div class="tools-item"> <div class="tools-item">
<span class="tools-item-icon"> <span class="tools-item-icon">
<i class="iconfont" :class="widget.icon"></i> <i class="iconfont"
:class="widget.icon"></i>
</span> </span>
<span class="tools-item-text">{{ widget.label }}</span> <span class="tools-item-text">{{ widget.label }}</span>
</div> </div>
@ -30,15 +28,14 @@
</el-tab-pane> </el-tab-pane>
<!-- 左侧图层--> <!-- 左侧图层-->
<el-tab-pane label="图层"> <el-tab-pane label="图层">
<div <div v-for="(item, index) in layerWidget"
v-for="(item, index) in layerWidget" :key="index"
:key="index" class="tools-item"
class="tools-item" :class="widgetIndex == index ? 'is-active' : ''"
:class="widgetIndex == index ? 'is-active' : ''" @click="layerClick(index)">
@click="layerClick(index)"
>
<span class="tools-item-icon"> <span class="tools-item-icon">
<i class="iconfont" :class="item.icon"></i> <i class="iconfont"
:class="item.icon"></i>
</span> </span>
<span class="tools-item-text">{{ item.label }}</span> <span class="tools-item-text">{{ item.label }}</span>
</div> </div>
@ -46,61 +43,78 @@
</el-tabs> </el-tabs>
</div> </div>
<div <div class="layout-left-fold"
class="layout-left-fold" :style="{ width: widthLeftForToolsHideButton + 'px' }"
:style="{ width: widthLeftForToolsHideButton + 'px' }" @click="toolIsShow = !toolIsShow">
@click="toolIsShow = !toolIsShow"
>
<i class="iconfont iconzhankai" /> <i class="iconfont iconzhankai" />
</div> </div>
<div <div class="layout-middle"
class="layout-middle" :style="{ width: middleWidth + 'px', height: middleHeight + 'px' }">
:style="{ width: middleWidth + 'px', height: middleHeight + 'px' }"
>
<div class="top-button"> <div class="top-button">
<span class="btn border-right">
<ul class="nav">
<li><i class="el-icon-brush"></i>
<ul>
<li>
<div><i class="el-icon-full-screen mr10"></i>边框 <i class="el-icon-arrow-right ml20"></i></div>
<ul class="three-level">
<li><a href="#">三级菜单项</a></li>
<li><a href="#">三级菜单项</a></li>
<li><a href="#">三级菜单项</a></li>
<li><a href="#">三级菜单项</a></li>
<li><a href="#">三级菜单项</a></li>
</ul>
</li>
<li>
<div><i class="el-icon-magic-stick mr10"></i>装饰<i class="el-icon-arrow-right ml20"></i></div>
<ul class="three-level">
<li><a href="#">三级菜单项</a></li>
<li><a href="#">三级菜单项</a></li>
<li><a href="#">三级菜单项</a></li>
<li><a href="#">三级菜单项</a></li>
<li><a href="#">三级菜单项</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</span>
<span class="btn"> <span class="btn">
<el-tooltip <el-tooltip class="item"
class="item" effect="dark"
effect="dark" content="保存"
content="保存" placement="bottom">
placement="bottom" <i class="iconfont iconsave"
> @click="saveData"></i>
<i class="iconfont iconsave" @click="saveData"></i>
</el-tooltip> </el-tooltip>
</span> </span>
<span class="btn"> <span class="btn">
<el-tooltip <el-tooltip class="item"
class="item" effect="dark"
effect="dark" content="预览"
content="预览" placement="bottom">
placement="bottom" <i class="iconfont iconyulan"
> @click="viewScreen"></i>
<i class="iconfont iconyulan" @click="viewScreen"></i>
</el-tooltip> </el-tooltip>
</span> </span>
</div> </div>
<div <div class="workbench-container"
class="workbench-container" :style="{
:style="{
width: bigscreenWidthInWorkbench + 'px', width: bigscreenWidthInWorkbench + 'px',
height: bigscreenHeightInWorkbench + 'px' height: bigscreenHeightInWorkbench + 'px'
}" }"
@mousedown="handleMouseDown" @mousedown="handleMouseDown">
> <vue-ruler-tool v-model="dashboard.presetLine"
<vue-ruler-tool class="vueRuler"
v-model="dashboard.presetLine" :step-length="50"
class="vueRuler" :parent="true"
:step-length="50" :position="'relative'"
:parent="true" :is-scale-revise="true"
:position="'relative'" :visible.sync="dashboard.presetLineVisible">
:is-scale-revise="true" <div id="workbench"
:visible.sync="dashboard.presetLineVisible" class="workbench"
> :style="{
<div
id="workbench"
class="workbench"
:style="{
transform: workbenchTransform, transform: workbenchTransform,
width: bigscreenWidth + 'px', width: bigscreenWidth + 'px',
height: bigscreenHeight + 'px', height: bigscreenHeight + 'px',
@ -113,70 +127,56 @@
'background-origin': 'initial', 'background-origin': 'initial',
'background-clip': 'initial' 'background-clip': 'initial'
}" }"
@click.self="setOptionsOnClickScreen" @click.self="setOptionsOnClickScreen">
> <widget ref="widgets"
<widget v-for="(widget, index) in widgets"
ref="widgets" :key="index"
v-for="(widget, index) in widgets" v-model="widget.value"
:key="index" :index="index"
v-model="widget.value" :type="widget.type"
:index="index" :bigscreen="{ bigscreenWidth, bigscreenHeight }"
:type="widget.type" @onActivated="setOptionsOnClickWidget"
:bigscreen="{ bigscreenWidth, bigscreenHeight }" @contextmenu.prevent.native="rightClick($event, index)"
@onActivated="setOptionsOnClickWidget" @mousedown.prevent.native="widgetsClick(index)" />
@contextmenu.prevent.native="rightClick($event, index)"
@mousedown.prevent.native="widgetsClick(index)"
/>
</div> </div>
</vue-ruler-tool> </vue-ruler-tool>
</div> </div>
</div> </div>
<div class="layout-right" :style="{ width: widthLeftForOptions + 'px' }"> <div class="layout-right"
<el-tabs v-model="activeName" type="border-card" :stretch="true"> :style="{ width: widthLeftForOptions + 'px' }">
<el-tab-pane <el-tabs v-model="activeName"
v-if=" type="border-card"
:stretch="true">
<el-tab-pane v-if="
isNotNull(widgetOptions.setup) || isNotNull(widgetOptions.collapse) isNotNull(widgetOptions.setup) || isNotNull(widgetOptions.collapse)
" "
name="first" name="first"
label="配置" label="配置">
> <dynamicForm ref="formData"
<dynamicForm :options="widgetOptions.setup"
ref="formData" @onChanged="val => widgetValueChanged('setup', val)" />
:options="widgetOptions.setup"
@onChanged="val => widgetValueChanged('setup', val)"
/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane <el-tab-pane v-if="isNotNull(widgetOptions.data)"
v-if="isNotNull(widgetOptions.data)" name="second"
name="second" label="数据">
label="数据" <dynamicForm ref="formData"
> :options="widgetOptions.data"
<dynamicForm @onChanged="val => widgetValueChanged('data', val)" />
ref="formData"
:options="widgetOptions.data"
@onChanged="val => widgetValueChanged('data', val)"
/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane <el-tab-pane v-if="isNotNull(widgetOptions.position)"
v-if="isNotNull(widgetOptions.position)" name="third"
name="third" label="坐标">
label="坐标" <dynamicForm ref="formData"
> :options="widgetOptions.position"
<dynamicForm @onChanged="val => widgetValueChanged('position', val)" />
ref="formData"
:options="widgetOptions.position"
@onChanged="val => widgetValueChanged('position', val)"
/>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
<content-menu <content-menu :visible.sync="visibleContentMenu"
:visible.sync="visibleContentMenu" :style-obj="styleObj"
:style-obj="styleObj" @deletelayer="deletelayer" />
@deletelayer="deletelayer"
/>
</div> </div>
</template> </template>
@ -197,7 +197,7 @@ export default {
dynamicForm, dynamicForm,
contentMenu contentMenu
}, },
data() { data () {
return { return {
layerWidget: [], layerWidget: [],
widgetTools: widgetTools, // js widgetTools: widgetTools, // js
@ -264,7 +264,7 @@ export default {
}, },
computed: { computed: {
// //
middleWidth() { middleWidth () {
var widthLeftAndRight = 0; var widthLeftAndRight = 0;
if (this.toolIsShow) { if (this.toolIsShow) {
widthLeftAndRight += this.widthLeftForTools; // widthLeftAndRight += this.widthLeftForTools; //
@ -275,37 +275,36 @@ export default {
var middleWidth = this.bodyWidth - widthLeftAndRight; var middleWidth = this.bodyWidth - widthLeftAndRight;
return middleWidth; return middleWidth;
}, },
middleHeight() { middleHeight () {
return this.bodyHeight; return this.bodyHeight;
}, },
// //
bigscreenScaleInWorkbench() { bigscreenScaleInWorkbench () {
var widthScale = this.middleWidth / this.bigscreenWidth; var widthScale = this.middleWidth / this.bigscreenWidth;
var heightScale = this.middleHeight / this.bigscreenHeight; var heightScale = this.middleHeight / this.bigscreenHeight;
return Math.min(widthScale, heightScale); return Math.min(widthScale, heightScale);
}, },
workbenchTransform() { workbenchTransform () {
return `scale(${this.bigscreenScaleInWorkbench}, ${ return `scale(${this.bigscreenScaleInWorkbench}, ${this.bigscreenScaleInWorkbench
this.bigscreenScaleInWorkbench })`;
})`;
}, },
// //
bigscreenWidthInWorkbench() { bigscreenWidthInWorkbench () {
return this.getPXUnderScale(this.bigscreenWidth); return this.getPXUnderScale(this.bigscreenWidth);
}, },
bigscreenHeightInWorkbench() { bigscreenHeightInWorkbench () {
return this.getPXUnderScale(this.bigscreenHeight); return this.getPXUnderScale(this.bigscreenHeight);
} }
}, },
watch: { watch: {
widgets: { widgets: {
handler(val) { handler (val) {
this.handlerLayerWidget(val); this.handlerLayerWidget(val);
}, },
deep: true deep: true
} }
}, },
mounted() { mounted () {
// //
this.setOptionsOnClickScreen(); this.setOptionsOnClickScreen();
@ -314,7 +313,7 @@ export default {
this.widgets = []; this.widgets = [];
}, },
methods: { methods: {
handlerLayerWidget(val) { handlerLayerWidget (val) {
const layerWidgetArr = []; const layerWidgetArr = [];
for (let i = 0; i < val.length; i++) { for (let i = 0; i < val.length; i++) {
const obj = {}; const obj = {};
@ -329,7 +328,7 @@ export default {
} }
this.layerWidget = layerWidgetArr; this.layerWidget = layerWidgetArr;
}, },
async initEchartData() { async initEchartData () {
const reportCode = this.$route.query.reportCode; const reportCode = this.$route.query.reportCode;
const { code, data } = await detailDashboard(reportCode); const { code, data } = await detailDashboard(reportCode);
if (code != 200) return; if (code != 200) return;
@ -338,7 +337,7 @@ export default {
this.widgets = processData; this.widgets = processData;
this.dashboard = screenData; this.dashboard = screenData;
}, },
handleBigScreen(data) { handleBigScreen (data) {
const optionScreen = this.deepClone(getToolByCode("screen").options); const optionScreen = this.deepClone(getToolByCode("screen").options);
const setup = optionScreen.setup; const setup = optionScreen.setup;
for (const key in data) { for (const key in data) {
@ -356,7 +355,7 @@ export default {
width: data.width width: data.width
}; };
}, },
handleInitEchartsData(data) { handleInitEchartsData (data) {
const widgets = data.dashboard.widgets; const widgets = data.dashboard.widgets;
const widgetsData = []; const widgetsData = [];
for (let i = 0; i < widgets.length; i++) { for (let i = 0; i < widgets.length; i++) {
@ -376,7 +375,7 @@ export default {
} }
return widgetsData; return widgetsData;
}, },
handleOptionsData(data, option) { handleOptionsData (data, option) {
for (const key in data.setup) { for (const key in data.setup) {
for (let i = 0; i < option.setup.length; i++) { for (let i = 0; i < option.setup.length; i++) {
let item = option.setup[i]; let item = option.setup[i];
@ -415,7 +414,7 @@ export default {
return option; return option;
}, },
// //
async saveData() { async saveData () {
if (!this.widgets || this.widgets.length == 0) { if (!this.widgets || this.widgets.length == 0) {
this.$message.error("请添加组件"); this.$message.error("请添加组件");
return; return;
@ -437,7 +436,7 @@ export default {
} }
}, },
// //
viewScreen() { viewScreen () {
var routeUrl = this.$router.resolve({ var routeUrl = this.$router.resolve({
path: "/bigscreen/viewer", path: "/bigscreen/viewer",
query: { reportCode: this.$route.query.reportCode } query: { reportCode: this.$route.query.reportCode }
@ -445,12 +444,12 @@ export default {
window.open(routeUrl.href, "_blank"); window.open(routeUrl.href, "_blank");
}, },
// //
getPXUnderScale(px) { getPXUnderScale (px) {
return this.bigscreenScaleInWorkbench * px; return this.bigscreenScaleInWorkbench * px;
}, },
// //
widgetOnDragged(evt, widgetCode) { widgetOnDragged (evt, widgetCode) {
var widgetType = widgetCode; var widgetType = widgetCode;
// //
@ -491,7 +490,7 @@ export default {
}, },
// //
handleDefaultValue(widgetJson) { handleDefaultValue (widgetJson) {
for (const key in widgetJson) { for (const key in widgetJson) {
if (key == "options") { if (key == "options") {
// collapsedatapositionsetup // collapsedatapositionsetup
@ -531,12 +530,12 @@ export default {
} }
return widgetJson; return widgetJson;
}, },
layerClick(index) { layerClick (index) {
this.widgetIndex = index; this.widgetIndex = index;
this.widgetsClick(index); this.widgetsClick(index);
}, },
// //
setOptionsOnClickScreen() { setOptionsOnClickScreen () {
this.screenCode = "screen"; this.screenCode = "screen";
// //
this.activeName = "first"; this.activeName = "first";
@ -544,7 +543,7 @@ export default {
}, },
// //
setOptionsOnClickWidget(obj) { setOptionsOnClickWidget (obj) {
this.screenCode = ""; this.screenCode = "";
if (typeof obj == "number") { if (typeof obj == "number") {
this.widgetOptions = this.deepClone(this.widgets[obj]["options"]); this.widgetOptions = this.deepClone(this.widgets[obj]["options"]);
@ -564,7 +563,7 @@ export default {
}); });
this.widgetOptions = this.deepClone(this.widgets[obj.index]["options"]); this.widgetOptions = this.deepClone(this.widgets[obj.index]["options"]);
}, },
widgetsClick(index) { widgetsClick (index) {
const draggableArr = this.$refs.widgets; const draggableArr = this.$refs.widgets;
for (let i = 0; i < draggableArr.length; i++) { for (let i = 0; i < draggableArr.length; i++) {
if (i == index) { if (i == index) {
@ -575,14 +574,14 @@ export default {
} }
this.setOptionsOnClickWidget(index); this.setOptionsOnClickWidget(index);
}, },
handleMouseDown() { handleMouseDown () {
const draggableArr = this.$refs.widgets; const draggableArr = this.$refs.widgets;
for (let i = 0; i < draggableArr.length; i++) { for (let i = 0; i < draggableArr.length; i++) {
this.$refs.widgets[i].$refs.draggable.setActive(false); this.$refs.widgets[i].$refs.draggable.setActive(false);
} }
}, },
// //
widgetValueChanged(key, val) { widgetValueChanged (key, val) {
if (this.screenCode == "screen") { if (this.screenCode == "screen") {
this.dashboard = this.deepClone(val); this.dashboard = this.deepClone(val);
} else { } else {
@ -594,7 +593,7 @@ export default {
} }
} }
}, },
rightClick(event, index) { rightClick (event, index) {
this.rightClickIndex = index; this.rightClickIndex = index;
const left = event.clientX; const left = event.clientX;
const top = event.clientY; const top = event.clientY;
@ -608,10 +607,10 @@ export default {
this.visibleContentMenu = true; this.visibleContentMenu = true;
return false; return false;
}, },
deletelayer() { deletelayer () {
this.widgets.splice(this.rightClickIndex, 1); this.widgets.splice(this.rightClickIndex, 1);
}, },
setDefaultValue(options, val) { setDefaultValue (options, val) {
for (let i = 0; i < options.length; i++) { for (let i = 0; i < options.length; i++) {
if (Object.prototype.toString.call(options[i]) == "[object Object]") { if (Object.prototype.toString.call(options[i]) == "[object Object]") {
for (const k in val) { for (const k in val) {
@ -640,6 +639,15 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.mr10 {
margin-right: 10px;
}
.ml20 {
margin-left: 20px;
}
.border-right {
border-right: 1px solid #566876;
}
.is-active { .is-active {
background: #31455d !important; background: #31455d !important;
color: #bfcbd9 !important; color: #bfcbd9 !important;
@ -833,4 +841,80 @@ export default {
} }
} }
} }
ul,
li {
list-style: none;
margin: 0;
padding: 0;
}
.nav {
}
.nav > li {
display: inline-block;
position: relative;
}
.nav > li > a {
text-decoration: none;
}
.nav > li:hover > a {
color: rgb(0, 136, 214);
}
.nav a {
color: #cde8ff;
display: block;
text-decoration: none;
}
.nav ul {
display: none;
background: #00113a;
position: absolute;
z-index: 10000;
width: 120px;
margin-left: -20px;
}
.nav ul li {
position: relative;
font-size: 12px;
}
.nav > li:hover > ul {
display: block;
}
.nav > li > .three-level > li > a {
width: 10em;
padding-left: 1em;
padding-right: 1em;
background-color: #0f2030;
}
// .nav li .three-level li {
// display: none;
// }
.nav > li > ul > li:hover > a {
display: block;
background-color: #182e42;
color: #fff;
}
.nav > li > ul > li > ul {
left: 100%;
top: 0;
}
.nav > li:last-child > ul > li > ul {
left: -100%;
top: 0;
}
.nav > li > ul > li:hover > ul {
display: block;
}
.nav > li > ul > li > ul > li > a {
padding-top: 0.4em;
padding-bottom: 0.4em;
width: 10em;
padding-left: 1em;
padding-right: 1em;
background-color: rgb(50, 50, 50);
}
.nav > li > ul > li > ul > li:hover > a {
background-color: rgb(255, 255, 0);
color: rgb(0, 0, 0);
}
</style> </style>

Loading…
Cancel
Save