2021-03-22 19:05:35 +08:00
|
|
|
|
<template>
|
2021-05-06 23:40:34 +08:00
|
|
|
|
<el-row>
|
2021-05-20 00:33:07 +08:00
|
|
|
|
<el-header class="de-header">
|
2022-03-10 10:38:33 +08:00
|
|
|
|
<el-col
|
|
|
|
|
:span="8"
|
|
|
|
|
style="text-overflow:ellipsis;overflow: hidden;white-space: nowrap;color: #606266;font-size: 16px"
|
|
|
|
|
>
|
2021-05-20 00:33:07 +08:00
|
|
|
|
<span style="line-height: 35px;">
|
|
|
|
|
{{ $t('commons.name') }} :{{ panelInfo.name || '测试仪表板' }}
|
|
|
|
|
</span>
|
|
|
|
|
</el-col>
|
2021-05-06 23:40:34 +08:00
|
|
|
|
<!--横向工具栏-->
|
2021-05-20 00:33:07 +08:00
|
|
|
|
<el-col :span="16">
|
2021-05-31 11:20:32 +08:00
|
|
|
|
<Toolbar
|
2021-07-06 18:34:01 +08:00
|
|
|
|
ref="toolbar"
|
2021-05-31 11:20:32 +08:00
|
|
|
|
:style-button-active="show&&showIndex===2"
|
|
|
|
|
:aided-button-active="aidedButtonActive"
|
|
|
|
|
@showPanel="showPanel"
|
|
|
|
|
@previewFullScreen="previewFullScreen"
|
|
|
|
|
@changeAidedDesign="changeAidedDesign"
|
2022-03-17 21:14:19 +08:00
|
|
|
|
@outerParamsSetVisibleChange="outerParamsSetVisibleChange"
|
2021-05-31 11:20:32 +08:00
|
|
|
|
/>
|
2021-05-20 00:33:07 +08:00
|
|
|
|
</el-col>
|
|
|
|
|
</el-header>
|
2021-05-20 11:18:31 +08:00
|
|
|
|
<de-container>
|
|
|
|
|
<de-aside-container class="ms-aside-container">
|
2021-11-23 15:34:42 +08:00
|
|
|
|
<div v-if="showAside" style="width: 60px; left: 0px; top: 0px; bottom: 0px; position: absolute">
|
2022-03-10 10:38:33 +08:00
|
|
|
|
<div
|
|
|
|
|
style="width: 60px;height: 100%;overflow: hidden auto;position: relative;margin: 0px auto; font-size: 14px"
|
|
|
|
|
>
|
2021-05-31 11:20:32 +08:00
|
|
|
|
<!-- 视图图表 start -->
|
2022-03-10 10:38:33 +08:00
|
|
|
|
<div
|
|
|
|
|
class="button-div-class"
|
|
|
|
|
style=" width: 24px;height: 24px;text-align: center;line-height: 1;position: relative;margin: 16px auto 0px;"
|
|
|
|
|
>
|
2022-02-14 18:57:35 +08:00
|
|
|
|
<el-button circle class="el-icon-circle-plus-outline" size="mini" @click="newChart()" />
|
2021-05-20 11:18:31 +08:00
|
|
|
|
</div>
|
2021-10-11 18:39:43 +08:00
|
|
|
|
<div class="button-text" style="position: relative; margin: 18px auto 16px;">
|
2022-03-10 10:38:33 +08:00
|
|
|
|
<div
|
|
|
|
|
style="max-width: 100%;text-align: center;white-space: nowrap;text-overflow: ellipsis;position: relative;flex-shrink: 0;"
|
|
|
|
|
>
|
2021-05-20 11:18:31 +08:00
|
|
|
|
{{ $t('panel.view') }}
|
2021-03-22 19:05:35 +08:00
|
|
|
|
</div>
|
2021-05-20 11:18:31 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div style="height: 1px; position: relative; margin: 0px auto;background-color:#E6E6E6;">
|
2022-03-10 10:38:33 +08:00
|
|
|
|
<div
|
|
|
|
|
style="width: 60px;height: 1px;line-height: 1px;text-align: center;white-space: pre;text-overflow: ellipsis;position: relative;flex-shrink: 0;"
|
|
|
|
|
/>
|
2021-05-20 11:18:31 +08:00
|
|
|
|
</div>
|
2021-05-31 11:20:32 +08:00
|
|
|
|
<!-- 视图图表 end -->
|
|
|
|
|
<!-- 过滤组件 start -->
|
2021-12-24 13:29:24 +08:00
|
|
|
|
|
2022-03-10 10:38:33 +08:00
|
|
|
|
<div
|
|
|
|
|
class="button-div-class"
|
|
|
|
|
style=" width: 24px;height: 24px;text-align: center;line-height: 1;position: relative;margin: 16px auto 0px; "
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
circle
|
|
|
|
|
:class="show&&showIndex===1? 'button-show':'button-closed'"
|
|
|
|
|
class="el-icon-s-tools"
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="showPanel(1)"
|
|
|
|
|
/>
|
2021-12-24 13:29:24 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="button-text" style=" position: relative; margin: 18px auto 16px;">
|
2022-03-10 10:38:33 +08:00
|
|
|
|
<div
|
|
|
|
|
style=" max-width: 100%;text-align: center;white-space: nowrap;text-overflow: ellipsis;position: relative;flex-shrink: 0;"
|
|
|
|
|
>
|
2021-12-24 13:29:24 +08:00
|
|
|
|
{{ $t('panel.module') }}
|
2021-03-22 19:05:35 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2021-12-24 13:29:24 +08:00
|
|
|
|
|
2021-05-27 18:54:06 +08:00
|
|
|
|
<div style="height: 1px; position: relative; margin: 0px auto;background-color:#E6E6E6;">
|
2022-03-10 10:38:33 +08:00
|
|
|
|
<div
|
|
|
|
|
style="width: 60px;height: 1px;line-height: 1px;text-align: center;white-space: pre;text-overflow: ellipsis;position: relative;flex-shrink: 0;"
|
|
|
|
|
/>
|
2021-05-27 18:54:06 +08:00
|
|
|
|
</div>
|
2021-05-31 11:20:32 +08:00
|
|
|
|
<!-- 过滤组件 end -->
|
2021-06-01 22:46:08 +08:00
|
|
|
|
<!-- 其他组件 start -->
|
2021-12-24 13:29:24 +08:00
|
|
|
|
|
2022-03-10 10:38:33 +08:00
|
|
|
|
<div
|
|
|
|
|
class="button-div-class"
|
|
|
|
|
style=" width: 24px;height: 24px;text-align: center;line-height: 1;position: relative;margin: 16px auto 0px; "
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
circle
|
|
|
|
|
:class="show&&showIndex===3? 'button-show':'button-closed'"
|
|
|
|
|
class="el-icon-brush"
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="showPanel(3)"
|
|
|
|
|
/>
|
2021-12-24 13:29:24 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="button-text" style=" position: relative; margin: 18px auto 16px;">
|
2022-03-10 10:38:33 +08:00
|
|
|
|
<div
|
|
|
|
|
style=" max-width: 100%;text-align: center;white-space: nowrap;text-overflow: ellipsis;position: relative;flex-shrink: 0;"
|
|
|
|
|
>
|
2021-12-24 13:29:24 +08:00
|
|
|
|
{{ $t('panel.other_module') }}
|
2021-06-01 22:46:08 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2021-12-24 13:29:24 +08:00
|
|
|
|
|
2021-06-01 22:46:08 +08:00
|
|
|
|
<div style="height: 1px; position: relative; margin: 0px auto;background-color:#E6E6E6;">
|
2022-03-10 10:38:33 +08:00
|
|
|
|
<div
|
|
|
|
|
style="width: 60px;height: 1px;line-height: 1px;text-align: center;white-space: pre;text-overflow: ellipsis;position: relative;flex-shrink: 0;"
|
|
|
|
|
/>
|
2021-06-01 22:46:08 +08:00
|
|
|
|
</div>
|
|
|
|
|
<!-- 其他组件 end -->
|
2022-02-14 18:57:35 +08:00
|
|
|
|
|
|
|
|
|
<!-- 视图复用 start -->
|
2022-03-10 10:38:33 +08:00
|
|
|
|
<div
|
|
|
|
|
class="button-div-class"
|
|
|
|
|
style=" width: 24px;height: 24px;text-align: center;line-height: 1;position: relative;margin: 16px auto 0px;"
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
:class="show&&showIndex===0? 'button-show':'button-closed'"
|
|
|
|
|
circle
|
|
|
|
|
class="el-icon-copy-document"
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="showPanel(0)"
|
|
|
|
|
/>
|
2022-02-14 18:57:35 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="button-text" style="position: relative; margin: 18px auto 16px;">
|
2022-03-10 10:38:33 +08:00
|
|
|
|
<div
|
|
|
|
|
style="max-width: 100%;text-align: center;white-space: nowrap;text-overflow: ellipsis;position: relative;flex-shrink: 0;"
|
|
|
|
|
>
|
2022-02-14 18:57:35 +08:00
|
|
|
|
<!-- {{ $t('panel.view') }}-->
|
|
|
|
|
复用
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="height: 1px; position: relative; margin: 0px auto;background-color:#E6E6E6;">
|
2022-03-10 10:38:33 +08:00
|
|
|
|
<div
|
|
|
|
|
style="width: 60px;height: 1px;line-height: 1px;text-align: center;white-space: pre;text-overflow: ellipsis;position: relative;flex-shrink: 0;"
|
|
|
|
|
/>
|
2022-02-14 18:57:35 +08:00
|
|
|
|
</div>
|
|
|
|
|
<!-- 视图复用 end -->
|
2021-03-22 19:05:35 +08:00
|
|
|
|
</div>
|
2021-05-20 11:18:31 +08:00
|
|
|
|
</div>
|
|
|
|
|
</de-aside-container>
|
|
|
|
|
|
|
|
|
|
<!--画布区域-->
|
2021-06-10 17:12:31 +08:00
|
|
|
|
<de-main-container id="canvasInfo-main">
|
2021-05-31 11:20:32 +08:00
|
|
|
|
<!--左侧抽屉-->
|
2021-05-20 11:18:31 +08:00
|
|
|
|
<el-drawer
|
|
|
|
|
:visible.sync="show"
|
|
|
|
|
:with-header="false"
|
|
|
|
|
style="position: absolute;"
|
|
|
|
|
direction="ltr"
|
|
|
|
|
:modal="false"
|
|
|
|
|
:size="drawerSize"
|
|
|
|
|
:wrapper-closable="false"
|
|
|
|
|
:close-on-press-escape="false"
|
|
|
|
|
:modal-append-to-body="true"
|
|
|
|
|
>
|
2021-07-06 18:34:01 +08:00
|
|
|
|
<view-select v-show=" show && showIndex===0" @newChart="newChart" />
|
2021-05-20 11:18:31 +08:00
|
|
|
|
<filter-group v-show=" show &&showIndex===1" />
|
2021-05-27 18:54:06 +08:00
|
|
|
|
<subject-setting v-show=" show &&showIndex===2" />
|
2021-06-01 22:46:08 +08:00
|
|
|
|
<assist-component v-show=" show &&showIndex===3" />
|
2021-05-20 11:18:31 +08:00
|
|
|
|
</el-drawer>
|
|
|
|
|
|
2021-11-23 15:34:42 +08:00
|
|
|
|
<!--PC端画布区域-->
|
2021-05-20 11:18:31 +08:00
|
|
|
|
<div
|
2021-11-23 15:34:42 +08:00
|
|
|
|
v-if="!previewVisible&&!mobileLayoutStatus"
|
2021-06-01 13:40:26 +08:00
|
|
|
|
id="canvasInfo"
|
2021-11-23 15:34:42 +08:00
|
|
|
|
class="this_canvas"
|
2021-10-12 11:33:27 +08:00
|
|
|
|
:style="customCanvasStyle"
|
2021-05-20 11:18:31 +08:00
|
|
|
|
@drop="handleDrop"
|
2021-10-12 11:05:29 +08:00
|
|
|
|
@dragover="handleDragOver"
|
2021-05-20 11:18:31 +08:00
|
|
|
|
@mousedown="handleMouseDown"
|
|
|
|
|
@mouseup="deselectCurComponent"
|
2021-10-13 14:19:17 +08:00
|
|
|
|
@scroll="canvasScroll"
|
2021-05-20 11:18:31 +08:00
|
|
|
|
>
|
2022-04-15 19:44:55 +08:00
|
|
|
|
<Editor ref="canvasEditor" :matrix-count="pcMatrixCountBase" :out-style="outStyle" :scroll-top="scrollTop" />
|
2021-05-20 11:18:31 +08:00
|
|
|
|
</div>
|
2021-11-23 15:34:42 +08:00
|
|
|
|
<!--移动端画布区域 保持宽高比2.5-->
|
|
|
|
|
<el-row v-if="mobileLayoutStatus" class="mobile_canvas_main">
|
|
|
|
|
<el-col :span="8" class="this_mobile_canvas_cell">
|
|
|
|
|
<div
|
2021-12-20 12:14:57 +08:00
|
|
|
|
v-proportion="2.1"
|
2021-12-02 16:37:11 +08:00
|
|
|
|
:style="customCanvasMobileStyle"
|
2021-11-23 15:34:42 +08:00
|
|
|
|
class="this_mobile_canvas"
|
|
|
|
|
@drop="handleDrop"
|
|
|
|
|
@dragover="handleDragOver"
|
|
|
|
|
@mousedown="handleMouseDown"
|
|
|
|
|
@mouseup="deselectCurComponent"
|
|
|
|
|
@scroll="canvasScroll"
|
|
|
|
|
>
|
|
|
|
|
<el-row class="this_mobile_canvas_top" />
|
2021-12-21 12:41:06 +08:00
|
|
|
|
<el-row class="this_mobile_canvas_inner_top">
|
|
|
|
|
{{ panelInfo.name }}
|
|
|
|
|
</el-row>
|
2021-11-23 15:34:42 +08:00
|
|
|
|
<el-row
|
|
|
|
|
id="canvasInfoMobile"
|
|
|
|
|
class="this_mobile_canvas_main"
|
2021-12-07 17:32:02 +08:00
|
|
|
|
:style="mobileCanvasStyle"
|
2021-11-23 15:34:42 +08:00
|
|
|
|
>
|
2022-03-10 10:38:33 +08:00
|
|
|
|
<Editor
|
|
|
|
|
v-if="mobileEditorShow"
|
|
|
|
|
id="editorMobile"
|
|
|
|
|
ref="editorMobile"
|
|
|
|
|
:matrix-count="mobileMatrixCount"
|
|
|
|
|
:out-style="outStyle"
|
|
|
|
|
:scroll-top="scrollTop"
|
|
|
|
|
@canvasDragging="canvasDragging"
|
|
|
|
|
/>
|
2021-12-21 12:41:06 +08:00
|
|
|
|
</el-row>
|
|
|
|
|
<el-row class="this_mobile_canvas_inner_bottom">
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<i v-if="!hasStar" class="el-icon-star-off" size="mini" @click="star" />
|
2022-03-10 10:38:33 +08:00
|
|
|
|
<i
|
|
|
|
|
v-if="hasStar"
|
|
|
|
|
class="el-icon-star-on"
|
|
|
|
|
style="color: #0a7be0;font-size: 18px"
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="unstar"
|
|
|
|
|
/>
|
2021-12-21 12:41:06 +08:00
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12" style="float: right">
|
|
|
|
|
<i class="el-icon-refresh-right" size="mini" @click="mobileRefresh" />
|
|
|
|
|
</el-col>
|
2021-11-23 15:34:42 +08:00
|
|
|
|
</el-row>
|
|
|
|
|
<el-row class="this_mobile_canvas_bottom" />
|
|
|
|
|
</div>
|
|
|
|
|
</el-col>
|
2021-12-07 17:32:02 +08:00
|
|
|
|
<el-col :span="16" class="this_mobile_canvas_cell this_mobile_canvas_wait_cell" :style="mobileCanvasStyle">
|
2021-11-23 15:34:42 +08:00
|
|
|
|
<component-wait />
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
2021-05-31 11:20:32 +08:00
|
|
|
|
</de-main-container>
|
2022-03-10 10:38:33 +08:00
|
|
|
|
|
2022-03-10 20:26:31 +08:00
|
|
|
|
<div v-if="!mobileLayoutStatus&&rightDrawOpen" class="tools-window-main">
|
2022-03-10 12:08:21 +08:00
|
|
|
|
<div v-if="showViewToolsAside">
|
2022-03-10 20:26:31 +08:00
|
|
|
|
<chart-edit v-if="curComponent" ref="chartEditRef" :edit-from="'panel'" :param="chartEditParam" />
|
2022-03-10 10:38:33 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div v-if="!showViewToolsAside">
|
|
|
|
|
<el-row style="height: 40px">
|
|
|
|
|
<el-tooltip :content="$t('chart.draw_back')">
|
|
|
|
|
<el-button class="el-icon-d-arrow-right" style="position:absolute;left: 4px;top: 5px;" size="mini" circle @click="changeRightDrawOpen(false)" />
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row>
|
|
|
|
|
<div class="view-selected-message-class">
|
2022-03-10 11:53:18 +08:00
|
|
|
|
<span style="font-size: 14px;margin-left: 10px;font-weight: bold;line-height: 20px">{{ $t('panel.select_view') }}</span>
|
2022-03-10 10:38:33 +08:00
|
|
|
|
</div>
|
|
|
|
|
</el-row>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2021-05-20 11:18:31 +08:00
|
|
|
|
</de-container>
|
2021-04-01 17:40:12 +08:00
|
|
|
|
|
2021-04-06 19:10:16 +08:00
|
|
|
|
<el-dialog
|
2021-04-15 10:33:22 +08:00
|
|
|
|
v-if="filterVisible && panelInfo.id"
|
2021-08-16 15:40:37 +08:00
|
|
|
|
:title="(currentWidget && currentWidget.getLeftPanel && currentWidget.getLeftPanel().label ? $t(currentWidget.getLeftPanel().label) : '') + $t('panel.module')"
|
2021-04-06 19:10:16 +08:00
|
|
|
|
:visible.sync="filterVisible"
|
|
|
|
|
custom-class="de-filter-dialog"
|
2021-12-09 18:26:42 +08:00
|
|
|
|
@close="cancelFilter"
|
2021-04-06 19:10:16 +08:00
|
|
|
|
>
|
2021-12-16 18:16:24 +08:00
|
|
|
|
<filter-dialog
|
|
|
|
|
v-if="filterVisible && currentWidget"
|
|
|
|
|
:ref="'filter-setting-' + currentFilterCom.id"
|
|
|
|
|
:widget-info="currentWidget"
|
|
|
|
|
:element="currentFilterCom"
|
|
|
|
|
@sure-button-status="sureStatusChange"
|
|
|
|
|
@re-fresh-component="reFreshComponent"
|
|
|
|
|
/>
|
2021-06-02 16:21:56 +08:00
|
|
|
|
<div style="text-align: end !important;margin: 0 15px 10px !important;">
|
2021-04-08 11:39:00 +08:00
|
|
|
|
<span slot="footer">
|
2021-05-19 11:59:04 +08:00
|
|
|
|
<el-button size="mini" @click="cancelFilter">{{ $t('commons.cancel') }}</el-button>
|
2021-12-16 18:16:24 +08:00
|
|
|
|
<el-button :disabled="!enableSureButton" type="primary" size="mini" @click="sureFilter">{{ $t('commons.confirm') }}</el-button>
|
2021-04-08 11:39:00 +08:00
|
|
|
|
</span>
|
|
|
|
|
</div>
|
2021-04-06 19:10:16 +08:00
|
|
|
|
</el-dialog>
|
2021-05-21 12:42:40 +08:00
|
|
|
|
|
2021-06-21 12:39:24 +08:00
|
|
|
|
<!--文字组件对话框-->
|
|
|
|
|
<el-dialog
|
2021-07-01 12:12:43 +08:00
|
|
|
|
v-if="styleDialogVisible && curComponent"
|
2021-06-21 12:39:24 +08:00
|
|
|
|
:title="$t('panel.style')"
|
|
|
|
|
:visible.sync="styleDialogVisible"
|
|
|
|
|
custom-class="de-style-dialog"
|
|
|
|
|
>
|
2021-07-01 12:12:43 +08:00
|
|
|
|
<PanelTextEditor v-if="curComponent.type==='v-text'" />
|
|
|
|
|
<AttrListExtend v-else />
|
2021-06-21 12:39:24 +08:00
|
|
|
|
<div style="text-align: center">
|
|
|
|
|
<span slot="footer">
|
|
|
|
|
<el-button size="mini" @click="closeStyleDialog">{{ $t('commons.confirm') }}</el-button>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
2021-06-16 16:55:22 +08:00
|
|
|
|
<fullscreen style="height: 100%;background: #f7f8fa;overflow-y: auto" :fullscreen.sync="previewVisible">
|
2022-03-10 10:38:33 +08:00
|
|
|
|
<Preview
|
|
|
|
|
v-if="previewVisible"
|
|
|
|
|
:in-screen="!previewVisible"
|
|
|
|
|
:show-type="canvasStyleData.selfAdaption?'full':'width'"
|
|
|
|
|
/>
|
2021-06-15 16:47:35 +08:00
|
|
|
|
</fullscreen>
|
2022-03-10 10:38:33 +08:00
|
|
|
|
<input
|
|
|
|
|
id="input"
|
|
|
|
|
ref="files"
|
|
|
|
|
type="file"
|
|
|
|
|
accept="image/*"
|
|
|
|
|
hidden
|
|
|
|
|
@click="e => {e.target.value = '';}"
|
|
|
|
|
@change="handleFileChange"
|
|
|
|
|
>
|
2021-06-21 15:33:10 +08:00
|
|
|
|
|
2021-07-01 18:47:53 +08:00
|
|
|
|
<!--矩形样式组件-->
|
2021-10-19 19:11:40 +08:00
|
|
|
|
<TextAttr v-if="showAttr" :scroll-left="scrollLeft" :scroll-top="scrollTop" />
|
2021-07-06 18:34:01 +08:00
|
|
|
|
<!--复用ChartGroup组件 不做显示-->
|
|
|
|
|
<ChartGroup
|
|
|
|
|
ref="chartGroup"
|
|
|
|
|
:opt-from="'panel'"
|
|
|
|
|
:advice-group-id="adviceGroupId"
|
2021-07-07 16:09:13 +08:00
|
|
|
|
style="height: 0px;width:0px;padding:0px;overflow: hidden"
|
2021-11-29 14:54:24 +08:00
|
|
|
|
:mounted-init="false"
|
2021-07-06 18:34:01 +08:00
|
|
|
|
@newViewInfo="newViewInfo"
|
|
|
|
|
/>
|
|
|
|
|
|
2022-03-17 21:14:19 +08:00
|
|
|
|
<!--仪表板外部参数设置组件-->
|
|
|
|
|
<el-dialog
|
|
|
|
|
:visible.sync="outerParamsSetVisible"
|
|
|
|
|
width="900px"
|
|
|
|
|
class="dialog-css"
|
|
|
|
|
:show-close="true"
|
|
|
|
|
:destroy-on-close="true"
|
|
|
|
|
:append-to-body="true"
|
|
|
|
|
>
|
2022-03-18 20:35:52 +08:00
|
|
|
|
<OuterParamsSet v-if="outerParamsSetVisible" @outerParamsSetVisibleChange="outerParamsSetVisibleChange" />
|
2022-03-17 21:14:19 +08:00
|
|
|
|
</el-dialog>
|
|
|
|
|
|
2021-05-06 23:40:34 +08:00
|
|
|
|
</el-row>
|
2021-03-22 19:05:35 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import DeMainContainer from '@/components/dataease/DeMainContainer'
|
|
|
|
|
import DeContainer from '@/components/dataease/DeContainer'
|
|
|
|
|
import DeAsideContainer from '@/components/dataease/DeAsideContainer'
|
|
|
|
|
import { addClass, removeClass } from '@/utils'
|
|
|
|
|
import FilterGroup from '../filter'
|
2021-03-23 13:58:49 +08:00
|
|
|
|
import ViewSelect from '../ViewSelect'
|
2021-04-27 10:28:55 +08:00
|
|
|
|
import SubjectSetting from '../SubjectSetting'
|
2021-03-23 17:16:51 +08:00
|
|
|
|
import bus from '@/utils/bus'
|
2021-03-30 15:38:32 +08:00
|
|
|
|
import Editor from '@/components/canvas/components/Editor/index'
|
2022-04-18 18:37:02 +08:00
|
|
|
|
import { deepCopy, matrixBaseChange, panelInit } from '@/components/canvas/utils/utils'
|
2022-02-23 15:57:26 +08:00
|
|
|
|
import componentList, {
|
|
|
|
|
BASE_MOBILE_STYLE,
|
|
|
|
|
COMMON_BACKGROUND,
|
|
|
|
|
HYPERLINKS
|
|
|
|
|
} from '@/components/canvas/custom-component/component-list' // 左侧列表数据
|
2021-03-25 19:16:32 +08:00
|
|
|
|
import { mapState } from 'vuex'
|
|
|
|
|
import { uuid } from 'vue-uuid'
|
2021-03-30 15:38:32 +08:00
|
|
|
|
import Toolbar from '@/components/canvas/components/Toolbar'
|
2022-03-17 21:14:19 +08:00
|
|
|
|
import { initPanelData, initViewCache } from '@/api/panel/panel'
|
2021-05-24 17:28:03 +08:00
|
|
|
|
import Preview from '@/components/canvas/components/Editor/Preview'
|
2021-06-17 11:46:15 +08:00
|
|
|
|
import AttrListExtend from '@/components/canvas/components/AttrListExtend'
|
2021-06-01 13:40:26 +08:00
|
|
|
|
import elementResizeDetectorMaker from 'element-resize-detector'
|
2021-06-01 22:46:08 +08:00
|
|
|
|
import AssistComponent from '@/views/panel/AssistComponent'
|
2021-07-01 12:12:43 +08:00
|
|
|
|
import PanelTextEditor from '@/components/canvas/custom-component/PanelTextEditor'
|
2021-07-06 18:34:01 +08:00
|
|
|
|
import ChartGroup from '@/views/chart/group/Group'
|
2022-03-17 21:14:19 +08:00
|
|
|
|
import { chartCopy } from '@/api/chart/chart'
|
2021-03-26 12:26:48 +08:00
|
|
|
|
// 引入样式
|
2021-03-30 15:38:32 +08:00
|
|
|
|
import '@/components/canvas/assets/iconfont/iconfont.css'
|
|
|
|
|
import '@/components/canvas/styles/animate.css'
|
2021-03-30 19:01:46 +08:00
|
|
|
|
import { ApplicationContext } from '@/utils/ApplicationContext'
|
2021-04-06 19:10:16 +08:00
|
|
|
|
import FilterDialog from '../filter/filterDialog'
|
2021-06-21 15:33:10 +08:00
|
|
|
|
import toast from '@/components/canvas/utils/toast'
|
|
|
|
|
import { commonStyle, commonAttr } from '@/components/canvas/custom-component/component-list'
|
|
|
|
|
import generateID from '@/components/canvas/utils/generateID'
|
2021-08-25 17:11:52 +08:00
|
|
|
|
import TextAttr from '@/components/canvas/components/TextAttr'
|
2021-11-23 15:34:42 +08:00
|
|
|
|
import ComponentWait from '@/views/panel/edit/ComponentWait'
|
2021-12-21 12:41:06 +08:00
|
|
|
|
import { deleteEnshrine, saveEnshrine, starStatus } from '@/api/panel/enshrine'
|
2022-03-10 10:38:33 +08:00
|
|
|
|
import ChartEdit from '@/views/chart/view/ChartEdit'
|
2022-03-17 21:14:19 +08:00
|
|
|
|
import OuterParamsSet from '@/views/panel/OuterParamsSet/index'
|
2021-06-21 15:33:10 +08:00
|
|
|
|
|
2021-03-22 19:05:35 +08:00
|
|
|
|
export default {
|
2021-04-01 17:40:12 +08:00
|
|
|
|
name: 'PanelEdit',
|
2021-03-22 19:05:35 +08:00
|
|
|
|
components: {
|
2022-03-17 21:14:19 +08:00
|
|
|
|
OuterParamsSet,
|
2021-11-23 15:34:42 +08:00
|
|
|
|
ComponentWait,
|
2021-03-22 19:05:35 +08:00
|
|
|
|
DeMainContainer,
|
|
|
|
|
DeContainer,
|
|
|
|
|
DeAsideContainer,
|
|
|
|
|
FilterGroup,
|
2021-03-23 13:58:49 +08:00
|
|
|
|
ViewSelect,
|
2021-03-26 12:26:48 +08:00
|
|
|
|
Editor,
|
2021-04-06 19:10:16 +08:00
|
|
|
|
Toolbar,
|
2021-04-27 10:28:55 +08:00
|
|
|
|
FilterDialog,
|
2021-05-21 12:42:40 +08:00
|
|
|
|
SubjectSetting,
|
2021-05-31 11:20:32 +08:00
|
|
|
|
Preview,
|
2021-06-17 11:46:15 +08:00
|
|
|
|
AttrListExtend,
|
2021-07-01 12:12:43 +08:00
|
|
|
|
AssistComponent,
|
2021-07-01 18:47:53 +08:00
|
|
|
|
PanelTextEditor,
|
2021-07-06 18:34:01 +08:00
|
|
|
|
TextAttr,
|
2022-03-10 10:38:33 +08:00
|
|
|
|
ChartGroup,
|
|
|
|
|
ChartEdit
|
2021-03-22 19:05:35 +08:00
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
2022-03-28 21:18:56 +08:00
|
|
|
|
asideToolType: 'none',
|
2022-03-17 21:14:19 +08:00
|
|
|
|
outerParamsSetVisible: false,
|
2022-01-20 11:33:41 +08:00
|
|
|
|
autoMoveOffSet: 15,
|
2021-12-21 12:41:06 +08:00
|
|
|
|
mobileEditorShow: true,
|
|
|
|
|
hasStar: false,
|
2021-05-20 11:18:31 +08:00
|
|
|
|
drawerSize: '300px',
|
|
|
|
|
visible: false,
|
2021-03-22 19:05:35 +08:00
|
|
|
|
show: false,
|
2021-04-01 17:40:12 +08:00
|
|
|
|
editView: false,
|
2021-03-23 13:58:49 +08:00
|
|
|
|
clickNotClose: false,
|
2021-03-25 19:16:32 +08:00
|
|
|
|
showIndex: -1,
|
|
|
|
|
activeName: 'attr',
|
2021-04-06 19:10:16 +08:00
|
|
|
|
reSelectAnimateIndex: undefined,
|
2021-04-08 11:39:00 +08:00
|
|
|
|
filterVisible: false,
|
2021-04-16 17:26:13 +08:00
|
|
|
|
currentWidget: null,
|
2021-05-07 19:20:47 +08:00
|
|
|
|
currentFilterCom: null,
|
2021-05-21 12:42:40 +08:00
|
|
|
|
subjectVisible: false,
|
2021-05-31 11:20:32 +08:00
|
|
|
|
previewVisible: false,
|
|
|
|
|
componentStyleShow: true,
|
2021-06-01 13:40:26 +08:00
|
|
|
|
aidedButtonActive: false,
|
|
|
|
|
timer: null,
|
|
|
|
|
needToChange: [
|
|
|
|
|
'top',
|
|
|
|
|
'left',
|
|
|
|
|
'width',
|
|
|
|
|
'height',
|
|
|
|
|
'fontSize',
|
|
|
|
|
'borderWidth'
|
|
|
|
|
],
|
|
|
|
|
scale: '100',
|
|
|
|
|
outStyle: {
|
|
|
|
|
width: null,
|
|
|
|
|
height: null
|
2021-06-08 12:39:04 +08:00
|
|
|
|
},
|
2021-06-21 15:33:10 +08:00
|
|
|
|
styleDialogVisible: false,
|
2021-07-06 18:34:01 +08:00
|
|
|
|
currentDropElement: null,
|
2021-07-07 19:09:28 +08:00
|
|
|
|
adviceGroupId: null,
|
|
|
|
|
scrollLeft: 0,
|
2021-07-23 13:45:01 +08:00
|
|
|
|
scrollTop: 0,
|
2021-09-22 17:34:36 +08:00
|
|
|
|
timeMachine: null,
|
2021-10-19 19:11:40 +08:00
|
|
|
|
dropComponentInfo: null,
|
|
|
|
|
// 需要展示属性设置的组件类型
|
|
|
|
|
showAttrComponent: [
|
|
|
|
|
'custom',
|
|
|
|
|
'v-text',
|
|
|
|
|
'picture-add',
|
|
|
|
|
'de-tabs',
|
|
|
|
|
'rect-shape',
|
2021-11-08 19:03:09 +08:00
|
|
|
|
'de-show-date',
|
2022-03-27 19:06:37 +08:00
|
|
|
|
'de-video',
|
2022-03-31 21:54:41 +08:00
|
|
|
|
'de-stream-media',
|
2022-03-27 19:06:37 +08:00
|
|
|
|
'de-frame'
|
2021-12-16 18:16:24 +08:00
|
|
|
|
],
|
2021-12-28 12:12:46 +08:00
|
|
|
|
enableSureButton: false,
|
2022-03-10 10:38:33 +08:00
|
|
|
|
filterFromDrag: false,
|
|
|
|
|
activeToolsName: 'view',
|
|
|
|
|
rightDrawOpen: false
|
2021-03-22 19:05:35 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
2021-03-29 14:57:04 +08:00
|
|
|
|
|
|
|
|
|
computed: {
|
2022-03-10 10:38:33 +08:00
|
|
|
|
// 侧边显示控制
|
|
|
|
|
chartEditParam() {
|
2022-03-29 16:10:30 +08:00
|
|
|
|
if (this.curComponent) {
|
|
|
|
|
if (this.curComponent.type === 'view') {
|
|
|
|
|
return { 'id': this.curComponent.propValue.viewId, 'optType': 'edit' }
|
|
|
|
|
} else if (this.curComponent.type === 'de-tabs' && this.$store.state.chart.viewId) {
|
|
|
|
|
return { 'id': this.$store.state.chart.viewId, 'optType': 'edit' }
|
|
|
|
|
} else {
|
|
|
|
|
return {}
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-03-10 10:38:33 +08:00
|
|
|
|
return this.curComponent ? { 'id': this.curComponent.propValue.viewId, 'optType': 'edit' } : {}
|
|
|
|
|
},
|
2021-11-23 15:34:42 +08:00
|
|
|
|
// 侧边显示控制
|
|
|
|
|
showAside() {
|
|
|
|
|
return !this.linkageSettingStatus && !this.mobileLayoutStatus
|
|
|
|
|
},
|
2022-03-10 10:38:33 +08:00
|
|
|
|
// 显示视图工具栏
|
|
|
|
|
showViewToolsAside() {
|
2022-03-29 16:10:30 +08:00
|
|
|
|
return this.curComponent && (this.curComponent.type === 'view' || this.curComponent.type === 'de-tabs')
|
2022-03-10 10:38:33 +08:00
|
|
|
|
},
|
2022-03-28 21:18:56 +08:00
|
|
|
|
showViewToolAsideType() {
|
|
|
|
|
if (this.curComponent) {
|
|
|
|
|
if (this.curComponent.type === 'view') {
|
|
|
|
|
return 'view'
|
|
|
|
|
} else {
|
|
|
|
|
return 'publicSet'
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return 'none'
|
|
|
|
|
}
|
|
|
|
|
},
|
2021-10-19 19:11:40 +08:00
|
|
|
|
showAttr() {
|
2021-12-08 15:28:54 +08:00
|
|
|
|
if (this.mobileLayoutStatus) {
|
|
|
|
|
return false
|
|
|
|
|
} else if (this.curComponent && this.showAttrComponent.includes(this.curComponent.type)) {
|
2021-10-19 19:11:40 +08:00
|
|
|
|
// 过滤组件有标题才显示
|
|
|
|
|
if (this.curComponent.type === 'custom' && !this.curComponent.options.attrs.title) {
|
|
|
|
|
return false
|
|
|
|
|
} else {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
},
|
2021-12-02 16:37:11 +08:00
|
|
|
|
customCanvasMobileStyle() {
|
|
|
|
|
return {
|
|
|
|
|
padding: this.componentGap + 'px'
|
|
|
|
|
}
|
|
|
|
|
},
|
2021-12-07 17:32:02 +08:00
|
|
|
|
mobileCanvasStyle() {
|
|
|
|
|
let style
|
|
|
|
|
if (this.canvasStyleData.openCommonStyle) {
|
2022-01-28 13:40:00 +08:00
|
|
|
|
if (this.canvasStyleData.panel.backgroundType === 'image' && typeof (this.canvasStyleData.panel.imageUrl) === 'string') {
|
2021-12-07 17:32:02 +08:00
|
|
|
|
style = {
|
|
|
|
|
background: `url(${this.canvasStyleData.panel.imageUrl}) no-repeat`
|
|
|
|
|
}
|
|
|
|
|
} else if (this.canvasStyleData.panel.backgroundType === 'color') {
|
|
|
|
|
style = {
|
|
|
|
|
background: this.canvasStyleData.panel.color
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
style = {
|
|
|
|
|
background: '#f7f8fa'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return style
|
|
|
|
|
},
|
2021-10-09 17:16:37 +08:00
|
|
|
|
customCanvasStyle() {
|
2021-11-12 12:07:06 +08:00
|
|
|
|
let style = {
|
|
|
|
|
padding: this.componentGap + 'px'
|
|
|
|
|
}
|
2021-10-09 17:16:37 +08:00
|
|
|
|
|
|
|
|
|
if (this.canvasStyleData.openCommonStyle) {
|
2022-01-28 14:10:09 +08:00
|
|
|
|
if (this.canvasStyleData.panel.backgroundType === 'image' && typeof (this.canvasStyleData.panel.imageUrl) === 'string') {
|
2021-10-09 17:16:37 +08:00
|
|
|
|
style = {
|
|
|
|
|
background: `url(${this.canvasStyleData.panel.imageUrl}) no-repeat`,
|
|
|
|
|
...style
|
|
|
|
|
}
|
|
|
|
|
} else if (this.canvasStyleData.panel.backgroundType === 'color') {
|
|
|
|
|
style = {
|
|
|
|
|
background: this.canvasStyleData.panel.color,
|
|
|
|
|
...style
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return style
|
|
|
|
|
},
|
2021-03-29 14:57:04 +08:00
|
|
|
|
panelInfo() {
|
|
|
|
|
return this.$store.state.panel.panelInfo
|
|
|
|
|
},
|
2022-04-15 19:44:55 +08:00
|
|
|
|
pcMatrixCountBase() {
|
|
|
|
|
if (this.canvasStyleData.aidedDesign) {
|
|
|
|
|
return {
|
|
|
|
|
x: this.pcMatrixCount.x * this.canvasStyleData.aidedDesign.matrixBase,
|
|
|
|
|
y: this.pcMatrixCount.y * this.canvasStyleData.aidedDesign.matrixBase
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return this.pcMatrixCount
|
|
|
|
|
}
|
|
|
|
|
},
|
2021-03-29 14:57:04 +08:00
|
|
|
|
...mapState([
|
|
|
|
|
'curComponent',
|
2021-06-21 15:33:10 +08:00
|
|
|
|
'curCanvasScale',
|
2021-03-29 14:57:04 +08:00
|
|
|
|
'isClickComponent',
|
2021-04-19 10:47:07 +08:00
|
|
|
|
'canvasStyleData',
|
2021-06-21 12:39:24 +08:00
|
|
|
|
'curComponentIndex',
|
2021-08-03 18:37:24 +08:00
|
|
|
|
'componentData',
|
2021-09-22 16:51:41 +08:00
|
|
|
|
'linkageSettingStatus',
|
2021-11-12 12:07:06 +08:00
|
|
|
|
'dragComponentInfo',
|
2021-11-23 15:34:42 +08:00
|
|
|
|
'componentGap',
|
|
|
|
|
'mobileLayoutStatus',
|
|
|
|
|
'pcMatrixCount',
|
|
|
|
|
'mobileMatrixCount',
|
2022-01-20 11:33:41 +08:00
|
|
|
|
'mobileLayoutStyle',
|
|
|
|
|
'scrollAutoMove'
|
2021-03-29 14:57:04 +08:00
|
|
|
|
])
|
|
|
|
|
},
|
|
|
|
|
|
2021-03-22 19:05:35 +08:00
|
|
|
|
watch: {
|
|
|
|
|
show(value) {
|
|
|
|
|
if (value && !this.clickNotClose) {
|
|
|
|
|
this.addEventClick()
|
|
|
|
|
}
|
|
|
|
|
if (value) {
|
|
|
|
|
addClass(document.body, 'showRightPanel')
|
|
|
|
|
} else {
|
|
|
|
|
removeClass(document.body, 'showRightPanel')
|
|
|
|
|
}
|
2021-03-29 14:57:04 +08:00
|
|
|
|
},
|
2021-07-23 13:45:01 +08:00
|
|
|
|
'$store.state.styleChangeTimes'() {
|
|
|
|
|
if (this.$store.state.styleChangeTimes > 0) {
|
|
|
|
|
this.destroyTimeMachine()
|
|
|
|
|
this.recordStyleChange(this.$store.state.styleChangeTimes)
|
|
|
|
|
}
|
2021-11-23 15:34:42 +08:00
|
|
|
|
},
|
|
|
|
|
mobileLayoutStatus() {
|
|
|
|
|
this.restore()
|
2021-03-22 19:05:35 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
2021-03-25 19:16:32 +08:00
|
|
|
|
created() {
|
2021-03-29 14:57:04 +08:00
|
|
|
|
this.init(this.$store.state.panel.panelInfo.id)
|
|
|
|
|
// this.restore()
|
2021-03-25 19:16:32 +08:00
|
|
|
|
// 全局监听按键事件
|
2021-10-13 14:19:17 +08:00
|
|
|
|
// listenGlobalKeyDown()
|
2021-07-07 19:09:28 +08:00
|
|
|
|
|
|
|
|
|
this.$store.commit('setCurComponent', { component: null, index: null })
|
2021-08-04 16:52:49 +08:00
|
|
|
|
this.$store.commit('clearLinkageSettingInfo', false)
|
2022-03-10 10:38:33 +08:00
|
|
|
|
this.$store.commit('resetViewEditInfo')
|
2021-03-25 19:16:32 +08:00
|
|
|
|
},
|
2021-03-22 19:05:35 +08:00
|
|
|
|
mounted() {
|
2021-05-20 11:18:31 +08:00
|
|
|
|
// this.insertToBody()
|
2021-03-25 19:16:32 +08:00
|
|
|
|
bus.$on('component-on-drag', () => {
|
|
|
|
|
this.show = false
|
|
|
|
|
})
|
2021-04-19 10:47:07 +08:00
|
|
|
|
|
|
|
|
|
bus.$on('component-dialog-edit', () => {
|
2021-06-21 12:39:24 +08:00
|
|
|
|
this.editDialog()
|
|
|
|
|
})
|
|
|
|
|
bus.$on('component-dialog-style', () => {
|
|
|
|
|
this.styleDialogVisible = true
|
2021-04-19 10:47:07 +08:00
|
|
|
|
})
|
2021-05-21 12:42:40 +08:00
|
|
|
|
|
|
|
|
|
bus.$on('previewFullScreenClose', () => {
|
|
|
|
|
this.previewVisible = false
|
|
|
|
|
})
|
2022-03-10 10:38:33 +08:00
|
|
|
|
|
|
|
|
|
bus.$on('change_panel_right_draw', (param) => {
|
|
|
|
|
this.changeRightDrawOpen(param)
|
|
|
|
|
})
|
2021-06-01 13:40:26 +08:00
|
|
|
|
const _this = this
|
|
|
|
|
const erd = elementResizeDetectorMaker()
|
|
|
|
|
// 监听div变动事件
|
|
|
|
|
erd.listenTo(document.getElementById('canvasInfo-main'), element => {
|
|
|
|
|
_this.$nextTick(() => {
|
|
|
|
|
_this.restore()
|
|
|
|
|
})
|
|
|
|
|
})
|
2021-03-22 19:05:35 +08:00
|
|
|
|
},
|
|
|
|
|
beforeDestroy() {
|
|
|
|
|
const elx = this.$refs.rightPanel
|
2021-03-23 18:17:31 +08:00
|
|
|
|
elx && elx.remove()
|
2021-03-22 19:05:35 +08:00
|
|
|
|
},
|
|
|
|
|
methods: {
|
2022-03-18 20:35:52 +08:00
|
|
|
|
closeOuterParamsSetDialog() {
|
2022-03-17 21:14:19 +08:00
|
|
|
|
this.outerParamsSetVisible = false
|
|
|
|
|
},
|
2022-03-10 10:38:33 +08:00
|
|
|
|
changeRightDrawOpen(param) {
|
2022-03-29 16:10:30 +08:00
|
|
|
|
if (!param) {
|
|
|
|
|
this.$store.dispatch('chart/setViewId', null)
|
|
|
|
|
}
|
2022-03-10 10:38:33 +08:00
|
|
|
|
this.rightDrawOpen = param
|
|
|
|
|
if (this.rightDrawOpen) {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.outStyle.width = this.outStyle.width + 0.000001
|
|
|
|
|
}, 0)
|
|
|
|
|
}
|
|
|
|
|
},
|
2021-03-29 14:57:04 +08:00
|
|
|
|
init(panelId) {
|
2022-01-25 16:38:19 +08:00
|
|
|
|
const _this = this
|
|
|
|
|
_this.initHasStar()
|
2022-03-29 13:24:50 +08:00
|
|
|
|
if (panelId) {
|
2022-01-25 16:38:19 +08:00
|
|
|
|
initPanelData(panelId, function() {
|
2022-03-10 10:38:33 +08:00
|
|
|
|
// 初始化视图缓存
|
|
|
|
|
initViewCache(panelId)
|
2022-04-20 19:05:09 +08:00
|
|
|
|
// 初始化记录的视图信息
|
|
|
|
|
_this.$store.commit('setComponentViewsData')
|
2022-03-10 20:26:31 +08:00
|
|
|
|
// 初始化保存状态
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
_this.$store.commit('refreshSaveStatus')
|
|
|
|
|
}, 500)
|
2021-03-29 14:57:04 +08:00
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
2021-12-21 12:41:06 +08:00
|
|
|
|
star() {
|
|
|
|
|
this.panelInfo && saveEnshrine(this.panelInfo.id, false).then(res => {
|
|
|
|
|
this.hasStar = true
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
unstar() {
|
|
|
|
|
this.panelInfo && deleteEnshrine(this.panelInfo.id, false).then(res => {
|
|
|
|
|
this.hasStar = false
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
initHasStar() {
|
2022-01-21 11:04:41 +08:00
|
|
|
|
this.panelInfo && this.panelInfo.id && starStatus(this.panelInfo.id, false).then(res => {
|
2021-12-21 12:41:06 +08:00
|
|
|
|
this.hasStar = res.data
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
mobileRefresh() {
|
|
|
|
|
this.mobileEditorShow = false
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.mobileEditorShow = true
|
|
|
|
|
})
|
|
|
|
|
},
|
2021-03-22 19:05:35 +08:00
|
|
|
|
save() {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
toDir() {
|
|
|
|
|
this.$router.replace('/panel/index')
|
|
|
|
|
},
|
|
|
|
|
showPanel(type) {
|
2021-05-20 11:18:31 +08:00
|
|
|
|
if (this.showIndex === -1 || this.showIndex === type) {
|
2021-05-28 00:04:39 +08:00
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
if (this.show) {
|
|
|
|
|
this.showIndex === -1
|
|
|
|
|
}
|
|
|
|
|
this.show = !this.show
|
|
|
|
|
}
|
|
|
|
|
)
|
2021-05-20 11:18:31 +08:00
|
|
|
|
}
|
2021-03-23 13:58:49 +08:00
|
|
|
|
this.showIndex = type
|
2021-03-22 19:05:35 +08:00
|
|
|
|
},
|
|
|
|
|
addEventClick() {
|
|
|
|
|
window.addEventListener('click', this.closeSidebar)
|
|
|
|
|
},
|
|
|
|
|
closeSidebar(evt) {
|
|
|
|
|
const parent = evt.target.closest('.button-div-class')
|
2021-05-20 11:18:31 +08:00
|
|
|
|
const self = evt.target.closest('.el-drawer__wrapper')
|
2021-04-27 10:28:55 +08:00
|
|
|
|
// 点击样式按钮 排除
|
|
|
|
|
const stick = evt.target.closest('.el-icon-magic-stick')
|
2021-10-12 17:48:07 +08:00
|
|
|
|
const xuanfuanniu = evt.target.closest('.icon-xuanfuanniu')
|
|
|
|
|
const shujujuzhen = evt.target.closest('.icon-shujujuzhen')
|
2021-11-29 15:55:48 +08:00
|
|
|
|
const suffix = evt.target.closest('.el-input__suffix')
|
2021-11-29 19:18:12 +08:00
|
|
|
|
if (!parent && !self && !stick && !xuanfuanniu && !shujujuzhen && !suffix) {
|
2021-03-22 19:05:35 +08:00
|
|
|
|
this.show = false
|
|
|
|
|
window.removeEventListener('click', this.closeSidebar)
|
2021-03-23 13:58:49 +08:00
|
|
|
|
this.showIndex = -1
|
2021-03-22 19:05:35 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
2021-03-25 19:16:32 +08:00
|
|
|
|
resetID(data) {
|
2021-05-05 22:14:23 +08:00
|
|
|
|
if (data) {
|
|
|
|
|
data.forEach(item => {
|
2021-05-20 16:45:27 +08:00
|
|
|
|
item.type !== 'custom' && (item.id = uuid.v1())
|
2021-05-05 22:14:23 +08:00
|
|
|
|
})
|
|
|
|
|
}
|
2021-03-25 19:16:32 +08:00
|
|
|
|
return data
|
|
|
|
|
},
|
|
|
|
|
handleDrop(e) {
|
2021-10-11 23:27:48 +08:00
|
|
|
|
this.dragComponentInfo.moveStatus = 'drop'
|
2021-09-22 17:34:36 +08:00
|
|
|
|
// 记录拖拽信息
|
|
|
|
|
this.dropComponentInfo = deepCopy(this.dragComponentInfo)
|
2021-06-21 15:33:10 +08:00
|
|
|
|
this.currentDropElement = e
|
2021-03-26 11:37:32 +08:00
|
|
|
|
e.preventDefault()
|
|
|
|
|
e.stopPropagation()
|
2021-03-25 19:16:32 +08:00
|
|
|
|
let component
|
2021-03-26 11:37:32 +08:00
|
|
|
|
const newComponentId = uuid.v1()
|
2021-03-25 19:16:32 +08:00
|
|
|
|
const componentInfo = JSON.parse(e.dataTransfer.getData('componentInfo'))
|
2021-06-01 22:46:08 +08:00
|
|
|
|
if (componentInfo.type === 'assist') {
|
|
|
|
|
// 辅助设计组件
|
|
|
|
|
componentList.forEach(componentTemp => {
|
|
|
|
|
if (componentInfo.id === componentTemp.id) {
|
|
|
|
|
component = deepCopy(componentTemp)
|
|
|
|
|
}
|
|
|
|
|
})
|
2021-06-21 15:33:10 +08:00
|
|
|
|
|
|
|
|
|
if (component.type === 'picture-add') {
|
|
|
|
|
this.goFile()
|
|
|
|
|
this.clearCurrentInfo()
|
|
|
|
|
return
|
|
|
|
|
}
|
2021-06-01 22:46:08 +08:00
|
|
|
|
} else if (componentInfo.type === 'view') {
|
|
|
|
|
// 用户视图设置 复制一个模板
|
2021-03-25 19:16:32 +08:00
|
|
|
|
componentList.forEach(componentTemp => {
|
|
|
|
|
if (componentTemp.type === 'view') {
|
|
|
|
|
component = deepCopy(componentTemp)
|
|
|
|
|
const propValue = {
|
2021-03-26 11:37:32 +08:00
|
|
|
|
id: newComponentId,
|
2021-03-25 19:16:32 +08:00
|
|
|
|
viewId: componentInfo.id
|
|
|
|
|
}
|
|
|
|
|
component.propValue = propValue
|
2021-06-09 09:46:56 +08:00
|
|
|
|
component.filters = []
|
2021-08-10 15:50:00 +08:00
|
|
|
|
component.linkageFilters = []
|
2021-03-25 19:16:32 +08:00
|
|
|
|
}
|
|
|
|
|
})
|
2021-03-31 16:35:10 +08:00
|
|
|
|
} else {
|
2021-04-08 11:39:00 +08:00
|
|
|
|
this.currentWidget = ApplicationContext.getService(componentInfo.id)
|
2021-04-19 10:47:07 +08:00
|
|
|
|
this.currentFilterCom = this.currentWidget.getDrawPanel()
|
2021-10-09 00:02:06 +08:00
|
|
|
|
if (this.canvasStyleData.auxiliaryMatrix) {
|
|
|
|
|
this.currentFilterCom.x = this.dropComponentInfo.x
|
|
|
|
|
this.currentFilterCom.y = this.dropComponentInfo.y
|
|
|
|
|
this.currentFilterCom.sizex = this.dropComponentInfo.sizex
|
|
|
|
|
this.currentFilterCom.sizey = this.dropComponentInfo.sizey
|
|
|
|
|
this.currentFilterCom.style.left = (this.dragComponentInfo.x - 1) * this.curCanvasScale.matrixStyleOriginWidth
|
|
|
|
|
this.currentFilterCom.style.top = (this.dragComponentInfo.y - 1) * this.curCanvasScale.matrixStyleOriginHeight
|
|
|
|
|
this.currentFilterCom.style.width = this.dragComponentInfo.sizex * this.curCanvasScale.matrixStyleOriginWidth
|
|
|
|
|
this.currentFilterCom.style.height = this.dragComponentInfo.sizey * this.curCanvasScale.matrixStyleOriginHeight
|
2021-11-02 16:40:49 +08:00
|
|
|
|
} else {
|
|
|
|
|
this.currentFilterCom.style.left = this.dragComponentInfo.shadowStyle.x
|
|
|
|
|
this.currentFilterCom.style.top = this.dragComponentInfo.shadowStyle.y
|
|
|
|
|
this.currentFilterCom.style.width = this.dragComponentInfo.style.width
|
|
|
|
|
this.currentFilterCom.style.height = this.dragComponentInfo.style.height
|
2021-10-09 00:02:06 +08:00
|
|
|
|
}
|
2021-04-16 17:26:13 +08:00
|
|
|
|
this.currentFilterCom.id = newComponentId
|
2021-10-09 00:02:06 +08:00
|
|
|
|
this.currentFilterCom.auxiliaryMatrix = this.canvasStyleData.auxiliaryMatrix
|
2021-12-22 18:31:46 +08:00
|
|
|
|
this.currentFilterCom.mobileStyle = BASE_MOBILE_STYLE
|
2022-03-01 16:16:09 +08:00
|
|
|
|
this.currentFilterCom.commonBackground = this.currentFilterCom.commonBackground || deepCopy(COMMON_BACKGROUND)
|
2022-02-23 15:57:26 +08:00
|
|
|
|
|
2021-04-16 17:26:13 +08:00
|
|
|
|
if (this.currentWidget.filterDialog) {
|
2021-04-06 19:10:16 +08:00
|
|
|
|
this.show = false
|
2021-12-28 12:12:46 +08:00
|
|
|
|
this.openFilterDialog(true)
|
2021-04-06 19:10:16 +08:00
|
|
|
|
return
|
|
|
|
|
}
|
2021-04-16 17:26:13 +08:00
|
|
|
|
component = deepCopy(this.currentFilterCom)
|
2021-03-25 19:16:32 +08:00
|
|
|
|
}
|
2021-10-09 00:02:06 +08:00
|
|
|
|
if (this.canvasStyleData.auxiliaryMatrix) {
|
|
|
|
|
component.x = this.dropComponentInfo.x
|
|
|
|
|
component.y = this.dropComponentInfo.y
|
|
|
|
|
component.sizex = this.dropComponentInfo.sizex
|
|
|
|
|
component.sizey = this.dropComponentInfo.sizey
|
|
|
|
|
|
|
|
|
|
component.style.left = (this.dragComponentInfo.x - 1) * this.curCanvasScale.matrixStyleOriginWidth
|
|
|
|
|
component.style.top = (this.dragComponentInfo.y - 1) * this.curCanvasScale.matrixStyleOriginHeight
|
|
|
|
|
component.style.width = this.dragComponentInfo.sizex * this.curCanvasScale.matrixStyleOriginWidth
|
|
|
|
|
component.style.height = this.dragComponentInfo.sizey * this.curCanvasScale.matrixStyleOriginHeight
|
|
|
|
|
} else {
|
|
|
|
|
component.style.top = this.dropComponentInfo.shadowStyle.y
|
|
|
|
|
component.style.left = this.dropComponentInfo.shadowStyle.x
|
|
|
|
|
component.style.width = this.dropComponentInfo.shadowStyle.width
|
|
|
|
|
component.style.height = this.dropComponentInfo.shadowStyle.height
|
|
|
|
|
}
|
2021-09-22 16:51:41 +08:00
|
|
|
|
|
2021-03-26 11:37:32 +08:00
|
|
|
|
component.id = newComponentId
|
2021-10-09 00:02:06 +08:00
|
|
|
|
// 新拖入的组件矩阵状态 和仪表板当前的矩阵状态 保持一致
|
|
|
|
|
component.auxiliaryMatrix = this.canvasStyleData.auxiliaryMatrix
|
2022-02-23 15:57:26 +08:00
|
|
|
|
// 统一设置背景信息
|
2022-03-01 16:16:09 +08:00
|
|
|
|
component.commonBackground = component.commonBackground || deepCopy(COMMON_BACKGROUND)
|
2022-02-14 18:57:35 +08:00
|
|
|
|
|
|
|
|
|
// 视图统一调整为复制
|
|
|
|
|
if (componentInfo.type === 'view') {
|
|
|
|
|
chartCopy(component.propValue.viewId, this.panelInfo.id).then(res => {
|
|
|
|
|
component.propValue.viewId = res.data
|
|
|
|
|
this.$store.commit('addComponent', { component })
|
|
|
|
|
this.$store.commit('recordSnapshot', 'handleDrop')
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
this.$store.commit('addComponent', { component })
|
|
|
|
|
this.$store.commit('recordSnapshot', 'handleDrop')
|
|
|
|
|
}
|
2021-04-16 17:26:13 +08:00
|
|
|
|
this.clearCurrentInfo()
|
|
|
|
|
},
|
|
|
|
|
clearCurrentInfo() {
|
|
|
|
|
this.currentWidget = null
|
|
|
|
|
this.currentFilterCom = null
|
2021-03-25 19:16:32 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
handleMouseDown() {
|
|
|
|
|
this.$store.commit('setClickComponentStatus', false)
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
deselectCurComponent(e) {
|
|
|
|
|
if (!this.isClickComponent) {
|
|
|
|
|
this.$store.commit('setCurComponent', { component: null, index: null })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 0 左击 1 滚轮 2 右击
|
2021-03-26 11:37:32 +08:00
|
|
|
|
if (e.button !== 2) {
|
2021-03-25 19:16:32 +08:00
|
|
|
|
this.$store.commit('hideContextMenu')
|
|
|
|
|
}
|
2021-04-06 19:10:16 +08:00
|
|
|
|
},
|
2021-12-28 12:12:46 +08:00
|
|
|
|
openFilterDialog(fromDrag = false) {
|
|
|
|
|
this.filterFromDrag = fromDrag
|
2021-04-06 19:10:16 +08:00
|
|
|
|
this.filterVisible = true
|
2021-04-08 11:39:00 +08:00
|
|
|
|
},
|
2021-11-29 19:18:12 +08:00
|
|
|
|
closeFilter() {
|
2021-04-08 11:39:00 +08:00
|
|
|
|
this.filterVisible = false
|
|
|
|
|
this.currentWidget = null
|
2021-04-16 17:26:13 +08:00
|
|
|
|
this.clearCurrentInfo()
|
2021-11-29 19:18:12 +08:00
|
|
|
|
},
|
|
|
|
|
cancelFilter() {
|
|
|
|
|
this.closeFilter()
|
2022-01-14 14:21:34 +08:00
|
|
|
|
if (this.filterFromDrag) {
|
2021-12-28 12:12:46 +08:00
|
|
|
|
bus.$emit('onRemoveLastItem')
|
|
|
|
|
}
|
2021-04-08 11:39:00 +08:00
|
|
|
|
},
|
|
|
|
|
sureFilter() {
|
2021-12-16 18:16:24 +08:00
|
|
|
|
this.currentFilterCom = this.$refs['filter-setting-' + this.currentFilterCom.id].getElementInfo()
|
2021-12-01 17:38:33 +08:00
|
|
|
|
this.$store.commit('setComponentWithId', this.currentFilterCom)
|
2021-09-01 14:03:55 +08:00
|
|
|
|
this.$store.commit('recordSnapshot', 'sureFilter')
|
2021-12-16 18:16:24 +08:00
|
|
|
|
this.$store.commit('setCurComponent', { component: this.currentFilterCom, index: this.curComponentIndex })
|
2022-01-14 14:21:34 +08:00
|
|
|
|
bus.$emit('reset-default-value', this.currentFilterCom.id)
|
2021-11-29 19:18:12 +08:00
|
|
|
|
this.closeFilter()
|
2021-04-08 18:18:08 +08:00
|
|
|
|
},
|
|
|
|
|
reFreshComponent(component) {
|
2021-04-16 17:26:13 +08:00
|
|
|
|
this.currentFilterCom = component
|
2021-04-19 17:40:15 +08:00
|
|
|
|
this.$forceUpdate()
|
2021-04-19 10:47:07 +08:00
|
|
|
|
},
|
2021-06-21 12:39:24 +08:00
|
|
|
|
editDialog() {
|
2021-07-27 16:46:55 +08:00
|
|
|
|
if (this.curComponent && this.curComponent.serviceName) {
|
|
|
|
|
const serviceName = this.curComponent.serviceName
|
|
|
|
|
this.currentWidget = ApplicationContext.getService(serviceName)
|
2021-12-16 18:16:24 +08:00
|
|
|
|
this.currentFilterCom = this.curComponent
|
|
|
|
|
this.openFilterDialog()
|
2021-07-27 16:46:55 +08:00
|
|
|
|
}
|
2021-05-07 19:20:47 +08:00
|
|
|
|
},
|
|
|
|
|
closeLeftPanel() {
|
|
|
|
|
this.show = false
|
2021-05-21 12:42:40 +08:00
|
|
|
|
},
|
|
|
|
|
previewFullScreen() {
|
|
|
|
|
this.previewVisible = true
|
2021-05-31 11:20:32 +08:00
|
|
|
|
},
|
|
|
|
|
changeAidedDesign() {
|
|
|
|
|
this.aidedButtonActive = !this.aidedButtonActive
|
2021-06-01 13:40:26 +08:00
|
|
|
|
},
|
2022-03-17 21:14:19 +08:00
|
|
|
|
outerParamsSetVisibleChange(param) {
|
|
|
|
|
this.outerParamsSetVisible = param
|
|
|
|
|
},
|
2021-06-01 13:40:26 +08:00
|
|
|
|
getOriginStyle(value) {
|
|
|
|
|
const scale = this.canvasStyleData.scale
|
2021-06-11 17:44:47 +08:00
|
|
|
|
const result = value / (scale / 100)
|
2021-06-01 13:40:26 +08:00
|
|
|
|
return result
|
|
|
|
|
},
|
|
|
|
|
restore() {
|
2021-11-23 15:34:42 +08:00
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
const domInfo = this.mobileLayoutStatus ? document.getElementById('canvasInfoMobile') : document.getElementById('canvasInfo')
|
|
|
|
|
if (domInfo) {
|
|
|
|
|
this.outStyle.height = domInfo.offsetHeight - this.getGap()
|
2021-10-13 14:19:17 +08:00
|
|
|
|
// 临时处理 确保每次restore 有会更新
|
2021-11-30 15:14:43 +08:00
|
|
|
|
this.outStyle.width = domInfo.offsetWidth - this.getGap() + (Math.random() * 0.000001) + 2
|
2021-11-23 15:34:42 +08:00
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
getGap() {
|
|
|
|
|
return this.mobileLayoutStatus ? 0 : this.componentGap * 2
|
2021-06-21 12:39:24 +08:00
|
|
|
|
},
|
|
|
|
|
closeStyleDialog() {
|
|
|
|
|
this.styleDialogVisible = false
|
2021-06-21 15:33:10 +08:00
|
|
|
|
},
|
|
|
|
|
goFile() {
|
|
|
|
|
this.$refs.files.click()
|
|
|
|
|
},
|
|
|
|
|
handleFileChange(e) {
|
2021-09-22 17:34:36 +08:00
|
|
|
|
const _this = this
|
2021-06-21 15:33:10 +08:00
|
|
|
|
const file = e.target.files[0]
|
|
|
|
|
if (!file.type.includes('image')) {
|
|
|
|
|
toast('只能插入图片')
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
const reader = new FileReader()
|
|
|
|
|
reader.onload = (res) => {
|
|
|
|
|
const fileResult = res.target.result
|
|
|
|
|
const img = new Image()
|
|
|
|
|
img.onload = () => {
|
2021-10-09 00:02:06 +08:00
|
|
|
|
const component = {
|
|
|
|
|
...commonAttr,
|
|
|
|
|
id: generateID(),
|
|
|
|
|
component: 'Picture',
|
2021-10-19 19:11:40 +08:00
|
|
|
|
type: 'picture-add',
|
2021-10-09 00:02:06 +08:00
|
|
|
|
label: '图片',
|
|
|
|
|
icon: '',
|
2021-12-23 14:44:04 +08:00
|
|
|
|
hyperlinks: HYPERLINKS,
|
2021-12-23 18:15:49 +08:00
|
|
|
|
mobileStyle: BASE_MOBILE_STYLE,
|
2021-10-09 00:02:06 +08:00
|
|
|
|
propValue: fileResult,
|
2022-04-26 18:50:31 +08:00
|
|
|
|
commonBackground: deepCopy(COMMON_BACKGROUND),
|
2021-10-09 00:02:06 +08:00
|
|
|
|
style: {
|
|
|
|
|
...commonStyle
|
2021-06-21 15:33:10 +08:00
|
|
|
|
}
|
2021-10-09 00:02:06 +08:00
|
|
|
|
}
|
2021-12-23 14:44:04 +08:00
|
|
|
|
component.auxiliaryMatrix = false
|
|
|
|
|
component.style.top = _this.dropComponentInfo.shadowStyle.y
|
|
|
|
|
component.style.left = _this.dropComponentInfo.shadowStyle.x
|
|
|
|
|
component.style.width = _this.dropComponentInfo.shadowStyle.width
|
|
|
|
|
component.style.height = _this.dropComponentInfo.shadowStyle.height
|
2021-10-09 00:02:06 +08:00
|
|
|
|
this.$store.commit('addComponent', {
|
|
|
|
|
component: component
|
2021-06-21 15:33:10 +08:00
|
|
|
|
})
|
2021-09-01 14:03:55 +08:00
|
|
|
|
this.$store.commit('recordSnapshot', 'handleFileChange')
|
2021-06-21 15:33:10 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
img.src = fileResult
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
reader.readAsDataURL(file)
|
|
|
|
|
},
|
|
|
|
|
getPositionX(x) {
|
|
|
|
|
if (this.canvasStyleData.selfAdaption) {
|
|
|
|
|
return x * 100 / this.curCanvasScale.scaleWidth
|
|
|
|
|
} else {
|
|
|
|
|
return x
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
getPositionY(y) {
|
|
|
|
|
if (this.canvasStyleData.selfAdaption) {
|
|
|
|
|
return y * 100 / this.curCanvasScale.scaleHeight
|
|
|
|
|
} else {
|
|
|
|
|
return y
|
|
|
|
|
}
|
2021-07-06 18:34:01 +08:00
|
|
|
|
},
|
|
|
|
|
newChart() {
|
2022-02-15 11:56:38 +08:00
|
|
|
|
this.adviceGroupId = this.panelInfo.id
|
2021-07-06 18:34:01 +08:00
|
|
|
|
this.show = false
|
2022-02-15 11:56:38 +08:00
|
|
|
|
this.$refs['chartGroup'].selectTable()
|
2021-07-06 18:34:01 +08:00
|
|
|
|
},
|
|
|
|
|
newViewInfo(newViewInfo) {
|
|
|
|
|
let component
|
|
|
|
|
const newComponentId = uuid.v1()
|
|
|
|
|
// 用户视图设置 复制一个模板
|
|
|
|
|
componentList.forEach(componentTemp => {
|
|
|
|
|
if (componentTemp.type === 'view') {
|
2022-04-18 18:37:02 +08:00
|
|
|
|
component = matrixBaseChange(deepCopy(componentTemp))
|
2021-07-06 18:34:01 +08:00
|
|
|
|
const propValue = {
|
|
|
|
|
id: newComponentId,
|
|
|
|
|
viewId: newViewInfo.id
|
|
|
|
|
}
|
|
|
|
|
component.propValue = propValue
|
|
|
|
|
component.filters = []
|
2021-08-10 15:50:00 +08:00
|
|
|
|
component.linkageFilters = []
|
2021-07-06 18:34:01 +08:00
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
2021-11-09 18:05:03 +08:00
|
|
|
|
component.auxiliaryMatrix = this.canvasStyleData.auxiliaryMatrix
|
2021-07-06 18:34:01 +08:00
|
|
|
|
// position = absolution 或导致有偏移 这里中和一下偏移量
|
2021-11-09 18:05:03 +08:00
|
|
|
|
if (this.canvasStyleData.auxiliaryMatrix) {
|
|
|
|
|
component.style.left = (component.x - 1) * this.curCanvasScale.matrixStyleOriginWidth
|
|
|
|
|
component.style.top = (component.y - 1) * this.curCanvasScale.matrixStyleOriginHeight
|
|
|
|
|
component.style.width = component.sizex * this.curCanvasScale.matrixStyleOriginWidth
|
|
|
|
|
component.style.height = component.sizey * this.curCanvasScale.matrixStyleOriginHeight
|
|
|
|
|
} else {
|
|
|
|
|
component.style.left = 0
|
|
|
|
|
component.style.top = 0
|
|
|
|
|
component.x = 1
|
|
|
|
|
component.y = 1
|
|
|
|
|
}
|
2021-07-06 18:34:01 +08:00
|
|
|
|
component.id = newComponentId
|
2022-03-30 10:14:45 +08:00
|
|
|
|
// 统一设置背景信息
|
|
|
|
|
component.commonBackground = deepCopy(COMMON_BACKGROUND)
|
2021-07-06 18:34:01 +08:00
|
|
|
|
this.$store.commit('addComponent', { component })
|
2021-09-01 14:03:55 +08:00
|
|
|
|
this.$store.commit('recordSnapshot', 'newViewInfo')
|
2021-07-06 18:34:01 +08:00
|
|
|
|
this.clearCurrentInfo()
|
|
|
|
|
this.$store.commit('setCurComponent', { component: component, index: this.componentData.length - 1 })
|
|
|
|
|
|
2022-03-10 11:53:18 +08:00
|
|
|
|
// 打开属性栏
|
|
|
|
|
bus.$emit('change_panel_right_draw', true)
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// // 编辑时临时保存 当前修改的画布
|
|
|
|
|
// this.$store.dispatch('panel/setComponentDataTemp', JSON.stringify(this.componentData))
|
|
|
|
|
// this.$store.dispatch('panel/setCanvasStyleDataTemp', JSON.stringify(this.canvasStyleData))
|
|
|
|
|
// if (this.curComponent.type === 'view') {
|
|
|
|
|
// this.$store.dispatch('chart/setViewId', null)
|
|
|
|
|
// this.$store.dispatch('chart/setViewId', this.curComponent.propValue.viewId)
|
|
|
|
|
// bus.$emit('PanelSwitchComponent', {
|
|
|
|
|
// name: 'ChartEdit',
|
|
|
|
|
// param: { 'id': this.curComponent.propValue.viewId, 'optType': 'edit' }
|
|
|
|
|
// })
|
|
|
|
|
// }
|
2021-07-07 19:09:28 +08:00
|
|
|
|
},
|
|
|
|
|
canvasScroll(event) {
|
|
|
|
|
this.scrollLeft = event.target.scrollLeft
|
|
|
|
|
this.scrollTop = event.target.scrollTop
|
2021-12-23 12:02:14 +08:00
|
|
|
|
bus.$emit('onScroll')
|
2021-07-23 13:45:01 +08:00
|
|
|
|
},
|
|
|
|
|
destroyTimeMachine() {
|
|
|
|
|
this.timeMachine && clearTimeout(this.timeMachine)
|
|
|
|
|
this.timeMachine = null
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 如果内部样式有变化 1秒钟后保存一个镜像
|
|
|
|
|
recordStyleChange(index) {
|
2022-03-01 14:46:18 +08:00
|
|
|
|
if (index === this.$store.state.styleChangeTimes) {
|
|
|
|
|
this.timeMachine = setTimeout(() => {
|
|
|
|
|
// console.log('recordSnapshot')
|
|
|
|
|
this.$store.commit('recordSnapshot')
|
2021-07-23 13:45:01 +08:00
|
|
|
|
this.$store.state.styleChangeTimes = 0
|
2022-03-01 14:46:18 +08:00
|
|
|
|
this.destroyTimeMachine()
|
|
|
|
|
}, 1000)
|
|
|
|
|
}
|
2021-10-12 11:05:29 +08:00
|
|
|
|
},
|
|
|
|
|
handleDragOver(e) {
|
|
|
|
|
e.preventDefault()
|
|
|
|
|
e.dataTransfer.dropEffect = 'copy'
|
|
|
|
|
this.$refs.canvasEditor.handleDragOver(e)
|
2021-12-16 18:16:24 +08:00
|
|
|
|
},
|
|
|
|
|
sureStatusChange(status) {
|
|
|
|
|
this.enableSureButton = status
|
2022-01-20 11:33:41 +08:00
|
|
|
|
},
|
|
|
|
|
canvasDragging(mY, offsetY) {
|
|
|
|
|
if (this.curComponent && this.curComponent.optStatus.dragging) {
|
|
|
|
|
// 触发滚动的区域偏移量
|
|
|
|
|
const touchOffset = 100
|
|
|
|
|
const canvasInfoMobile = document.getElementById('canvasInfoMobile')
|
|
|
|
|
// 获取子盒子(高度肯定比父盒子大)
|
|
|
|
|
// const editorMobile = document.getElementById('editorMobile')
|
|
|
|
|
// 画布区顶部到浏览器顶部距离
|
|
|
|
|
const canvasTop = canvasInfoMobile.offsetTop + 75
|
|
|
|
|
// 画布区有高度
|
|
|
|
|
const canvasHeight = canvasInfoMobile.offsetHeight
|
|
|
|
|
// 画布区域底部距离浏览器顶部距离
|
|
|
|
|
const canvasBottom = canvasTop + canvasHeight
|
|
|
|
|
if (mY > (canvasBottom - touchOffset) && offsetY > 0) {
|
|
|
|
|
// 触发底部滚动
|
|
|
|
|
this.scrollMove(this.autoMoveOffSet)
|
|
|
|
|
} else if (mY < (canvasTop + touchOffset) && offsetY < 0) {
|
|
|
|
|
// 触发顶部滚动
|
|
|
|
|
this.scrollMove(-this.autoMoveOffSet)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
scrollMove(offset) {
|
|
|
|
|
const canvasInfoMobile = document.getElementById('canvasInfoMobile')
|
|
|
|
|
canvasInfoMobile.scrollTop = canvasInfoMobile.scrollTop + offset
|
|
|
|
|
this.$store.commit('setScrollAutoMove', this.scrollAutoMove + offset)
|
2021-03-22 19:05:35 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
.ms-aside-container {
|
2021-11-15 14:57:14 +08:00
|
|
|
|
height: calc(100vh - 35px);
|
2021-03-22 19:05:35 +08:00
|
|
|
|
max-width: 60px;
|
|
|
|
|
border: none;
|
2021-06-01 13:40:26 +08:00
|
|
|
|
width: 60px;
|
2021-03-22 19:05:35 +08:00
|
|
|
|
}
|
|
|
|
|
|
2021-05-18 17:31:28 +08:00
|
|
|
|
.ms-main-container {
|
2021-11-15 14:57:14 +08:00
|
|
|
|
height: calc(100vh - 35px);
|
2021-05-18 17:31:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
2021-03-22 19:05:35 +08:00
|
|
|
|
.de-header {
|
|
|
|
|
height: 35px !important;
|
|
|
|
|
border-bottom: 1px solid #E6E6E6;
|
2021-10-09 18:22:52 +08:00
|
|
|
|
|
|
|
|
|
}
|
2022-03-10 10:38:33 +08:00
|
|
|
|
|
2021-10-09 18:22:52 +08:00
|
|
|
|
.blackTheme .de-header {
|
2022-03-10 10:38:33 +08:00
|
|
|
|
background-color: var(--SiderBG) !important;
|
|
|
|
|
color: var(--TextActive);
|
2021-03-22 19:05:35 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.showLeftPanel {
|
2022-03-10 10:38:33 +08:00
|
|
|
|
overflow: hidden;
|
|
|
|
|
position: relative;
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
2021-03-22 19:05:35 +08:00
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2022-03-10 10:38:33 +08:00
|
|
|
|
.leftPanel-background {
|
|
|
|
|
position: fixed;
|
|
|
|
|
top: 0;
|
|
|
|
|
left: 0;
|
|
|
|
|
opacity: 0;
|
|
|
|
|
transition: opacity .3s cubic-bezier(.7, .3, .1, 1);
|
|
|
|
|
background: rgba(0, 0, 0, .2);
|
|
|
|
|
z-index: -1;
|
|
|
|
|
}
|
2021-03-22 19:05:35 +08:00
|
|
|
|
|
2022-03-10 10:38:33 +08:00
|
|
|
|
.leftPanel {
|
|
|
|
|
width: 100%;
|
|
|
|
|
max-width: 300px;
|
|
|
|
|
height: calc(100vh - 35px);
|
|
|
|
|
position: fixed;
|
|
|
|
|
top: 91px;
|
|
|
|
|
left: 60px;
|
|
|
|
|
box-shadow: 0px 0px 15px 0px rgba(0, 0, 0, .05);
|
|
|
|
|
transition: all .25s cubic-bezier(.7, .3, .1, 1);
|
|
|
|
|
transform: translate(100%);
|
|
|
|
|
background: var(--SiderBG, #fff);
|
|
|
|
|
z-index: 1003;
|
|
|
|
|
}
|
2021-03-22 19:05:35 +08:00
|
|
|
|
|
2022-03-10 10:38:33 +08:00
|
|
|
|
.show {
|
|
|
|
|
transition: all .3s cubic-bezier(.7, .3, .1, 1);
|
2021-03-22 19:05:35 +08:00
|
|
|
|
|
2022-03-10 10:38:33 +08:00
|
|
|
|
.leftPanel-background {
|
|
|
|
|
z-index: 1002;
|
|
|
|
|
opacity: 1;
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.leftPanel {
|
|
|
|
|
transform: translate(0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.mobile_canvas_main {
|
|
|
|
|
width: 80%;
|
|
|
|
|
height: 90%;
|
|
|
|
|
margin-left: 10%;
|
|
|
|
|
margin-top: 3%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.this_mobile_canvas {
|
|
|
|
|
border-radius: 30px;
|
|
|
|
|
min-width: 300px;
|
|
|
|
|
max-width: 350px;
|
|
|
|
|
min-height: 600px;
|
|
|
|
|
max-height: 700px;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
background-color: #000000;
|
|
|
|
|
background-size: 100% 100% !important;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.this_mobile_canvas_inner_top {
|
|
|
|
|
vertical-align: middle;
|
|
|
|
|
text-align: center;
|
|
|
|
|
background-color: #f7f8fa;
|
|
|
|
|
height: 30px;
|
|
|
|
|
line-height: 30px;
|
|
|
|
|
font-size: 14px;
|
2021-03-22 19:05:35 +08:00
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-10 10:38:33 +08:00
|
|
|
|
.this_mobile_canvas_top {
|
|
|
|
|
height: 30px;
|
|
|
|
|
width: 100%;
|
2021-03-22 19:05:35 +08:00
|
|
|
|
}
|
|
|
|
|
|
2022-03-10 10:38:33 +08:00
|
|
|
|
.this_mobile_canvas_inner_bottom {
|
|
|
|
|
background-color: #f7f8fa;
|
|
|
|
|
line-height: 30px;
|
|
|
|
|
vertical-align: middle;
|
|
|
|
|
color: gray;
|
|
|
|
|
height: 30px;
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
2021-11-23 15:34:42 +08:00
|
|
|
|
|
2022-03-10 10:38:33 +08:00
|
|
|
|
.this_mobile_canvas_bottom {
|
|
|
|
|
height: 30px;
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
2021-11-23 15:34:42 +08:00
|
|
|
|
|
2022-03-10 10:38:33 +08:00
|
|
|
|
.this_mobile_canvas_main {
|
|
|
|
|
overflow-x: hidden;
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
height: calc(100% - 120px);;
|
|
|
|
|
background-color: #d7d9e3;
|
|
|
|
|
background-size: 100% 100% !important;
|
|
|
|
|
}
|
2021-12-21 12:41:06 +08:00
|
|
|
|
|
2022-03-10 10:38:33 +08:00
|
|
|
|
.this_mobile_canvas_cell {
|
|
|
|
|
text-align: center;
|
|
|
|
|
height: 100%;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
}
|
2021-11-23 15:34:42 +08:00
|
|
|
|
|
2022-03-10 10:38:33 +08:00
|
|
|
|
.this_mobile_canvas_wait_cell {
|
|
|
|
|
background-size: 100% 100% !important;
|
|
|
|
|
border: 2px solid #9ea6b2
|
|
|
|
|
}
|
2021-12-21 12:41:06 +08:00
|
|
|
|
|
2022-03-10 10:38:33 +08:00
|
|
|
|
.this_canvas {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: calc(100vh - 35px);
|
|
|
|
|
overflow-x: hidden;
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
background-size: 100% 100% !important;
|
|
|
|
|
}
|
2021-11-23 15:34:42 +08:00
|
|
|
|
|
2022-03-10 10:38:33 +08:00
|
|
|
|
.el-main {
|
|
|
|
|
height: calc(100vh - 35px);
|
|
|
|
|
padding: 0 !important;
|
|
|
|
|
overflow: auto;
|
|
|
|
|
position: relative;
|
|
|
|
|
}
|
2021-11-23 15:34:42 +08:00
|
|
|
|
|
2022-03-10 10:38:33 +08:00
|
|
|
|
.el-main ::v-deep .el-drawer__wrapper {
|
|
|
|
|
width: 310px !important;
|
|
|
|
|
}
|
2021-11-23 15:34:42 +08:00
|
|
|
|
|
2022-03-10 10:38:33 +08:00
|
|
|
|
.el-main ::v-deep .el-drawer__body {
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
}
|
2021-05-20 11:18:31 +08:00
|
|
|
|
|
2022-03-10 10:38:33 +08:00
|
|
|
|
.button-show {
|
|
|
|
|
background-color: var(--ContentBG, #ebf2fe) !important;
|
|
|
|
|
}
|
2021-05-27 18:54:06 +08:00
|
|
|
|
|
2022-03-10 10:38:33 +08:00
|
|
|
|
.button-closed {
|
|
|
|
|
background-color: var(--SiderBG, #ffffff) !important;
|
|
|
|
|
}
|
2021-05-31 11:20:32 +08:00
|
|
|
|
|
2022-03-10 10:38:33 +08:00
|
|
|
|
.style-aside {
|
|
|
|
|
width: 250px;
|
|
|
|
|
max-width: 250px !important;
|
|
|
|
|
border: 1px solid var(--TableBorderColor, #E6E6E6);
|
|
|
|
|
padding: 10px;
|
|
|
|
|
transition: all 0.3s;
|
2021-05-31 11:20:32 +08:00
|
|
|
|
|
2022-03-10 10:38:33 +08:00
|
|
|
|
}
|
2021-05-20 11:18:31 +08:00
|
|
|
|
|
2022-03-10 10:38:33 +08:00
|
|
|
|
.placeholder {
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
color: gray;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.show {
|
|
|
|
|
transform: translateX(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.hidden {
|
|
|
|
|
transform: translateX(100%);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.style-edit-dialog {
|
|
|
|
|
width: 300px !important;
|
|
|
|
|
height: 400px !important;
|
2021-07-01 12:12:43 +08:00
|
|
|
|
|
2022-03-10 10:38:33 +08:00
|
|
|
|
.el-dialog__header {
|
|
|
|
|
padding: 10px 20px !important;
|
2021-07-01 12:12:43 +08:00
|
|
|
|
|
2022-03-10 10:38:33 +08:00
|
|
|
|
.el-dialog__headerbtn {
|
|
|
|
|
top: 15px !important;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.el-dialog__body {
|
|
|
|
|
padding: 1px 15px !important;
|
2021-07-01 12:12:43 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2022-03-10 10:38:33 +08:00
|
|
|
|
|
|
|
|
|
.style-hidden {
|
|
|
|
|
overflow-x: hidden;
|
2021-07-01 12:12:43 +08:00
|
|
|
|
}
|
2022-03-10 10:38:33 +08:00
|
|
|
|
|
|
|
|
|
.button-text {
|
2021-10-11 18:39:43 +08:00
|
|
|
|
color: var(--TextActive);
|
2022-03-10 10:38:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.mobile-canvas {
|
2021-11-23 15:34:42 +08:00
|
|
|
|
width: 300px;
|
|
|
|
|
height: 600px;
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-10 10:38:33 +08:00
|
|
|
|
.info-class {
|
|
|
|
|
text-align: center;
|
|
|
|
|
height: 100%;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
background-color: #FFFFFF;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
color: #9ea6b2;
|
|
|
|
|
}
|
2021-07-01 12:12:43 +08:00
|
|
|
|
|
2022-03-10 10:38:33 +08:00
|
|
|
|
::-webkit-scrollbar {
|
|
|
|
|
width: 2px !important;
|
|
|
|
|
height: 2px !important;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.tools-window-main {
|
|
|
|
|
width: 300px;
|
|
|
|
|
background-color: #FFFFFF;
|
|
|
|
|
transition: 1s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.tools-window-tabs {
|
|
|
|
|
height: calc(100vh - 100px);
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
overflow-x: hidden;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
> > > .el-tabs__item {
|
|
|
|
|
padding: 0 15px;
|
|
|
|
|
}
|
|
|
|
|
.view-selected-message-class {
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
color: #9ea6b2;
|
|
|
|
|
height: 100%;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
height: calc(100vh - 100px);
|
|
|
|
|
}
|
2021-11-23 11:35:02 +08:00
|
|
|
|
|
2021-03-22 19:05:35 +08:00
|
|
|
|
</style>
|