diff --git a/.gitignore b/.gitignore index be521430de53fc069ce64ca0778491e85fc75be7..f4d0fe03ca96d86be6e901e8fd1cdeb4cbac39c1 100644 --- a/.gitignore +++ b/.gitignore @@ -79,6 +79,7 @@ web_modules/ # Next.js build output .next out +template # Nuxt.js build / generate output .nuxt diff --git a/README.md b/README.md index b056c72f4180eee915428d0ed797ac531678759b..d533bf5260aca373bad1e4c4cec722ce2bb580f1 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,12 @@ ## 软件架构 +总体架构采用分层设计,通过组件层、模板层以及工程层进行拆分 + ![总体架构](/assets/architecture.png) +对于[vue-lcd-engine](https://gitee.com/VLeeDesignTheory/vue-lcd-engine)分别通过`component`、`tooler`、`sider`、`setter`、`renderer`、`share`进行模块拆分。其中,`component`模块是暴露给开发者进行协同开发的共建区块 + ![技术选型](/assets/technology.png) @@ -24,10 +28,35 @@ npm install vue-lcd-engine 2. 引入 ```js -import * as VueLowCode from 'vue-lcd-engine' - -Object.keys(VueLowCode).forEach(key => { - Vue.use(VueLowCode[`${key}`]) +import { + Cascader, + ComponentBox, + ConfigItem, + EditScreens, + Feedback, + Layout, + Loading, + Ruler, + Size, + SvgIcon, + Thumbnail +} from 'vue-lcd-engine' + +// 全局注册 +[ + Cascader, + ComponentBox, + ConfigItem, + EditScreens, + Feedback, + Layout, + Loading, + Ruler, + Size, + SvgIcon, + Thumbnail +].forEach(component => { + Vue.component(component.name, component) }) ``` @@ -35,7 +64,7 @@ Object.keys(VueLowCode).forEach(key => { ```vue + + \ No newline at end of file diff --git a/components/Cascader/components/CascaderItem.vue b/components/Cascader/components/CascaderItem.vue new file mode 100644 index 0000000000000000000000000000000000000000..e89ec84a9f9438511d6dd399fd7bfe16f3d6f541 --- /dev/null +++ b/components/Cascader/components/CascaderItem.vue @@ -0,0 +1,126 @@ + + + + + \ No newline at end of file diff --git a/components/Cascader/index.vue b/components/Cascader/index.vue new file mode 100644 index 0000000000000000000000000000000000000000..53a443127bc148b686c44646096c22c93de21d9a --- /dev/null +++ b/components/Cascader/index.vue @@ -0,0 +1,290 @@ + + + + + diff --git a/components/ComponentBox/index.vue b/components/ComponentBox/index.vue new file mode 100644 index 0000000000000000000000000000000000000000..43af3a020bbcffefc6afcbec98acfc1d5cef98cb --- /dev/null +++ b/components/ComponentBox/index.vue @@ -0,0 +1,1346 @@ + + + + + diff --git a/components/ComponentBox/utils/dom.js b/components/ComponentBox/utils/dom.js new file mode 100644 index 0000000000000000000000000000000000000000..9e36dba6ea7db7caadf85aca93a0a8d6bcbe2a14 --- /dev/null +++ b/components/ComponentBox/utils/dom.js @@ -0,0 +1,60 @@ +import { isFunction } from './fns' + +// 将选择器与父元素匹配 +export function matchesSelectorToParentElements (el, selector, baseNode) { + let node = el + + const matchesSelectorFunc = [ + 'matches', + 'webkitMatchesSelector', + 'mozMatchesSelector', + 'msMatchesSelector', + 'oMatchesSelector' + ].find(func => isFunction(node[func])) + + if (!isFunction(node[matchesSelectorFunc])) return false + + do { + if (node[matchesSelectorFunc](selector)) return true + if (node === baseNode) return false + node = node.parentNode + } while (node) + + return false +} + +export function getComputedSize ($el) { + const style = window.getComputedStyle($el) + + return [ + parseFloat(style.getPropertyValue('width'), 10), + parseFloat(style.getPropertyValue('height'), 10) + ] +} +// 添加事件 +export function addEvent (el, event, handler) { + if (!el) { + return + } + if (el.attachEvent) { + el.attachEvent('on' + event, handler) + } else if (el.addEventListener) { + el.addEventListener(event, handler, true) + } else { + el['on' + event] = handler + } +} + +// 删除事件 +export function removeEvent (el, event, handler) { + if (!el) { + return + } + if (el.detachEvent) { + el.detachEvent('on' + event, handler) + } else if (el.removeEventListener) { + el.removeEventListener(event, handler, true) + } else { + el['on' + event] = null + } +} diff --git a/components/ComponentBox/utils/fns.js b/components/ComponentBox/utils/fns.js new file mode 100644 index 0000000000000000000000000000000000000000..f8bda0b0d91a29ef97e2ad7303c86838e5e14533 --- /dev/null +++ b/components/ComponentBox/utils/fns.js @@ -0,0 +1,39 @@ +export function isFunction (func) { + return (typeof func === 'function' || Object.prototype.toString.call(func) === '[object Function]') +} + +export function snapToGrid (grid, pendingX, pendingY, scale = 1) { + const x = Math.round((pendingX / scale) / grid[0]) * grid[0] + const y = Math.round((pendingY / scale) / grid[1]) * grid[1] + + return [x, y] +} + +export function getSize (el) { + const rect = el.getBoundingClientRect() + + return [ + parseInt(rect.width), + parseInt(rect.height) + ] +} + +export function computeWidth (parentWidth, left, right) { + return parentWidth - left - right +} + +export function computeHeight (parentHeight, top, bottom) { + return parentHeight - top - bottom +} + +export function restrictToBounds (value, min, max) { + if (min !== null && value < min) { + return min + } + + if (max !== null && max < value) { + return max + } + + return value +} diff --git a/components/ConfigItem/index.vue b/components/ConfigItem/index.vue new file mode 100644 index 0000000000000000000000000000000000000000..62cbd2117262a8436d5db946a27cc1fd55ae71bf --- /dev/null +++ b/components/ConfigItem/index.vue @@ -0,0 +1,49 @@ + + + + + \ No newline at end of file diff --git a/components/EditScreens/index.vue b/components/EditScreens/index.vue new file mode 100644 index 0000000000000000000000000000000000000000..5653149ef66749e6cd05e5e980eff50b6d78f551 --- /dev/null +++ b/components/EditScreens/index.vue @@ -0,0 +1,58 @@ + + + + + \ No newline at end of file diff --git a/components/Feedback/index.vue b/components/Feedback/index.vue new file mode 100644 index 0000000000000000000000000000000000000000..5eb9762c5170783a3c177a58b29455eaecaebb84 --- /dev/null +++ b/components/Feedback/index.vue @@ -0,0 +1,39 @@ + + + \ No newline at end of file diff --git a/components/Layout/index.vue b/components/Layout/index.vue new file mode 100644 index 0000000000000000000000000000000000000000..4813ca5d90dfdac3f052168a1da96e875ae5a62d --- /dev/null +++ b/components/Layout/index.vue @@ -0,0 +1,62 @@ + + + + + \ No newline at end of file diff --git a/components/Loading/index.vue b/components/Loading/index.vue new file mode 100644 index 0000000000000000000000000000000000000000..f51b44f0ec3f90e578c596cb02afbd6a19ec7c4a --- /dev/null +++ b/components/Loading/index.vue @@ -0,0 +1,43 @@ + + + + diff --git a/components/Ruler/components/SketchRule.vue b/components/Ruler/components/SketchRule.vue new file mode 100644 index 0000000000000000000000000000000000000000..9851005312615bdc90b8416dabd0bb3414f94ef1 --- /dev/null +++ b/components/Ruler/components/SketchRule.vue @@ -0,0 +1,470 @@ + + + + \ No newline at end of file diff --git a/components/Ruler/index.vue b/components/Ruler/index.vue new file mode 100644 index 0000000000000000000000000000000000000000..a0beba54cb181caa5553dd3ed8ebc7c97cc9aa83 --- /dev/null +++ b/components/Ruler/index.vue @@ -0,0 +1,88 @@ + + + + + \ No newline at end of file diff --git a/components/Size/index.vue b/components/Size/index.vue new file mode 100644 index 0000000000000000000000000000000000000000..d94cd2ba2d8d7b9f02506d35f4bbc646ab43db98 --- /dev/null +++ b/components/Size/index.vue @@ -0,0 +1,113 @@ + + + + + diff --git a/components/SvgIcon/index.vue b/components/SvgIcon/index.vue new file mode 100644 index 0000000000000000000000000000000000000000..926cd0ce6cf829ce44267ef8c0411033073c54c6 --- /dev/null +++ b/components/SvgIcon/index.vue @@ -0,0 +1,26 @@ + + + \ No newline at end of file diff --git a/components/Thumbnail/index.vue b/components/Thumbnail/index.vue new file mode 100644 index 0000000000000000000000000000000000000000..e1dd18b58d5e20b36a9c7532db8d6fd6006d1246 --- /dev/null +++ b/components/Thumbnail/index.vue @@ -0,0 +1,63 @@ + + + + + diff --git a/components/index.js b/components/index.js new file mode 100644 index 0000000000000000000000000000000000000000..ed11470e4e753e5d2e5d5395e8a7cfb0bac513e1 --- /dev/null +++ b/components/index.js @@ -0,0 +1,44 @@ +import Cascader from './Cascader/index.vue'; +import ComponentBox from './ComponentBox/index.vue'; +import ConfigItem from './ConfigItem/index.vue'; +import EditScreens from './EditScreens/index.vue'; +import Feedback from './Feedback/index.vue'; +import Layout from './Layout/index.vue'; +import Loading from './Loading/index.vue'; +import Ruler from './Ruler/index.vue'; +import Size from './Size/index.vue'; +import SvgIcon from './SvgIcon/index.vue'; +import Thumbnail from './Thumbnail/index.vue'; + +[ + Cascader, + ComponentBox, + ConfigItem, + EditScreens, + Feedback, + Layout, + Loading, + Ruler, + Size, + SvgIcon, + Thumbnail +].forEach(item => { + item.install = function(Vue) { + Vue.component(item.name, item) + } +}) + + +export { + Cascader, + ComponentBox, + ConfigItem, + EditScreens, + Feedback, + Layout, + Loading, + Ruler, + Size, + SvgIcon, + Thumbnail +} \ No newline at end of file diff --git a/components/mixins/window.js b/components/mixins/window.js new file mode 100644 index 0000000000000000000000000000000000000000..3fe52cfaccb1960900a456f9d569ed29908bdd81 --- /dev/null +++ b/components/mixins/window.js @@ -0,0 +1,29 @@ +import { throttle } from '../utils'; + +export default { + data() { + return { + windowWidth: null, // 存放窗口宽度的状态值 + windowHeight: null // 存放窗口高度的状态值 + } + }, + mounted() { + + this.updateWindowSize(); // 初始化获取当前窗口宽度 + + window.addEventListener('resize', this.handleResize); // 添加窗口大小改变的事件监听器 + }, + beforeDestroy() { + window.removeEventListener('resize', this.handleResize); // 在组件销毁之前移除事件监听器 + }, + methods: { + updateWindowSize() { + this.windowWidth = window.innerWidth; // 将当前窗口宽度赋值给状态值 + this.windowHeight = window.innerHeight; // 将当前窗口宽度赋值给状态值 + }, + handleResize: throttle(function(event) { + this.updateWindowSize(); + this.$router.go(0) + }, 500) + } + } \ No newline at end of file diff --git a/components/styles/cover.less b/components/styles/cover.less new file mode 100644 index 0000000000000000000000000000000000000000..c72b7ed5e545ba23e98d5bbeeed82b6386f140e1 --- /dev/null +++ b/components/styles/cover.less @@ -0,0 +1,179 @@ +@import './vars.less'; + +// 重写button样式 +.ant_btn_reset() { + /deep/ .ant-btn:hover { + color: @text-color !important; + } + + /deep/ .ant-btn:focus { + color: @text-color !important; + } +} + +// 重写input样式 +.ant_input_reset() { + /deep/ .ant-input { + background-color: transparent; + } + + /deep/ .ant-input-disabled { + color: @dark-color-6; + } +} + +// 重写select样式 +.ant_select_reset() { + /deep/ .ant-select-selection { + background-color: transparent; + } + + /deep/ .ant-select-arrow { + color: white; + } +} + +// 重写slider样式 +.ant_slider_reset() { + /deep/ .ant-slider-rail { + background-color: white; + } + + /deep/ .ant-slider-track { + background-color: @primary-color; + } + + /deep/ .ant-slider-handle { + background-color: @primary-color; + border-color: @primary-color; + } +} + +// 重写popconfirm样式 +.ant_popconfirm_reset() { + .ant-popover { + .ant-popover-arrow { + border-color: @primary-color !important; + } + + .ant-popover-inner { + background-color: @primary-color; + + .ant-popover-buttons .ant-btn { + color: lighten(@dark-color, 99.9% - lightness(@dark-color)); + background: transparent; + border: none; + font-size: 12px; + + &.ant-btn-primary { + border: 1px solid lighten(@dark-color, 99.9% - lightness(@dark-color)); + } + } + } + + &.popconfirm-delete { + .ant-popover-buttons { + display: none; + } + + .ant-popover-message { + padding: 4px 0 0 0; + } + } + } +} + +// 重写pagination样式 +.ant_pagination_reset() { + /deep/ .ant-pagination { + .ant-pagination-item-active a { + background: @primary-color; + color: lighten(@dark-color, 99.9% - lightness(@dark-color)); + } + + .ant-pagination-item-ellipsis { + color: lighten(@dark-color, 99.9% - lightness(@dark-color)); + } + } +} + +// 重写checkbox样式 +.ant_checkbox_reset() { + /deep/ .ant-checkbox-inner { + background-color: transparent; + } +} + +// 重写collapse样式 +.ant_collapse_reset() { + /deep/ .ant-collapse { + .ant-collapse-item { + .ant-modal-close { + .ant-modal-close-icon { + color: white; + } + } + + .ant-collapse-content { + background-color: @dark-color-5; + } + + } + + } +} + +// 重写table样式 +.ant_table_reset() { + /deep/ .ant-table { + background-color: transparent; + border: 1px solid @dark-color-5; + border-radius: 0.25rem; + .ant-table-row-selected { + td { + background-color: transparent; + } + } + + .ant-table-placeholder { + background-color: transparent; + + .ant-empty-description { + color: white; + } + } + + .ant-table-thead { + th { + background-color: @dark-color-4; + } + } + + .ant-table-selection-column { + .ant-checkbox-inner { + border-color: @dark-color-6; + background-color: transparent; + } + } + + .ant-table-tbody .ant-table-row:nth-child(odd) { + background-color: transparent; + } + + .ant-table-tbody .ant-table-row:nth-child(even) { + background: @dark-color-4; + } + } +} + +// 重写modal样式 +.ant_modal_reset() { + /deep/ .ant-modal-content { + background-color: @dark-color-3; + + .ant-modal-header { + background-color: inherit; + } + } + +} \ No newline at end of file diff --git a/components/styles/index.less b/components/styles/index.less new file mode 100644 index 0000000000000000000000000000000000000000..a0d47ac605580d1d004888938db477245303b973 --- /dev/null +++ b/components/styles/index.less @@ -0,0 +1,61 @@ +@import '~ant-design-vue/dist/antd.less'; + +// 1920一下屏幕 不需要放大 只需要响应式布局即可 +@media screen and (min-width:1366px) { + html,body { + font-size: excl(12px); + } +} + +@media screen and (min-width:1440px) { + html,body { + font-size: excl(14px); + } +} + +@media screen and (min-width:1600px) { + html,body { + font-size: excl(14px); + } +} + +@media screen and (min-width:1920px) { + html,body { + font-size: excl(16px); + } +} + +@media screen and (min-width:2560px) { + html,body { + font-size: excl(18px); + } +} + +@media screen and (min-width:3840px) { + html,body { + font-size: excl(18px); + } +} + +/* 设置滚动条的样式 */ +::-webkit-scrollbar { + width:8px; + height:8px; +} +/* 滚动槽 */ +::-webkit-scrollbar-track { + -webkit-box-shadow:inset006pxrgba(0,0,0,0.3); + border-radius:10px; +} +/* 滚动条滑块 */ +::-webkit-scrollbar-thumb { + border-radius:10px; + background:#d8d8d8; + -webkit-box-shadow:inset006pxrgba(0,0,0,0.5); +} +::-webkit-scrollbar-thumb:window-inactive { + background:rgba(0,0,0,0.4); +} +::-webkit-scrollbar-corner { + background: transparent; +} \ No newline at end of file diff --git a/components/styles/vars.less b/components/styles/vars.less new file mode 100644 index 0000000000000000000000000000000000000000..9c1eaa01d44f36845f0b782b94e6e56033408418 --- /dev/null +++ b/components/styles/vars.less @@ -0,0 +1,57 @@ +// 自定义变量 +@dark-color: #141414; +// #0f0f0f +@dark-color-1: darken(@dark-color, lightness(@dark-color) - 5.84%); +// #1f1f1f +@dark-color-2: lighten(@dark-color, 12.16% - lightness(@dark-color)); +// #2e2e2e +@dark-color-3: lighten(@dark-color, 18.04% - lightness(@dark-color)); +// #3a3a3a +@dark-color-4: lighten(@dark-color, 22.75% - lightness(@dark-color)); +// #404040 +@dark-color-5: lighten(@dark-color, 25.1% - lightness(@dark-color)); +// #595959 +@dark-color-6: lighten(@dark-color, 34.9% - lightness(@dark-color)); + +// ant-design-vue 变量 +@primary-color: #3779ee; // 全局主色 +@link-color: #1890ff; // 链接色 +@success-color: #2bbe8c; // 成功色 +@warning-color: #faad14; // 警告色 +@error-color: #eb5c5c; // 错误色 +// 暗黑主题修改 +@background-color-light: @dark-color-6; +@background-color-base: @dark-color-6; +@body-background: @dark-color; +@component-background: @dark-color-6; +@label-color: @text-color; +@border-color-base: @dark-color-6; +@border-color-split: @dark-color-6; +@heading-color: @text-color; +@text-color: @text-color; +@item-active-bg: @primary-color; +@item-hover-bg: @primary-color; +@text-color: white; +@text-color-secondary: darken(@text-color, 10%); // 次文本色 +@disabled-color: fade(@dark-color, 0.25); // 失效色 + + +:export { + primary_color: @primary-color; + link_color: @link-color; + success_color: @success-color; + warning_color: @warning-color; + error_color: @error-color; + dark_color: @dark-color; + dark_color_1: @dark-color-1; + dark_color_2: @dark-color-2; + dark_color_3: @dark-color-3; + dark_color_4: @dark-color-4; + dark_color_5: @dark-color-5; + dark_color_6: @dark-color-6; + text_color: @text-color; + text_color_secondary: @text-color-secondary; + disabled_color: @disabled-color; +} + + diff --git a/components/utils/icon.js b/components/utils/icon.js new file mode 100644 index 0000000000000000000000000000000000000000..681ee6d87ff0d29533682c7d22011a9309e55c9a --- /dev/null +++ b/components/utils/icon.js @@ -0,0 +1,507 @@ +const SVG_TYPES = { + "lcd-icon-editor-center_normal": { + template: ` + + 编组 + + + + + + + + + + `, + }, + "lcd-icon-editor-float_selected": { + template: ` + + 编组备份 + + + + + + + + `, + }, + "lcd-icon-editor-background_normal": { + template: ` + + 编组 3 + + + + + + + + + `, + }, + "lcd-icon-editor-component_selected": { + template: ` + + 形状 + + + + + + + + + + `, + }, + "lcd-icon-editor-background_selected": { + template: ` + + 编组备份 4 + + + + + + + + + `, + }, + "lcd-icon-editor-center_selected": { + template: ` + + 编组备份 2 + + + + + + + + + + `, + }, + "lcd-icon-editor-collapse": { + template: ` + + 路径 + + + + + + + + + + `, + }, + "lcd-icon-editor-exit": { + template: ` + + 形状 2 + + + + + + + + + + `, + }, + "lcd-icon-home-checked": { + template: ` + + 形状 + + + + + + + + + + + + + + `, + }, + "lcd-icon-editor-handbook_hover": { + template: ` + + 编组 20备份 + + + + + + + + `, + }, + "lcd-icon-editor-handbook_normal": { + template: ` + + 编组 20 + + + + + + + + `, + }, + "lcd-icon-editor-expand": { + template: ` + + 编组 29 + + + + + + + + + + + + + `, + }, + "lcd-icon-editor-float_normal": { + template: ` + + 编组 4 + + + + + + + + `, + }, + "lcd-icon-home-more": { + template: ` + + 编组 13 + + + + + + + + + + + + + `, + }, + "lcd-icon-editor-panel_normal": { + template: ` + + 编组 2 + + + + + + + + `, + }, + "lcd-icon-editor-redo": { + template: ` + + 编组 38 + + + + + + + + + + + + `, + }, + "lcd-icon-home-delete": { + template: ` + + 编组 15 + + + + + + + + + + + + + + + `, + }, + "lcd-icon-editor-panel_selected": { + template: ` + + 编组备份 3 + + + + + + + + `, + }, + "lcd-icon-editor-preview": { + template: ` + + 编组 31 + + + + + + + + + + + `, + }, + "lcd-icon-editor-undo": { + template: ` + + 编组 32 + + + + + + + + + + + + `, + }, + "lcd-icon-editor-remove": { + template: ` + + 编组 47 + + + + + + + + + + + + `, + }, + "lcd-icon-editor-save": { + template: ` + + 形状 + + + + + + + + + + + `, + }, + "lcd-icon-home-tooltip": { + template: ` + + 编组 13 + + + + + + + + + + + + + `, + }, + "lcd-icon-editor-restore": { + template: ` + + 路径 + + + + + + + + + + `, + }, + "lcd-icon-home-base": { + template: ` + + 编组 14 + + + + + + + + + + + + + `, + }, + "lcd-icon-editor-lock": { + template: ` + + 编组 49 + + + + + + + + + + + `, + }, + "lcd-icon-home-confirm": { + template: ` + + 编组 12 + + + + + + + + + + + + + + `, + }, + "lcd-icon-home-edit": { + template: ` + + 编组 14 + + + + + + + + + + + + + `, + }, + "lcd-icon-home-emtry": { + template: ` + + 编组 12 + + + + + + + + + + + + + + + `, + }, + "lcd-icon-logo": { + template: ` + + 形状 + + + + + + + + `, + }, + "lcd-icon-editor-unlock": { + template: ` + + 编组 48 + + + + + + + + + + + `, + }, +}; + +// 用于注册svg_icon方法 +const register = (type, svg) => { + if (type) { + if (SVG_TYPES[`lcd-icon-${type}`]) + console.warn(`lcd-icon-${type}图标已存在,注册后会覆盖当前图标!`); + SVG_TYPES[`lcd-icon-${type}`] = { + template: svg, + }; + } +}; + +export { register, SVG_TYPES }; diff --git a/components/utils/index.js b/components/utils/index.js new file mode 100644 index 0000000000000000000000000000000000000000..63365bf5d1886f5e69a5502278822ef82cfc30d0 --- /dev/null +++ b/components/utils/index.js @@ -0,0 +1,3 @@ +export * from 'lodash'; +// 本地utils +export * from './icon'; \ No newline at end of file diff --git a/dist/vue-lcd-engine.cjs.js b/dist/vue-lcd-engine.cjs.js index 808542ca7e77f080c418977a75ffb703437f8b4d..88a2ba570b658ea084337ef8726a71dcb860f629 100644 --- a/dist/vue-lcd-engine.cjs.js +++ b/dist/vue-lcd-engine.cjs.js @@ -1 +1,4265 @@ -console.log('vue-lcd-engine.cjs.js') \ No newline at end of file +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +require('core-js/modules/es.object.to-string.js'); +require('core-js/modules/web.dom-collections.for-each.js'); +require('core-js/modules/es.function.name.js'); +require('core-js/modules/es.array.find-index.js'); +require('core-js/modules/es.array.find.js'); +require('core-js/modules/es.number.constructor.js'); +var antDesignVue = require('ant-design-vue'); +require('core-js/modules/es.json.stringify.js'); +var lodash = require('lodash'); +require('core-js/modules/es.set.js'); +require('core-js/modules/es.string.iterator.js'); +require('core-js/modules/web.dom-collections.iterator.js'); +require('core-js/modules/es.array.filter.js'); +require('core-js/modules/es.array.includes.js'); +require('core-js/modules/es.error.cause.js'); +require('core-js/modules/es.regexp.constructor.js'); +require('core-js/modules/es.regexp.dot-all.js'); +require('core-js/modules/es.regexp.exec.js'); +require('core-js/modules/es.regexp.sticky.js'); +require('core-js/modules/es.regexp.to-string.js'); +require('core-js/modules/es.regexp.test.js'); +require('core-js/modules/es.string.includes.js'); +require('core-js/modules/es.array.fill.js'); +require('core-js/modules/es.object.keys.js'); +require('core-js/modules/es.array.push.js'); +require('core-js/modules/es.string.replace.js'); +require('core-js/modules/es.number.to-fixed.js'); +require('core-js/modules/es.array.concat.js'); +require('core-js/modules/es.array.splice.js'); + +function _typeof(o) { + "@babel/helpers - typeof"; + + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { + return typeof o; + } : function (o) { + return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; + }, _typeof(o); +} + +function toPrimitive(t, r) { + if ("object" != _typeof(t) || !t) return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r || "default"); + if ("object" != _typeof(i)) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === r ? String : Number)(t); +} + +function toPropertyKey(t) { + var i = toPrimitive(t, "string"); + return "symbol" == _typeof(i) ? i : String(i); +} + +function _defineProperty(obj, key, value) { + key = toPropertyKey(key); + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; +} + +var script$d = { + name: 'CascaderItem', + components: _defineProperty({}, antDesignVue.Tooltip.name, antDesignVue.Tooltip), + props: { + optionsItem: { + type: Array, + default: function _default() { + return []; + } + }, + selected: { + type: Object, + default: function _default() { + return {}; + } + }, + mode: { + type: String, + default: 'horizontal' + }, + indexLevel: { + type: Number, + default: 1 + }, + tooltip: { + type: Boolean, + default: false + }, + showTitle: { + type: Boolean, + default: true + } + }, + data: function data() { + return {}; + }, + methods: { + handleSelected: function handleSelected(e) { + this.$emit('handleSelected', e, this.indexLevel); + } + } +}; + +function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) { + if (typeof shadowMode !== 'boolean') { + createInjectorSSR = createInjector; + createInjector = shadowMode; + shadowMode = false; + } + // Vue.extend constructor export interop. + const options = typeof script === 'function' ? script.options : script; + // render functions + if (template && template.render) { + options.render = template.render; + options.staticRenderFns = template.staticRenderFns; + options._compiled = true; + // functional template + if (isFunctionalTemplate) { + options.functional = true; + } + } + // scopedId + if (scopeId) { + options._scopeId = scopeId; + } + let hook; + if (moduleIdentifier) { + // server build + hook = function (context) { + // 2.3 injection + context = + context || // cached call + (this.$vnode && this.$vnode.ssrContext) || // stateful + (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional + // 2.2 with runInNewContext: true + if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { + context = __VUE_SSR_CONTEXT__; + } + // inject component styles + if (style) { + style.call(this, createInjectorSSR(context)); + } + // register component module identifier for async chunk inference + if (context && context._registeredComponents) { + context._registeredComponents.add(moduleIdentifier); + } + }; + // used by ssr in case component is cached and beforeCreate + // never gets called + options._ssrRegister = hook; + } + else if (style) { + hook = shadowMode + ? function (context) { + style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot)); + } + : function (context) { + style.call(this, createInjector(context)); + }; + } + if (hook) { + if (options.functional) { + // register for functional component in vue file + const originalRender = options.render; + options.render = function renderWithStyleInjection(h, context) { + hook.call(context); + return originalRender(h, context); + }; + } + else { + // inject component registration as beforeCreate hook + const existing = options.beforeCreate; + options.beforeCreate = existing ? [].concat(existing, hook) : [hook]; + } + } + return script; +} + +const isOldIE = typeof navigator !== 'undefined' && + /msie [6-9]\\b/.test(navigator.userAgent.toLowerCase()); +function createInjector(context) { + return (id, style) => addStyle(id, style); +} +let HEAD; +const styles = {}; +function addStyle(id, css) { + const group = isOldIE ? css.media || 'default' : id; + const style = styles[group] || (styles[group] = { ids: new Set(), styles: [] }); + if (!style.ids.has(id)) { + style.ids.add(id); + let code = css.source; + if (css.map) { + // https://developer.chrome.com/devtools/docs/javascript-debugging + // this makes source maps inside style tags work properly in Chrome + code += '\n/*# sourceURL=' + css.map.sources[0] + ' */'; + // http://stackoverflow.com/a/26603875 + code += + '\n/*# sourceMappingURL=data:application/json;base64,' + + btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) + + ' */'; + } + if (!style.element) { + style.element = document.createElement('style'); + style.element.type = 'text/css'; + if (css.media) + style.element.setAttribute('media', css.media); + if (HEAD === undefined) { + HEAD = document.head || document.getElementsByTagName('head')[0]; + } + HEAD.appendChild(style.element); + } + if ('styleSheet' in style.element) { + style.styles.push(code); + style.element.styleSheet.cssText = style.styles + .filter(Boolean) + .join('\n'); + } + else { + const index = style.ids.size - 1; + const textNode = document.createTextNode(code); + const nodes = style.element.childNodes; + if (nodes[index]) + style.element.removeChild(nodes[index]); + if (nodes.length) + style.element.insertBefore(textNode, nodes[index]); + else + style.element.appendChild(textNode); + } + } +} + +/* script */ +const __vue_script__$d = script$d; + +/* template */ +var __vue_render__$d = function () { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c( + "ul", + { staticClass: "cascader-item-content" }, + _vm._l(_vm.optionsItem, function (item, index) { + var _obj; + return _c( + "li", + { + key: index, + class: [ + "cascader-item", + "cascader-item-" + _vm.mode, + ((_obj = {}), + (_obj["cascader-item-" + _vm.mode + "-active"] = + _vm.selected === item), + _obj), + ], + on: { + click: function ($event) { + return _vm.handleSelected(item) + }, + }, + }, + [ + _c( + "a-tooltip", + { + attrs: { placement: "rightBottom" }, + scopedSlots: _vm._u( + [ + _vm.tooltip + ? { + key: "title", + fn: function () { + return [_c("span", [_vm._v(_vm._s(item.label))])] + }, + proxy: true, + } + : null, + ], + null, + true + ), + }, + [ + _vm._v(" "), + _c( + "div", + [ + _vm._t("icon-title", function () { + return [ + _vm.selected === item + ? [_c("svg-icon", { attrs: { type: item.iconHover } })] + : [ + item.icon + ? _c("svg-icon", { attrs: { type: item.icon } }) + : _vm._e(), + ], + ] + }), + ], + 2 + ), + ] + ), + _vm._v(" "), + _c( + "a-tooltip", + { + attrs: { placement: "rightBottom" }, + scopedSlots: _vm._u( + [ + _vm.tooltip + ? { + key: "title", + fn: function () { + return [_c("span", [_vm._v(_vm._s(item.label))])] + }, + proxy: true, + } + : null, + ], + null, + true + ), + }, + [ + _vm._v(" "), + _vm.showTitle + ? _c("span", { staticClass: "cascader-item-name" }, [ + _vm._v(_vm._s(item.label)), + ]) + : _vm._e(), + ] + ), + ], + 1 + ) + }), + 0 + ) +}; +var __vue_staticRenderFns__$d = []; +__vue_render__$d._withStripped = true; + + /* style */ + const __vue_inject_styles__$d = function (inject) { + if (!inject) return + inject("data-v-cb71bf0e_0", { source: "[data-v-cb71bf0e]:export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.cascader-item-content[data-v-cb71bf0e] {\n margin-top: 1px;\n padding: 0;\n box-sizing: border-box;\n width: 100%;\n}\n.cascader-item-content .cascader-item[data-v-cb71bf0e] {\n width: 100%;\n cursor: pointer;\n}\n.cascader-item-content .cascader-item-horizontal[data-v-cb71bf0e] {\n display: flex;\n align-items: center;\n height: 48px;\n}\n.cascader-item-content .cascader-item-horizontal i[data-v-cb71bf0e] {\n margin: 0 10px 0 15px;\n}\n.cascader-item-content .cascader-item-horizontal i.anticon[data-v-cb71bf0e] {\n pointer-events: none;\n}\n.cascader-item-content .cascader-item-vertical[data-v-cb71bf0e] {\n display: flex;\n justify-content: center;\n flex-direction: column;\n align-items: center;\n margin: 11px 6px;\n width: calc(100% - 12px);\n height: 80px;\n}\n.cascader-item-content .cascader-item-vertical i[data-v-cb71bf0e] {\n pointer-events: none;\n}\n.cascader-item-content .cascader-item-vertical-active[data-v-cb71bf0e] {\n color: #ffffff;\n background-color: #2c2c2c;\n}\n.cascader-item-content .cascader-item-horizontal-active[data-v-cb71bf0e] {\n color: #ffffff;\n background-color: #1a1a1a;\n}\n", map: {"version":3,"sources":["CascaderItem.vue"],"names":[],"mappings":"AAAA;EACE,sBAAsB;EACtB,mBAAmB;EACnB,sBAAsB;EACtB,sBAAsB;EACtB,oBAAoB;EACpB,mBAAmB;EACnB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,iBAAiB;EACjB,6BAA6B;EAC7B,wCAAwC;AAC1C;AACA;EACE,eAAe;EACf,UAAU;EACV,sBAAsB;EACtB,WAAW;AACb;AACA;EACE,WAAW;EACX,eAAe;AACjB;AACA;EACE,aAAa;EACb,mBAAmB;EACnB,YAAY;AACd;AACA;EACE,qBAAqB;AACvB;AACA;EACE,oBAAoB;AACtB;AACA;EACE,aAAa;EACb,uBAAuB;EACvB,sBAAsB;EACtB,mBAAmB;EACnB,gBAAgB;EAChB,wBAAwB;EACxB,YAAY;AACd;AACA;EACE,oBAAoB;AACtB;AACA;EACE,cAAc;EACd,yBAAyB;AAC3B;AACA;EACE,cAAc;EACd,yBAAyB;AAC3B","file":"CascaderItem.vue","sourcesContent":[":export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.cascader-item-content {\n margin-top: 1px;\n padding: 0;\n box-sizing: border-box;\n width: 100%;\n}\n.cascader-item-content .cascader-item {\n width: 100%;\n cursor: pointer;\n}\n.cascader-item-content .cascader-item-horizontal {\n display: flex;\n align-items: center;\n height: 48px;\n}\n.cascader-item-content .cascader-item-horizontal i {\n margin: 0 10px 0 15px;\n}\n.cascader-item-content .cascader-item-horizontal i.anticon {\n pointer-events: none;\n}\n.cascader-item-content .cascader-item-vertical {\n display: flex;\n justify-content: center;\n flex-direction: column;\n align-items: center;\n margin: 11px 6px;\n width: calc(100% - 12px);\n height: 80px;\n}\n.cascader-item-content .cascader-item-vertical i {\n pointer-events: none;\n}\n.cascader-item-content .cascader-item-vertical-active {\n color: #ffffff;\n background-color: #2c2c2c;\n}\n.cascader-item-content .cascader-item-horizontal-active {\n color: #ffffff;\n background-color: #1a1a1a;\n}\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__$d = "data-v-cb71bf0e"; + /* module identifier */ + const __vue_module_identifier__$d = undefined; + /* functional template */ + const __vue_is_functional_template__$d = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$d = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$d, staticRenderFns: __vue_staticRenderFns__$d }, + __vue_inject_styles__$d, + __vue_script__$d, + __vue_scope_id__$d, + __vue_is_functional_template__$d, + __vue_module_identifier__$d, + false, + createInjector, + undefined, + undefined + ); + +var SVG_TYPES = { + "lcd-icon-editor-center_normal": { + template: "\n \n \u7F16\u7EC4\n \n \n \n \n \n \n \n \n \n " + }, + "lcd-icon-editor-float_selected": { + template: "\n \n \u7F16\u7EC4\u5907\u4EFD\n \n \n \n \n \n \n \n " + }, + "lcd-icon-editor-background_normal": { + template: "\n \n \u7F16\u7EC4 3\n \n \n \n \n \n \n \n \n " + }, + "lcd-icon-editor-component_selected": { + template: "\n \n \u5F62\u72B6\n \n \n \n \n \n \n \n \n \n " + }, + "lcd-icon-editor-background_selected": { + template: "\n \n \u7F16\u7EC4\u5907\u4EFD 4\n \n \n \n \n \n \n \n \n " + }, + "lcd-icon-editor-center_selected": { + template: "\n \n \u7F16\u7EC4\u5907\u4EFD 2\n \n \n \n \n \n \n \n \n \n " + }, + "lcd-icon-editor-collapse": { + template: "\n \n \u8DEF\u5F84\n \n \n \n \n \n \n \n \n \n " + }, + "lcd-icon-editor-exit": { + template: "\n \n \u5F62\u72B6 2\n \n \n \n \n \n \n \n \n \n " + }, + "lcd-icon-home-checked": { + template: "\n \n \u5F62\u72B6\n \n \n \n \n \n \n \n \n \n \n \n \n \n " + }, + "lcd-icon-editor-handbook_hover": { + template: "\n \n \u7F16\u7EC4 20\u5907\u4EFD\n \n \n \n \n \n \n \n " + }, + "lcd-icon-editor-handbook_normal": { + template: "\n \n \u7F16\u7EC4 20\n \n \n \n \n \n \n \n " + }, + "lcd-icon-editor-expand": { + template: "\n \n \u7F16\u7EC4 29\n \n \n \n \n \n \n \n \n \n \n \n \n " + }, + "lcd-icon-editor-float_normal": { + template: "\n \n \u7F16\u7EC4 4\n \n \n \n \n \n \n \n " + }, + "lcd-icon-home-more": { + template: "\n \n \u7F16\u7EC4 13\n \n \n \n \n \n \n \n \n \n \n \n \n " + }, + "lcd-icon-editor-panel_normal": { + template: "\n \n \u7F16\u7EC4 2\n \n \n \n \n \n \n \n " + }, + "lcd-icon-editor-redo": { + template: "\n \n \u7F16\u7EC4 38\n \n \n \n \n \n \n \n \n \n \n \n " + }, + "lcd-icon-home-delete": { + template: "\n \n \u7F16\u7EC4 15\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n " + }, + "lcd-icon-editor-panel_selected": { + template: "\n \n \u7F16\u7EC4\u5907\u4EFD 3\n \n \n \n \n \n \n \n " + }, + "lcd-icon-editor-preview": { + template: "\n \n \u7F16\u7EC4 31\n \n \n \n \n \n \n \n \n \n \n " + }, + "lcd-icon-editor-undo": { + template: "\n \n \u7F16\u7EC4 32\n \n \n \n \n \n \n \n \n \n \n \n " + }, + "lcd-icon-editor-remove": { + template: "\n \n \u7F16\u7EC4 47\n \n \n \n \n \n \n \n \n \n \n \n " + }, + "lcd-icon-editor-save": { + template: "\n \n \u5F62\u72B6\n \n \n \n \n \n \n \n \n \n \n " + }, + "lcd-icon-home-tooltip": { + template: "\n \n \u7F16\u7EC4 13\n \n \n \n \n \n \n \n \n \n \n \n \n " + }, + "lcd-icon-editor-restore": { + template: "\n \n \u8DEF\u5F84\n \n \n \n \n \n \n \n \n \n " + }, + "lcd-icon-home-base": { + template: "\n \n \u7F16\u7EC4 14\n \n \n \n \n \n \n \n \n \n \n \n \n " + }, + "lcd-icon-editor-lock": { + template: "\n \n \u7F16\u7EC4 49\n \n \n \n \n \n \n \n \n \n \n " + }, + "lcd-icon-home-confirm": { + template: "\n \n \u7F16\u7EC4 12\n \n \n \n \n \n \n \n \n \n \n \n \n \n " + }, + "lcd-icon-home-edit": { + template: "\n \n \u7F16\u7EC4 14\n \n \n \n \n \n \n \n \n \n \n \n \n " + }, + "lcd-icon-home-emtry": { + template: "\n \n \u7F16\u7EC4 12\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n " + }, + "lcd-icon-logo": { + template: "\n \n \u5F62\u72B6\n \n \n \n \n \n \n \n " + }, + "lcd-icon-editor-unlock": { + template: "\n \n \u7F16\u7EC4 48\n \n \n \n \n \n \n \n \n \n \n " + } +}; + +var script$c = { + name: 'CascaderComponent', + props: { + options: { + type: Array, + default: function _default() { + return []; + } + }, + layout: { + type: String, + default: 'biserial' + }, + cover: String, + proxyName: String + }, + data: function data() { + return {}; + }, + methods: { + /* 拖拽开始 */handleDragStart: function handleDragStart(e, item) { + var _e$dataTransfer; + e === null || e === void 0 || (_e$dataTransfer = e.dataTransfer) === null || _e$dataTransfer === void 0 || _e$dataTransfer.setData('ChartData', JSON.stringify(lodash.omit(item, ['coverAddress']))); + }, + /* 拖拽结束 */handleDragEnd: function handleDragEnd() { + /* */ + } + } +}; + +/* script */ +const __vue_script__$c = script$c; + +/* template */ +var __vue_render__$c = function () { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c( + "div", + { staticClass: "cascader-component" }, + _vm._l(_vm.options, function (item, index) { + return _c( + "div", + { + key: index, + class: [ + "cascader-component-draggle", + "cascader-component-draggle-" + _vm.layout, + ], + }, + [ + _c("div", { staticClass: "cascader-component-draggle-title" }, [ + _vm._v(_vm._s(item.label)), + ]), + _vm._v(" "), + _c( + "div", + { + staticClass: "cascader-component-draggle-warp", + attrs: { draggable: "true" }, + on: { + dragstart: function ($event) { + return _vm.handleDragStart($event, item) + }, + dragend: _vm.handleDragEnd, + }, + }, + [ + _c("img", { + staticClass: "list-img", + attrs: { + src: item.coverAddress + ? _vm.proxyName + "/" + item.coverAddress + : _vm.cover, + alt: item.coverAddress + ? _vm.proxyName + "/" + item.coverAddress + : _vm.cover, + }, + }), + ] + ), + ] + ) + }), + 0 + ) +}; +var __vue_staticRenderFns__$c = []; +__vue_render__$c._withStripped = true; + + /* style */ + const __vue_inject_styles__$c = function (inject) { + if (!inject) return + inject("data-v-f4e622b4_0", { source: "[data-v-f4e622b4]:export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.cascader-component[data-v-f4e622b4] {\n width: 100%;\n height: auto;\n}\n.cascader-component-draggle[data-v-f4e622b4] {\n margin: 12px;\n background: #2e2e2e;\n width: calc(100% - 26px);\n cursor: pointer;\n border: 1px solid transparent;\n}\n.cascader-component-draggle[data-v-f4e622b4]:hover {\n border: 1px solid #3779ee;\n}\n.cascader-component-draggle:hover .list-img[data-v-f4e622b4] {\n transform: scale(1.05);\n}\n.cascader-component-draggle .cascader-component-draggle-title[data-v-f4e622b4] {\n padding: 0 12px;\n box-sizing: border-box;\n color: rgba(255, 255, 255, 0.6);\n font-size: 14px;\n height: 36px;\n line-height: 36px;\n}\n.cascader-component-draggle .cascader-component-draggle-warp[data-v-f4e622b4] {\n display: flex;\n justify-content: center;\n align-content: center;\n text-align: center;\n padding: 0 12px 15px 12px;\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n}\n.cascader-component-draggle .cascader-component-draggle-warp .list-img[data-v-f4e622b4] {\n width: 100%;\n height: 100%;\n border-radius: 2px;\n object-fit: contain;\n transition: all 0.5s;\n}\n", map: {"version":3,"sources":["CascaderComponent.vue","C:\\Users\\lihq1\\Desktop\\开源\\vue-lcd-engine\\components\\Cascader\\components\\CascaderComponent.vue"],"names":[],"mappings":"AAAA;EACE,sBAAsB;EACtB,mBAAmB;EACnB,sBAAsB;EACtB,sBAAsB;EACtB,oBAAoB;EACpB,mBAAmB;EACnB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,iBAAiB;EACjB,6BAA6B;EAC7B,wCAAwC;AAC1C;AACA;EACE,WAAW;EACX,YAAY;AACd;AACA;EACE,YAAY;EACZ,mBAAmB;EACnB,wBAAwB;EACxB,eAAe;EACf,6BAA6B;AAC/B;AACA;EACE,yBAAyB;AAC3B;AACA;EACE,sBAAsB;AACxB;AACA;EACE,eAAe;EACf,sBAAsB;EACtB,+BAA+B;EAC/B,eAAe;EACf,YAAY;EACZ,iBAAiB;AACnB;AACA;EACE,aAAa;EACb,uBAAuB;EACvB,qBAAqB;EACrB,kBAAkB;EAClB,yBAAyB;EACzB,sBAAsB;EACtB,WAAW;EACX,YAAY;AACd;AACA;EACE,WAAW;EACX,YAAY;EACZ,kBAAkB;EAClB,mBAAmB;EACnB,oBAAoB;ACCtB","file":"CascaderComponent.vue","sourcesContent":[":export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.cascader-component {\n width: 100%;\n height: auto;\n}\n.cascader-component-draggle {\n margin: 12px;\n background: #2e2e2e;\n width: calc(100% - 26px);\n cursor: pointer;\n border: 1px solid transparent;\n}\n.cascader-component-draggle:hover {\n border: 1px solid #3779ee;\n}\n.cascader-component-draggle:hover .list-img {\n transform: scale(1.05);\n}\n.cascader-component-draggle .cascader-component-draggle-title {\n padding: 0 12px;\n box-sizing: border-box;\n color: rgba(255, 255, 255, 0.6);\n font-size: 14px;\n height: 36px;\n line-height: 36px;\n}\n.cascader-component-draggle .cascader-component-draggle-warp {\n display: flex;\n justify-content: center;\n align-content: center;\n text-align: center;\n padding: 0 12px 15px 12px;\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n}\n.cascader-component-draggle .cascader-component-draggle-warp .list-img {\n width: 100%;\n height: 100%;\n border-radius: 2px;\n object-fit: contain;\n transition: all 0.5s;\n}\n","\r\n\r\n\r\n\r\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__$c = "data-v-f4e622b4"; + /* module identifier */ + const __vue_module_identifier__$c = undefined; + /* functional template */ + const __vue_is_functional_template__$c = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$c = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$c, staticRenderFns: __vue_staticRenderFns__$c }, + __vue_inject_styles__$c, + __vue_script__$c, + __vue_scope_id__$c, + __vue_is_functional_template__$c, + __vue_module_identifier__$c, + false, + createInjector, + undefined, + undefined + ); + +var window$1 = { + data: function data() { + return { + windowWidth: null, + // 存放窗口宽度的状态值 + windowHeight: null // 存放窗口高度的状态值 + }; + }, + mounted: function mounted() { + this.updateWindowSize(); // 初始化获取当前窗口宽度 + + window.addEventListener('resize', this.handleResize); // 添加窗口大小改变的事件监听器 + }, + beforeDestroy: function beforeDestroy() { + window.removeEventListener('resize', this.handleResize); // 在组件销毁之前移除事件监听器 + }, + methods: { + updateWindowSize: function updateWindowSize() { + this.windowWidth = window.innerWidth; // 将当前窗口宽度赋值给状态值 + this.windowHeight = window.innerHeight; // 将当前窗口宽度赋值给状态值 + }, + handleResize: lodash.throttle(function (event) { + this.updateWindowSize(); + this.$router.go(0); + }, 500) + } +}; + +var script$b = { + name: 'Cascader', + mixins: [window$1], + components: _defineProperty({ + CascaderItem: __vue_component__$d, + CascaderComponent: __vue_component__$c + }, antDesignVue.Spin.name, antDesignVue.Spin), + props: { + proxyName: { + type: String, + default: 'tgcos' + }, + cover: { + type: String, + default: '' + }, + options: { + // 数据 + type: Array, + default: function _default() { + return []; + } + }, + defaultSelect: { + // 默认选中 + type: Array, + default: function _default() { + return []; + } + }, + fieldNames: { + type: Object, + default: function _default() { + return { + children: 'children', + label: 'label', + value: 'value' + }; + } + }, + loading: { + type: Boolean, + default: false + } + }, + watch: { + defaultSelect: function defaultSelect() { + this.getCheckedNames(this.options); + } + }, + computed: { + styleMediaClass: function styleMediaClass() { + if (this.windowWidth < 1366) { + return 'cascader-column-close'; + } + return ''; + } + }, + data: function data() { + return { + selectedLevelOne: null, + selectedLevelTwo: null, + selectedLevelThree: null, + selectedLevelFour: null, + defaultIndex: 0 // 默认选中第一个 + }; + }, + methods: { + handleSelected: function handleSelected(e, index) { + var _this = this; + var label = this.fieldNames.label; + var children = this.fieldNames.children; + if (this.windowWidth < 1000) return; + if (!this.selectedLevelTwo) { + this.$emit('handleColseOpen', 1); + } + if (index === 1) { + this.selectedLevelOne = e; + if (e[children] && this.defaultSelect.length > 1) { + var Index = e.children.findIndex(function (e) { + return e[label] == _this.defaultSelect[1]; + }); + this.selectedLevelTwo = e[children][Index]; + this.selectedLevelThree = e[children][Index][children]; + } else { + this.selectedLevelTwo = null; + this.selectedLevelThree = null; + } + } else if (index === 2) { + this.selectedLevelTwo = e; + if (e[children] && e[children].length) { + this.selectedLevelThree = e.layout ? e[children] : e[children][this.defaultIndex][children]; + this.selectedLevelFour = e[children][this.defaultIndex]; + } + if (!e[children]) { + this.selectedLevelThree = null; + this.selectedLevelFour = null; + } + } else { + this.selectedLevelThree = e[children] || null; + this.selectedLevelFour = e; + } + }, + handleColse: function handleColse() { + this.selectedLevelTwo = null; + this.selectedLevelThree = null; + this.selectedLevelFour = null; + this.$emit('handleColseOpen', 0); + }, + getCheckedNames: function getCheckedNames(data) { + var label = this.fieldNames.label; + var children = this.fieldNames.children; + var that = this; + var result = this.defaultSelect; + var keyValue = ['selectedLevelOne', 'selectedLevelTwo', 'selectedLevelFour', 'selectedLevelThree']; + var index = 0; + data.forEach(function (element) { + return traverse([element]); + }); + function traverse(element) { + var key = element.find(function (e) { + return e[label] === result[index]; + }) || null; + if (key) { + that[keyValue[index]] = key; + index++; + if (index === result.length) { + that[keyValue[keyValue.length - 1]] = key[children] || null; + } + key[children] && key[children].forEach(function (k) { + return traverse([k]); + }); + } + } + } + } +}; + +/* script */ +const __vue_script__$b = script$b; + +/* template */ +var __vue_render__$b = function () { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c("a-spin", { attrs: { spinning: _vm.loading } }, [ + _c("div", { staticClass: "cascader" }, [ + _vm.options + ? _c( + "div", + { class: ["cascader-column", _vm.styleMediaClass] }, + [ + _c("cascader-item", { + attrs: { + optionsItem: _vm.options, + indexLevel: 1, + mode: "vertical", + selected: _vm.selectedLevelOne, + tooltip: _vm.windowWidth < 1366, + }, + on: { handleSelected: _vm.handleSelected }, + }), + _vm._v(" "), + _vm._t("opearte", function () { + return [_c("div")] + }), + ], + 2 + ) + : _vm._e(), + _vm._v(" "), + _vm.selectedLevelOne + ? _c( + "div", + { class: ["cascader-column", _vm.styleMediaClass] }, + [ + _c("cascader-item", { + attrs: { + optionsItem: _vm.selectedLevelOne[_vm.fieldNames.children], + indexLevel: 2, + selected: _vm.selectedLevelTwo, + tooltip: _vm.windowWidth < 1366, + }, + on: { handleSelected: _vm.handleSelected }, + }), + ], + 1 + ) + : _vm._e(), + _vm._v(" "), + _vm.selectedLevelTwo && _vm.windowWidth >= 1000 + ? _c("div", { class: ["cascader-column", _vm.styleMediaClass] }, [ + _c("div", { staticClass: "cascader-column-top" }, [ + _c( + "div", + { + staticClass: "cascader-column-top-close", + on: { click: _vm.handleColse }, + }, + [_vm._v("X")] + ), + ]), + _vm._v(" "), + _c("div", { staticClass: "cascader-column-main" }, [ + !_vm.selectedLevelTwo.layout + ? _c( + "div", + { staticClass: "cascader-column-left" }, + [ + _c( + "cascader-item", + { + attrs: { + optionsItem: + _vm.selectedLevelTwo[_vm.fieldNames.children], + indexLevel: 3, + selected: _vm.selectedLevelFour, + tooltip: _vm.windowWidth < 1600, + showTitle: _vm.windowWidth > 760, + }, + on: { handleSelected: _vm.handleSelected }, + }, + [_c("template", { slot: "icon-title" }, [_c("div")])], + 2 + ), + ], + 1 + ) + : _vm._e(), + _vm._v(" "), + _c( + "div", + { staticClass: "cascader-column-right" }, + [ + _c("cascader-component", { + attrs: { + cover: _vm.cover, + proxyName: _vm.proxyName, + options: _vm.selectedLevelThree, + layout: _vm.selectedLevelTwo.layout || "biserial", + }, + }), + ], + 1 + ), + ]), + ]) + : _vm._e(), + ]), + ]) +}; +var __vue_staticRenderFns__$b = []; +__vue_render__$b._withStripped = true; + + /* style */ + const __vue_inject_styles__$b = function (inject) { + if (!inject) return + inject("data-v-655ef464_0", { source: "[data-v-655ef464]:export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.cascader[data-v-655ef464] {\n display: flex;\n flex-wrap: wrap;\n height: 100%;\n color: rgba(255, 255, 255, 0.6);\n overflow: hidden;\n}\n.cascader .cascader-column[data-v-655ef464] {\n position: relative;\n font-size: 16px;\n height: 100%;\n}\n.cascader .cascader-column[data-v-655ef464]:nth-child(1) {\n flex: 80;\n}\n.cascader .cascader-column[data-v-655ef464]:nth-child(2) {\n flex: 130;\n background: #141414;\n}\n.cascader .cascader-column[data-v-655ef464]:nth-child(3) {\n flex: 350;\n}\n.cascader .cascader-column .cascader-column-top[data-v-655ef464] {\n display: flex;\n justify-content: flex-end;\n line-height: 40px;\n height: 40px;\n box-shadow: 0px 1px 0px 0px #000000;\n}\n.cascader .cascader-column .cascader-column-top-close[data-v-655ef464] {\n text-align: center;\n width: 16px;\n height: 40px;\n margin-right: 12px;\n cursor: pointer;\n color: #ffffff;\n}\n.cascader .cascader-column .cascader-column-main[data-v-655ef464] {\n display: flex;\n width: 100%;\n height: calc(100% - 40px);\n}\n.cascader .cascader-column .cascader-column-main .cascader-column-left[data-v-655ef464] {\n flex: 110;\n}\n.cascader .cascader-column .cascader-column-main .cascader-column-left[data-v-655ef464] .cascader-item-name {\n margin: 0 auto;\n width: calc(100% - 16px);\n padding: 4px;\n box-sizing: border-box;\n text-align: center;\n border-radius: 4px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.cascader .cascader-column .cascader-column-main .cascader-column-left[data-v-655ef464] .cascader-item-horizontal-active .cascader-item-name {\n background-color: #333;\n}\n.cascader .cascader-column .cascader-column-main .cascader-column-right[data-v-655ef464] {\n flex: 240;\n height: 100%;\n overflow: auto;\n}\n.cascader .cascader-column-close[data-v-655ef464] {\n font-size: 12px;\n}\n.cascader .cascader-column-close[data-v-655ef464]:nth-child(1) {\n flex: 100;\n}\n.cascader .cascader-column-close[data-v-655ef464]:nth-child(1) .cascader-item-vertical {\n width: calc(100% - 12px);\n}\n.cascader .cascader-column-close[data-v-655ef464]:nth-child(2) {\n flex: 60;\n}\n.cascader .cascader-column-close[data-v-655ef464]:nth-child(2) .cascader-item-name {\n display: none;\n}\n.cascader .cascader-column-close[data-v-655ef464]:nth-child(2) .cascader-item-horizontal {\n justify-content: center;\n}\n.cascader .cascader-column-close[data-v-655ef464]:nth-child(2) .cascader-item-horizontal i {\n margin: 0;\n}\n.ant-spin-nested-loading[data-v-655ef464] {\n height: 100%;\n}\n.ant-spin-nested-loading[data-v-655ef464] .ant-spin-container {\n height: 100%;\n}\n.ant-spin-nested-loading[data-v-655ef464] .ant-spin-spinning {\n max-height: 100%;\n}\n", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,sBAAsB;EACtB,mBAAmB;EACnB,sBAAsB;EACtB,sBAAsB;EACtB,oBAAoB;EACpB,mBAAmB;EACnB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,iBAAiB;EACjB,6BAA6B;EAC7B,wCAAwC;AAC1C;AACA;EACE,aAAa;EACb,eAAe;EACf,YAAY;EACZ,+BAA+B;EAC/B,gBAAgB;AAClB;AACA;EACE,kBAAkB;EAClB,eAAe;EACf,YAAY;AACd;AACA;EACE,QAAQ;AACV;AACA;EACE,SAAS;EACT,mBAAmB;AACrB;AACA;EACE,SAAS;AACX;AACA;EACE,aAAa;EACb,yBAAyB;EACzB,iBAAiB;EACjB,YAAY;EACZ,mCAAmC;AACrC;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,kBAAkB;EAClB,eAAe;EACf,cAAc;AAChB;AACA;EACE,aAAa;EACb,WAAW;EACX,yBAAyB;AAC3B;AACA;EACE,SAAS;AACX;AACA;EACE,cAAc;EACd,wBAAwB;EACxB,YAAY;EACZ,sBAAsB;EACtB,kBAAkB;EAClB,kBAAkB;EAClB,gBAAgB;EAChB,uBAAuB;EACvB,mBAAmB;AACrB;AACA;EACE,sBAAsB;AACxB;AACA;EACE,SAAS;EACT,YAAY;EACZ,cAAc;AAChB;AACA;EACE,eAAe;AACjB;AACA;EACE,SAAS;AACX;AACA;EACE,wBAAwB;AAC1B;AACA;EACE,QAAQ;AACV;AACA;EACE,aAAa;AACf;AACA;EACE,uBAAuB;AACzB;AACA;EACE,SAAS;AACX;AACA;EACE,YAAY;AACd;AACA;EACE,YAAY;AACd;AACA;EACE,gBAAgB;AAClB","file":"index.vue","sourcesContent":[":export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.cascader {\n display: flex;\n flex-wrap: wrap;\n height: 100%;\n color: rgba(255, 255, 255, 0.6);\n overflow: hidden;\n}\n.cascader .cascader-column {\n position: relative;\n font-size: 16px;\n height: 100%;\n}\n.cascader .cascader-column:nth-child(1) {\n flex: 80;\n}\n.cascader .cascader-column:nth-child(2) {\n flex: 130;\n background: #141414;\n}\n.cascader .cascader-column:nth-child(3) {\n flex: 350;\n}\n.cascader .cascader-column .cascader-column-top {\n display: flex;\n justify-content: flex-end;\n line-height: 40px;\n height: 40px;\n box-shadow: 0px 1px 0px 0px #000000;\n}\n.cascader .cascader-column .cascader-column-top-close {\n text-align: center;\n width: 16px;\n height: 40px;\n margin-right: 12px;\n cursor: pointer;\n color: #ffffff;\n}\n.cascader .cascader-column .cascader-column-main {\n display: flex;\n width: 100%;\n height: calc(100% - 40px);\n}\n.cascader .cascader-column .cascader-column-main .cascader-column-left {\n flex: 110;\n}\n.cascader .cascader-column .cascader-column-main .cascader-column-left /deep/ .cascader-item-name {\n margin: 0 auto;\n width: calc(100% - 16px);\n padding: 4px;\n box-sizing: border-box;\n text-align: center;\n border-radius: 4px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.cascader .cascader-column .cascader-column-main .cascader-column-left /deep/ .cascader-item-horizontal-active .cascader-item-name {\n background-color: #333;\n}\n.cascader .cascader-column .cascader-column-main .cascader-column-right {\n flex: 240;\n height: 100%;\n overflow: auto;\n}\n.cascader .cascader-column-close {\n font-size: 12px;\n}\n.cascader .cascader-column-close:nth-child(1) {\n flex: 100;\n}\n.cascader .cascader-column-close:nth-child(1) /deep/ .cascader-item-vertical {\n width: calc(100% - 12px);\n}\n.cascader .cascader-column-close:nth-child(2) {\n flex: 60;\n}\n.cascader .cascader-column-close:nth-child(2) /deep/ .cascader-item-name {\n display: none;\n}\n.cascader .cascader-column-close:nth-child(2) /deep/ .cascader-item-horizontal {\n justify-content: center;\n}\n.cascader .cascader-column-close:nth-child(2) /deep/ .cascader-item-horizontal i {\n margin: 0;\n}\n.ant-spin-nested-loading {\n height: 100%;\n}\n.ant-spin-nested-loading /deep/ .ant-spin-container {\n height: 100%;\n}\n.ant-spin-nested-loading /deep/ .ant-spin-spinning {\n max-height: 100%;\n}\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__$b = "data-v-655ef464"; + /* module identifier */ + const __vue_module_identifier__$b = undefined; + /* functional template */ + const __vue_is_functional_template__$b = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$b = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$b, staticRenderFns: __vue_staticRenderFns__$b }, + __vue_inject_styles__$b, + __vue_script__$b, + __vue_scope_id__$b, + __vue_is_functional_template__$b, + __vue_module_identifier__$b, + false, + createInjector, + undefined, + undefined + ); + +function ownKeys(e, r) { + var t = Object.keys(e); + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + r && (o = o.filter(function (r) { + return Object.getOwnPropertyDescriptor(e, r).enumerable; + })), t.push.apply(t, o); + } + return t; +} +function _objectSpread2(e) { + for (var r = 1; r < arguments.length; r++) { + var t = null != arguments[r] ? arguments[r] : {}; + r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { + _defineProperty(e, r, t[r]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { + Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); + }); + } + return e; +} + +function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + return arr2; +} + +function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) return _arrayLikeToArray(arr); +} + +function _iterableToArray(iter) { + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); +} + +function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); +} + +function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} + +function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); +} + +function _createForOfIteratorHelper(o, allowArrayLike) { + var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; + if (!it) { + if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { + if (it) o = it; + var i = 0; + var F = function F() {}; + return { + s: F, + n: function n() { + if (i >= o.length) return { + done: true + }; + return { + done: false, + value: o[i++] + }; + }, + e: function e(_e) { + throw _e; + }, + f: F + }; + } + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + var normalCompletion = true, + didErr = false, + err; + return { + s: function s() { + it = it.call(o); + }, + n: function n() { + var step = it.next(); + normalCompletion = step.done; + return step; + }, + e: function e(_e2) { + didErr = true; + err = _e2; + }, + f: function f() { + try { + if (!normalCompletion && it["return"] != null) it["return"](); + } finally { + if (didErr) throw err; + } + } + }; +} + +function _regeneratorRuntime() { + _regeneratorRuntime = function _regeneratorRuntime() { + return e; + }; + var t, + e = {}, + r = Object.prototype, + n = r.hasOwnProperty, + o = Object.defineProperty || function (t, e, r) { + t[e] = r.value; + }, + i = "function" == typeof Symbol ? Symbol : {}, + a = i.iterator || "@@iterator", + c = i.asyncIterator || "@@asyncIterator", + u = i.toStringTag || "@@toStringTag"; + function define(t, e, r) { + return Object.defineProperty(t, e, { + value: r, + enumerable: !0, + configurable: !0, + writable: !0 + }), t[e]; + } + try { + define({}, ""); + } catch (t) { + define = function define(t, e, r) { + return t[e] = r; + }; + } + function wrap(t, e, r, n) { + var i = e && e.prototype instanceof Generator ? e : Generator, + a = Object.create(i.prototype), + c = new Context(n || []); + return o(a, "_invoke", { + value: makeInvokeMethod(t, r, c) + }), a; + } + function tryCatch(t, e, r) { + try { + return { + type: "normal", + arg: t.call(e, r) + }; + } catch (t) { + return { + type: "throw", + arg: t + }; + } + } + e.wrap = wrap; + var h = "suspendedStart", + l = "suspendedYield", + f = "executing", + s = "completed", + y = {}; + function Generator() {} + function GeneratorFunction() {} + function GeneratorFunctionPrototype() {} + var p = {}; + define(p, a, function () { + return this; + }); + var d = Object.getPrototypeOf, + v = d && d(d(values([]))); + v && v !== r && n.call(v, a) && (p = v); + var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); + function defineIteratorMethods(t) { + ["next", "throw", "return"].forEach(function (e) { + define(t, e, function (t) { + return this._invoke(e, t); + }); + }); + } + function AsyncIterator(t, e) { + function invoke(r, o, i, a) { + var c = tryCatch(t[r], t, o); + if ("throw" !== c.type) { + var u = c.arg, + h = u.value; + return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { + invoke("next", t, i, a); + }, function (t) { + invoke("throw", t, i, a); + }) : e.resolve(h).then(function (t) { + u.value = t, i(u); + }, function (t) { + return invoke("throw", t, i, a); + }); + } + a(c.arg); + } + var r; + o(this, "_invoke", { + value: function value(t, n) { + function callInvokeWithMethodAndArg() { + return new e(function (e, r) { + invoke(t, n, e, r); + }); + } + return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); + } + }); + } + function makeInvokeMethod(e, r, n) { + var o = h; + return function (i, a) { + if (o === f) throw new Error("Generator is already running"); + if (o === s) { + if ("throw" === i) throw a; + return { + value: t, + done: !0 + }; + } + for (n.method = i, n.arg = a;;) { + var c = n.delegate; + if (c) { + var u = maybeInvokeDelegate(c, n); + if (u) { + if (u === y) continue; + return u; + } + } + if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { + if (o === h) throw o = s, n.arg; + n.dispatchException(n.arg); + } else "return" === n.method && n.abrupt("return", n.arg); + o = f; + var p = tryCatch(e, r, n); + if ("normal" === p.type) { + if (o = n.done ? s : l, p.arg === y) continue; + return { + value: p.arg, + done: n.done + }; + } + "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); + } + }; + } + function maybeInvokeDelegate(e, r) { + var n = r.method, + o = e.iterator[n]; + if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; + var i = tryCatch(o, e.iterator, r.arg); + if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; + var a = i.arg; + return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); + } + function pushTryEntry(t) { + var e = { + tryLoc: t[0] + }; + 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); + } + function resetTryEntry(t) { + var e = t.completion || {}; + e.type = "normal", delete e.arg, t.completion = e; + } + function Context(t) { + this.tryEntries = [{ + tryLoc: "root" + }], t.forEach(pushTryEntry, this), this.reset(!0); + } + function values(e) { + if (e || "" === e) { + var r = e[a]; + if (r) return r.call(e); + if ("function" == typeof e.next) return e; + if (!isNaN(e.length)) { + var o = -1, + i = function next() { + for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; + return next.value = t, next.done = !0, next; + }; + return i.next = i; + } + } + throw new TypeError(_typeof(e) + " is not iterable"); + } + return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { + value: GeneratorFunctionPrototype, + configurable: !0 + }), o(GeneratorFunctionPrototype, "constructor", { + value: GeneratorFunction, + configurable: !0 + }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { + var e = "function" == typeof t && t.constructor; + return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); + }, e.mark = function (t) { + return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; + }, e.awrap = function (t) { + return { + __await: t + }; + }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { + return this; + }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { + void 0 === i && (i = Promise); + var a = new AsyncIterator(wrap(t, r, n, o), i); + return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { + return t.done ? t.value : a.next(); + }); + }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { + return this; + }), define(g, "toString", function () { + return "[object Generator]"; + }), e.keys = function (t) { + var e = Object(t), + r = []; + for (var n in e) r.push(n); + return r.reverse(), function next() { + for (; r.length;) { + var t = r.pop(); + if (t in e) return next.value = t, next.done = !1, next; + } + return next.done = !0, next; + }; + }, e.values = values, Context.prototype = { + constructor: Context, + reset: function reset(e) { + if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); + }, + stop: function stop() { + this.done = !0; + var t = this.tryEntries[0].completion; + if ("throw" === t.type) throw t.arg; + return this.rval; + }, + dispatchException: function dispatchException(e) { + if (this.done) throw e; + var r = this; + function handle(n, o) { + return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; + } + for (var o = this.tryEntries.length - 1; o >= 0; --o) { + var i = this.tryEntries[o], + a = i.completion; + if ("root" === i.tryLoc) return handle("end"); + if (i.tryLoc <= this.prev) { + var c = n.call(i, "catchLoc"), + u = n.call(i, "finallyLoc"); + if (c && u) { + if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); + if (this.prev < i.finallyLoc) return handle(i.finallyLoc); + } else if (c) { + if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); + } else { + if (!u) throw new Error("try statement without catch or finally"); + if (this.prev < i.finallyLoc) return handle(i.finallyLoc); + } + } + } + }, + abrupt: function abrupt(t, e) { + for (var r = this.tryEntries.length - 1; r >= 0; --r) { + var o = this.tryEntries[r]; + if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { + var i = o; + break; + } + } + i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); + var a = i ? i.completion : {}; + return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); + }, + complete: function complete(t, e) { + if ("throw" === t.type) throw t.arg; + return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; + }, + finish: function finish(t) { + for (var e = this.tryEntries.length - 1; e >= 0; --e) { + var r = this.tryEntries[e]; + if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; + } + }, + "catch": function _catch(t) { + for (var e = this.tryEntries.length - 1; e >= 0; --e) { + var r = this.tryEntries[e]; + if (r.tryLoc === t) { + var n = r.completion; + if ("throw" === n.type) { + var o = n.arg; + resetTryEntry(r); + } + return o; + } + } + throw new Error("illegal catch attempt"); + }, + delegateYield: function delegateYield(e, r, n) { + return this.delegate = { + iterator: values(e), + resultName: r, + nextLoc: n + }, "next" === this.method && (this.arg = t), y; + } + }, e; +} + +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { + try { + var info = gen[key](arg); + var value = info.value; + } catch (error) { + reject(error); + return; + } + if (info.done) { + resolve(value); + } else { + Promise.resolve(value).then(_next, _throw); + } +} +function _asyncToGenerator(fn) { + return function () { + var self = this, + args = arguments; + return new Promise(function (resolve, reject) { + var gen = fn.apply(self, args); + function _next(value) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); + } + function _throw(err) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); + } + _next(undefined); + }); + }; +} + +function _arrayWithHoles(arr) { + if (Array.isArray(arr)) return arr; +} + +function _iterableToArrayLimit(r, l) { + var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; + if (null != t) { + var e, + n, + i, + u, + a = [], + f = !0, + o = !1; + try { + if (i = (t = t.call(r)).next, 0 === l) { + if (Object(t) !== t) return; + f = !1; + } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); + } catch (r) { + o = !0, n = r; + } finally { + try { + if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; + } finally { + if (o) throw n; + } + } + return a; + } +} + +function _nonIterableRest() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} + +function _slicedToArray(arr, i) { + return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); +} + +function isFunction(func) { + return typeof func === 'function' || Object.prototype.toString.call(func) === '[object Function]'; +} +function snapToGrid(grid, pendingX, pendingY) { + var scale = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1; + var x = Math.round(pendingX / scale / grid[0]) * grid[0]; + var y = Math.round(pendingY / scale / grid[1]) * grid[1]; + return [x, y]; +} +function computeWidth(parentWidth, left, right) { + return parentWidth - left - right; +} +function computeHeight(parentHeight, top, bottom) { + return parentHeight - top - bottom; +} +function restrictToBounds(value, min, max) { + if (min !== null && value < min) { + return min; + } + if (max !== null && max < value) { + return max; + } + return value; +} + +// 将选择器与父元素匹配 +function matchesSelectorToParentElements(el, selector, baseNode) { + var node = el; + var matchesSelectorFunc = ['matches', 'webkitMatchesSelector', 'mozMatchesSelector', 'msMatchesSelector', 'oMatchesSelector'].find(function (func) { + return isFunction(node[func]); + }); + if (!isFunction(node[matchesSelectorFunc])) return false; + do { + if (node[matchesSelectorFunc](selector)) return true; + if (node === baseNode) return false; + node = node.parentNode; + } while (node); + return false; +} +function getComputedSize($el) { + var style = window.getComputedStyle($el); + return [parseFloat(style.getPropertyValue('width'), 10), parseFloat(style.getPropertyValue('height'), 10)]; +} +// 添加事件 +function addEvent(el, event, handler) { + if (!el) { + return; + } + if (el.attachEvent) { + el.attachEvent('on' + event, handler); + } else if (el.addEventListener) { + el.addEventListener(event, handler, true); + } else { + el['on' + event] = handler; + } +} + +// 删除事件 +function removeEvent(el, event, handler) { + if (!el) { + return; + } + if (el.detachEvent) { + el.detachEvent('on' + event, handler); + } else if (el.removeEventListener) { + el.removeEventListener(event, handler, true); + } else { + el['on' + event] = null; + } +} + +var events = { + mouse: { + start: 'mousedown', + move: 'mousemove', + stop: 'mouseup' + }, + touch: { + start: 'touchstart', + move: 'touchmove', + stop: 'touchend' + } +}; + +// 禁止用户选取 +var userSelectNone = { + userSelect: 'none', + MozUserSelect: 'none', + WebkitUserSelect: 'none', + MsUserSelect: 'none' +}; +// 用户选中自动 +var userSelectAuto = { + userSelect: 'auto', + MozUserSelect: 'auto', + WebkitUserSelect: 'auto', + MsUserSelect: 'auto' +}; +var eventsFor = events.mouse; +var script$a = { + replace: true, + name: 'ComponentBox', + props: { + className: { + type: String, + default: 'vdr' + }, + classNameDraggable: { + type: String, + default: 'draggable' + }, + classNameResizable: { + type: String, + default: 'resizable' + }, + classNameDragging: { + type: String, + default: 'dragging' + }, + classNameResizing: { + type: String, + default: 'resizing' + }, + classNameActive: { + type: String, + default: 'active' + }, + classNameHandle: { + type: String, + default: 'handle' + }, + disableUserSelect: { + type: Boolean, + default: true + }, + enableNativeDrag: { + type: Boolean, + default: false + }, + preventDeactivation: { + type: Boolean, + default: false + }, + active: { + type: Boolean, + default: false + }, + draggable: { + type: Boolean, + default: true + }, + resizable: { + type: Boolean, + default: true + }, + // 锁定宽高比 + lockAspectRatio: { + type: Boolean, + default: false + }, + w: { + type: [Number, String], + default: 200, + validator: function validator(val) { + if (typeof val === 'number') { + return val > 0; + } + return val === 'auto'; + } + }, + h: { + type: [Number, String], + default: 200, + validator: function validator(val) { + if (typeof val === 'number') { + return val > 0; + } + return val === 'auto'; + } + }, + transform: { + type: String, + default: '' + }, + perspective: { + type: Number, + default: 0 + }, + minWidth: { + type: Number, + default: 0, + validator: function validator(val) { + return val >= 0; + } + }, + minHeight: { + type: Number, + default: 0, + validator: function validator(val) { + return val >= 0; + } + }, + maxWidth: { + type: Number, + default: null, + validator: function validator(val) { + return val >= 0; + } + }, + maxHeight: { + type: Number, + default: null, + validator: function validator(val) { + return val >= 0; + } + }, + x: { + type: Number, + default: 0 + }, + y: { + type: Number, + default: 0 + }, + z: { + type: [String, Number], + default: 'auto', + validator: function validator(val) { + return typeof val === 'string' ? val === 'auto' : val >= 0; + } + }, + handles: { + type: Array, + default: function _default() { + return ['tl', 'tm', 'tr', 'mr', 'br', 'bm', 'bl', 'ml']; + }, + validator: function validator(val) { + var s = new Set(['tl', 'tm', 'tr', 'mr', 'br', 'bm', 'bl', 'ml']); + return new Set(val.filter(function (h) { + return s.has(h); + })).size === val.length; + } + }, + dragHandle: { + type: String, + default: null + }, + dragCancel: { + type: String, + default: null + }, + axis: { + type: String, + default: 'both', + validator: function validator(val) { + return ['x', 'y', 'both'].includes(val); + } + }, + grid: { + type: Array, + default: function _default() { + return [1, 1]; + } + }, + parent: { + type: [Boolean, String], + default: false + }, + onDragStart: { + type: Function, + default: function _default() { + return true; + } + }, + onDrag: { + type: Function, + default: function _default() { + return true; + } + }, + onResizeStart: { + type: Function, + default: function _default() { + return true; + } + }, + onResize: { + type: Function, + default: function _default() { + return true; + } + }, + // 冲突检测 + isConflictCheck: { + type: Boolean, + default: false + }, + // 元素对齐 + snap: { + type: Boolean, + default: false + }, + // 当调用对齐时,用来设置组件与组件之间的对齐距离,以像素为单位 + snapTolerance: { + type: Number, + default: 5, + validator: function validator(val) { + return typeof val === 'number'; + } + }, + // 缩放比例 + scaleRatio: { + type: Number, + default: 1, + validator: function validator(val) { + return typeof val === 'number'; + } + }, + // handle是否缩放 + handleInfo: { + type: Object, + default: function _default() { + return { + size: 8, + offset: -5, + switch: true + }; + } + } + }, + data: function data() { + return { + left: this.x, + top: this.y, + right: null, + bottom: null, + width: null, + height: null, + widthTouched: false, + heightTouched: false, + aspectFactor: null, + parentWidth: null, + parentHeight: null, + minW: this.minWidth, + minH: this.minHeight, + maxW: this.maxWidth, + maxH: this.maxHeight, + handle: null, + enabled: this.active, + resizing: false, + dragging: false, + zIndex: this.z + }; + }, + created: function created() { + // eslint-disable-next-line 无效的prop:minWidth不能大于maxWidth + if (this.maxWidth && this.minWidth > this.maxWidth) ; + // eslint-disable-next-line 无效prop:minHeight不能大于maxHeight' + if (this.maxWidth && this.minHeight > this.maxHeight) ; + this.resetBoundsAndMouseState(); + }, + mounted: function mounted() { + if (!this.enableNativeDrag) { + this.$el.ondragstart = function () { + return false; + }; + } + var _this$getParentSize = this.getParentSize(), + _this$getParentSize2 = _slicedToArray(_this$getParentSize, 2), + parentWidth = _this$getParentSize2[0], + parentHeight = _this$getParentSize2[1]; + this.parentWidth = parentWidth; + this.parentHeight = parentHeight; + var _getComputedSize = getComputedSize(this.$el), + _getComputedSize2 = _slicedToArray(_getComputedSize, 2), + width = _getComputedSize2[0], + height = _getComputedSize2[1]; + this.aspectFactor = (this.w !== 'auto' ? this.w : width) / (this.h !== 'auto' ? this.h : height); + this.width = this.w !== 'auto' ? this.w : width; + this.height = this.h !== 'auto' ? this.h : height; + this.right = this.parentWidth - this.width - this.left; + this.bottom = this.parentHeight - this.height - this.top; + this.settingAttribute(); + + // 优化:取消选中的行为优先绑定在父节点上 + var parentElement = this.$el.parentNode; + addEvent(parentElement || document.documentElement, 'mousedown', this.deselect); + addEvent(parentElement || document.documentElement, 'touchend touchcancel', this.deselect); + addEvent(window, 'resize', this.checkParentSize); + }, + beforeDestroy: function beforeDestroy() { + removeEvent(document.documentElement, 'mousedown', this.deselect); + removeEvent(document.documentElement, 'touchstart', this.handleUp); + removeEvent(document.documentElement, 'mousemove', this.move); + removeEvent(document.documentElement, 'touchmove', this.move); + removeEvent(document.documentElement, 'mouseup', this.handleUp); + removeEvent(document.documentElement, 'touchend touchcancel', this.deselect); + removeEvent(window, 'resize', this.checkParentSize); + }, + methods: { + // 右键菜单 + onContextMenu: function onContextMenu(e) { + this.$emit('contextmenu', e); + }, + // 重置边界和鼠标状态 + resetBoundsAndMouseState: function resetBoundsAndMouseState() { + this.mouseClickPosition = { + mouseX: 0, + mouseY: 0, + x: 0, + y: 0, + w: 0, + h: 0 + }; + this.bounds = { + minLeft: null, + maxLeft: null, + minRight: null, + maxRight: null, + minTop: null, + maxTop: null, + minBottom: null, + maxBottom: null + }; + }, + // 检查父元素大小 + checkParentSize: function checkParentSize() { + if (this.parent) { + var _this$getParentSize3 = this.getParentSize(), + _this$getParentSize4 = _slicedToArray(_this$getParentSize3, 2), + newParentWidth = _this$getParentSize4[0], + newParentHeight = _this$getParentSize4[1]; + // 修复父元素改变大小后,组件resizing时活动异常 + this.right = newParentWidth - this.width - this.left; + this.bottom = newParentHeight - this.height - this.top; + this.parentWidth = newParentWidth; + this.parentHeight = newParentHeight; + } + }, + // 获取父元素大小 + getParentSize: function getParentSize() { + if (this.parent === true) { + var style = window.getComputedStyle(this.$el.parentNode, null); + return [parseInt(style.getPropertyValue('width'), 10), parseInt(style.getPropertyValue('height'), 10)]; + } + if (typeof this.parent === 'string') { + var parentNode = document.querySelector(this.parent); + if (!(parentNode instanceof HTMLElement)) { + throw new Error("The selector ".concat(this.parent, " does not match any element")); + } + return [parentNode.offsetWidth, parentNode.offsetHeight]; + } + return [null, null]; + }, + // 元素触摸按下 + elementTouchDown: function elementTouchDown(e) { + // 阻止事件冒泡 + e.stopPropagation(); + eventsFor = events.touch; + this.elementDown(e); + }, + elementMouseDown: function elementMouseDown(e) { + // 阻止事件冒泡 + e.stopPropagation(); + eventsFor = events.mouse; + this.elementDown(e); + }, + // 元素按下 + elementDown: function elementDown(e) { + // 阻止事件冒泡 + e.stopPropagation(); + if (e instanceof MouseEvent && e.which !== 1) { + return; + } + var target = e.target || e.srcElement; + if (this.$el.contains(target)) { + if (this.onDragStart(e) === false) { + return; + } + if (this.dragHandle && !matchesSelectorToParentElements(target, this.dragHandle, this.$el) || this.dragCancel && matchesSelectorToParentElements(target, this.dragCancel, this.$el)) { + this.dragging = false; + return; + } + if (!this.enabled) { + this.enabled = true; + this.$emit('activated'); + this.$emit('update:active', true); + } + if (this.draggable) { + this.dragging = true; + } + this.mouseClickPosition.mouseX = e.touches ? e.touches[0].pageX : e.pageX; + this.mouseClickPosition.mouseY = e.touches ? e.touches[0].pageY : e.pageY; + this.mouseClickPosition.left = this.left; + this.mouseClickPosition.right = this.right; + this.mouseClickPosition.top = this.top; + this.mouseClickPosition.bottom = this.bottom; + this.mouseClickPosition.w = this.width; + this.mouseClickPosition.h = this.height; + if (this.parent) { + var _this$getParentSize5 = this.getParentSize(), + _this$getParentSize6 = _slicedToArray(_this$getParentSize5, 2), + parentWidth = _this$getParentSize6[0], + parentHeight = _this$getParentSize6[1]; + // 拖拽时重新计算父组件跟当前组件的宽高位移等信息 + this.parentWidth = parentWidth; + this.parentHeight = parentHeight; + this.right = this.parentWidth - this.width - this.left; + this.bottom = this.parentHeight - this.height - this.top; + this.bounds = this.calcDragLimits(); + } + addEvent(document.documentElement, eventsFor.move, this.move); + addEvent(document.documentElement, eventsFor.stop, this.handleUp); + } + }, + // 计算移动范围 + calcDragLimits: function calcDragLimits() { + return { + minLeft: this.left % this.grid[0], + maxLeft: Math.floor((this.parentWidth - this.width - this.left) / this.grid[0]) * this.grid[0] + this.left, + minRight: this.right % this.grid[0], + maxRight: Math.floor((this.parentWidth - this.width - this.right) / this.grid[0]) * this.grid[0] + this.right, + minTop: this.top % this.grid[1], + maxTop: Math.floor((this.parentHeight - this.height - this.top) / this.grid[1]) * this.grid[1] + this.top, + minBottom: this.bottom % this.grid[1], + maxBottom: Math.floor((this.parentHeight - this.height - this.bottom) / this.grid[1]) * this.grid[1] + this.bottom + }; + }, + // 取消 + deselect: function deselect(e) { + var target = e.target || e.srcElement; + var regex = new RegExp(this.className + '-([trmbl]{2})', ''); + if (!this.$el.contains(target) && !regex.test(target.className)) { + if (this.enabled && !this.preventDeactivation) { + this.enabled = false; + this.$emit('deactivated'); + this.$emit('update:active', false); + } + removeEvent(document.documentElement, eventsFor.move, this.handleResize); + } + if (e.button !== 2) { + this.resetBoundsAndMouseState(); + } + }, + // 控制柄触摸按下 + handleTouchDown: function handleTouchDown(handle, e) { + eventsFor = events.touch; + this.handleDown(handle, e); + }, + // 控制柄按下 + handleDown: function handleDown(handle, e) { + if (e instanceof MouseEvent && e.which !== 1) { + return; + } + if (this.onResizeStart(handle, e) === false) { + return; + } + if (e.stopPropagation) e.stopPropagation(); + + // Here we avoid a dangerous recursion by faking + // corner handles as middle handles + if (this.lockAspectRatio && !handle.includes('m')) { + this.handle = 'm' + handle.substring(1); + } else { + this.handle = handle; + } + this.resizing = true; + this.mouseClickPosition.mouseX = e.touches ? e.touches[0].pageX : e.pageX; + this.mouseClickPosition.mouseY = e.touches ? e.touches[0].pageY : e.pageY; + this.mouseClickPosition.left = this.left; + this.mouseClickPosition.right = this.right; + this.mouseClickPosition.top = this.top; + this.mouseClickPosition.bottom = this.bottom; + this.mouseClickPosition.w = this.width; + this.mouseClickPosition.h = this.height; + this.bounds = this.calcResizeLimits(); + addEvent(document.documentElement, eventsFor.move, this.handleResize); + addEvent(document.documentElement, eventsFor.stop, this.handleUp); + }, + // 计算调整大小范围 + calcResizeLimits: function calcResizeLimits() { + var minW = this.minW; + var minH = this.minH; + var maxW = this.maxW; + var maxH = this.maxH; + var aspectFactor = this.aspectFactor; + var _this$grid = _slicedToArray(this.grid, 2), + gridX = _this$grid[0], + gridY = _this$grid[1]; + var width = this.width; + var height = this.height; + var left = this.left; + var top = this.top; + var right = this.right; + var bottom = this.bottom; + if (this.lockAspectRatio) { + if (minW / minH > aspectFactor) { + minH = minW / aspectFactor; + } else { + minW = aspectFactor * minH; + } + if (maxW && maxH) { + maxW = Math.min(maxW, aspectFactor * maxH); + maxH = Math.min(maxH, maxW / aspectFactor); + } else if (maxW) { + maxH = maxW / aspectFactor; + } else if (maxH) { + maxW = aspectFactor * maxH; + } + } + maxW = maxW - maxW % gridX; + maxH = maxH - maxH % gridY; + var limits = { + minLeft: null, + maxLeft: null, + minTop: null, + maxTop: null, + minRight: null, + maxRight: null, + minBottom: null, + maxBottom: null + }; + if (this.parent) { + limits.minLeft = left % gridX; + limits.maxLeft = left + Math.floor((width - minW) / gridX) * gridX; + limits.minTop = top % gridY; + limits.maxTop = top + Math.floor((height - minH) / gridY) * gridY; + limits.minRight = right % gridX; + limits.maxRight = right + Math.floor((width - minW) / gridX) * gridX; + limits.minBottom = bottom % gridY; + limits.maxBottom = bottom + Math.floor((height - minH) / gridY) * gridY; + if (maxW) { + limits.minLeft = Math.max(limits.minLeft, this.parentWidth - right - maxW); + limits.minRight = Math.max(limits.minRight, this.parentWidth - left - maxW); + } + if (maxH) { + limits.minTop = Math.max(limits.minTop, this.parentHeight - bottom - maxH); + limits.minBottom = Math.max(limits.minBottom, this.parentHeight - top - maxH); + } + if (this.lockAspectRatio) { + limits.minLeft = Math.max(limits.minLeft, left - top * aspectFactor); + limits.minTop = Math.max(limits.minTop, top - left / aspectFactor); + limits.minRight = Math.max(limits.minRight, right - bottom * aspectFactor); + limits.minBottom = Math.max(limits.minBottom, bottom - right / aspectFactor); + } + } else { + limits.minLeft = null; + limits.maxLeft = left + Math.floor((width - minW) / gridX) * gridX; + limits.minTop = null; + limits.maxTop = top + Math.floor((height - minH) / gridY) * gridY; + limits.minRight = null; + limits.maxRight = right + Math.floor((width - minW) / gridX) * gridX; + limits.minBottom = null; + limits.maxBottom = bottom + Math.floor((height - minH) / gridY) * gridY; + if (maxW) { + limits.minLeft = -(right + maxW); + limits.minRight = -(left + maxW); + } + if (maxH) { + limits.minTop = -(bottom + maxH); + limits.minBottom = -(top + maxH); + } + if (this.lockAspectRatio && maxW && maxH) { + limits.minLeft = Math.min(limits.minLeft, -(right + maxW)); + limits.minTop = Math.min(limits.minTop, -(maxH + bottom)); + limits.minRight = Math.min(limits.minRight, -left - maxW); + limits.minBottom = Math.min(limits.minBottom, -top - maxH); + } + } + return limits; + }, + // 移动 + move: function move(e) { + e.stopPropagation(); + if (this.resizing) { + this.handleResize(e); + } else if (this.dragging) { + this.handleDrag(e); + } + }, + // 元素移动 + handleDrag: function handleDrag(e) { + var _this = this; + return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() { + var axis, grid, bounds, mouseClickPosition, tmpDeltaX, tmpDeltaY, _snapToGrid, _snapToGrid2, deltaX, deltaY, left, top, right, bottom; + return _regeneratorRuntime().wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + axis = _this.axis; + grid = _this.grid; + bounds = _this.bounds; + mouseClickPosition = _this.mouseClickPosition; + tmpDeltaX = axis && axis !== 'y' ? mouseClickPosition.mouseX - (e.touches ? e.touches[0].pageX : e.pageX) : 0; + tmpDeltaY = axis && axis !== 'x' ? mouseClickPosition.mouseY - (e.touches ? e.touches[0].pageY : e.pageY) : 0; + _snapToGrid = snapToGrid(grid, tmpDeltaX, tmpDeltaY, _this.scaleRatio), _snapToGrid2 = _slicedToArray(_snapToGrid, 2), deltaX = _snapToGrid2[0], deltaY = _snapToGrid2[1]; + left = restrictToBounds(mouseClickPosition.left - deltaX, bounds.minLeft, bounds.maxLeft); + top = restrictToBounds(mouseClickPosition.top - deltaY, bounds.minTop, bounds.maxTop); + if (!(_this.onDrag(left, top) === false)) { + _context.next = 11; + break; + } + return _context.abrupt("return"); + case 11: + right = restrictToBounds(mouseClickPosition.right + deltaX, bounds.minRight, bounds.maxRight); + bottom = restrictToBounds(mouseClickPosition.bottom + deltaY, bounds.minBottom, bounds.maxBottom); + _this.left = left; + _this.top = top; + _this.right = right; + _this.bottom = bottom; + _context.next = 19; + return _this.snapCheck(); + case 19: + _this.$emit('dragging', _this.left, _this.top); + case 20: + case "end": + return _context.stop(); + } + }, _callee); + }))(); + }, + moveHorizontally: function moveHorizontally(val) { + var _snapToGrid3 = snapToGrid(this.grid, val, this.top, this.scale), + _snapToGrid4 = _slicedToArray(_snapToGrid3, 2), + deltaX = _snapToGrid4[0]; + _snapToGrid4[1]; + var left = restrictToBounds(deltaX, this.bounds.minLeft, this.bounds.maxLeft); + this.left = left; + this.right = this.parentWidth - this.width - left; + }, + moveVertically: function moveVertically(val) { + var _snapToGrid5 = snapToGrid(this.grid, this.left, val, this.scale), + _snapToGrid6 = _slicedToArray(_snapToGrid5, 2); + _snapToGrid6[0]; + var deltaY = _snapToGrid6[1]; + var top = restrictToBounds(deltaY, this.bounds.minTop, this.bounds.maxTop); + this.top = top; + this.bottom = this.parentHeight - this.height - top; + }, + // 控制柄移动 + handleResize: function handleResize(e) { + // ; + var left = this.left; + var top = this.top; + var right = this.right; + var bottom = this.bottom; + var mouseClickPosition = this.mouseClickPosition; + this.lockAspectRatio; + var aspectFactor = this.aspectFactor; + var tmpDeltaX = mouseClickPosition.mouseX - (e.touches ? e.touches[0].pageX : e.pageX); + var tmpDeltaY = mouseClickPosition.mouseY - (e.touches ? e.touches[0].pageY : e.pageY); + if (!this.widthTouched && tmpDeltaX) { + this.widthTouched = true; + } + if (!this.heightTouched && tmpDeltaY) { + this.heightTouched = true; + } + var _snapToGrid7 = snapToGrid(this.grid, tmpDeltaX, tmpDeltaY, this.scaleRatio), + _snapToGrid8 = _slicedToArray(_snapToGrid7, 2), + deltaX = _snapToGrid8[0], + deltaY = _snapToGrid8[1]; + if (this.handle.includes('b')) { + bottom = restrictToBounds(mouseClickPosition.bottom + deltaY, this.bounds.minBottom, this.bounds.maxBottom); + if (this.lockAspectRatio && this.resizingOnY) { + right = this.right - (this.bottom - bottom) * aspectFactor; + } + } else if (this.handle.includes('t')) { + top = restrictToBounds(mouseClickPosition.top - deltaY, this.bounds.minTop, this.bounds.maxTop); + if (this.lockAspectRatio && this.resizingOnY) { + left = this.left - (this.top - top) * aspectFactor; + } + } + if (this.handle.includes('r')) { + right = restrictToBounds(mouseClickPosition.right + deltaX, this.bounds.minRight, this.bounds.maxRight); + if (this.lockAspectRatio && this.resizingOnX) { + bottom = this.bottom - (this.right - right) / aspectFactor; + } + } else if (this.handle.includes('l')) { + left = restrictToBounds(mouseClickPosition.left - deltaX, this.bounds.minLeft, this.bounds.maxLeft); + if (this.lockAspectRatio && this.resizingOnX) { + top = this.top - (this.left - left) / aspectFactor; + } + } + var width = computeWidth(this.parentWidth, left, right); + var height = computeHeight(this.parentHeight, top, bottom); + if (this.onResize(this.handle, left, top, width, height) === false) { + return; + } + this.left = left; + this.top = top; + this.right = right; + this.bottom = bottom; + this.width = width; + this.height = height; + this.$emit('resizing', this.left, this.top, this.width, this.height); + }, + changeWidth: function changeWidth(val) { + var _snapToGrid9 = snapToGrid(this.grid, val, 0, this.scale), + _snapToGrid10 = _slicedToArray(_snapToGrid9, 2), + newWidth = _snapToGrid10[0]; + _snapToGrid10[1]; + var right = restrictToBounds(this.parentWidth - newWidth - this.left, this.bounds.minRight, this.bounds.maxRight); + var bottom = this.bottom; + if (this.lockAspectRatio) { + bottom = this.bottom - (this.right - right) / this.aspectFactor; + } + var width = computeWidth(this.parentWidth, this.left, right); + var height = computeHeight(this.parentHeight, this.top, bottom); + this.right = right; + this.bottom = bottom; + this.width = width; + this.height = height; + }, + changeHeight: function changeHeight(val) { + var _snapToGrid11 = snapToGrid(this.grid, 0, val, this.scale), + _snapToGrid12 = _slicedToArray(_snapToGrid11, 2); + _snapToGrid12[0]; + var newHeight = _snapToGrid12[1]; + var bottom = restrictToBounds(this.parentHeight - newHeight - this.top, this.bounds.minBottom, this.bounds.maxBottom); + var right = this.right; + if (this.lockAspectRatio) { + right = this.right - (this.bottom - bottom) * this.aspectFactor; + } + var width = computeWidth(this.parentWidth, this.left, right); + var height = computeHeight(this.parentHeight, this.top, bottom); + this.right = right; + this.bottom = bottom; + this.width = width; + this.height = height; + }, + // 从控制柄松开 + handleUp: function handleUp(e) { + var _this2 = this; + return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() { + var temArr, refLine, i; + return _regeneratorRuntime().wrap(function _callee2$(_context2) { + while (1) switch (_context2.prev = _context2.next) { + case 0: + _this2.handle = null; + + // 初始化辅助线数据 + temArr = new Array(3).fill({ + display: false, + position: '', + origin: '', + lineLength: '' + }); + refLine = { + vLine: [], + hLine: [] + }; + for (i in refLine) { + refLine[i] = JSON.parse(JSON.stringify(temArr)); + } + if (!_this2.resizing) { + _context2.next = 10; + break; + } + _this2.resizing = false; + _context2.next = 8; + return _this2.conflictCheck(); + case 8: + _this2.$emit('refLineParams', refLine); + _this2.$emit('resizestop', _this2.left, _this2.top, _this2.width, _this2.height); + case 10: + if (!_this2.dragging) { + _context2.next = 16; + break; + } + _this2.dragging = false; + _context2.next = 14; + return _this2.conflictCheck(); + case 14: + _this2.$emit('refLineParams', refLine); + _this2.$emit('dragstop', _this2.left, _this2.top, _this2.width, _this2.height); + case 16: + _this2.resetBoundsAndMouseState(); + removeEvent(document.documentElement, eventsFor.move, _this2.handleResize); + removeEvent(document.documentElement, eventsFor.move, _this2.move); + removeEvent(document.documentElement, 'mouseup', _this2.handleUp); + case 20: + case "end": + return _context2.stop(); + } + }, _callee2); + }))(); + }, + // 新增方法 ↓↓↓ + // 设置属性 + settingAttribute: function settingAttribute() { + // 设置冲突检测 + this.$el.setAttribute('data-is-check', "".concat(this.isConflictCheck)); + // 设置对齐元素 + this.$el.setAttribute('data-is-snap', "".concat(this.snap)); + }, + // 冲突检测 + conflictCheck: function conflictCheck() { + var top = this.top; + var left = this.left; + var width = this.width; + var height = this.height; + if (this.isConflictCheck) { + var nodes = this.$el.parentNode.childNodes; // 获取当前父节点下所有子节点 + var _iterator = _createForOfIteratorHelper(nodes), + _step; + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var item = _step.value; + if (item.className !== undefined && !item.className.includes(this.classNameActive) && item.getAttribute('data-is-check') !== null && item.getAttribute('data-is-check') !== 'false') { + var tw = item.offsetWidth; + var th = item.offsetHeight; + // 正则获取left与right + var _this$formatTransform = this.formatTransformVal(item.style.transform), + _this$formatTransform2 = _slicedToArray(_this$formatTransform, 2), + tl = _this$formatTransform2[0], + tt = _this$formatTransform2[1]; + + // 左上角与右下角重叠 + var tfAndBr = top >= tt && left >= tl && tt + th > top && tl + tw > left || top <= tt && left < tl && top + height > tt && left + width > tl; + // 右上角与左下角重叠 + var brAndTf = left <= tl && top >= tt && left + width > tl && top < tt + th || top < tt && left > tl && top + height > tt && left < tl + tw; + // 下边与上边重叠 + var bAndT = top <= tt && left >= tl && top + height > tt && left < tl + tw || top >= tt && left <= tl && top < tt + th && left > tl + tw; + // 上边与下边重叠(宽度不一样) + var tAndB = top <= tt && left >= tl && top + height > tt && left < tl + tw || top >= tt && left <= tl && top < tt + th && left > tl + tw; + // 左边与右边重叠 + var lAndR = left >= tl && top >= tt && left < tl + tw && top < tt + th || top > tt && left <= tl && left + width > tl && top < tt + th; + // 左边与右边重叠(高度不一样) + var rAndL = top <= tt && left >= tl && top + height > tt && left < tl + tw || top >= tt && left <= tl && top < tt + th && left + width > tl; + + // 如果冲突,就将回退到移动前的位置 + if (tfAndBr || brAndTf || bAndT || tAndB || lAndR || rAndL) { + this.top = this.mouseClickPosition.top; + this.left = this.mouseClickPosition.left; + this.right = this.mouseClickPosition.right; + this.bottom = this.mouseClickPosition.bottom; + this.width = this.mouseClickPosition.w; + this.height = this.mouseClickPosition.h; + this.$emit('resizing', this.left, this.top, this.width, this.height); + } + } + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + } + }, + // 检测对齐元素 + snapCheck: function snapCheck() { + var _this3 = this; + return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() { + var width, height, activeLeft, activeRight, activeTop, activeBottom, temArr, refLine, i, nodes, tem, _yield$_this3$getActi, groupWidth, groupHeight, groupLeft, groupTop, bln, _iterator2, _step2, item, w, h, _this3$formatTransfor, _this3$formatTransfor2, l, t, r, b, hc, vc, ts, TS, bs, BS, ls, LS, rs, RS, arrTem, _i, xory, horv, _this3$calcLineValues, origin, length; + return _regeneratorRuntime().wrap(function _callee3$(_context3) { + while (1) switch (_context3.prev = _context3.next) { + case 0: + width = _this3.width; + height = _this3.height; + if (!_this3.snap) { + _context3.next = 24; + break; + } + activeLeft = _this3.left; + activeRight = _this3.left + width; + activeTop = _this3.top; + activeBottom = _this3.top + height; // 初始化辅助线数据 + temArr = new Array(3).fill({ + display: false, + position: '', + origin: '', + lineLength: '' + }); + refLine = { + vLine: [], + hLine: [] + }; + for (i in refLine) { + refLine[i] = JSON.parse(JSON.stringify(temArr)); + } + + // 获取当前父节点下所有子节点 + nodes = _this3.$el.parentNode.childNodes; + tem = { + value: { + x: [[], [], []], + y: [[], [], []] + }, + display: [], + position: [] + }; + _context3.next = 14; + return _this3.getActiveAll(nodes); + case 14: + _yield$_this3$getActi = _context3.sent; + groupWidth = _yield$_this3$getActi.groupWidth; + groupHeight = _yield$_this3$getActi.groupHeight; + groupLeft = _yield$_this3$getActi.groupLeft; + groupTop = _yield$_this3$getActi.groupTop; + bln = _yield$_this3$getActi.bln; + if (!bln) { + width = groupWidth; + height = groupHeight; + activeLeft = groupLeft; + activeRight = groupLeft + groupWidth; + activeTop = groupTop; + activeBottom = groupTop + groupHeight; + } + _iterator2 = _createForOfIteratorHelper(nodes); + try { + for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { + item = _step2.value; + if (item.className !== undefined && !item.className.includes(_this3.classNameActive) && item.getAttribute('data-is-snap') !== null && item.getAttribute('data-is-snap') !== 'false') { + w = item.offsetWidth; + h = item.offsetHeight; + _this3$formatTransfor = _this3.formatTransformVal(item.style.transform), _this3$formatTransfor2 = _slicedToArray(_this3$formatTransfor, 2), l = _this3$formatTransfor2[0], t = _this3$formatTransfor2[1]; + r = l + w; // 对齐目标right + b = t + h; // 对齐目标的bottom + hc = Math.abs(activeTop + height / 2 - (t + h / 2)) <= _this3.snapTolerance; // 水平中线 + vc = Math.abs(activeLeft + width / 2 - (l + w / 2)) <= _this3.snapTolerance; // 垂直中线 + ts = Math.abs(t - activeBottom) <= _this3.snapTolerance; // 从上到下 + TS = Math.abs(b - activeBottom) <= _this3.snapTolerance; // 从上到下 + bs = Math.abs(t - activeTop) <= _this3.snapTolerance; // 从下到上 + BS = Math.abs(b - activeTop) <= _this3.snapTolerance; // 从下到上 + ls = Math.abs(l - activeRight) <= _this3.snapTolerance; // 外左 + LS = Math.abs(r - activeRight) <= _this3.snapTolerance; // 外左 + rs = Math.abs(l - activeLeft) <= _this3.snapTolerance; // 外右 + RS = Math.abs(r - activeLeft) <= _this3.snapTolerance; // 外右 + tem['display'] = [ts, TS, bs, BS, hc, hc, ls, LS, rs, RS, vc, vc]; + tem['position'] = [t, b, t, b, t + h / 2, t + h / 2, l, r, l, r, l + w / 2, l + w / 2]; + + // fix:中线自动对齐,元素可能超过父元素边界的问题 + if (ts) { + if (bln) { + _this3.top = Math.max(t - height, _this3.bounds.minTop); + _this3.bottom = _this3.parentHeight - _this3.top - height; + } + tem.value.y[0].push(l, r, activeLeft, activeRight); + } + if (bs) { + if (bln) { + _this3.top = t; + _this3.bottom = _this3.parentHeight - _this3.top - height; + } + tem.value.y[0].push(l, r, activeLeft, activeRight); + } + if (TS) { + if (bln) { + _this3.top = Math.max(b - height, _this3.bounds.minTop); + _this3.bottom = _this3.parentHeight - _this3.top - height; + } + tem.value.y[1].push(l, r, activeLeft, activeRight); + } + if (BS) { + if (bln) { + _this3.top = b; + _this3.bottom = _this3.parentHeight - _this3.top - height; + } + tem.value.y[1].push(l, r, activeLeft, activeRight); + } + if (ls) { + if (bln) { + _this3.left = Math.max(l - width, _this3.bounds.minLeft); + _this3.right = _this3.parentWidth - _this3.left - width; + } + tem.value.x[0].push(t, b, activeTop, activeBottom); + } + if (rs) { + if (bln) { + _this3.left = l; + _this3.right = _this3.parentWidth - _this3.left - width; + } + tem.value.x[0].push(t, b, activeTop, activeBottom); + } + if (LS) { + if (bln) { + _this3.left = Math.max(r - width, _this3.bounds.minLeft); + _this3.right = _this3.parentWidth - _this3.left - width; + } + tem.value.x[1].push(t, b, activeTop, activeBottom); + } + if (RS) { + if (bln) { + _this3.left = r; + _this3.right = _this3.parentWidth - _this3.left - width; + } + tem.value.x[1].push(t, b, activeTop, activeBottom); + } + if (hc) { + if (bln) { + _this3.top = Math.max(t + h / 2 - height / 2, _this3.bounds.minTop); + _this3.bottom = _this3.parentHeight - _this3.top - height; + } + tem.value.y[2].push(l, r, activeLeft, activeRight); + } + if (vc) { + if (bln) { + _this3.left = Math.max(l + w / 2 - width / 2, _this3.bounds.minLeft); + _this3.right = _this3.parentWidth - _this3.left - width; + } + tem.value.x[2].push(t, b, activeTop, activeBottom); + } + // 辅助线坐标与是否显示(display)对应的数组,易于循环遍历 + arrTem = [0, 1, 0, 1, 2, 2, 0, 1, 0, 1, 2, 2]; + for (_i = 0; _i <= arrTem.length; _i++) { + // 前6为Y辅助线,后6为X辅助线 + xory = _i < 6 ? 'y' : 'x'; + horv = _i < 6 ? 'hLine' : 'vLine'; + if (tem.display[_i]) { + _this3$calcLineValues = _this3.calcLineValues(tem.value[xory][arrTem[_i]]), origin = _this3$calcLineValues.origin, length = _this3$calcLineValues.length; + refLine[horv][arrTem[_i]].display = tem.display[_i]; + refLine[horv][arrTem[_i]].position = tem.position[_i] + 'px'; + refLine[horv][arrTem[_i]].origin = origin; + refLine[horv][arrTem[_i]].lineLength = length; + } + } + } + } + } catch (err) { + _iterator2.e(err); + } finally { + _iterator2.f(); + } + _this3.$emit('refLineParams', refLine); + case 24: + case "end": + return _context3.stop(); + } + }, _callee3); + }))(); + }, + calcLineValues: function calcLineValues(arr) { + var length = Math.max.apply(Math, _toConsumableArray(arr)) - Math.min.apply(Math, _toConsumableArray(arr)) + 'px'; + var origin = Math.min.apply(Math, _toConsumableArray(arr)) + 'px'; + return { + length: length, + origin: origin + }; + }, + getActiveAll: function getActiveAll(nodes) { + var _this4 = this; + return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() { + var activeAll, XArray, YArray, groupWidth, groupHeight, groupLeft, groupTop, _iterator3, _step3, item, AllLength, _iterator4, _step4, i, l, r, t, b, bln; + return _regeneratorRuntime().wrap(function _callee4$(_context4) { + while (1) switch (_context4.prev = _context4.next) { + case 0: + activeAll = []; + XArray = []; + YArray = []; + groupWidth = 0; + groupHeight = 0; + groupLeft = 0; + groupTop = 0; + _iterator3 = _createForOfIteratorHelper(nodes); + try { + for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { + item = _step3.value; + if (item.className !== undefined && item.className.includes(_this4.classNameActive)) { + activeAll.push(item); + } + } + } catch (err) { + _iterator3.e(err); + } finally { + _iterator3.f(); + } + AllLength = activeAll.length; + if (AllLength > 1) { + _iterator4 = _createForOfIteratorHelper(activeAll); + try { + for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) { + i = _step4.value; + l = i.offsetLeft; + r = l + i.offsetWidth; + t = i.offsetTop; + b = t + i.offsetHeight; + XArray.push(t, b); + YArray.push(l, r); + } + } catch (err) { + _iterator4.e(err); + } finally { + _iterator4.f(); + } + groupWidth = Math.max.apply(Math, YArray) - Math.min.apply(Math, YArray); + groupHeight = Math.max.apply(Math, XArray) - Math.min.apply(Math, XArray); + groupLeft = Math.min.apply(Math, YArray); + groupTop = Math.min.apply(Math, XArray); + } + bln = AllLength === 1; + return _context4.abrupt("return", { + groupWidth: groupWidth, + groupHeight: groupHeight, + groupLeft: groupLeft, + groupTop: groupTop, + bln: bln + }); + case 13: + case "end": + return _context4.stop(); + } + }, _callee4); + }))(); + }, + // 正则获取left与top + formatTransformVal: function formatTransformVal(string) { + var _string$replace$split = string.replace(/[^0-9\-,]/g, '').split(','), + _string$replace$split2 = _slicedToArray(_string$replace$split, 2), + left = _string$replace$split2[0], + top = _string$replace$split2[1]; + if (top === undefined) top = 0; + return [+left, +top]; + } + }, + computed: { + handleStyle: function handleStyle() { + var _this5 = this; + return function (stick) { + if (!_this5.handleInfo.switch) return { + display: _this5.enabled ? 'block' : 'none' + }; + var size = (_this5.handleInfo.size / _this5.scaleRatio).toFixed(2); + var offset = (_this5.handleInfo.offset / _this5.scaleRatio).toFixed(2); + var center = (size / 2).toFixed(2); + var styleMap = { + tl: { + top: "".concat(offset, "px"), + left: "".concat(offset, "px") + }, + tm: { + top: "".concat(offset, "px"), + left: "calc(50% - ".concat(center, "px)") + }, + tr: { + top: "".concat(offset, "px"), + right: "".concat(offset, "px") + }, + mr: { + top: "calc(50% - ".concat(center, "px)"), + right: "".concat(offset, "px") + }, + br: { + bottom: "".concat(offset, "px"), + right: "".concat(offset, "px") + }, + bm: { + bottom: "".concat(offset, "px"), + right: "calc(50% - ".concat(center, "px)") + }, + bl: { + bottom: "".concat(offset, "px"), + left: "".concat(offset, "px") + }, + ml: { + top: "calc(50% - ".concat(center, "px)"), + left: "".concat(offset, "px") + } + }; + var stickStyle = { + width: "".concat(size, "px"), + height: "".concat(size, "px"), + top: styleMap[stick].top, + left: styleMap[stick].left, + right: styleMap[stick].right, + bottom: styleMap[stick].bottom + }; + stickStyle.display = _this5.enabled ? 'block' : 'none'; + return stickStyle; + }; + }, + style: function style() { + if (this.perspective > 0) { + return _objectSpread2({ + transform: this.transform ? "perspective(".concat(this.perspective, "px) translate(").concat(this.left, "px, ").concat(this.top, "px)") + '' + this.transform : "translate(".concat(this.left, "px, ").concat(this.top, "px)"), + '-ms-transform': this.transform ? "perspective(".concat(this.perspective, "px) translate(").concat(this.left, "px, ").concat(this.top, "px)") + '' + this.transform : "translate(".concat(this.left, "px, ").concat(this.top, "px)"), + '-moz-transform': this.transform ? "perspective(".concat(this.perspective, "px) translate(").concat(this.left, "px, ").concat(this.top, "px)") + '' + this.transform : "translate(".concat(this.left, "px, ").concat(this.top, "px)"), + '-webkit-transform': this.transform ? "perspective(".concat(this.perspective, "px) translate(").concat(this.left, "px, ").concat(this.top, "px)") + '' + this.transform : "translate(".concat(this.left, "px, ").concat(this.top, "px)"), + '-o-transform': this.transform ? "perspective(".concat(this.perspective, "px) translate(").concat(this.left, "px, ").concat(this.top, "px)") + '' + this.transform : "translate(".concat(this.left, "px, ").concat(this.top, "px)"), + width: this.computedWidth, + height: this.computedHeight, + zIndex: this.zIndex + }, this.dragging && this.disableUserSelect ? userSelectNone : userSelectAuto); + } else { + return _objectSpread2({ + transform: this.transform ? "translate(".concat(this.left, "px, ").concat(this.top, "px)") + '' + this.transform : "translate(".concat(this.left, "px, ").concat(this.top, "px)"), + '-ms-transform': this.transform ? "translate(".concat(this.left, "px, ").concat(this.top, "px)") + '' + this.transform : "translate(".concat(this.left, "px, ").concat(this.top, "px)"), + '-moz-transform': this.transform ? "translate(".concat(this.left, "px, ").concat(this.top, "px)") + '' + this.transform : "translate(".concat(this.left, "px, ").concat(this.top, "px)"), + '-webkit-transform': this.transform ? "translate(".concat(this.left, "px, ").concat(this.top, "px)") + '' + this.transform : "translate(".concat(this.left, "px, ").concat(this.top, "px)"), + '-o-transform': this.transform ? "translate(".concat(this.left, "px, ").concat(this.top, "px)") + '' + this.transform : "translate(".concat(this.left, "px, ").concat(this.top, "px)"), + width: this.computedWidth, + height: this.computedHeight, + zIndex: this.zIndex + }, this.dragging && this.disableUserSelect ? userSelectNone : userSelectAuto); + } + }, + // 控制柄显示与否 + actualHandles: function actualHandles() { + if (!this.resizable) return []; + return this.handles; + }, + computedWidth: function computedWidth() { + if (this.w === 'auto') { + if (!this.widthTouched) { + return 'auto'; + } + } + return this.width + 'px'; + }, + computedHeight: function computedHeight() { + if (this.h === 'auto') { + if (!this.heightTouched) { + return 'auto'; + } + } + return this.height + 'px'; + }, + resizingOnX: function resizingOnX() { + return Boolean(this.handle) && (this.handle.includes('l') || this.handle.includes('r')); + }, + resizingOnY: function resizingOnY() { + return Boolean(this.handle) && (this.handle.includes('t') || this.handle.includes('b')); + }, + isCornerHandle: function isCornerHandle() { + return Boolean(this.handle) && ['tl', 'tr', 'br', 'bl'].includes(this.handle); + } + }, + watch: { + active: function active(val) { + this.enabled = val; + if (val) ; else { + this.$emit('deactivated'); + } + }, + z: function z(val) { + if (val >= 0 || val === 'auto') { + this.zIndex = val; + } + }, + x: function x(val) { + if (this.resizing || this.dragging) { + return; + } + if (this.parent) { + this.bounds = this.calcDragLimits(); + } + this.moveHorizontally(val); + }, + y: function y(val) { + if (this.resizing || this.dragging) { + return; + } + if (this.parent) { + this.bounds = this.calcDragLimits(); + } + this.moveVertically(val); + }, + lockAspectRatio: function lockAspectRatio(val) { + if (val) { + this.aspectFactor = this.width / this.height; + } else { + this.aspectFactor = undefined; + } + }, + minWidth: function minWidth(val) { + if (val > 0 && val <= this.width) { + this.minW = val; + } + }, + minHeight: function minHeight(val) { + if (val > 0 && val <= this.height) { + this.minH = val; + } + }, + maxWidth: function maxWidth(val) { + this.maxW = val; + }, + maxHeight: function maxHeight(val) { + this.maxH = val; + }, + w: function w(val) { + if (this.resizing || this.dragging) { + return; + } + if (this.parent) { + this.bounds = this.calcResizeLimits(); + } + this.changeWidth(val); + }, + h: function h(val) { + if (this.resizing || this.dragging) { + return; + } + if (this.parent) { + this.bounds = this.calcResizeLimits(); + } + this.changeHeight(val); + } + } +}; + +/* script */ +const __vue_script__$a = script$a; + +/* template */ +var __vue_render__$a = function () { + var _obj; + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c( + "div", + { + class: [ + ((_obj = {}), + (_obj[_vm.classNameActive] = _vm.enabled), + (_obj[_vm.classNameDragging] = _vm.dragging), + (_obj[_vm.classNameResizing] = _vm.resizing), + (_obj[_vm.classNameDraggable] = _vm.draggable), + (_obj[_vm.classNameResizable] = _vm.resizable), + _obj), + _vm.className, + ], + style: _vm.style, + on: { + mousedown: _vm.elementMouseDown, + touchstart: _vm.elementTouchDown, + contextmenu: _vm.onContextMenu, + }, + }, + [ + _vm._l(_vm.actualHandles, function (handle) { + return _c( + "div", + { + key: handle, + class: [_vm.classNameHandle, _vm.classNameHandle + "-" + handle], + style: _vm.handleStyle(handle), + on: { + mousedown: function ($event) { + $event.stopPropagation(); + $event.preventDefault(); + return _vm.handleDown(handle, $event) + }, + touchstart: function ($event) { + $event.stopPropagation(); + $event.preventDefault(); + return _vm.handleTouchDown(handle, $event) + }, + }, + }, + [_vm._t(handle)], + 2 + ) + }), + _vm._v(" "), + _vm._t("default"), + ], + 2 + ) +}; +var __vue_staticRenderFns__$a = []; +__vue_render__$a._withStripped = true; + + /* style */ + const __vue_inject_styles__$a = function (inject) { + if (!inject) return + inject("data-v-95085f0c_0", { source: ".vdr[data-v-95085f0c] {\n touch-action: none;\n position: absolute;\n box-sizing: border-box;\n border: 1px dashed #d6d6d6;\n}\n.handle[data-v-95085f0c] {\n box-sizing: border-box;\n position: absolute;\n width: 8px;\n height: 8px;\n background: #ffffff;\n border: 1px solid #333;\n box-shadow: 0 0 2px #bbb;\n}\n.handle-tl[data-v-95085f0c] {\n top: -5px;\n left: -5px;\n cursor: nw-resize;\n}\n.handle-tm[data-v-95085f0c] {\n top: -5px;\n left: calc(50% - 4px);\n /*margin-left: -5px;*/\n cursor: n-resize;\n}\n.handle-tr[data-v-95085f0c] {\n top: -5px;\n right: -5px;\n cursor: ne-resize;\n}\n.handle-ml[data-v-95085f0c] {\n top: calc(50% - 4px);\n /*margin-top: -5px;*/\n left: -5px;\n cursor: w-resize;\n}\n.handle-mr[data-v-95085f0c] {\n top: calc(50% - 4px);\n /*margin-top: -5px;*/\n right: -5px;\n cursor: e-resize;\n}\n.handle-bl[data-v-95085f0c] {\n bottom: -5px;\n left: -5px;\n cursor: sw-resize;\n}\n.handle-bm[data-v-95085f0c] {\n bottom: -5px;\n left: calc(50% - 4px);\n /*margin-left: -5px;*/\n cursor: s-resize;\n}\n.handle-br[data-v-95085f0c] {\n bottom: -5px;\n right: -5px;\n cursor: se-resize;\n}\n.ref-line[data-v-95085f0c] {\n position: absolute;\n background-color: #ff00cc;\n z-index: 9999;\n}\n.v-line[data-v-95085f0c] {\n width: 1px;\n}\n.h-line[data-v-95085f0c] {\n height: 1px;\n}\n@media only screen and (max-width: 768px) {\n[class*=\"handle-\"][data-v-95085f0c]:before {\n content: \"\";\n left: -10px;\n right: -10px;\n bottom: -10px;\n top: -10px;\n position: absolute;\n}\n}\n", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,kBAAkB;EAClB,sBAAsB;EACtB,0BAA0B;AAC5B;AACA;EACE,sBAAsB;EACtB,kBAAkB;EAClB,UAAU;EACV,WAAW;EACX,mBAAmB;EACnB,sBAAsB;EACtB,wBAAwB;AAC1B;AACA;EACE,SAAS;EACT,UAAU;EACV,iBAAiB;AACnB;AACA;EACE,SAAS;EACT,qBAAqB;EACrB,qBAAqB;EACrB,gBAAgB;AAClB;AACA;EACE,SAAS;EACT,WAAW;EACX,iBAAiB;AACnB;AACA;EACE,oBAAoB;EACpB,oBAAoB;EACpB,UAAU;EACV,gBAAgB;AAClB;AACA;EACE,oBAAoB;EACpB,oBAAoB;EACpB,WAAW;EACX,gBAAgB;AAClB;AACA;EACE,YAAY;EACZ,UAAU;EACV,iBAAiB;AACnB;AACA;EACE,YAAY;EACZ,qBAAqB;EACrB,qBAAqB;EACrB,gBAAgB;AAClB;AACA;EACE,YAAY;EACZ,WAAW;EACX,iBAAiB;AACnB;AACA;EACE,kBAAkB;EAClB,yBAAyB;EACzB,aAAa;AACf;AACA;EACE,UAAU;AACZ;AACA;EACE,WAAW;AACb;AACA;AACE;IACE,WAAW;IACX,WAAW;IACX,YAAY;IACZ,aAAa;IACb,UAAU;IACV,kBAAkB;AACpB;AACF","file":"index.vue","sourcesContent":[".vdr {\n touch-action: none;\n position: absolute;\n box-sizing: border-box;\n border: 1px dashed #d6d6d6;\n}\n.handle {\n box-sizing: border-box;\n position: absolute;\n width: 8px;\n height: 8px;\n background: #ffffff;\n border: 1px solid #333;\n box-shadow: 0 0 2px #bbb;\n}\n.handle-tl {\n top: -5px;\n left: -5px;\n cursor: nw-resize;\n}\n.handle-tm {\n top: -5px;\n left: calc(50% - 4px);\n /*margin-left: -5px;*/\n cursor: n-resize;\n}\n.handle-tr {\n top: -5px;\n right: -5px;\n cursor: ne-resize;\n}\n.handle-ml {\n top: calc(50% - 4px);\n /*margin-top: -5px;*/\n left: -5px;\n cursor: w-resize;\n}\n.handle-mr {\n top: calc(50% - 4px);\n /*margin-top: -5px;*/\n right: -5px;\n cursor: e-resize;\n}\n.handle-bl {\n bottom: -5px;\n left: -5px;\n cursor: sw-resize;\n}\n.handle-bm {\n bottom: -5px;\n left: calc(50% - 4px);\n /*margin-left: -5px;*/\n cursor: s-resize;\n}\n.handle-br {\n bottom: -5px;\n right: -5px;\n cursor: se-resize;\n}\n.ref-line {\n position: absolute;\n background-color: #ff00cc;\n z-index: 9999;\n}\n.v-line {\n width: 1px;\n}\n.h-line {\n height: 1px;\n}\n@media only screen and (max-width: 768px) {\n [class*=\"handle-\"]:before {\n content: \"\";\n left: -10px;\n right: -10px;\n bottom: -10px;\n top: -10px;\n position: absolute;\n }\n}\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__$a = "data-v-95085f0c"; + /* module identifier */ + const __vue_module_identifier__$a = undefined; + /* functional template */ + const __vue_is_functional_template__$a = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$a = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$a, staticRenderFns: __vue_staticRenderFns__$a }, + __vue_inject_styles__$a, + __vue_script__$a, + __vue_scope_id__$a, + __vue_is_functional_template__$a, + __vue_module_identifier__$a, + false, + createInjector, + undefined, + undefined + ); + +var script$9 = { + name: 'ConfigItem', + components: _defineProperty(_defineProperty({}, antDesignVue.Row.name, antDesignVue.Row), antDesignVue.Col.name, antDesignVue.Col), + props: { + title: { + type: String, + default: '' + } + } +}; + +/* script */ +const __vue_script__$9 = script$9; + +/* template */ +var __vue_render__$9 = function () { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c( + "div", + { staticClass: "config-item" }, + [ + _c( + "a-row", + { staticClass: "config-item-title" }, + [ + _c("a-col", { attrs: { span: 6 } }, [_vm._v(_vm._s(_vm.title))]), + _vm._v(" "), + _c("a-col", { attrs: { span: 18 } }, [ + _c( + "div", + { staticClass: "config-item-auxiliary" }, + [_vm._t("auxiliary")], + 2 + ), + _vm._v(" "), + _c( + "div", + { staticClass: "config-item-enhance" }, + [_vm._t("enhance")], + 2 + ), + ]), + ], + 1 + ), + _vm._v(" "), + _c("div", { staticClass: "config-item-content" }, [_vm._t("content")], 2), + ], + 1 + ) +}; +var __vue_staticRenderFns__$9 = []; +__vue_render__$9._withStripped = true; + + /* style */ + const __vue_inject_styles__$9 = function (inject) { + if (!inject) return + inject("data-v-eced1050_0", { source: ".config-item[data-v-eced1050] {\n padding: 10px 12px;\n}\n.config-item-enhance[data-v-eced1050] {\n margin-top: 12px;\n}\n.config-item-content[data-v-eced1050] {\n margin-top: 12px;\n}\n", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;AACpB;AACA;EACE,gBAAgB;AAClB;AACA;EACE,gBAAgB;AAClB","file":"index.vue","sourcesContent":[".config-item {\n padding: 10px 12px;\n}\n.config-item-enhance {\n margin-top: 12px;\n}\n.config-item-content {\n margin-top: 12px;\n}\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__$9 = "data-v-eced1050"; + /* module identifier */ + const __vue_module_identifier__$9 = undefined; + /* functional template */ + const __vue_is_functional_template__$9 = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$9 = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$9, staticRenderFns: __vue_staticRenderFns__$9 }, + __vue_inject_styles__$9, + __vue_script__$9, + __vue_scope_id__$9, + __vue_is_functional_template__$9, + __vue_module_identifier__$9, + false, + createInjector, + undefined, + undefined + ); + +// +// +// +// +// +// +// +// +// +// +// +// + +var script$8 = { + name: 'EditScreens', + data: function data() { + return { + width: '', + isPressSpace: false + }; + }, + methods: { + handleScroll: function handleScroll() { + var $app = this.$refs.$app; + var refSketchRuleBox = this.$refs.refSketchRuleBox; + if (!$app) return; + var screensRect = $app.getBoundingClientRect(); + var canvasRect = refSketchRuleBox.getBoundingClientRect(); + var perspectiveX = screensRect.left - canvasRect.left; + var perspectiveY = screensRect.top - canvasRect.top; + this.$emit('handleScroll', { + perspectiveX: perspectiveX, + perspectiveY: perspectiveY + }); + }, + handleOtherStop: function handleOtherStop() { + this.$emit('handleOtherStop'); + } + } +}; + +/* script */ +const __vue_script__$8 = script$8; + +/* template */ +var __vue_render__$8 = function () { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c( + "div", + { + ref: "$app", + staticClass: "edit-screens", + on: { scroll: _vm.handleScroll }, + }, + [ + _c("div", { ref: "$container", staticClass: "edit-screen-container" }, [ + _c( + "div", + { + ref: "refSketchRuleBox", + staticClass: "canvas", + on: { click: _vm.handleOtherStop }, + }, + [ + _c( + "div", + { style: { pointerEvents: _vm.isPressSpace ? "none" : "auto" } }, + [_vm._t("default")], + 2 + ), + ] + ), + ]), + ] + ) +}; +var __vue_staticRenderFns__$8 = []; +__vue_render__$8._withStripped = true; + + /* style */ + const __vue_inject_styles__$8 = function (inject) { + if (!inject) return + inject("data-v-6541cebf_0", { source: ".edit-screens[data-v-6541cebf] {\n position: relative;\n margin: 24px 0 0 24px;\n width: calc(100% - 24px);\n height: calc(100% - 24px);\n overflow: auto;\n user-select: none;\n}\n.edit-screens .edit-screen-container[data-v-6541cebf] {\n position: absolute;\n width: 100%;\n height: 100%;\n}\n.edit-screens .edit-screen-container .canvas[data-v-6541cebf] {\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,qBAAqB;EACrB,wBAAwB;EACxB,yBAAyB;EACzB,cAAc;EACd,iBAAiB;AACnB;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,WAAW;EACX,YAAY;AACd","file":"index.vue","sourcesContent":[".edit-screens {\n position: relative;\n margin: 24px 0 0 24px;\n width: calc(100% - 24px);\n height: calc(100% - 24px);\n overflow: auto;\n user-select: none;\n}\n.edit-screens .edit-screen-container {\n position: absolute;\n width: 100%;\n height: 100%;\n}\n.edit-screens .edit-screen-container .canvas {\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__$8 = "data-v-6541cebf"; + /* module identifier */ + const __vue_module_identifier__$8 = undefined; + /* functional template */ + const __vue_is_functional_template__$8 = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$8 = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$8, staticRenderFns: __vue_staticRenderFns__$8 }, + __vue_inject_styles__$8, + __vue_script__$8, + __vue_scope_id__$8, + __vue_is_functional_template__$8, + __vue_module_identifier__$8, + false, + createInjector, + undefined, + undefined + ); + +var script$7 = { + name: 'Feedback', + props: _objectSpread2({}, antDesignVue.Result.props), + components: _defineProperty({}, antDesignVue.Result.name, antDesignVue.Result), + data: function data() { + return {}; + } +}; + +/* script */ +const __vue_script__$7 = script$7; + +/* template */ +var __vue_render__$7 = function () { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c( + "div", + { staticClass: "feedback" }, + [_c("a-result", _vm._b({}, "a-result", _vm.$props, false))], + 1 + ) +}; +var __vue_staticRenderFns__$7 = []; +__vue_render__$7._withStripped = true; + + /* style */ + const __vue_inject_styles__$7 = function (inject) { + if (!inject) return + inject("data-v-4ea49bf0_0", { source: "[data-v-4ea49bf0]:export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n[data-v-4ea49bf0] .ant-result-title {\n color: white;\n}\n[data-v-4ea49bf0] .ant-result-subtitle {\n color: white;\n}\n.feedback[data-v-4ea49bf0] {\n height: 100%;\n background-color: #141414;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n", map: {"version":3,"sources":["index.vue","C:\\Users\\lihq1\\Desktop\\开源\\vue-lcd-engine\\components\\Feedback\\index.vue"],"names":[],"mappings":"AAAA;EACE,sBAAsB;EACtB,mBAAmB;EACnB,sBAAsB;EACtB,sBAAsB;EACtB,oBAAoB;EACpB,mBAAmB;EACnB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,iBAAiB;EACjB,6BAA6B;EAC7B,wCAAwC;AAC1C;AACC;EACC,YAAY;AACd;AACC;ECCD,YAAA;ADCA;ACCA;EACA,YAAA;EACA,yBAAA;EDCE,aAAa;ECCf,mBAAA;EACA,uBAAA;AACA","file":"index.vue","sourcesContent":[":export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n /deep/ .ant-result-title {\n color: white;\n}\n /deep/ .ant-result-subtitle {\n color: white;\n}\n.feedback {\n height: 100%;\n background-color: #141414;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n","\r\n\r\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__$7 = "data-v-4ea49bf0"; + /* module identifier */ + const __vue_module_identifier__$7 = undefined; + /* functional template */ + const __vue_is_functional_template__$7 = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$7 = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$7, staticRenderFns: __vue_staticRenderFns__$7 }, + __vue_inject_styles__$7, + __vue_script__$7, + __vue_scope_id__$7, + __vue_is_functional_template__$7, + __vue_module_identifier__$7, + false, + createInjector, + undefined, + undefined + ); + +// +// +// +// +// +// +// +// +// +// +// +// + +var script$6 = { + name: 'Layout', + props: { + logo: { + type: String, + default: '' + }, + title: { + type: String, + default: '' + } + } +}; + +/* script */ +const __vue_script__$6 = script$6; + +/* template */ +var __vue_render__$6 = function () { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c("div", { staticClass: "layout" }, [ + _c("header", { staticClass: "layout-header" }, [ + _c("img", { + staticClass: "header-logo", + attrs: { src: _vm.logo, alt: "logo" }, + }), + _vm._v(" "), + _c("span", { staticClass: "header-title" }, [_vm._v(_vm._s(_vm.title))]), + ]), + _vm._v(" "), + _c("main", { staticClass: "layout-main" }, [_c("router-view")], 1), + ]) +}; +var __vue_staticRenderFns__$6 = []; +__vue_render__$6._withStripped = true; + + /* style */ + const __vue_inject_styles__$6 = function (inject) { + if (!inject) return + inject("data-v-3bbf3843_0", { source: "[data-v-3bbf3843]:export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.layout[data-v-3bbf3843] {\n background-color: #141414;\n height: 100%;\n}\n.layout-header[data-v-3bbf3843] {\n height: 60px;\n background-color: #1f1f1f;\n padding: 16px 24px;\n display: flex;\n align-items: center;\n justify-content: left;\n box-shadow: 0px 1px 0px 0px #000000;\n border-bottom: 1px solid #404040;\n}\n.layout-header .header-logo[data-v-3bbf3843] {\n width: 24px;\n height: 24px;\n}\n.layout-header .header-title[data-v-3bbf3843] {\n font-size: 20px;\n margin-left: 12px;\n}\n.layout-main[data-v-3bbf3843] {\n height: calc(100% - 60px);\n overflow-y: auto;\n}\n", map: {"version":3,"sources":["index.vue","C:\\Users\\lihq1\\Desktop\\开源\\vue-lcd-engine\\components\\Layout\\index.vue"],"names":[],"mappings":"AAAA;EACE,sBAAsB;EACtB,mBAAmB;EACnB,sBAAsB;EACtB,sBAAsB;EACtB,oBAAoB;EACpB,mBAAmB;EACnB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,iBAAiB;EACjB,6BAA6B;EAC7B,wCAAwC;AAC1C;AACA;EACE,yBAAyB;EACzB,YAAY;AACd;AACA;EACE,YAAY;EACZ,yBAAyB;EACzB,kBAAkB;EAClB,aAAa;EACb,mBAAmB;EACnB,qBAAqB;EACrB,mCAAmC;ECCrC,gCAAA;ADCA;ACCA;EACA,WAAA;EACA,YAAA;ADCA;ACCA;EACA,eAAA;EACA,iBAAA;AACA;AACA;EACA,yBAAA;EACA,gBAAA;AACA","file":"index.vue","sourcesContent":[":export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.layout {\n background-color: #141414;\n height: 100%;\n}\n.layout-header {\n height: 60px;\n background-color: #1f1f1f;\n padding: 16px 24px;\n display: flex;\n align-items: center;\n justify-content: left;\n box-shadow: 0px 1px 0px 0px #000000;\n border-bottom: 1px solid #404040;\n}\n.layout-header .header-logo {\n width: 24px;\n height: 24px;\n}\n.layout-header .header-title {\n font-size: 20px;\n margin-left: 12px;\n}\n.layout-main {\n height: calc(100% - 60px);\n overflow-y: auto;\n}\n","\r\n\r\n\r\n\r\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__$6 = "data-v-3bbf3843"; + /* module identifier */ + const __vue_module_identifier__$6 = undefined; + /* functional template */ + const __vue_is_functional_template__$6 = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$6 = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$6, staticRenderFns: __vue_staticRenderFns__$6 }, + __vue_inject_styles__$6, + __vue_script__$6, + __vue_scope_id__$6, + __vue_is_functional_template__$6, + __vue_module_identifier__$6, + false, + createInjector, + undefined, + undefined + ); + +var script$5 = { + name: 'Loading', + components: _defineProperty({}, antDesignVue.Spin.name, antDesignVue.Spin), + data: function data() { + return { + visible: true + }; + } +}; + +/* script */ +const __vue_script__$5 = script$5; + +/* template */ +var __vue_render__$5 = function () { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c( + "a-spin", + { attrs: { spinning: _vm.visible, wrapperClassName: "loading" } }, + [_vm.visible ? _c("div", { staticClass: "loading" }) : _vm._e()] + ) +}; +var __vue_staticRenderFns__$5 = []; +__vue_render__$5._withStripped = true; + + /* style */ + const __vue_inject_styles__$5 = function (inject) { + if (!inject) return + inject("data-v-3d236889_0", { source: ".loading[data-v-3d236889] {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 44;\n}\n.loading-box[data-v-3d236889] {\n position: absolute;\n left: 50%;\n top: 50%;\n width: 100px;\n transform: translate(-50%, -50%);\n line-height: 28px;\n}\n.loading-box i[data-v-3d236889] {\n font-size: 24px;\n margin-right: 5px;\n}\n", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,OAAO;EACP,QAAQ;EACR,MAAM;EACN,SAAS;EACT,WAAW;AACb;AACA;EACE,kBAAkB;EAClB,SAAS;EACT,QAAQ;EACR,YAAY;EACZ,gCAAgC;EAChC,iBAAiB;AACnB;AACA;EACE,eAAe;EACf,iBAAiB;AACnB","file":"index.vue","sourcesContent":[".loading {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 44;\n}\n.loading-box {\n position: absolute;\n left: 50%;\n top: 50%;\n width: 100px;\n transform: translate(-50%, -50%);\n line-height: 28px;\n}\n.loading-box i {\n font-size: 24px;\n margin-right: 5px;\n}\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__$5 = "data-v-3d236889"; + /* module identifier */ + const __vue_module_identifier__$5 = undefined; + /* functional template */ + const __vue_is_functional_template__$5 = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$5 = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$5, staticRenderFns: __vue_staticRenderFns__$5 }, + __vue_inject_styles__$5, + __vue_script__$5, + __vue_scope_id__$5, + __vue_is_functional_template__$5, + __vue_module_identifier__$5, + false, + createInjector, + undefined, + undefined + ); + +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// + +var script$4 = { + name: 'SketchRule', + props: { + mode: { + type: String, + default: 'horizontal' + }, + width: { + type: Number + }, + height: { + type: Number + }, + configColor: { + type: Object, + default: function _default() { + return { + fillStyle: '#666', + strokeStyle: '#666', + font: 16, + lineWidth: 1 + }; + } + }, + scale: { + // 缩放 + type: Number, + default: 1 + }, + layout: { + type: Array, + default: function _default() { + return []; + } + }, + perspective: { + // 刻度尺跟随滚动条移动偏移量 + type: Number, + default: 0 + } + }, + computed: { + ruleId: function ruleId() { + return Math.random().toFixed(16) + '-' + this.mode; + }, + hv: function hv() { + return this.$refs["rule-".concat(this.mode)].querySelector('.indicator'); + }, + vertical: function vertical() { + return this.mode === 'horizontal'; + }, + styleBorder: function styleBorder() { + var _this$lineConfig = this.lineConfig, + width = _this$lineConfig.width, + color = _this$lineConfig.color, + type = _this$lineConfig.type; + var border = "".concat(width, "px ").concat(type, " ").concat(color); + return this.vertical ? { + borderLeft: border + } : { + borderTop: border + }; + }, + lock: function lock() { + return document.querySelector('.rule-panel-lock').getBoundingClientRect(); + }, + $Q: function $Q() { + var scale = 10; + var text = 10; + if (this.scale < 0.1) { + text = 80; + } else if (this.scale >= 0.1 && this.scale <= 0.25) { + text = 40; + } else if (this.scale > 0.25 && this.scale <= 0.5) { + text = 20; + } else if (this.scale > 0.5 && this.scale <= 1) { + text = 10; + } else if (this.scale > 1 && this.scale <= 3) { + text = 5; + } + scale = text * this.scale; + return { + scale: scale, + text: text + }; + } + }, + watch: { + canvasWidth: function canvasWidth(val, oldVal) { + if (oldVal) { + this.horizontalValue = val - oldVal; + } + }, + layout: function layout() { + this.handleUpdate(); + }, + perspective: function perspective() { + this.handleUpdate(); + }, + scale: function scale() { + this.handleUpdate(); + } + }, + data: function data() { + return { + config: { + // 刻度尺配置 + size: 101, + x: 0, + y: 0, + w: 10, + h: 10, + width: 20, + height: 20, + fillStyle: '#fff', + strokeStyle: '#fff', + font: 12, + lineWidth: 1 + }, + cxt: null, + canvas: null, + showIndicator: false, + showValue: 0, + lineArr: [], + showAnctionValue: 0, + startValue: null, + lineConfig: { + // 拖拽线的样式 + color: '#51d6a9', + type: 'dashed', + width: 1 + }, + canvasWidth: 0, + horizontalValue: 0 + }; + }, + mounted: function mounted() { + var _this = this; + // window.addEventListener('resize', this.getWrapperSize) + this.$nextTick(function () { + _this.initDom(); + }); + }, + methods: { + initDom: function initDom() { + this.canvas = document.getElementById(this.ruleId); + this.config = Object.assign(this.config, this.configColor); + if (!this.canvas) return; + this.cxt = this.canvas.getContext('2d'); + this.initBindEvent(); + this.initConfig(); + this.draw(this.cxt, this.config); + }, + initConfig: function initConfig() { + var _document$querySelect2; + var _document$querySelect = document.querySelector('.editor-render-top').getBoundingClientRect(), + width = _document$querySelect.width, + height = _document$querySelect.height; + this.warpOffset = (_document$querySelect2 = document.querySelector('.ruler')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.getBoundingClientRect(); + var iconOffSet = this.lock.width; + this.canvasWidth = width; + var numLength = this.perspective; + var dom = document.querySelector('.ruler'); + dom.style.height = height + 'px'; + this.config.width = this.vertical ? 20 : iconOffSet; + this.config.height = this.vertical ? iconOffSet : 20; + var Width = this.vertical ? width - iconOffSet + numLength : this.config.width; + var Height = this.vertical ? this.config.height : height - iconOffSet + numLength; + var Size = this.vertical ? Width : Height; + this.canvas.setAttribute('width', Width); + this.canvas.setAttribute('height', Height); + this.config.size = Math.ceil(Math.ceil(Size / 10 * 40) + 1); + }, + initBindEvent: function initBindEvent() { + this.handleMouseenter(); + this.handleMouseleave(); + this.handleMousemove(); + this.handleMouseClick(); + }, + getScale: function getScale() {}, + draw: function draw(cxt, config) { + var scale = this.scale; + var size = config.size || 101; + var x = config.x || 0; + var y = config.y || 0; + var w = config.w || 10; + var h = config.h || 10; + var v = this.mode || 'horizontal'; + cxt.clearRect(0, 0, config.width, config.height); + cxt.strokeStyle = config.strokeStyle; + cxt.lineWidth = config.lineWidth / (this.scale * 1.5); + cxt.font = "".concat(12, "px -apple-system,\n \"Helvetica Neue\", \".SFNSText-Regular\",\n \"SF UI Text\", Arial, \"PingFang SC\", \"Hiragino Sans GB\",\n \"Microsoft YaHei\", \"WenQuanYi Zen Hei\", sans-serif"); + cxt.fillStyle = config.fillStyle; + for (var i = 0; i < size; i++) { + cxt.beginPath(); + if (v == 'vertical') { + var startY = y - this.perspective + i * this.$Q.scale; + cxt.moveTo(x, startY); + if (i % 10 == 0) { + cxt.save(); + cxt.translate(10, -10); + cxt.rotate(90 * Math.PI / 180); + cxt.fillText(x + i * this.$Q.text, x + w * 1.2 + i * this.$Q.scale - this.perspective, y); + cxt.restore(); + cxt.lineTo(x + w * 1.3, x + i * this.$Q.scale - this.perspective); + } else { + cxt.lineTo(x + (i % 5 === 0 ? 0.8 : 0.5) * w, startY); + } + cxt.scale(1, scale); + } else { + var startX = x - this.perspective + i * this.$Q.scale; + cxt.moveTo(startX, y); + if (i % 10 == 0) { + cxt.fillText(x + i * this.$Q.text, startX + 2, y + h * 1.8); + cxt.lineTo(startX, y + h * 1.3); + } else { + cxt.lineTo(startX, y + (i % 5 === 0 ? 0.8 : 0.5) * h); + } + cxt.scale(scale, 1); + } + cxt.stroke(); + cxt.closePath(); + cxt.setTransform(1, 0, 0, 1, 0, 0); + } + }, + getWrapperSize: function getWrapperSize() { + if (!this.canvas) return; + this.initConfig(); + this.draw(this.cxt, this.config); + }, + setPosition: function setPosition(_ref) { + var offsetX = _ref.offsetX, + offsetY = _ref.offsetY; + if (this.vertical) { + this.hv.style.left = offsetX + 'px'; + this.showValue = (offsetX + this.perspective) / this.scale; + } else { + this.hv.style.top = offsetY + 'px'; + this.showValue = (offsetY + this.perspective) / this.scale; + } + }, + handleMouseenter: function handleMouseenter() { + var _this2 = this; + this.canvas.onmouseenter = function (e) { + if (_this2.startValue) return; + _this2.showIndicator = true; + _this2.setPosition(e); + }; + }, + handleMouseleave: function handleMouseleave() { + var _this3 = this; + this.canvas.onmouseleave = function () { + _this3.showIndicator = false; + }; + }, + handleMousemove: function handleMousemove() { + var _this4 = this; + this.canvas.onmousemove = function (e) { + if (_this4.startValue) return; + _this4.setPosition(e); + }; + }, + // 点击出现对齐线 + handleMouseClick: function handleMouseClick() { + var _this5 = this; + this.canvas.onclick = function (e) { + var offsetX = e.offsetX, + offsetY = e.offsetY; + if (_this5.vertical) { + !_this5.lineArr.includes(offsetX) && _this5.lineArr.push({ + top: 0, + left: offsetX, + value: (offsetX + _this5.perspective) / _this5.scale + }); + } else { + !_this5.lineArr.includes(offsetY) && _this5.lineArr.push({ + top: offsetY, + left: 0, + value: (offsetY + _this5.perspective) / _this5.scale + }); + } + }; + }, + handleEnterLeave: function handleEnterLeave() { + var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + this.showAnctionValue = value; + }, + handleDelete: function handleDelete(e) { + var index = this.lineArr.findIndex(function (k) { + return k.value === e; + }); + this.lineArr.splice(index, 1); + }, + handleMouseDown: function handleMouseDown(e) { + this.startValue = e; + document.addEventListener('mousemove', this.handleMove); + document.addEventListener('mouseup', this.handleMouseUp); + }, + handleMouseUp: function handleMouseUp() { + // const warpCanvasWidthHeight = this.vertical + // ? Math.floor(this.canvas.getAttribute('width')) / this.scale - this.lock.width - 3 + // : Math.floor(this.canvas.getAttribute('height')) / this.scale - this.lock.width - 1 + // this.lineArr = this.lineArr.filter(e => e.value < warpCanvasWidthHeight / this.scale && e.value >= 0) + this.startValue = null; + document.removeEventListener('mousemove', this.handleMove); + document.removeEventListener('mouseup', this.handleMouseUp); + }, + setStyle: function setStyle(e) { + // e = { color: 'red', type: 'dashed', width: 1 } + this.lineConfig = Object.assign(this.lineConfig, e); + }, + // 拖动已经显示的对齐线移动 + handleMove: function handleMove(e) { + var _this6 = this; + e.stopPropagation(); + e.preventDefault(); + var clientX = e.clientX, + clientY = e.clientY; + var iconOffSet = this.lock.width; + var left = this.vertical ? Math.round(clientX - this.warpOffset.left - iconOffSet) : 0; + var top = this.vertical ? 0 : Math.round(clientY - this.warpOffset.top - iconOffSet); + var value = this.vertical ? Math.round((clientX - this.warpOffset.left - iconOffSet + this.perspective) / this.scale) : Math.round(clientY - this.warpOffset.top - iconOffSet + this.perspective / this.scale); + var index = this.lineArr.findIndex(function (k) { + return Math.abs(k.value - _this6.startValue) <= 3; + }); + this.startValue = value; + this.showAnctionValue = value; + index >= 0 && this.$set(this.lineArr, index, { + top: top, + left: left, + value: value + }); + }, + listenMouseMove: function listenMouseMove(e) {}, + handleScrollSetine: function handleScrollSetine() { + var _this7 = this; + if (!this.lineArr.length) return; + this.lineArr.forEach(function (e, i) { + var valueMax = Math.round(e.value) * _this7.scale - _this7.perspective; + _this7.$set(_this7.lineArr, i, { + top: _this7.vertical ? 0 : valueMax, + left: _this7.vertical ? valueMax : 0, + value: Math.round(e.value) + }); + }); + }, + handleUpdate: function handleUpdate() { + if (!this.canvas) return; + this.initConfig(); + this.draw(this.cxt, this.config); + this.handleScrollSetine(); + } + }, + beforeDestroy: function beforeDestroy() { + window.removeEventListener('resize', this.getWrapperSize); + } +}; + +/* script */ +const __vue_script__$4 = script$4; + +/* template */ +var __vue_render__$4 = function () { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c("div", { ref: "rule-" + _vm.mode, class: ["rule-" + _vm.mode] }, [ + _c("canvas", { attrs: { id: _vm.ruleId } }), + _vm._v(" "), + _c( + "div", + { staticClass: "lines" }, + _vm._l(_vm.lineArr, function (item, index) { + return _c( + "div", + { + key: index, + staticClass: "line", + style: Object.assign( + {}, + { top: item.top + "px", left: item.left + "px" }, + _vm.styleBorder, + { display: item.value >= 0 ? "" : "none" } + ), + attrs: { + "aria-left": item.left, + "aria-top": item.top, + "aria-value": Math.round(item.value), + }, + on: { + mouseenter: function ($event) { + return _vm.handleEnterLeave(item.value) + }, + mouseleave: function ($event) { + return _vm.handleEnterLeave() + }, + mousedown: function ($event) { + return _vm.handleMouseDown(item.value) + }, + }, + }, + [ + _c("div", { staticClass: "anction" }, [ + _c( + "span", + { + staticClass: "del", + style: { + visibility: + _vm.showAnctionValue === item.value + ? "visible" + : "hidden", + }, + on: { + click: function ($event) { + return _vm.handleDelete(item.value) + }, + }, + }, + [_vm._v("x")] + ), + _vm._v(" "), + _c("span", { staticClass: "value" }, [ + _vm._v(_vm._s(Math.round(item.value))), + ]), + ]), + ] + ) + }), + 0 + ), + _vm._v(" "), + _c( + "div", + { + directives: [ + { + name: "show", + rawName: "v-show", + value: _vm.showIndicator, + expression: "showIndicator", + }, + ], + staticClass: "indicator", + style: _vm.styleBorder, + }, + [ + _c("div", { staticClass: "value" }, [ + _vm._v(_vm._s(Math.round(_vm.showValue))), + ]), + ] + ), + ]) +}; +var __vue_staticRenderFns__$4 = []; +__vue_render__$4._withStripped = true; + + /* style */ + const __vue_inject_styles__$4 = function (inject) { + if (!inject) return + inject("data-v-a7216922_0", { source: "[data-v-a7216922]:export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.rule-horizontal[data-v-a7216922] {\n position: absolute;\n left: 24px;\n width: calc(100% - 24px);\n font-size: 12px;\n}\n.rule-horizontal .lines .line[data-v-a7216922] {\n position: absolute;\n top: 0;\n cursor: ew-resize;\n height: 100vh;\n padding-left: 5px;\n z-index: 1;\n}\n.rule-horizontal .lines .line .anction[data-v-a7216922] {\n position: absolute;\n top: 24px;\n display: flex;\n justify-content: center;\n align-items: center;\n user-select: none;\n}\n.rule-horizontal .lines .line .anction .del[data-v-a7216922] {\n padding: 0;\n font-size: 20px;\n font-weight: 600;\n cursor: pointer;\n}\n.rule-horizontal .lines .line .anction .value[data-v-a7216922] {\n pointer-events: none;\n margin-left: 5px;\n transform: translateY(3px);\n}\n.rule-horizontal .indicator[data-v-a7216922] {\n position: absolute;\n pointer-events: none;\n top: 0;\n height: 100vh;\n z-index: 1;\n}\n.rule-horizontal .indicator .value[data-v-a7216922] {\n position: absolute;\n width: auto;\n padding: 0 2px;\n margin-top: 4px;\n margin-left: 4px;\n}\n.rule-vertical[data-v-a7216922] {\n position: absolute;\n top: 24px;\n width: 24px;\n height: calc(100% - 24px);\n font-size: 12px;\n}\n.rule-vertical .lines .line[data-v-a7216922] {\n position: absolute;\n top: 0;\n cursor: ns-resize;\n width: 100vw;\n padding-top: 5px;\n z-index: 1;\n}\n.rule-vertical .lines .line .anction[data-v-a7216922] {\n position: absolute;\n left: 24px;\n display: flex;\n justify-content: center;\n align-items: center;\n user-select: none;\n}\n.rule-vertical .lines .line .anction .del[data-v-a7216922] {\n padding: 0;\n font-size: 20px;\n font-weight: 600;\n cursor: pointer;\n}\n.rule-vertical .lines .line .anction .value[data-v-a7216922] {\n pointer-events: none;\n margin-left: 5px;\n transform: translateY(3px);\n}\n.rule-vertical .indicator[data-v-a7216922] {\n position: absolute;\n pointer-events: none;\n top: 0;\n width: 100vw;\n z-index: 1;\n}\n.rule-vertical .indicator .value[data-v-a7216922] {\n position: absolute;\n left: 0;\n width: auto;\n padding: 0 2px;\n margin-top: -5px;\n margin-left: 2px;\n transform: rotate(-90deg);\n transform-origin: 0 0;\n}\ncanvas[data-v-a7216922] {\n background: #292929;\n pointer-events: auto;\n}\n", map: {"version":3,"sources":["SketchRule.vue"],"names":[],"mappings":"AAAA;EACE,sBAAsB;EACtB,mBAAmB;EACnB,sBAAsB;EACtB,sBAAsB;EACtB,oBAAoB;EACpB,mBAAmB;EACnB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,iBAAiB;EACjB,6BAA6B;EAC7B,wCAAwC;AAC1C;AACA;EACE,kBAAkB;EAClB,UAAU;EACV,wBAAwB;EACxB,eAAe;AACjB;AACA;EACE,kBAAkB;EAClB,MAAM;EACN,iBAAiB;EACjB,aAAa;EACb,iBAAiB;EACjB,UAAU;AACZ;AACA;EACE,kBAAkB;EAClB,SAAS;EACT,aAAa;EACb,uBAAuB;EACvB,mBAAmB;EACnB,iBAAiB;AACnB;AACA;EACE,UAAU;EACV,eAAe;EACf,gBAAgB;EAChB,eAAe;AACjB;AACA;EACE,oBAAoB;EACpB,gBAAgB;EAChB,0BAA0B;AAC5B;AACA;EACE,kBAAkB;EAClB,oBAAoB;EACpB,MAAM;EACN,aAAa;EACb,UAAU;AACZ;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,cAAc;EACd,eAAe;EACf,gBAAgB;AAClB;AACA;EACE,kBAAkB;EAClB,SAAS;EACT,WAAW;EACX,yBAAyB;EACzB,eAAe;AACjB;AACA;EACE,kBAAkB;EAClB,MAAM;EACN,iBAAiB;EACjB,YAAY;EACZ,gBAAgB;EAChB,UAAU;AACZ;AACA;EACE,kBAAkB;EAClB,UAAU;EACV,aAAa;EACb,uBAAuB;EACvB,mBAAmB;EACnB,iBAAiB;AACnB;AACA;EACE,UAAU;EACV,eAAe;EACf,gBAAgB;EAChB,eAAe;AACjB;AACA;EACE,oBAAoB;EACpB,gBAAgB;EAChB,0BAA0B;AAC5B;AACA;EACE,kBAAkB;EAClB,oBAAoB;EACpB,MAAM;EACN,YAAY;EACZ,UAAU;AACZ;AACA;EACE,kBAAkB;EAClB,OAAO;EACP,WAAW;EACX,cAAc;EACd,gBAAgB;EAChB,gBAAgB;EAChB,yBAAyB;EACzB,qBAAqB;AACvB;AACA;EACE,mBAAmB;EACnB,oBAAoB;AACtB","file":"SketchRule.vue","sourcesContent":[":export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.rule-horizontal {\n position: absolute;\n left: 24px;\n width: calc(100% - 24px);\n font-size: 12px;\n}\n.rule-horizontal .lines .line {\n position: absolute;\n top: 0;\n cursor: ew-resize;\n height: 100vh;\n padding-left: 5px;\n z-index: 1;\n}\n.rule-horizontal .lines .line .anction {\n position: absolute;\n top: 24px;\n display: flex;\n justify-content: center;\n align-items: center;\n user-select: none;\n}\n.rule-horizontal .lines .line .anction .del {\n padding: 0;\n font-size: 20px;\n font-weight: 600;\n cursor: pointer;\n}\n.rule-horizontal .lines .line .anction .value {\n pointer-events: none;\n margin-left: 5px;\n transform: translateY(3px);\n}\n.rule-horizontal .indicator {\n position: absolute;\n pointer-events: none;\n top: 0;\n height: 100vh;\n z-index: 1;\n}\n.rule-horizontal .indicator .value {\n position: absolute;\n width: auto;\n padding: 0 2px;\n margin-top: 4px;\n margin-left: 4px;\n}\n.rule-vertical {\n position: absolute;\n top: 24px;\n width: 24px;\n height: calc(100% - 24px);\n font-size: 12px;\n}\n.rule-vertical .lines .line {\n position: absolute;\n top: 0;\n cursor: ns-resize;\n width: 100vw;\n padding-top: 5px;\n z-index: 1;\n}\n.rule-vertical .lines .line .anction {\n position: absolute;\n left: 24px;\n display: flex;\n justify-content: center;\n align-items: center;\n user-select: none;\n}\n.rule-vertical .lines .line .anction .del {\n padding: 0;\n font-size: 20px;\n font-weight: 600;\n cursor: pointer;\n}\n.rule-vertical .lines .line .anction .value {\n pointer-events: none;\n margin-left: 5px;\n transform: translateY(3px);\n}\n.rule-vertical .indicator {\n position: absolute;\n pointer-events: none;\n top: 0;\n width: 100vw;\n z-index: 1;\n}\n.rule-vertical .indicator .value {\n position: absolute;\n left: 0;\n width: auto;\n padding: 0 2px;\n margin-top: -5px;\n margin-left: 2px;\n transform: rotate(-90deg);\n transform-origin: 0 0;\n}\ncanvas {\n background: #292929;\n pointer-events: auto;\n}\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__$4 = "data-v-a7216922"; + /* module identifier */ + const __vue_module_identifier__$4 = undefined; + /* functional template */ + const __vue_is_functional_template__$4 = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$4 = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$4, staticRenderFns: __vue_staticRenderFns__$4 }, + __vue_inject_styles__$4, + __vue_script__$4, + __vue_scope_id__$4, + __vue_is_functional_template__$4, + __vue_module_identifier__$4, + false, + createInjector, + undefined, + undefined + ); + +var script$3 = { + name: 'Ruler', + props: { + width: { + type: Number + }, + height: { + type: Number + }, + perspectiveX: { + type: Number, + default: 0 + }, + perspectiveY: { + type: Number, + default: 0 + }, + layoutX: { + type: Array, + default: function _default() { + return []; + } + }, + layoutY: { + type: Array, + default: function _default() { + return []; + } + }, + scale: { + type: Number, + default: 1 + } + }, + components: { + SketchRule: __vue_component__$4 + }, + data: function data() { + return {}; + } +}; + +/* script */ +const __vue_script__$3 = script$3; + +/* template */ +var __vue_render__$3 = function () { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c( + "div", + { staticClass: "ruler" }, + [ + _c("svg-icon", { + staticClass: "rule-panel-lock", + attrs: { type: "editor-lock" }, + }), + _vm._v(" "), + _c("SketchRule", { + ref: "horizontal", + attrs: { + width: _vm.width, + height: _vm.height, + perspective: _vm.perspectiveX, + layout: _vm.layoutX, + scale: _vm.scale, + }, + }), + _vm._v(" "), + _c("SketchRule", { + ref: "vertical", + attrs: { + mode: "vertical", + width: _vm.width, + height: _vm.height, + perspective: _vm.perspectiveY, + layout: _vm.layoutY, + scale: _vm.scale, + }, + }), + _vm._v(" "), + _vm._t("container"), + ], + 2 + ) +}; +var __vue_staticRenderFns__$3 = []; +__vue_render__$3._withStripped = true; + + /* style */ + const __vue_inject_styles__$3 = function (inject) { + if (!inject) return + inject("data-v-2bdc2ee0_0", { source: "[data-v-2bdc2ee0]:export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.ruler[data-v-2bdc2ee0] {\n position: relative;\n background-image: linear-gradient(90deg, #141414 14px, transparent 0), linear-gradient(0deg, transparent 14px, rgba(48, 48, 48, 0.64) 0);\n background-size: 17px 17px;\n background-position: 15px, 20px, 0, 0;\n width: 100%;\n overflow: hidden;\n}\n.ruler .rule-panel-lock[data-v-2bdc2ee0] {\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n width: 24px;\n height: 24px;\n cursor: pointer;\n}\n", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,sBAAsB;EACtB,mBAAmB;EACnB,sBAAsB;EACtB,sBAAsB;EACtB,oBAAoB;EACpB,mBAAmB;EACnB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,iBAAiB;EACjB,6BAA6B;EAC7B,wCAAwC;AAC1C;AACA;EACE,kBAAkB;EAClB,wIAAwI;EACxI,0BAA0B;EAC1B,qCAAqC;EACrC,WAAW;EACX,gBAAgB;AAClB;AACA;EACE,aAAa;EACb,uBAAuB;EACvB,mBAAmB;EACnB,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,eAAe;AACjB","file":"index.vue","sourcesContent":[":export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.ruler {\n position: relative;\n background-image: linear-gradient(90deg, #141414 14px, transparent 0), linear-gradient(0deg, transparent 14px, rgba(48, 48, 48, 0.64) 0);\n background-size: 17px 17px;\n background-position: 15px, 20px, 0, 0;\n width: 100%;\n overflow: hidden;\n}\n.ruler .rule-panel-lock {\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n width: 24px;\n height: 24px;\n cursor: pointer;\n}\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__$3 = "data-v-2bdc2ee0"; + /* module identifier */ + const __vue_module_identifier__$3 = undefined; + /* functional template */ + const __vue_is_functional_template__$3 = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$3 = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$3, staticRenderFns: __vue_staticRenderFns__$3 }, + __vue_inject_styles__$3, + __vue_script__$3, + __vue_scope_id__$3, + __vue_is_functional_template__$3, + __vue_module_identifier__$3, + false, + createInjector, + undefined, + undefined + ); + +var script$2 = { + name: 'Size', + components: _defineProperty({}, antDesignVue.Input.name, antDesignVue.Input), + props: { + width: { + type: Number, + default: 0 + }, + height: { + type: Number, + default: 0 + } + }, + computed: { + resize: function resize() { + return !this.w.disabled && !this.h.disabled; + } + }, + watch: { + width: { + immediate: true, + handler: function handler(val, oldVal) { + this.w = _objectSpread2(_objectSpread2({}, this.w), {}, { + value: val + }); + } + }, + height: { + immediate: true, + handler: function handler(val, oldVal) { + this.h = _objectSpread2(_objectSpread2({}, this.h), {}, { + value: val + }); + } + }, + resize: { + immediate: true, + handler: function handler(val) { + this.$emit('size', val); + } + } + }, + data: function data() { + return { + w: { + value: this.width, + disabled: false + }, + h: { + value: this.height, + disabled: false + } + }; + } +}; + +/* script */ +const __vue_script__$2 = script$2; + +/* template */ +var __vue_render__$2 = function () { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c("div", { staticClass: "size" }, [ + _c( + "div", + { staticClass: "size-item" }, + [ + _c("a-input", { + staticClass: "size-item-input", + attrs: { disabled: _vm.w.disabled, suffix: "W" }, + on: { + change: function ($event) { + _vm.$emit("update:width", Number(_vm.w.value)); + }, + }, + model: { + value: _vm.w.value, + callback: function ($$v) { + _vm.$set(_vm.w, "value", $$v); + }, + expression: "w.value", + }, + }), + _vm._v(" "), + _c("svg-icon", { + attrs: { type: _vm.w.disabled ? "editor-lock" : "editor-unlock" }, + on: { + click: function ($event) { + _vm.w.disabled = !_vm.w.disabled; + }, + }, + }), + ], + 1 + ), + _vm._v(" "), + _c( + "div", + { staticClass: "size-item" }, + [ + _c("a-input", { + staticClass: "size-item-input", + attrs: { disabled: _vm.h.disabled, suffix: "H" }, + on: { + change: function ($event) { + _vm.$emit("update:height", Number(_vm.h.value)); + }, + }, + model: { + value: _vm.h.value, + callback: function ($$v) { + _vm.$set(_vm.h, "value", $$v); + }, + expression: "h.value", + }, + }), + _vm._v(" "), + _c("svg-icon", { + attrs: { type: _vm.h.disabled ? "editor-lock" : "editor-unlock" }, + on: { + click: function ($event) { + _vm.h.disabled = !_vm.h.disabled; + }, + }, + }), + ], + 1 + ), + ]) +}; +var __vue_staticRenderFns__$2 = []; +__vue_render__$2._withStripped = true; + + /* style */ + const __vue_inject_styles__$2 = function (inject) { + if (!inject) return + inject("data-v-eebdab88_0", { source: "[data-v-eebdab88]:export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.size[data-v-eebdab88] {\n display: flex;\n align-items: center;\n justify-content: left;\n}\n.size[data-v-eebdab88] .ant-input {\n background-color: transparent;\n}\n.size[data-v-eebdab88] .ant-input-disabled {\n color: #595959;\n}\n.size-item[data-v-eebdab88] {\n flex: 1;\n}\n.size-item-input[data-v-eebdab88] {\n width: 70%;\n margin-right: 10px;\n}\n", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,sBAAsB;EACtB,mBAAmB;EACnB,sBAAsB;EACtB,sBAAsB;EACtB,oBAAoB;EACpB,mBAAmB;EACnB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,iBAAiB;EACjB,6BAA6B;EAC7B,wCAAwC;AAC1C;AACA;EACE,aAAa;EACb,mBAAmB;EACnB,qBAAqB;AACvB;AACA;EACE,6BAA6B;AAC/B;AACA;EACE,cAAc;AAChB;AACA;EACE,OAAO;AACT;AACA;EACE,UAAU;EACV,kBAAkB;AACpB","file":"index.vue","sourcesContent":[":export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.size {\n display: flex;\n align-items: center;\n justify-content: left;\n}\n.size /deep/ .ant-input {\n background-color: transparent;\n}\n.size /deep/ .ant-input-disabled {\n color: #595959;\n}\n.size-item {\n flex: 1;\n}\n.size-item-input {\n width: 70%;\n margin-right: 10px;\n}\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__$2 = "data-v-eebdab88"; + /* module identifier */ + const __vue_module_identifier__$2 = undefined; + /* functional template */ + const __vue_is_functional_template__$2 = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$2 = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$2, staticRenderFns: __vue_staticRenderFns__$2 }, + __vue_inject_styles__$2, + __vue_script__$2, + __vue_scope_id__$2, + __vue_is_functional_template__$2, + __vue_module_identifier__$2, + false, + createInjector, + undefined, + undefined + ); + +var script$1 = { + name: 'SvgIcon', + components: _defineProperty({}, antDesignVue.Icon.name, antDesignVue.Icon), + props: { + type: { + type: String + } + }, + data: function data() { + return { + SVG_TYPES: SVG_TYPES + }; + } +}; + +/* script */ +const __vue_script__$1 = script$1; + +/* template */ +var __vue_render__$1 = function () { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c("a-icon", { + attrs: { type: _vm.type, component: _vm.SVG_TYPES["lcd-icon-" + _vm.type] }, + on: { + click: function ($event) { + return _vm.$emit("click") + }, + }, + }) +}; +var __vue_staticRenderFns__$1 = []; +__vue_render__$1._withStripped = true; + + /* style */ + const __vue_inject_styles__$1 = undefined; + /* scoped */ + const __vue_scope_id__$1 = undefined; + /* module identifier */ + const __vue_module_identifier__$1 = undefined; + /* functional template */ + const __vue_is_functional_template__$1 = false; + /* style inject */ + + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$1 = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$1, staticRenderFns: __vue_staticRenderFns__$1 }, + __vue_inject_styles__$1, + __vue_script__$1, + __vue_scope_id__$1, + __vue_is_functional_template__$1, + __vue_module_identifier__$1, + false, + undefined, + undefined, + undefined + ); + +// +var script = { + name: 'Thumbnail', + mixins: [window$1], + props: { + src: { + type: String, + default: '' + }, + avatar: { + type: String, + default: '' + } + } +}; + +/* script */ +const __vue_script__ = script; + +/* template */ +var __vue_render__ = function () { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c( + "div", + { staticClass: "thumbnail" }, + [ + !_vm.src + ? [ + _c("div", { staticClass: "thumbnail-default" }, [ + _c("img", { + staticClass: "thumbnail-default-avatar", + attrs: { src: _vm.avatar, alt: "default" }, + }), + _vm._v(" "), + _vm.windowWidth >= 1200 + ? _c("span", { staticClass: "thumbnail-default-tooltip" }, [ + _vm._v("暂无封面"), + ]) + : _vm._e(), + ]), + ] + : [ + _c("img", { + staticClass: "thumbnail-image", + attrs: { src: _vm.src, alt: "thumbnail" }, + }), + ], + ], + 2 + ) +}; +var __vue_staticRenderFns__ = []; +__vue_render__._withStripped = true; + + /* style */ + const __vue_inject_styles__ = function (inject) { + if (!inject) return + inject("data-v-12393bd0_0", { source: ":export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.thumbnail {\n aspect-ratio: 1.77777778;\n}\n.thumbnail-default {\n width: 100%;\n height: 100%;\n background-color: #141414;\n border: 1px solid #3779ee;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n}\n.thumbnail-default-avatar {\n width: 40%;\n}\n.thumbnail-default-tooltip {\n margin-top: 22px;\n}\n.thumbnail-image {\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["index.vue","C:\\Users\\lihq1\\Desktop\\开源\\vue-lcd-engine\\components\\Thumbnail\\index.vue"],"names":[],"mappings":"AAAA;EACE,sBAAsB;EACtB,mBAAmB;EACnB,sBAAsB;EACtB,sBAAsB;EACtB,oBAAoB;EACpB,mBAAmB;EACnB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,iBAAiB;EACjB,6BAA6B;EAC7B,wCAAwC;AAC1C;AACA;EACE,wBAAwB;AAC1B;AACA;EACE,WAAW;EACX,YAAY;EACZ,yBAAyB;EACzB,yBAAyB;EACzB,aAAa;EACb,mBAAmB;EACnB,uBAAuB;EACvB,sBAAsB;AACxB;AACA;EACE,UAAU;AACZ;AACA;EACE,gBAAgB;ACClB;AACA;EACA,WAAA;EDCE,YAAY;ACCd","file":"index.vue","sourcesContent":[":export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.thumbnail {\n aspect-ratio: 1.77777778;\n}\n.thumbnail-default {\n width: 100%;\n height: 100%;\n background-color: #141414;\n border: 1px solid #3779ee;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n}\n.thumbnail-default-avatar {\n width: 40%;\n}\n.thumbnail-default-tooltip {\n margin-top: 22px;\n}\n.thumbnail-image {\n width: 100%;\n height: 100%;\n}\n","\r\n\r\n\r\n\r\n\r\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__ = undefined; + /* module identifier */ + const __vue_module_identifier__ = undefined; + /* functional template */ + const __vue_is_functional_template__ = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__ = /*#__PURE__*/normalizeComponent( + { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ }, + __vue_inject_styles__, + __vue_script__, + __vue_scope_id__, + __vue_is_functional_template__, + __vue_module_identifier__, + false, + createInjector, + undefined, + undefined + ); + +[__vue_component__$b, __vue_component__$a, __vue_component__$9, __vue_component__$8, __vue_component__$7, __vue_component__$6, __vue_component__$5, __vue_component__$3, __vue_component__$2, __vue_component__$1, __vue_component__].forEach(function (item) { + item.install = function (Vue) { + Vue.component(item.name, item); + }; +}); + +exports.Cascader = __vue_component__$b; +exports.ComponentBox = __vue_component__$a; +exports.ConfigItem = __vue_component__$9; +exports.EditScreens = __vue_component__$8; +exports.Feedback = __vue_component__$7; +exports.Layout = __vue_component__$6; +exports.Loading = __vue_component__$5; +exports.Ruler = __vue_component__$3; +exports.Size = __vue_component__$2; +exports.SvgIcon = __vue_component__$1; +exports.Thumbnail = __vue_component__; diff --git a/dist/vue-lcd-engine.cjs.min.js b/dist/vue-lcd-engine.cjs.min.js new file mode 100644 index 0000000000000000000000000000000000000000..92293cce7fc6b5372cb71b1fd8266bc2a0095ef2 --- /dev/null +++ b/dist/vue-lcd-engine.cjs.min.js @@ -0,0 +1 @@ +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("core-js/modules/es.object.to-string.js"),require("core-js/modules/web.dom-collections.for-each.js"),require("core-js/modules/es.function.name.js"),require("core-js/modules/es.array.find-index.js"),require("core-js/modules/es.array.find.js"),require("core-js/modules/es.number.constructor.js");var t=require("ant-design-vue");require("core-js/modules/es.json.stringify.js");var e=require("lodash");function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t){var e=function(t,e){if("object"!=n(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,e||"default");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==n(e)?e:String(e)}function r(t,e,n){return(e=i(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}require("core-js/modules/es.set.js"),require("core-js/modules/es.string.iterator.js"),require("core-js/modules/web.dom-collections.iterator.js"),require("core-js/modules/es.array.filter.js"),require("core-js/modules/es.array.includes.js"),require("core-js/modules/es.error.cause.js"),require("core-js/modules/es.regexp.constructor.js"),require("core-js/modules/es.regexp.dot-all.js"),require("core-js/modules/es.regexp.exec.js"),require("core-js/modules/es.regexp.sticky.js"),require("core-js/modules/es.regexp.to-string.js"),require("core-js/modules/es.regexp.test.js"),require("core-js/modules/es.string.includes.js"),require("core-js/modules/es.array.fill.js"),require("core-js/modules/es.object.keys.js"),require("core-js/modules/es.array.push.js"),require("core-js/modules/es.string.replace.js"),require("core-js/modules/es.number.to-fixed.js"),require("core-js/modules/es.array.concat.js"),require("core-js/modules/es.array.splice.js");var o={name:"CascaderItem",components:r({},t.Tooltip.name,t.Tooltip),props:{optionsItem:{type:Array,default:function(){return[]}},selected:{type:Object,default:function(){return{}}},mode:{type:String,default:"horizontal"},indexLevel:{type:Number,default:1},tooltip:{type:Boolean,default:!1},showTitle:{type:Boolean,default:!0}},data:function(){return{}},methods:{handleSelected:function(t){this.$emit("handleSelected",t,this.indexLevel)}}};function a(t,e,n,i,r,o,a,s,l,c){"boolean"!=typeof a&&(l=s,s=a,a=!1);const d="function"==typeof n?n.options:n;let h;if(t&&t.render&&(d.render=t.render,d.staticRenderFns=t.staticRenderFns,d._compiled=!0,r&&(d.functional=!0)),i&&(d._scopeId=i),o?(h=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(o)},d._ssrRegister=h):e&&(h=a?function(t){e.call(this,c(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,s(t))}),h)if(d.functional){const t=d.render;d.render=function(e,n){return h.call(n),t(e,n)}}else{const t=d.beforeCreate;d.beforeCreate=t?[].concat(t,h):[h]}return n}const s="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());function l(t){return(t,e)=>function(t,e){const n=s?e.media||"default":t,i=d[n]||(d[n]={ids:new Set,styles:[]});if(!i.ids.has(t)){i.ids.add(t);let n=e.source;if(e.map&&(n+="\n/*# sourceURL="+e.map.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e.map))))+" */"),i.element||(i.element=document.createElement("style"),i.element.type="text/css",e.media&&i.element.setAttribute("media",e.media),void 0===c&&(c=document.head||document.getElementsByTagName("head")[0]),c.appendChild(i.element)),"styleSheet"in i.element)i.styles.push(n),i.element.styleSheet.cssText=i.styles.filter(Boolean).join("\n");else{const t=i.ids.size-1,e=document.createTextNode(n),r=i.element.childNodes;r[t]&&i.element.removeChild(r[t]),r.length?i.element.insertBefore(e,r[t]):i.element.appendChild(e)}}}(t,e)}let c;const d={};const h=o;var A=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ul",{staticClass:"cascader-item-content"},t._l(t.optionsItem,(function(e,i){var r;return n("li",{key:i,class:["cascader-item","cascader-item-"+t.mode,(r={},r["cascader-item-"+t.mode+"-active"]=t.selected===e,r)],on:{click:function(n){return t.handleSelected(e)}}},[n("a-tooltip",{attrs:{placement:"rightBottom"},scopedSlots:t._u([t.tooltip?{key:"title",fn:function(){return[n("span",[t._v(t._s(e.label))])]},proxy:!0}:null],null,!0)},[t._v(" "),n("div",[t._t("icon-title",(function(){return[t.selected===e?[n("svg-icon",{attrs:{type:e.iconHover}})]:[e.icon?n("svg-icon",{attrs:{type:e.icon}}):t._e()]]}))],2)]),t._v(" "),n("a-tooltip",{attrs:{placement:"rightBottom"},scopedSlots:t._u([t.tooltip?{key:"title",fn:function(){return[n("span",[t._v(t._s(e.label))])]},proxy:!0}:null],null,!0)},[t._v(" "),t.showTitle?n("span",{staticClass:"cascader-item-name"},[t._v(t._s(e.label))]):t._e()])],1)})),0)};A._withStripped=!0;const p=a({render:A,staticRenderFns:[]},(function(t){t&&t("data-v-cb71bf0e_0",{source:"[data-v-cb71bf0e]:export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.cascader-item-content[data-v-cb71bf0e] {\n margin-top: 1px;\n padding: 0;\n box-sizing: border-box;\n width: 100%;\n}\n.cascader-item-content .cascader-item[data-v-cb71bf0e] {\n width: 100%;\n cursor: pointer;\n}\n.cascader-item-content .cascader-item-horizontal[data-v-cb71bf0e] {\n display: flex;\n align-items: center;\n height: 48px;\n}\n.cascader-item-content .cascader-item-horizontal i[data-v-cb71bf0e] {\n margin: 0 10px 0 15px;\n}\n.cascader-item-content .cascader-item-horizontal i.anticon[data-v-cb71bf0e] {\n pointer-events: none;\n}\n.cascader-item-content .cascader-item-vertical[data-v-cb71bf0e] {\n display: flex;\n justify-content: center;\n flex-direction: column;\n align-items: center;\n margin: 11px 6px;\n width: calc(100% - 12px);\n height: 80px;\n}\n.cascader-item-content .cascader-item-vertical i[data-v-cb71bf0e] {\n pointer-events: none;\n}\n.cascader-item-content .cascader-item-vertical-active[data-v-cb71bf0e] {\n color: #ffffff;\n background-color: #2c2c2c;\n}\n.cascader-item-content .cascader-item-horizontal-active[data-v-cb71bf0e] {\n color: #ffffff;\n background-color: #1a1a1a;\n}\n",map:{version:3,sources:["CascaderItem.vue"],names:[],mappings:"AAAA;EACE,sBAAsB;EACtB,mBAAmB;EACnB,sBAAsB;EACtB,sBAAsB;EACtB,oBAAoB;EACpB,mBAAmB;EACnB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,iBAAiB;EACjB,6BAA6B;EAC7B,wCAAwC;AAC1C;AACA;EACE,eAAe;EACf,UAAU;EACV,sBAAsB;EACtB,WAAW;AACb;AACA;EACE,WAAW;EACX,eAAe;AACjB;AACA;EACE,aAAa;EACb,mBAAmB;EACnB,YAAY;AACd;AACA;EACE,qBAAqB;AACvB;AACA;EACE,oBAAoB;AACtB;AACA;EACE,aAAa;EACb,uBAAuB;EACvB,sBAAsB;EACtB,mBAAmB;EACnB,gBAAgB;EAChB,wBAAwB;EACxB,YAAY;AACd;AACA;EACE,oBAAoB;AACtB;AACA;EACE,cAAc;EACd,yBAAyB;AAC3B;AACA;EACE,cAAc;EACd,yBAAyB;AAC3B",file:"CascaderItem.vue",sourcesContent:[":export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.cascader-item-content {\n margin-top: 1px;\n padding: 0;\n box-sizing: border-box;\n width: 100%;\n}\n.cascader-item-content .cascader-item {\n width: 100%;\n cursor: pointer;\n}\n.cascader-item-content .cascader-item-horizontal {\n display: flex;\n align-items: center;\n height: 48px;\n}\n.cascader-item-content .cascader-item-horizontal i {\n margin: 0 10px 0 15px;\n}\n.cascader-item-content .cascader-item-horizontal i.anticon {\n pointer-events: none;\n}\n.cascader-item-content .cascader-item-vertical {\n display: flex;\n justify-content: center;\n flex-direction: column;\n align-items: center;\n margin: 11px 6px;\n width: calc(100% - 12px);\n height: 80px;\n}\n.cascader-item-content .cascader-item-vertical i {\n pointer-events: none;\n}\n.cascader-item-content .cascader-item-vertical-active {\n color: #ffffff;\n background-color: #2c2c2c;\n}\n.cascader-item-content .cascader-item-horizontal-active {\n color: #ffffff;\n background-color: #1a1a1a;\n}\n"]},media:void 0})}),h,"data-v-cb71bf0e",false,undefined,!1,l,void 0,void 0);var u={"lcd-icon-editor-center_normal":{template:'\n \n 编组\n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-float_selected":{template:'\n \n 编组备份\n \n \n \n \n \n \n \n '},"lcd-icon-editor-background_normal":{template:'\n \n 编组 3\n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-component_selected":{template:'\n \n 形状\n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-background_selected":{template:'\n \n 编组备份 4\n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-center_selected":{template:'\n \n 编组备份 2\n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-collapse":{template:'\n \n 路径\n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-exit":{template:'\n \n 形状 2\n \n \n \n \n \n \n \n \n \n '},"lcd-icon-home-checked":{template:'\n \n 形状\n \n \n \n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-handbook_hover":{template:'\n \n 编组 20备份\n \n \n \n \n \n \n \n '},"lcd-icon-editor-handbook_normal":{template:'\n \n 编组 20\n \n \n \n \n \n \n \n '},"lcd-icon-editor-expand":{template:'\n \n 编组 29\n \n \n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-float_normal":{template:'\n \n 编组 4\n \n \n \n \n \n \n \n '},"lcd-icon-home-more":{template:'\n \n 编组 13\n \n \n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-panel_normal":{template:'\n \n 编组 2\n \n \n \n \n \n \n \n '},"lcd-icon-editor-redo":{template:'\n \n 编组 38\n \n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-home-delete":{template:'\n \n 编组 15\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-panel_selected":{template:'\n \n 编组备份 3\n \n \n \n \n \n \n \n '},"lcd-icon-editor-preview":{template:'\n \n 编组 31\n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-undo":{template:'\n \n 编组 32\n \n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-remove":{template:'\n \n 编组 47\n \n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-save":{template:'\n \n 形状\n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-home-tooltip":{template:'\n \n 编组 13\n \n \n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-restore":{template:'\n \n 路径\n \n \n \n \n \n \n \n \n \n '},"lcd-icon-home-base":{template:'\n \n 编组 14\n \n \n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-lock":{template:'\n \n 编组 49\n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-home-confirm":{template:'\n \n 编组 12\n \n \n \n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-home-edit":{template:'\n \n 编组 14\n \n \n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-home-emtry":{template:'\n \n 编组 12\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-logo":{template:'\n \n 形状\n \n \n \n \n \n \n \n '},"lcd-icon-editor-unlock":{template:'\n \n 编组 48\n \n \n \n \n \n \n \n \n \n \n '}};const f={name:"CascaderComponent",props:{options:{type:Array,default:function(){return[]}},layout:{type:String,default:"biserial"},cover:String,proxyName:String},data:function(){return{}},methods:{handleDragStart:function(t,n){var i;null==t||null===(i=t.dataTransfer)||void 0===i||i.setData("ChartData",JSON.stringify(e.omit(n,["coverAddress"])))},handleDragEnd:function(){}}};var m=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"cascader-component"},t._l(t.options,(function(e,i){return n("div",{key:i,class:["cascader-component-draggle","cascader-component-draggle-"+t.layout]},[n("div",{staticClass:"cascader-component-draggle-title"},[t._v(t._s(e.label))]),t._v(" "),n("div",{staticClass:"cascader-component-draggle-warp",attrs:{draggable:"true"},on:{dragstart:function(n){return t.handleDragStart(n,e)},dragend:t.handleDragEnd}},[n("img",{staticClass:"list-img",attrs:{src:e.coverAddress?t.proxyName+"/"+e.coverAddress:t.cover,alt:e.coverAddress?t.proxyName+"/"+e.coverAddress:t.cover}})])])})),0)};m._withStripped=!0;const C=a({render:m,staticRenderFns:[]},(function(t){t&&t("data-v-f4e622b4_0",{source:"[data-v-f4e622b4]:export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.cascader-component[data-v-f4e622b4] {\n width: 100%;\n height: auto;\n}\n.cascader-component-draggle[data-v-f4e622b4] {\n margin: 12px;\n background: #2e2e2e;\n width: calc(100% - 26px);\n cursor: pointer;\n border: 1px solid transparent;\n}\n.cascader-component-draggle[data-v-f4e622b4]:hover {\n border: 1px solid #3779ee;\n}\n.cascader-component-draggle:hover .list-img[data-v-f4e622b4] {\n transform: scale(1.05);\n}\n.cascader-component-draggle .cascader-component-draggle-title[data-v-f4e622b4] {\n padding: 0 12px;\n box-sizing: border-box;\n color: rgba(255, 255, 255, 0.6);\n font-size: 14px;\n height: 36px;\n line-height: 36px;\n}\n.cascader-component-draggle .cascader-component-draggle-warp[data-v-f4e622b4] {\n display: flex;\n justify-content: center;\n align-content: center;\n text-align: center;\n padding: 0 12px 15px 12px;\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n}\n.cascader-component-draggle .cascader-component-draggle-warp .list-img[data-v-f4e622b4] {\n width: 100%;\n height: 100%;\n border-radius: 2px;\n object-fit: contain;\n transition: all 0.5s;\n}\n",map:{version:3,sources:["CascaderComponent.vue","C:\\Users\\lihq1\\Desktop\\开源\\vue-lcd-engine\\components\\Cascader\\components\\CascaderComponent.vue"],names:[],mappings:"AAAA;EACE,sBAAsB;EACtB,mBAAmB;EACnB,sBAAsB;EACtB,sBAAsB;EACtB,oBAAoB;EACpB,mBAAmB;EACnB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,iBAAiB;EACjB,6BAA6B;EAC7B,wCAAwC;AAC1C;AACA;EACE,WAAW;EACX,YAAY;AACd;AACA;EACE,YAAY;EACZ,mBAAmB;EACnB,wBAAwB;EACxB,eAAe;EACf,6BAA6B;AAC/B;AACA;EACE,yBAAyB;AAC3B;AACA;EACE,sBAAsB;AACxB;AACA;EACE,eAAe;EACf,sBAAsB;EACtB,+BAA+B;EAC/B,eAAe;EACf,YAAY;EACZ,iBAAiB;AACnB;AACA;EACE,aAAa;EACb,uBAAuB;EACvB,qBAAqB;EACrB,kBAAkB;EAClB,yBAAyB;EACzB,sBAAsB;EACtB,WAAW;EACX,YAAY;AACd;AACA;EACE,WAAW;EACX,YAAY;EACZ,kBAAkB;EAClB,mBAAmB;EACnB,oBAAoB;ACCtB",file:"CascaderComponent.vue",sourcesContent:[":export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.cascader-component {\n width: 100%;\n height: auto;\n}\n.cascader-component-draggle {\n margin: 12px;\n background: #2e2e2e;\n width: calc(100% - 26px);\n cursor: pointer;\n border: 1px solid transparent;\n}\n.cascader-component-draggle:hover {\n border: 1px solid #3779ee;\n}\n.cascader-component-draggle:hover .list-img {\n transform: scale(1.05);\n}\n.cascader-component-draggle .cascader-component-draggle-title {\n padding: 0 12px;\n box-sizing: border-box;\n color: rgba(255, 255, 255, 0.6);\n font-size: 14px;\n height: 36px;\n line-height: 36px;\n}\n.cascader-component-draggle .cascader-component-draggle-warp {\n display: flex;\n justify-content: center;\n align-content: center;\n text-align: center;\n padding: 0 12px 15px 12px;\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n}\n.cascader-component-draggle .cascader-component-draggle-warp .list-img {\n width: 100%;\n height: 100%;\n border-radius: 2px;\n object-fit: contain;\n transition: all 0.5s;\n}\n",'\r\n\r\n\r\n\r\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__$c = "data-v-f4e622b4"; + /* module identifier */ + const __vue_module_identifier__$c = undefined; + /* functional template */ + const __vue_is_functional_template__$c = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$c = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$c, staticRenderFns: __vue_staticRenderFns__$c }, + __vue_inject_styles__$c, + __vue_script__$c, + __vue_scope_id__$c, + __vue_is_functional_template__$c, + __vue_module_identifier__$c, + false, + createInjector, + undefined, + undefined + ); + +var window$1 = { + data: function data() { + return { + windowWidth: null, + // 存放窗口宽度的状态值 + windowHeight: null // 存放窗口高度的状态值 + }; + }, + mounted: function mounted() { + this.updateWindowSize(); // 初始化获取当前窗口宽度 + + window.addEventListener('resize', this.handleResize); // 添加窗口大小改变的事件监听器 + }, + beforeDestroy: function beforeDestroy() { + window.removeEventListener('resize', this.handleResize); // 在组件销毁之前移除事件监听器 + }, + methods: { + updateWindowSize: function updateWindowSize() { + this.windowWidth = window.innerWidth; // 将当前窗口宽度赋值给状态值 + this.windowHeight = window.innerHeight; // 将当前窗口宽度赋值给状态值 + }, + handleResize: throttle(function (event) { + this.updateWindowSize(); + this.$router.go(0); + }, 500) + } +}; + +var script$b = { + name: 'Cascader', + mixins: [window$1], + components: _defineProperty({ + CascaderItem: __vue_component__$d, + CascaderComponent: __vue_component__$c + }, Spin.name, Spin), + props: { + proxyName: { + type: String, + default: 'tgcos' + }, + cover: { + type: String, + default: '' + }, + options: { + // 数据 + type: Array, + default: function _default() { + return []; + } + }, + defaultSelect: { + // 默认选中 + type: Array, + default: function _default() { + return []; + } + }, + fieldNames: { + type: Object, + default: function _default() { + return { + children: 'children', + label: 'label', + value: 'value' + }; + } + }, + loading: { + type: Boolean, + default: false + } + }, + watch: { + defaultSelect: function defaultSelect() { + this.getCheckedNames(this.options); + } + }, + computed: { + styleMediaClass: function styleMediaClass() { + if (this.windowWidth < 1366) { + return 'cascader-column-close'; + } + return ''; + } + }, + data: function data() { + return { + selectedLevelOne: null, + selectedLevelTwo: null, + selectedLevelThree: null, + selectedLevelFour: null, + defaultIndex: 0 // 默认选中第一个 + }; + }, + methods: { + handleSelected: function handleSelected(e, index) { + var _this = this; + var label = this.fieldNames.label; + var children = this.fieldNames.children; + if (this.windowWidth < 1000) return; + if (!this.selectedLevelTwo) { + this.$emit('handleColseOpen', 1); + } + if (index === 1) { + this.selectedLevelOne = e; + if (e[children] && this.defaultSelect.length > 1) { + var Index = e.children.findIndex(function (e) { + return e[label] == _this.defaultSelect[1]; + }); + this.selectedLevelTwo = e[children][Index]; + this.selectedLevelThree = e[children][Index][children]; + } else { + this.selectedLevelTwo = null; + this.selectedLevelThree = null; + } + } else if (index === 2) { + this.selectedLevelTwo = e; + if (e[children] && e[children].length) { + this.selectedLevelThree = e.layout ? e[children] : e[children][this.defaultIndex][children]; + this.selectedLevelFour = e[children][this.defaultIndex]; + } + if (!e[children]) { + this.selectedLevelThree = null; + this.selectedLevelFour = null; + } + } else { + this.selectedLevelThree = e[children] || null; + this.selectedLevelFour = e; + } + }, + handleColse: function handleColse() { + this.selectedLevelTwo = null; + this.selectedLevelThree = null; + this.selectedLevelFour = null; + this.$emit('handleColseOpen', 0); + }, + getCheckedNames: function getCheckedNames(data) { + var label = this.fieldNames.label; + var children = this.fieldNames.children; + var that = this; + var result = this.defaultSelect; + var keyValue = ['selectedLevelOne', 'selectedLevelTwo', 'selectedLevelFour', 'selectedLevelThree']; + var index = 0; + data.forEach(function (element) { + return traverse([element]); + }); + function traverse(element) { + var key = element.find(function (e) { + return e[label] === result[index]; + }) || null; + if (key) { + that[keyValue[index]] = key; + index++; + if (index === result.length) { + that[keyValue[keyValue.length - 1]] = key[children] || null; + } + key[children] && key[children].forEach(function (k) { + return traverse([k]); + }); + } + } + } + } +}; + +/* script */ +const __vue_script__$b = script$b; + +/* template */ +var __vue_render__$b = function () { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c("a-spin", { attrs: { spinning: _vm.loading } }, [ + _c("div", { staticClass: "cascader" }, [ + _vm.options + ? _c( + "div", + { class: ["cascader-column", _vm.styleMediaClass] }, + [ + _c("cascader-item", { + attrs: { + optionsItem: _vm.options, + indexLevel: 1, + mode: "vertical", + selected: _vm.selectedLevelOne, + tooltip: _vm.windowWidth < 1366, + }, + on: { handleSelected: _vm.handleSelected }, + }), + _vm._v(" "), + _vm._t("opearte", function () { + return [_c("div")] + }), + ], + 2 + ) + : _vm._e(), + _vm._v(" "), + _vm.selectedLevelOne + ? _c( + "div", + { class: ["cascader-column", _vm.styleMediaClass] }, + [ + _c("cascader-item", { + attrs: { + optionsItem: _vm.selectedLevelOne[_vm.fieldNames.children], + indexLevel: 2, + selected: _vm.selectedLevelTwo, + tooltip: _vm.windowWidth < 1366, + }, + on: { handleSelected: _vm.handleSelected }, + }), + ], + 1 + ) + : _vm._e(), + _vm._v(" "), + _vm.selectedLevelTwo && _vm.windowWidth >= 1000 + ? _c("div", { class: ["cascader-column", _vm.styleMediaClass] }, [ + _c("div", { staticClass: "cascader-column-top" }, [ + _c( + "div", + { + staticClass: "cascader-column-top-close", + on: { click: _vm.handleColse }, + }, + [_vm._v("X")] + ), + ]), + _vm._v(" "), + _c("div", { staticClass: "cascader-column-main" }, [ + !_vm.selectedLevelTwo.layout + ? _c( + "div", + { staticClass: "cascader-column-left" }, + [ + _c( + "cascader-item", + { + attrs: { + optionsItem: + _vm.selectedLevelTwo[_vm.fieldNames.children], + indexLevel: 3, + selected: _vm.selectedLevelFour, + tooltip: _vm.windowWidth < 1600, + showTitle: _vm.windowWidth > 760, + }, + on: { handleSelected: _vm.handleSelected }, + }, + [_c("template", { slot: "icon-title" }, [_c("div")])], + 2 + ), + ], + 1 + ) + : _vm._e(), + _vm._v(" "), + _c( + "div", + { staticClass: "cascader-column-right" }, + [ + _c("cascader-component", { + attrs: { + cover: _vm.cover, + proxyName: _vm.proxyName, + options: _vm.selectedLevelThree, + layout: _vm.selectedLevelTwo.layout || "biserial", + }, + }), + ], + 1 + ), + ]), + ]) + : _vm._e(), + ]), + ]) +}; +var __vue_staticRenderFns__$b = []; +__vue_render__$b._withStripped = true; + + /* style */ + const __vue_inject_styles__$b = function (inject) { + if (!inject) return + inject("data-v-655ef464_0", { source: "[data-v-655ef464]:export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.cascader[data-v-655ef464] {\n display: flex;\n flex-wrap: wrap;\n height: 100%;\n color: rgba(255, 255, 255, 0.6);\n overflow: hidden;\n}\n.cascader .cascader-column[data-v-655ef464] {\n position: relative;\n font-size: 16px;\n height: 100%;\n}\n.cascader .cascader-column[data-v-655ef464]:nth-child(1) {\n flex: 80;\n}\n.cascader .cascader-column[data-v-655ef464]:nth-child(2) {\n flex: 130;\n background: #141414;\n}\n.cascader .cascader-column[data-v-655ef464]:nth-child(3) {\n flex: 350;\n}\n.cascader .cascader-column .cascader-column-top[data-v-655ef464] {\n display: flex;\n justify-content: flex-end;\n line-height: 40px;\n height: 40px;\n box-shadow: 0px 1px 0px 0px #000000;\n}\n.cascader .cascader-column .cascader-column-top-close[data-v-655ef464] {\n text-align: center;\n width: 16px;\n height: 40px;\n margin-right: 12px;\n cursor: pointer;\n color: #ffffff;\n}\n.cascader .cascader-column .cascader-column-main[data-v-655ef464] {\n display: flex;\n width: 100%;\n height: calc(100% - 40px);\n}\n.cascader .cascader-column .cascader-column-main .cascader-column-left[data-v-655ef464] {\n flex: 110;\n}\n.cascader .cascader-column .cascader-column-main .cascader-column-left[data-v-655ef464] .cascader-item-name {\n margin: 0 auto;\n width: calc(100% - 16px);\n padding: 4px;\n box-sizing: border-box;\n text-align: center;\n border-radius: 4px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.cascader .cascader-column .cascader-column-main .cascader-column-left[data-v-655ef464] .cascader-item-horizontal-active .cascader-item-name {\n background-color: #333;\n}\n.cascader .cascader-column .cascader-column-main .cascader-column-right[data-v-655ef464] {\n flex: 240;\n height: 100%;\n overflow: auto;\n}\n.cascader .cascader-column-close[data-v-655ef464] {\n font-size: 12px;\n}\n.cascader .cascader-column-close[data-v-655ef464]:nth-child(1) {\n flex: 100;\n}\n.cascader .cascader-column-close[data-v-655ef464]:nth-child(1) .cascader-item-vertical {\n width: calc(100% - 12px);\n}\n.cascader .cascader-column-close[data-v-655ef464]:nth-child(2) {\n flex: 60;\n}\n.cascader .cascader-column-close[data-v-655ef464]:nth-child(2) .cascader-item-name {\n display: none;\n}\n.cascader .cascader-column-close[data-v-655ef464]:nth-child(2) .cascader-item-horizontal {\n justify-content: center;\n}\n.cascader .cascader-column-close[data-v-655ef464]:nth-child(2) .cascader-item-horizontal i {\n margin: 0;\n}\n.ant-spin-nested-loading[data-v-655ef464] {\n height: 100%;\n}\n.ant-spin-nested-loading[data-v-655ef464] .ant-spin-container {\n height: 100%;\n}\n.ant-spin-nested-loading[data-v-655ef464] .ant-spin-spinning {\n max-height: 100%;\n}\n", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,sBAAsB;EACtB,mBAAmB;EACnB,sBAAsB;EACtB,sBAAsB;EACtB,oBAAoB;EACpB,mBAAmB;EACnB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,iBAAiB;EACjB,6BAA6B;EAC7B,wCAAwC;AAC1C;AACA;EACE,aAAa;EACb,eAAe;EACf,YAAY;EACZ,+BAA+B;EAC/B,gBAAgB;AAClB;AACA;EACE,kBAAkB;EAClB,eAAe;EACf,YAAY;AACd;AACA;EACE,QAAQ;AACV;AACA;EACE,SAAS;EACT,mBAAmB;AACrB;AACA;EACE,SAAS;AACX;AACA;EACE,aAAa;EACb,yBAAyB;EACzB,iBAAiB;EACjB,YAAY;EACZ,mCAAmC;AACrC;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,kBAAkB;EAClB,eAAe;EACf,cAAc;AAChB;AACA;EACE,aAAa;EACb,WAAW;EACX,yBAAyB;AAC3B;AACA;EACE,SAAS;AACX;AACA;EACE,cAAc;EACd,wBAAwB;EACxB,YAAY;EACZ,sBAAsB;EACtB,kBAAkB;EAClB,kBAAkB;EAClB,gBAAgB;EAChB,uBAAuB;EACvB,mBAAmB;AACrB;AACA;EACE,sBAAsB;AACxB;AACA;EACE,SAAS;EACT,YAAY;EACZ,cAAc;AAChB;AACA;EACE,eAAe;AACjB;AACA;EACE,SAAS;AACX;AACA;EACE,wBAAwB;AAC1B;AACA;EACE,QAAQ;AACV;AACA;EACE,aAAa;AACf;AACA;EACE,uBAAuB;AACzB;AACA;EACE,SAAS;AACX;AACA;EACE,YAAY;AACd;AACA;EACE,YAAY;AACd;AACA;EACE,gBAAgB;AAClB","file":"index.vue","sourcesContent":[":export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.cascader {\n display: flex;\n flex-wrap: wrap;\n height: 100%;\n color: rgba(255, 255, 255, 0.6);\n overflow: hidden;\n}\n.cascader .cascader-column {\n position: relative;\n font-size: 16px;\n height: 100%;\n}\n.cascader .cascader-column:nth-child(1) {\n flex: 80;\n}\n.cascader .cascader-column:nth-child(2) {\n flex: 130;\n background: #141414;\n}\n.cascader .cascader-column:nth-child(3) {\n flex: 350;\n}\n.cascader .cascader-column .cascader-column-top {\n display: flex;\n justify-content: flex-end;\n line-height: 40px;\n height: 40px;\n box-shadow: 0px 1px 0px 0px #000000;\n}\n.cascader .cascader-column .cascader-column-top-close {\n text-align: center;\n width: 16px;\n height: 40px;\n margin-right: 12px;\n cursor: pointer;\n color: #ffffff;\n}\n.cascader .cascader-column .cascader-column-main {\n display: flex;\n width: 100%;\n height: calc(100% - 40px);\n}\n.cascader .cascader-column .cascader-column-main .cascader-column-left {\n flex: 110;\n}\n.cascader .cascader-column .cascader-column-main .cascader-column-left /deep/ .cascader-item-name {\n margin: 0 auto;\n width: calc(100% - 16px);\n padding: 4px;\n box-sizing: border-box;\n text-align: center;\n border-radius: 4px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.cascader .cascader-column .cascader-column-main .cascader-column-left /deep/ .cascader-item-horizontal-active .cascader-item-name {\n background-color: #333;\n}\n.cascader .cascader-column .cascader-column-main .cascader-column-right {\n flex: 240;\n height: 100%;\n overflow: auto;\n}\n.cascader .cascader-column-close {\n font-size: 12px;\n}\n.cascader .cascader-column-close:nth-child(1) {\n flex: 100;\n}\n.cascader .cascader-column-close:nth-child(1) /deep/ .cascader-item-vertical {\n width: calc(100% - 12px);\n}\n.cascader .cascader-column-close:nth-child(2) {\n flex: 60;\n}\n.cascader .cascader-column-close:nth-child(2) /deep/ .cascader-item-name {\n display: none;\n}\n.cascader .cascader-column-close:nth-child(2) /deep/ .cascader-item-horizontal {\n justify-content: center;\n}\n.cascader .cascader-column-close:nth-child(2) /deep/ .cascader-item-horizontal i {\n margin: 0;\n}\n.ant-spin-nested-loading {\n height: 100%;\n}\n.ant-spin-nested-loading /deep/ .ant-spin-container {\n height: 100%;\n}\n.ant-spin-nested-loading /deep/ .ant-spin-spinning {\n max-height: 100%;\n}\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__$b = "data-v-655ef464"; + /* module identifier */ + const __vue_module_identifier__$b = undefined; + /* functional template */ + const __vue_is_functional_template__$b = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$b = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$b, staticRenderFns: __vue_staticRenderFns__$b }, + __vue_inject_styles__$b, + __vue_script__$b, + __vue_scope_id__$b, + __vue_is_functional_template__$b, + __vue_module_identifier__$b, + false, + createInjector, + undefined, + undefined + ); + +function ownKeys(e, r) { + var t = Object.keys(e); + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + r && (o = o.filter(function (r) { + return Object.getOwnPropertyDescriptor(e, r).enumerable; + })), t.push.apply(t, o); + } + return t; +} +function _objectSpread2(e) { + for (var r = 1; r < arguments.length; r++) { + var t = null != arguments[r] ? arguments[r] : {}; + r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { + _defineProperty(e, r, t[r]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { + Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); + }); + } + return e; +} + +function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + return arr2; +} + +function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) return _arrayLikeToArray(arr); +} + +function _iterableToArray(iter) { + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); +} + +function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); +} + +function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} + +function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); +} + +function _createForOfIteratorHelper(o, allowArrayLike) { + var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; + if (!it) { + if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { + if (it) o = it; + var i = 0; + var F = function F() {}; + return { + s: F, + n: function n() { + if (i >= o.length) return { + done: true + }; + return { + done: false, + value: o[i++] + }; + }, + e: function e(_e) { + throw _e; + }, + f: F + }; + } + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + var normalCompletion = true, + didErr = false, + err; + return { + s: function s() { + it = it.call(o); + }, + n: function n() { + var step = it.next(); + normalCompletion = step.done; + return step; + }, + e: function e(_e2) { + didErr = true; + err = _e2; + }, + f: function f() { + try { + if (!normalCompletion && it["return"] != null) it["return"](); + } finally { + if (didErr) throw err; + } + } + }; +} + +function _regeneratorRuntime() { + _regeneratorRuntime = function _regeneratorRuntime() { + return e; + }; + var t, + e = {}, + r = Object.prototype, + n = r.hasOwnProperty, + o = Object.defineProperty || function (t, e, r) { + t[e] = r.value; + }, + i = "function" == typeof Symbol ? Symbol : {}, + a = i.iterator || "@@iterator", + c = i.asyncIterator || "@@asyncIterator", + u = i.toStringTag || "@@toStringTag"; + function define(t, e, r) { + return Object.defineProperty(t, e, { + value: r, + enumerable: !0, + configurable: !0, + writable: !0 + }), t[e]; + } + try { + define({}, ""); + } catch (t) { + define = function define(t, e, r) { + return t[e] = r; + }; + } + function wrap(t, e, r, n) { + var i = e && e.prototype instanceof Generator ? e : Generator, + a = Object.create(i.prototype), + c = new Context(n || []); + return o(a, "_invoke", { + value: makeInvokeMethod(t, r, c) + }), a; + } + function tryCatch(t, e, r) { + try { + return { + type: "normal", + arg: t.call(e, r) + }; + } catch (t) { + return { + type: "throw", + arg: t + }; + } + } + e.wrap = wrap; + var h = "suspendedStart", + l = "suspendedYield", + f = "executing", + s = "completed", + y = {}; + function Generator() {} + function GeneratorFunction() {} + function GeneratorFunctionPrototype() {} + var p = {}; + define(p, a, function () { + return this; + }); + var d = Object.getPrototypeOf, + v = d && d(d(values([]))); + v && v !== r && n.call(v, a) && (p = v); + var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); + function defineIteratorMethods(t) { + ["next", "throw", "return"].forEach(function (e) { + define(t, e, function (t) { + return this._invoke(e, t); + }); + }); + } + function AsyncIterator(t, e) { + function invoke(r, o, i, a) { + var c = tryCatch(t[r], t, o); + if ("throw" !== c.type) { + var u = c.arg, + h = u.value; + return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { + invoke("next", t, i, a); + }, function (t) { + invoke("throw", t, i, a); + }) : e.resolve(h).then(function (t) { + u.value = t, i(u); + }, function (t) { + return invoke("throw", t, i, a); + }); + } + a(c.arg); + } + var r; + o(this, "_invoke", { + value: function value(t, n) { + function callInvokeWithMethodAndArg() { + return new e(function (e, r) { + invoke(t, n, e, r); + }); + } + return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); + } + }); + } + function makeInvokeMethod(e, r, n) { + var o = h; + return function (i, a) { + if (o === f) throw new Error("Generator is already running"); + if (o === s) { + if ("throw" === i) throw a; + return { + value: t, + done: !0 + }; + } + for (n.method = i, n.arg = a;;) { + var c = n.delegate; + if (c) { + var u = maybeInvokeDelegate(c, n); + if (u) { + if (u === y) continue; + return u; + } + } + if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { + if (o === h) throw o = s, n.arg; + n.dispatchException(n.arg); + } else "return" === n.method && n.abrupt("return", n.arg); + o = f; + var p = tryCatch(e, r, n); + if ("normal" === p.type) { + if (o = n.done ? s : l, p.arg === y) continue; + return { + value: p.arg, + done: n.done + }; + } + "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); + } + }; + } + function maybeInvokeDelegate(e, r) { + var n = r.method, + o = e.iterator[n]; + if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; + var i = tryCatch(o, e.iterator, r.arg); + if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; + var a = i.arg; + return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); + } + function pushTryEntry(t) { + var e = { + tryLoc: t[0] + }; + 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); + } + function resetTryEntry(t) { + var e = t.completion || {}; + e.type = "normal", delete e.arg, t.completion = e; + } + function Context(t) { + this.tryEntries = [{ + tryLoc: "root" + }], t.forEach(pushTryEntry, this), this.reset(!0); + } + function values(e) { + if (e || "" === e) { + var r = e[a]; + if (r) return r.call(e); + if ("function" == typeof e.next) return e; + if (!isNaN(e.length)) { + var o = -1, + i = function next() { + for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; + return next.value = t, next.done = !0, next; + }; + return i.next = i; + } + } + throw new TypeError(_typeof(e) + " is not iterable"); + } + return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { + value: GeneratorFunctionPrototype, + configurable: !0 + }), o(GeneratorFunctionPrototype, "constructor", { + value: GeneratorFunction, + configurable: !0 + }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { + var e = "function" == typeof t && t.constructor; + return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); + }, e.mark = function (t) { + return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; + }, e.awrap = function (t) { + return { + __await: t + }; + }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { + return this; + }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { + void 0 === i && (i = Promise); + var a = new AsyncIterator(wrap(t, r, n, o), i); + return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { + return t.done ? t.value : a.next(); + }); + }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { + return this; + }), define(g, "toString", function () { + return "[object Generator]"; + }), e.keys = function (t) { + var e = Object(t), + r = []; + for (var n in e) r.push(n); + return r.reverse(), function next() { + for (; r.length;) { + var t = r.pop(); + if (t in e) return next.value = t, next.done = !1, next; + } + return next.done = !0, next; + }; + }, e.values = values, Context.prototype = { + constructor: Context, + reset: function reset(e) { + if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); + }, + stop: function stop() { + this.done = !0; + var t = this.tryEntries[0].completion; + if ("throw" === t.type) throw t.arg; + return this.rval; + }, + dispatchException: function dispatchException(e) { + if (this.done) throw e; + var r = this; + function handle(n, o) { + return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; + } + for (var o = this.tryEntries.length - 1; o >= 0; --o) { + var i = this.tryEntries[o], + a = i.completion; + if ("root" === i.tryLoc) return handle("end"); + if (i.tryLoc <= this.prev) { + var c = n.call(i, "catchLoc"), + u = n.call(i, "finallyLoc"); + if (c && u) { + if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); + if (this.prev < i.finallyLoc) return handle(i.finallyLoc); + } else if (c) { + if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); + } else { + if (!u) throw new Error("try statement without catch or finally"); + if (this.prev < i.finallyLoc) return handle(i.finallyLoc); + } + } + } + }, + abrupt: function abrupt(t, e) { + for (var r = this.tryEntries.length - 1; r >= 0; --r) { + var o = this.tryEntries[r]; + if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { + var i = o; + break; + } + } + i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); + var a = i ? i.completion : {}; + return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); + }, + complete: function complete(t, e) { + if ("throw" === t.type) throw t.arg; + return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; + }, + finish: function finish(t) { + for (var e = this.tryEntries.length - 1; e >= 0; --e) { + var r = this.tryEntries[e]; + if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; + } + }, + "catch": function _catch(t) { + for (var e = this.tryEntries.length - 1; e >= 0; --e) { + var r = this.tryEntries[e]; + if (r.tryLoc === t) { + var n = r.completion; + if ("throw" === n.type) { + var o = n.arg; + resetTryEntry(r); + } + return o; + } + } + throw new Error("illegal catch attempt"); + }, + delegateYield: function delegateYield(e, r, n) { + return this.delegate = { + iterator: values(e), + resultName: r, + nextLoc: n + }, "next" === this.method && (this.arg = t), y; + } + }, e; +} + +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { + try { + var info = gen[key](arg); + var value = info.value; + } catch (error) { + reject(error); + return; + } + if (info.done) { + resolve(value); + } else { + Promise.resolve(value).then(_next, _throw); + } +} +function _asyncToGenerator(fn) { + return function () { + var self = this, + args = arguments; + return new Promise(function (resolve, reject) { + var gen = fn.apply(self, args); + function _next(value) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); + } + function _throw(err) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); + } + _next(undefined); + }); + }; +} + +function _arrayWithHoles(arr) { + if (Array.isArray(arr)) return arr; +} + +function _iterableToArrayLimit(r, l) { + var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; + if (null != t) { + var e, + n, + i, + u, + a = [], + f = !0, + o = !1; + try { + if (i = (t = t.call(r)).next, 0 === l) { + if (Object(t) !== t) return; + f = !1; + } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); + } catch (r) { + o = !0, n = r; + } finally { + try { + if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; + } finally { + if (o) throw n; + } + } + return a; + } +} + +function _nonIterableRest() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} + +function _slicedToArray(arr, i) { + return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); +} + +function isFunction(func) { + return typeof func === 'function' || Object.prototype.toString.call(func) === '[object Function]'; +} +function snapToGrid(grid, pendingX, pendingY) { + var scale = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1; + var x = Math.round(pendingX / scale / grid[0]) * grid[0]; + var y = Math.round(pendingY / scale / grid[1]) * grid[1]; + return [x, y]; +} +function computeWidth(parentWidth, left, right) { + return parentWidth - left - right; +} +function computeHeight(parentHeight, top, bottom) { + return parentHeight - top - bottom; +} +function restrictToBounds(value, min, max) { + if (min !== null && value < min) { + return min; + } + if (max !== null && max < value) { + return max; + } + return value; +} + +// 将选择器与父元素匹配 +function matchesSelectorToParentElements(el, selector, baseNode) { + var node = el; + var matchesSelectorFunc = ['matches', 'webkitMatchesSelector', 'mozMatchesSelector', 'msMatchesSelector', 'oMatchesSelector'].find(function (func) { + return isFunction(node[func]); + }); + if (!isFunction(node[matchesSelectorFunc])) return false; + do { + if (node[matchesSelectorFunc](selector)) return true; + if (node === baseNode) return false; + node = node.parentNode; + } while (node); + return false; +} +function getComputedSize($el) { + var style = window.getComputedStyle($el); + return [parseFloat(style.getPropertyValue('width'), 10), parseFloat(style.getPropertyValue('height'), 10)]; +} +// 添加事件 +function addEvent(el, event, handler) { + if (!el) { + return; + } + if (el.attachEvent) { + el.attachEvent('on' + event, handler); + } else if (el.addEventListener) { + el.addEventListener(event, handler, true); + } else { + el['on' + event] = handler; + } +} + +// 删除事件 +function removeEvent(el, event, handler) { + if (!el) { + return; + } + if (el.detachEvent) { + el.detachEvent('on' + event, handler); + } else if (el.removeEventListener) { + el.removeEventListener(event, handler, true); + } else { + el['on' + event] = null; + } +} + +var events = { + mouse: { + start: 'mousedown', + move: 'mousemove', + stop: 'mouseup' + }, + touch: { + start: 'touchstart', + move: 'touchmove', + stop: 'touchend' + } +}; + +// 禁止用户选取 +var userSelectNone = { + userSelect: 'none', + MozUserSelect: 'none', + WebkitUserSelect: 'none', + MsUserSelect: 'none' +}; +// 用户选中自动 +var userSelectAuto = { + userSelect: 'auto', + MozUserSelect: 'auto', + WebkitUserSelect: 'auto', + MsUserSelect: 'auto' +}; +var eventsFor = events.mouse; +var script$a = { + replace: true, + name: 'ComponentBox', + props: { + className: { + type: String, + default: 'vdr' + }, + classNameDraggable: { + type: String, + default: 'draggable' + }, + classNameResizable: { + type: String, + default: 'resizable' + }, + classNameDragging: { + type: String, + default: 'dragging' + }, + classNameResizing: { + type: String, + default: 'resizing' + }, + classNameActive: { + type: String, + default: 'active' + }, + classNameHandle: { + type: String, + default: 'handle' + }, + disableUserSelect: { + type: Boolean, + default: true + }, + enableNativeDrag: { + type: Boolean, + default: false + }, + preventDeactivation: { + type: Boolean, + default: false + }, + active: { + type: Boolean, + default: false + }, + draggable: { + type: Boolean, + default: true + }, + resizable: { + type: Boolean, + default: true + }, + // 锁定宽高比 + lockAspectRatio: { + type: Boolean, + default: false + }, + w: { + type: [Number, String], + default: 200, + validator: function validator(val) { + if (typeof val === 'number') { + return val > 0; + } + return val === 'auto'; + } + }, + h: { + type: [Number, String], + default: 200, + validator: function validator(val) { + if (typeof val === 'number') { + return val > 0; + } + return val === 'auto'; + } + }, + transform: { + type: String, + default: '' + }, + perspective: { + type: Number, + default: 0 + }, + minWidth: { + type: Number, + default: 0, + validator: function validator(val) { + return val >= 0; + } + }, + minHeight: { + type: Number, + default: 0, + validator: function validator(val) { + return val >= 0; + } + }, + maxWidth: { + type: Number, + default: null, + validator: function validator(val) { + return val >= 0; + } + }, + maxHeight: { + type: Number, + default: null, + validator: function validator(val) { + return val >= 0; + } + }, + x: { + type: Number, + default: 0 + }, + y: { + type: Number, + default: 0 + }, + z: { + type: [String, Number], + default: 'auto', + validator: function validator(val) { + return typeof val === 'string' ? val === 'auto' : val >= 0; + } + }, + handles: { + type: Array, + default: function _default() { + return ['tl', 'tm', 'tr', 'mr', 'br', 'bm', 'bl', 'ml']; + }, + validator: function validator(val) { + var s = new Set(['tl', 'tm', 'tr', 'mr', 'br', 'bm', 'bl', 'ml']); + return new Set(val.filter(function (h) { + return s.has(h); + })).size === val.length; + } + }, + dragHandle: { + type: String, + default: null + }, + dragCancel: { + type: String, + default: null + }, + axis: { + type: String, + default: 'both', + validator: function validator(val) { + return ['x', 'y', 'both'].includes(val); + } + }, + grid: { + type: Array, + default: function _default() { + return [1, 1]; + } + }, + parent: { + type: [Boolean, String], + default: false + }, + onDragStart: { + type: Function, + default: function _default() { + return true; + } + }, + onDrag: { + type: Function, + default: function _default() { + return true; + } + }, + onResizeStart: { + type: Function, + default: function _default() { + return true; + } + }, + onResize: { + type: Function, + default: function _default() { + return true; + } + }, + // 冲突检测 + isConflictCheck: { + type: Boolean, + default: false + }, + // 元素对齐 + snap: { + type: Boolean, + default: false + }, + // 当调用对齐时,用来设置组件与组件之间的对齐距离,以像素为单位 + snapTolerance: { + type: Number, + default: 5, + validator: function validator(val) { + return typeof val === 'number'; + } + }, + // 缩放比例 + scaleRatio: { + type: Number, + default: 1, + validator: function validator(val) { + return typeof val === 'number'; + } + }, + // handle是否缩放 + handleInfo: { + type: Object, + default: function _default() { + return { + size: 8, + offset: -5, + switch: true + }; + } + } + }, + data: function data() { + return { + left: this.x, + top: this.y, + right: null, + bottom: null, + width: null, + height: null, + widthTouched: false, + heightTouched: false, + aspectFactor: null, + parentWidth: null, + parentHeight: null, + minW: this.minWidth, + minH: this.minHeight, + maxW: this.maxWidth, + maxH: this.maxHeight, + handle: null, + enabled: this.active, + resizing: false, + dragging: false, + zIndex: this.z + }; + }, + created: function created() { + // eslint-disable-next-line 无效的prop:minWidth不能大于maxWidth + if (this.maxWidth && this.minWidth > this.maxWidth) ; + // eslint-disable-next-line 无效prop:minHeight不能大于maxHeight' + if (this.maxWidth && this.minHeight > this.maxHeight) ; + this.resetBoundsAndMouseState(); + }, + mounted: function mounted() { + if (!this.enableNativeDrag) { + this.$el.ondragstart = function () { + return false; + }; + } + var _this$getParentSize = this.getParentSize(), + _this$getParentSize2 = _slicedToArray(_this$getParentSize, 2), + parentWidth = _this$getParentSize2[0], + parentHeight = _this$getParentSize2[1]; + this.parentWidth = parentWidth; + this.parentHeight = parentHeight; + var _getComputedSize = getComputedSize(this.$el), + _getComputedSize2 = _slicedToArray(_getComputedSize, 2), + width = _getComputedSize2[0], + height = _getComputedSize2[1]; + this.aspectFactor = (this.w !== 'auto' ? this.w : width) / (this.h !== 'auto' ? this.h : height); + this.width = this.w !== 'auto' ? this.w : width; + this.height = this.h !== 'auto' ? this.h : height; + this.right = this.parentWidth - this.width - this.left; + this.bottom = this.parentHeight - this.height - this.top; + this.settingAttribute(); + + // 优化:取消选中的行为优先绑定在父节点上 + var parentElement = this.$el.parentNode; + addEvent(parentElement || document.documentElement, 'mousedown', this.deselect); + addEvent(parentElement || document.documentElement, 'touchend touchcancel', this.deselect); + addEvent(window, 'resize', this.checkParentSize); + }, + beforeDestroy: function beforeDestroy() { + removeEvent(document.documentElement, 'mousedown', this.deselect); + removeEvent(document.documentElement, 'touchstart', this.handleUp); + removeEvent(document.documentElement, 'mousemove', this.move); + removeEvent(document.documentElement, 'touchmove', this.move); + removeEvent(document.documentElement, 'mouseup', this.handleUp); + removeEvent(document.documentElement, 'touchend touchcancel', this.deselect); + removeEvent(window, 'resize', this.checkParentSize); + }, + methods: { + // 右键菜单 + onContextMenu: function onContextMenu(e) { + this.$emit('contextmenu', e); + }, + // 重置边界和鼠标状态 + resetBoundsAndMouseState: function resetBoundsAndMouseState() { + this.mouseClickPosition = { + mouseX: 0, + mouseY: 0, + x: 0, + y: 0, + w: 0, + h: 0 + }; + this.bounds = { + minLeft: null, + maxLeft: null, + minRight: null, + maxRight: null, + minTop: null, + maxTop: null, + minBottom: null, + maxBottom: null + }; + }, + // 检查父元素大小 + checkParentSize: function checkParentSize() { + if (this.parent) { + var _this$getParentSize3 = this.getParentSize(), + _this$getParentSize4 = _slicedToArray(_this$getParentSize3, 2), + newParentWidth = _this$getParentSize4[0], + newParentHeight = _this$getParentSize4[1]; + // 修复父元素改变大小后,组件resizing时活动异常 + this.right = newParentWidth - this.width - this.left; + this.bottom = newParentHeight - this.height - this.top; + this.parentWidth = newParentWidth; + this.parentHeight = newParentHeight; + } + }, + // 获取父元素大小 + getParentSize: function getParentSize() { + if (this.parent === true) { + var style = window.getComputedStyle(this.$el.parentNode, null); + return [parseInt(style.getPropertyValue('width'), 10), parseInt(style.getPropertyValue('height'), 10)]; + } + if (typeof this.parent === 'string') { + var parentNode = document.querySelector(this.parent); + if (!(parentNode instanceof HTMLElement)) { + throw new Error("The selector ".concat(this.parent, " does not match any element")); + } + return [parentNode.offsetWidth, parentNode.offsetHeight]; + } + return [null, null]; + }, + // 元素触摸按下 + elementTouchDown: function elementTouchDown(e) { + // 阻止事件冒泡 + e.stopPropagation(); + eventsFor = events.touch; + this.elementDown(e); + }, + elementMouseDown: function elementMouseDown(e) { + // 阻止事件冒泡 + e.stopPropagation(); + eventsFor = events.mouse; + this.elementDown(e); + }, + // 元素按下 + elementDown: function elementDown(e) { + // 阻止事件冒泡 + e.stopPropagation(); + if (e instanceof MouseEvent && e.which !== 1) { + return; + } + var target = e.target || e.srcElement; + if (this.$el.contains(target)) { + if (this.onDragStart(e) === false) { + return; + } + if (this.dragHandle && !matchesSelectorToParentElements(target, this.dragHandle, this.$el) || this.dragCancel && matchesSelectorToParentElements(target, this.dragCancel, this.$el)) { + this.dragging = false; + return; + } + if (!this.enabled) { + this.enabled = true; + this.$emit('activated'); + this.$emit('update:active', true); + } + if (this.draggable) { + this.dragging = true; + } + this.mouseClickPosition.mouseX = e.touches ? e.touches[0].pageX : e.pageX; + this.mouseClickPosition.mouseY = e.touches ? e.touches[0].pageY : e.pageY; + this.mouseClickPosition.left = this.left; + this.mouseClickPosition.right = this.right; + this.mouseClickPosition.top = this.top; + this.mouseClickPosition.bottom = this.bottom; + this.mouseClickPosition.w = this.width; + this.mouseClickPosition.h = this.height; + if (this.parent) { + var _this$getParentSize5 = this.getParentSize(), + _this$getParentSize6 = _slicedToArray(_this$getParentSize5, 2), + parentWidth = _this$getParentSize6[0], + parentHeight = _this$getParentSize6[1]; + // 拖拽时重新计算父组件跟当前组件的宽高位移等信息 + this.parentWidth = parentWidth; + this.parentHeight = parentHeight; + this.right = this.parentWidth - this.width - this.left; + this.bottom = this.parentHeight - this.height - this.top; + this.bounds = this.calcDragLimits(); + } + addEvent(document.documentElement, eventsFor.move, this.move); + addEvent(document.documentElement, eventsFor.stop, this.handleUp); + } + }, + // 计算移动范围 + calcDragLimits: function calcDragLimits() { + return { + minLeft: this.left % this.grid[0], + maxLeft: Math.floor((this.parentWidth - this.width - this.left) / this.grid[0]) * this.grid[0] + this.left, + minRight: this.right % this.grid[0], + maxRight: Math.floor((this.parentWidth - this.width - this.right) / this.grid[0]) * this.grid[0] + this.right, + minTop: this.top % this.grid[1], + maxTop: Math.floor((this.parentHeight - this.height - this.top) / this.grid[1]) * this.grid[1] + this.top, + minBottom: this.bottom % this.grid[1], + maxBottom: Math.floor((this.parentHeight - this.height - this.bottom) / this.grid[1]) * this.grid[1] + this.bottom + }; + }, + // 取消 + deselect: function deselect(e) { + var target = e.target || e.srcElement; + var regex = new RegExp(this.className + '-([trmbl]{2})', ''); + if (!this.$el.contains(target) && !regex.test(target.className)) { + if (this.enabled && !this.preventDeactivation) { + this.enabled = false; + this.$emit('deactivated'); + this.$emit('update:active', false); + } + removeEvent(document.documentElement, eventsFor.move, this.handleResize); + } + if (e.button !== 2) { + this.resetBoundsAndMouseState(); + } + }, + // 控制柄触摸按下 + handleTouchDown: function handleTouchDown(handle, e) { + eventsFor = events.touch; + this.handleDown(handle, e); + }, + // 控制柄按下 + handleDown: function handleDown(handle, e) { + if (e instanceof MouseEvent && e.which !== 1) { + return; + } + if (this.onResizeStart(handle, e) === false) { + return; + } + if (e.stopPropagation) e.stopPropagation(); + + // Here we avoid a dangerous recursion by faking + // corner handles as middle handles + if (this.lockAspectRatio && !handle.includes('m')) { + this.handle = 'm' + handle.substring(1); + } else { + this.handle = handle; + } + this.resizing = true; + this.mouseClickPosition.mouseX = e.touches ? e.touches[0].pageX : e.pageX; + this.mouseClickPosition.mouseY = e.touches ? e.touches[0].pageY : e.pageY; + this.mouseClickPosition.left = this.left; + this.mouseClickPosition.right = this.right; + this.mouseClickPosition.top = this.top; + this.mouseClickPosition.bottom = this.bottom; + this.mouseClickPosition.w = this.width; + this.mouseClickPosition.h = this.height; + this.bounds = this.calcResizeLimits(); + addEvent(document.documentElement, eventsFor.move, this.handleResize); + addEvent(document.documentElement, eventsFor.stop, this.handleUp); + }, + // 计算调整大小范围 + calcResizeLimits: function calcResizeLimits() { + var minW = this.minW; + var minH = this.minH; + var maxW = this.maxW; + var maxH = this.maxH; + var aspectFactor = this.aspectFactor; + var _this$grid = _slicedToArray(this.grid, 2), + gridX = _this$grid[0], + gridY = _this$grid[1]; + var width = this.width; + var height = this.height; + var left = this.left; + var top = this.top; + var right = this.right; + var bottom = this.bottom; + if (this.lockAspectRatio) { + if (minW / minH > aspectFactor) { + minH = minW / aspectFactor; + } else { + minW = aspectFactor * minH; + } + if (maxW && maxH) { + maxW = Math.min(maxW, aspectFactor * maxH); + maxH = Math.min(maxH, maxW / aspectFactor); + } else if (maxW) { + maxH = maxW / aspectFactor; + } else if (maxH) { + maxW = aspectFactor * maxH; + } + } + maxW = maxW - maxW % gridX; + maxH = maxH - maxH % gridY; + var limits = { + minLeft: null, + maxLeft: null, + minTop: null, + maxTop: null, + minRight: null, + maxRight: null, + minBottom: null, + maxBottom: null + }; + if (this.parent) { + limits.minLeft = left % gridX; + limits.maxLeft = left + Math.floor((width - minW) / gridX) * gridX; + limits.minTop = top % gridY; + limits.maxTop = top + Math.floor((height - minH) / gridY) * gridY; + limits.minRight = right % gridX; + limits.maxRight = right + Math.floor((width - minW) / gridX) * gridX; + limits.minBottom = bottom % gridY; + limits.maxBottom = bottom + Math.floor((height - minH) / gridY) * gridY; + if (maxW) { + limits.minLeft = Math.max(limits.minLeft, this.parentWidth - right - maxW); + limits.minRight = Math.max(limits.minRight, this.parentWidth - left - maxW); + } + if (maxH) { + limits.minTop = Math.max(limits.minTop, this.parentHeight - bottom - maxH); + limits.minBottom = Math.max(limits.minBottom, this.parentHeight - top - maxH); + } + if (this.lockAspectRatio) { + limits.minLeft = Math.max(limits.minLeft, left - top * aspectFactor); + limits.minTop = Math.max(limits.minTop, top - left / aspectFactor); + limits.minRight = Math.max(limits.minRight, right - bottom * aspectFactor); + limits.minBottom = Math.max(limits.minBottom, bottom - right / aspectFactor); + } + } else { + limits.minLeft = null; + limits.maxLeft = left + Math.floor((width - minW) / gridX) * gridX; + limits.minTop = null; + limits.maxTop = top + Math.floor((height - minH) / gridY) * gridY; + limits.minRight = null; + limits.maxRight = right + Math.floor((width - minW) / gridX) * gridX; + limits.minBottom = null; + limits.maxBottom = bottom + Math.floor((height - minH) / gridY) * gridY; + if (maxW) { + limits.minLeft = -(right + maxW); + limits.minRight = -(left + maxW); + } + if (maxH) { + limits.minTop = -(bottom + maxH); + limits.minBottom = -(top + maxH); + } + if (this.lockAspectRatio && maxW && maxH) { + limits.minLeft = Math.min(limits.minLeft, -(right + maxW)); + limits.minTop = Math.min(limits.minTop, -(maxH + bottom)); + limits.minRight = Math.min(limits.minRight, -left - maxW); + limits.minBottom = Math.min(limits.minBottom, -top - maxH); + } + } + return limits; + }, + // 移动 + move: function move(e) { + e.stopPropagation(); + if (this.resizing) { + this.handleResize(e); + } else if (this.dragging) { + this.handleDrag(e); + } + }, + // 元素移动 + handleDrag: function handleDrag(e) { + var _this = this; + return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() { + var axis, grid, bounds, mouseClickPosition, tmpDeltaX, tmpDeltaY, _snapToGrid, _snapToGrid2, deltaX, deltaY, left, top, right, bottom; + return _regeneratorRuntime().wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + axis = _this.axis; + grid = _this.grid; + bounds = _this.bounds; + mouseClickPosition = _this.mouseClickPosition; + tmpDeltaX = axis && axis !== 'y' ? mouseClickPosition.mouseX - (e.touches ? e.touches[0].pageX : e.pageX) : 0; + tmpDeltaY = axis && axis !== 'x' ? mouseClickPosition.mouseY - (e.touches ? e.touches[0].pageY : e.pageY) : 0; + _snapToGrid = snapToGrid(grid, tmpDeltaX, tmpDeltaY, _this.scaleRatio), _snapToGrid2 = _slicedToArray(_snapToGrid, 2), deltaX = _snapToGrid2[0], deltaY = _snapToGrid2[1]; + left = restrictToBounds(mouseClickPosition.left - deltaX, bounds.minLeft, bounds.maxLeft); + top = restrictToBounds(mouseClickPosition.top - deltaY, bounds.minTop, bounds.maxTop); + if (!(_this.onDrag(left, top) === false)) { + _context.next = 11; + break; + } + return _context.abrupt("return"); + case 11: + right = restrictToBounds(mouseClickPosition.right + deltaX, bounds.minRight, bounds.maxRight); + bottom = restrictToBounds(mouseClickPosition.bottom + deltaY, bounds.minBottom, bounds.maxBottom); + _this.left = left; + _this.top = top; + _this.right = right; + _this.bottom = bottom; + _context.next = 19; + return _this.snapCheck(); + case 19: + _this.$emit('dragging', _this.left, _this.top); + case 20: + case "end": + return _context.stop(); + } + }, _callee); + }))(); + }, + moveHorizontally: function moveHorizontally(val) { + var _snapToGrid3 = snapToGrid(this.grid, val, this.top, this.scale), + _snapToGrid4 = _slicedToArray(_snapToGrid3, 2), + deltaX = _snapToGrid4[0]; + _snapToGrid4[1]; + var left = restrictToBounds(deltaX, this.bounds.minLeft, this.bounds.maxLeft); + this.left = left; + this.right = this.parentWidth - this.width - left; + }, + moveVertically: function moveVertically(val) { + var _snapToGrid5 = snapToGrid(this.grid, this.left, val, this.scale), + _snapToGrid6 = _slicedToArray(_snapToGrid5, 2); + _snapToGrid6[0]; + var deltaY = _snapToGrid6[1]; + var top = restrictToBounds(deltaY, this.bounds.minTop, this.bounds.maxTop); + this.top = top; + this.bottom = this.parentHeight - this.height - top; + }, + // 控制柄移动 + handleResize: function handleResize(e) { + // ; + var left = this.left; + var top = this.top; + var right = this.right; + var bottom = this.bottom; + var mouseClickPosition = this.mouseClickPosition; + this.lockAspectRatio; + var aspectFactor = this.aspectFactor; + var tmpDeltaX = mouseClickPosition.mouseX - (e.touches ? e.touches[0].pageX : e.pageX); + var tmpDeltaY = mouseClickPosition.mouseY - (e.touches ? e.touches[0].pageY : e.pageY); + if (!this.widthTouched && tmpDeltaX) { + this.widthTouched = true; + } + if (!this.heightTouched && tmpDeltaY) { + this.heightTouched = true; + } + var _snapToGrid7 = snapToGrid(this.grid, tmpDeltaX, tmpDeltaY, this.scaleRatio), + _snapToGrid8 = _slicedToArray(_snapToGrid7, 2), + deltaX = _snapToGrid8[0], + deltaY = _snapToGrid8[1]; + if (this.handle.includes('b')) { + bottom = restrictToBounds(mouseClickPosition.bottom + deltaY, this.bounds.minBottom, this.bounds.maxBottom); + if (this.lockAspectRatio && this.resizingOnY) { + right = this.right - (this.bottom - bottom) * aspectFactor; + } + } else if (this.handle.includes('t')) { + top = restrictToBounds(mouseClickPosition.top - deltaY, this.bounds.minTop, this.bounds.maxTop); + if (this.lockAspectRatio && this.resizingOnY) { + left = this.left - (this.top - top) * aspectFactor; + } + } + if (this.handle.includes('r')) { + right = restrictToBounds(mouseClickPosition.right + deltaX, this.bounds.minRight, this.bounds.maxRight); + if (this.lockAspectRatio && this.resizingOnX) { + bottom = this.bottom - (this.right - right) / aspectFactor; + } + } else if (this.handle.includes('l')) { + left = restrictToBounds(mouseClickPosition.left - deltaX, this.bounds.minLeft, this.bounds.maxLeft); + if (this.lockAspectRatio && this.resizingOnX) { + top = this.top - (this.left - left) / aspectFactor; + } + } + var width = computeWidth(this.parentWidth, left, right); + var height = computeHeight(this.parentHeight, top, bottom); + if (this.onResize(this.handle, left, top, width, height) === false) { + return; + } + this.left = left; + this.top = top; + this.right = right; + this.bottom = bottom; + this.width = width; + this.height = height; + this.$emit('resizing', this.left, this.top, this.width, this.height); + }, + changeWidth: function changeWidth(val) { + var _snapToGrid9 = snapToGrid(this.grid, val, 0, this.scale), + _snapToGrid10 = _slicedToArray(_snapToGrid9, 2), + newWidth = _snapToGrid10[0]; + _snapToGrid10[1]; + var right = restrictToBounds(this.parentWidth - newWidth - this.left, this.bounds.minRight, this.bounds.maxRight); + var bottom = this.bottom; + if (this.lockAspectRatio) { + bottom = this.bottom - (this.right - right) / this.aspectFactor; + } + var width = computeWidth(this.parentWidth, this.left, right); + var height = computeHeight(this.parentHeight, this.top, bottom); + this.right = right; + this.bottom = bottom; + this.width = width; + this.height = height; + }, + changeHeight: function changeHeight(val) { + var _snapToGrid11 = snapToGrid(this.grid, 0, val, this.scale), + _snapToGrid12 = _slicedToArray(_snapToGrid11, 2); + _snapToGrid12[0]; + var newHeight = _snapToGrid12[1]; + var bottom = restrictToBounds(this.parentHeight - newHeight - this.top, this.bounds.minBottom, this.bounds.maxBottom); + var right = this.right; + if (this.lockAspectRatio) { + right = this.right - (this.bottom - bottom) * this.aspectFactor; + } + var width = computeWidth(this.parentWidth, this.left, right); + var height = computeHeight(this.parentHeight, this.top, bottom); + this.right = right; + this.bottom = bottom; + this.width = width; + this.height = height; + }, + // 从控制柄松开 + handleUp: function handleUp(e) { + var _this2 = this; + return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() { + var temArr, refLine, i; + return _regeneratorRuntime().wrap(function _callee2$(_context2) { + while (1) switch (_context2.prev = _context2.next) { + case 0: + _this2.handle = null; + + // 初始化辅助线数据 + temArr = new Array(3).fill({ + display: false, + position: '', + origin: '', + lineLength: '' + }); + refLine = { + vLine: [], + hLine: [] + }; + for (i in refLine) { + refLine[i] = JSON.parse(JSON.stringify(temArr)); + } + if (!_this2.resizing) { + _context2.next = 10; + break; + } + _this2.resizing = false; + _context2.next = 8; + return _this2.conflictCheck(); + case 8: + _this2.$emit('refLineParams', refLine); + _this2.$emit('resizestop', _this2.left, _this2.top, _this2.width, _this2.height); + case 10: + if (!_this2.dragging) { + _context2.next = 16; + break; + } + _this2.dragging = false; + _context2.next = 14; + return _this2.conflictCheck(); + case 14: + _this2.$emit('refLineParams', refLine); + _this2.$emit('dragstop', _this2.left, _this2.top, _this2.width, _this2.height); + case 16: + _this2.resetBoundsAndMouseState(); + removeEvent(document.documentElement, eventsFor.move, _this2.handleResize); + removeEvent(document.documentElement, eventsFor.move, _this2.move); + removeEvent(document.documentElement, 'mouseup', _this2.handleUp); + case 20: + case "end": + return _context2.stop(); + } + }, _callee2); + }))(); + }, + // 新增方法 ↓↓↓ + // 设置属性 + settingAttribute: function settingAttribute() { + // 设置冲突检测 + this.$el.setAttribute('data-is-check', "".concat(this.isConflictCheck)); + // 设置对齐元素 + this.$el.setAttribute('data-is-snap', "".concat(this.snap)); + }, + // 冲突检测 + conflictCheck: function conflictCheck() { + var top = this.top; + var left = this.left; + var width = this.width; + var height = this.height; + if (this.isConflictCheck) { + var nodes = this.$el.parentNode.childNodes; // 获取当前父节点下所有子节点 + var _iterator = _createForOfIteratorHelper(nodes), + _step; + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var item = _step.value; + if (item.className !== undefined && !item.className.includes(this.classNameActive) && item.getAttribute('data-is-check') !== null && item.getAttribute('data-is-check') !== 'false') { + var tw = item.offsetWidth; + var th = item.offsetHeight; + // 正则获取left与right + var _this$formatTransform = this.formatTransformVal(item.style.transform), + _this$formatTransform2 = _slicedToArray(_this$formatTransform, 2), + tl = _this$formatTransform2[0], + tt = _this$formatTransform2[1]; + + // 左上角与右下角重叠 + var tfAndBr = top >= tt && left >= tl && tt + th > top && tl + tw > left || top <= tt && left < tl && top + height > tt && left + width > tl; + // 右上角与左下角重叠 + var brAndTf = left <= tl && top >= tt && left + width > tl && top < tt + th || top < tt && left > tl && top + height > tt && left < tl + tw; + // 下边与上边重叠 + var bAndT = top <= tt && left >= tl && top + height > tt && left < tl + tw || top >= tt && left <= tl && top < tt + th && left > tl + tw; + // 上边与下边重叠(宽度不一样) + var tAndB = top <= tt && left >= tl && top + height > tt && left < tl + tw || top >= tt && left <= tl && top < tt + th && left > tl + tw; + // 左边与右边重叠 + var lAndR = left >= tl && top >= tt && left < tl + tw && top < tt + th || top > tt && left <= tl && left + width > tl && top < tt + th; + // 左边与右边重叠(高度不一样) + var rAndL = top <= tt && left >= tl && top + height > tt && left < tl + tw || top >= tt && left <= tl && top < tt + th && left + width > tl; + + // 如果冲突,就将回退到移动前的位置 + if (tfAndBr || brAndTf || bAndT || tAndB || lAndR || rAndL) { + this.top = this.mouseClickPosition.top; + this.left = this.mouseClickPosition.left; + this.right = this.mouseClickPosition.right; + this.bottom = this.mouseClickPosition.bottom; + this.width = this.mouseClickPosition.w; + this.height = this.mouseClickPosition.h; + this.$emit('resizing', this.left, this.top, this.width, this.height); + } + } + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + } + }, + // 检测对齐元素 + snapCheck: function snapCheck() { + var _this3 = this; + return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() { + var width, height, activeLeft, activeRight, activeTop, activeBottom, temArr, refLine, i, nodes, tem, _yield$_this3$getActi, groupWidth, groupHeight, groupLeft, groupTop, bln, _iterator2, _step2, item, w, h, _this3$formatTransfor, _this3$formatTransfor2, l, t, r, b, hc, vc, ts, TS, bs, BS, ls, LS, rs, RS, arrTem, _i, xory, horv, _this3$calcLineValues, origin, length; + return _regeneratorRuntime().wrap(function _callee3$(_context3) { + while (1) switch (_context3.prev = _context3.next) { + case 0: + width = _this3.width; + height = _this3.height; + if (!_this3.snap) { + _context3.next = 24; + break; + } + activeLeft = _this3.left; + activeRight = _this3.left + width; + activeTop = _this3.top; + activeBottom = _this3.top + height; // 初始化辅助线数据 + temArr = new Array(3).fill({ + display: false, + position: '', + origin: '', + lineLength: '' + }); + refLine = { + vLine: [], + hLine: [] + }; + for (i in refLine) { + refLine[i] = JSON.parse(JSON.stringify(temArr)); + } + + // 获取当前父节点下所有子节点 + nodes = _this3.$el.parentNode.childNodes; + tem = { + value: { + x: [[], [], []], + y: [[], [], []] + }, + display: [], + position: [] + }; + _context3.next = 14; + return _this3.getActiveAll(nodes); + case 14: + _yield$_this3$getActi = _context3.sent; + groupWidth = _yield$_this3$getActi.groupWidth; + groupHeight = _yield$_this3$getActi.groupHeight; + groupLeft = _yield$_this3$getActi.groupLeft; + groupTop = _yield$_this3$getActi.groupTop; + bln = _yield$_this3$getActi.bln; + if (!bln) { + width = groupWidth; + height = groupHeight; + activeLeft = groupLeft; + activeRight = groupLeft + groupWidth; + activeTop = groupTop; + activeBottom = groupTop + groupHeight; + } + _iterator2 = _createForOfIteratorHelper(nodes); + try { + for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { + item = _step2.value; + if (item.className !== undefined && !item.className.includes(_this3.classNameActive) && item.getAttribute('data-is-snap') !== null && item.getAttribute('data-is-snap') !== 'false') { + w = item.offsetWidth; + h = item.offsetHeight; + _this3$formatTransfor = _this3.formatTransformVal(item.style.transform), _this3$formatTransfor2 = _slicedToArray(_this3$formatTransfor, 2), l = _this3$formatTransfor2[0], t = _this3$formatTransfor2[1]; + r = l + w; // 对齐目标right + b = t + h; // 对齐目标的bottom + hc = Math.abs(activeTop + height / 2 - (t + h / 2)) <= _this3.snapTolerance; // 水平中线 + vc = Math.abs(activeLeft + width / 2 - (l + w / 2)) <= _this3.snapTolerance; // 垂直中线 + ts = Math.abs(t - activeBottom) <= _this3.snapTolerance; // 从上到下 + TS = Math.abs(b - activeBottom) <= _this3.snapTolerance; // 从上到下 + bs = Math.abs(t - activeTop) <= _this3.snapTolerance; // 从下到上 + BS = Math.abs(b - activeTop) <= _this3.snapTolerance; // 从下到上 + ls = Math.abs(l - activeRight) <= _this3.snapTolerance; // 外左 + LS = Math.abs(r - activeRight) <= _this3.snapTolerance; // 外左 + rs = Math.abs(l - activeLeft) <= _this3.snapTolerance; // 外右 + RS = Math.abs(r - activeLeft) <= _this3.snapTolerance; // 外右 + tem['display'] = [ts, TS, bs, BS, hc, hc, ls, LS, rs, RS, vc, vc]; + tem['position'] = [t, b, t, b, t + h / 2, t + h / 2, l, r, l, r, l + w / 2, l + w / 2]; + + // fix:中线自动对齐,元素可能超过父元素边界的问题 + if (ts) { + if (bln) { + _this3.top = Math.max(t - height, _this3.bounds.minTop); + _this3.bottom = _this3.parentHeight - _this3.top - height; + } + tem.value.y[0].push(l, r, activeLeft, activeRight); + } + if (bs) { + if (bln) { + _this3.top = t; + _this3.bottom = _this3.parentHeight - _this3.top - height; + } + tem.value.y[0].push(l, r, activeLeft, activeRight); + } + if (TS) { + if (bln) { + _this3.top = Math.max(b - height, _this3.bounds.minTop); + _this3.bottom = _this3.parentHeight - _this3.top - height; + } + tem.value.y[1].push(l, r, activeLeft, activeRight); + } + if (BS) { + if (bln) { + _this3.top = b; + _this3.bottom = _this3.parentHeight - _this3.top - height; + } + tem.value.y[1].push(l, r, activeLeft, activeRight); + } + if (ls) { + if (bln) { + _this3.left = Math.max(l - width, _this3.bounds.minLeft); + _this3.right = _this3.parentWidth - _this3.left - width; + } + tem.value.x[0].push(t, b, activeTop, activeBottom); + } + if (rs) { + if (bln) { + _this3.left = l; + _this3.right = _this3.parentWidth - _this3.left - width; + } + tem.value.x[0].push(t, b, activeTop, activeBottom); + } + if (LS) { + if (bln) { + _this3.left = Math.max(r - width, _this3.bounds.minLeft); + _this3.right = _this3.parentWidth - _this3.left - width; + } + tem.value.x[1].push(t, b, activeTop, activeBottom); + } + if (RS) { + if (bln) { + _this3.left = r; + _this3.right = _this3.parentWidth - _this3.left - width; + } + tem.value.x[1].push(t, b, activeTop, activeBottom); + } + if (hc) { + if (bln) { + _this3.top = Math.max(t + h / 2 - height / 2, _this3.bounds.minTop); + _this3.bottom = _this3.parentHeight - _this3.top - height; + } + tem.value.y[2].push(l, r, activeLeft, activeRight); + } + if (vc) { + if (bln) { + _this3.left = Math.max(l + w / 2 - width / 2, _this3.bounds.minLeft); + _this3.right = _this3.parentWidth - _this3.left - width; + } + tem.value.x[2].push(t, b, activeTop, activeBottom); + } + // 辅助线坐标与是否显示(display)对应的数组,易于循环遍历 + arrTem = [0, 1, 0, 1, 2, 2, 0, 1, 0, 1, 2, 2]; + for (_i = 0; _i <= arrTem.length; _i++) { + // 前6为Y辅助线,后6为X辅助线 + xory = _i < 6 ? 'y' : 'x'; + horv = _i < 6 ? 'hLine' : 'vLine'; + if (tem.display[_i]) { + _this3$calcLineValues = _this3.calcLineValues(tem.value[xory][arrTem[_i]]), origin = _this3$calcLineValues.origin, length = _this3$calcLineValues.length; + refLine[horv][arrTem[_i]].display = tem.display[_i]; + refLine[horv][arrTem[_i]].position = tem.position[_i] + 'px'; + refLine[horv][arrTem[_i]].origin = origin; + refLine[horv][arrTem[_i]].lineLength = length; + } + } + } + } + } catch (err) { + _iterator2.e(err); + } finally { + _iterator2.f(); + } + _this3.$emit('refLineParams', refLine); + case 24: + case "end": + return _context3.stop(); + } + }, _callee3); + }))(); + }, + calcLineValues: function calcLineValues(arr) { + var length = Math.max.apply(Math, _toConsumableArray(arr)) - Math.min.apply(Math, _toConsumableArray(arr)) + 'px'; + var origin = Math.min.apply(Math, _toConsumableArray(arr)) + 'px'; + return { + length: length, + origin: origin + }; + }, + getActiveAll: function getActiveAll(nodes) { + var _this4 = this; + return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() { + var activeAll, XArray, YArray, groupWidth, groupHeight, groupLeft, groupTop, _iterator3, _step3, item, AllLength, _iterator4, _step4, i, l, r, t, b, bln; + return _regeneratorRuntime().wrap(function _callee4$(_context4) { + while (1) switch (_context4.prev = _context4.next) { + case 0: + activeAll = []; + XArray = []; + YArray = []; + groupWidth = 0; + groupHeight = 0; + groupLeft = 0; + groupTop = 0; + _iterator3 = _createForOfIteratorHelper(nodes); + try { + for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { + item = _step3.value; + if (item.className !== undefined && item.className.includes(_this4.classNameActive)) { + activeAll.push(item); + } + } + } catch (err) { + _iterator3.e(err); + } finally { + _iterator3.f(); + } + AllLength = activeAll.length; + if (AllLength > 1) { + _iterator4 = _createForOfIteratorHelper(activeAll); + try { + for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) { + i = _step4.value; + l = i.offsetLeft; + r = l + i.offsetWidth; + t = i.offsetTop; + b = t + i.offsetHeight; + XArray.push(t, b); + YArray.push(l, r); + } + } catch (err) { + _iterator4.e(err); + } finally { + _iterator4.f(); + } + groupWidth = Math.max.apply(Math, YArray) - Math.min.apply(Math, YArray); + groupHeight = Math.max.apply(Math, XArray) - Math.min.apply(Math, XArray); + groupLeft = Math.min.apply(Math, YArray); + groupTop = Math.min.apply(Math, XArray); + } + bln = AllLength === 1; + return _context4.abrupt("return", { + groupWidth: groupWidth, + groupHeight: groupHeight, + groupLeft: groupLeft, + groupTop: groupTop, + bln: bln + }); + case 13: + case "end": + return _context4.stop(); + } + }, _callee4); + }))(); + }, + // 正则获取left与top + formatTransformVal: function formatTransformVal(string) { + var _string$replace$split = string.replace(/[^0-9\-,]/g, '').split(','), + _string$replace$split2 = _slicedToArray(_string$replace$split, 2), + left = _string$replace$split2[0], + top = _string$replace$split2[1]; + if (top === undefined) top = 0; + return [+left, +top]; + } + }, + computed: { + handleStyle: function handleStyle() { + var _this5 = this; + return function (stick) { + if (!_this5.handleInfo.switch) return { + display: _this5.enabled ? 'block' : 'none' + }; + var size = (_this5.handleInfo.size / _this5.scaleRatio).toFixed(2); + var offset = (_this5.handleInfo.offset / _this5.scaleRatio).toFixed(2); + var center = (size / 2).toFixed(2); + var styleMap = { + tl: { + top: "".concat(offset, "px"), + left: "".concat(offset, "px") + }, + tm: { + top: "".concat(offset, "px"), + left: "calc(50% - ".concat(center, "px)") + }, + tr: { + top: "".concat(offset, "px"), + right: "".concat(offset, "px") + }, + mr: { + top: "calc(50% - ".concat(center, "px)"), + right: "".concat(offset, "px") + }, + br: { + bottom: "".concat(offset, "px"), + right: "".concat(offset, "px") + }, + bm: { + bottom: "".concat(offset, "px"), + right: "calc(50% - ".concat(center, "px)") + }, + bl: { + bottom: "".concat(offset, "px"), + left: "".concat(offset, "px") + }, + ml: { + top: "calc(50% - ".concat(center, "px)"), + left: "".concat(offset, "px") + } + }; + var stickStyle = { + width: "".concat(size, "px"), + height: "".concat(size, "px"), + top: styleMap[stick].top, + left: styleMap[stick].left, + right: styleMap[stick].right, + bottom: styleMap[stick].bottom + }; + stickStyle.display = _this5.enabled ? 'block' : 'none'; + return stickStyle; + }; + }, + style: function style() { + if (this.perspective > 0) { + return _objectSpread2({ + transform: this.transform ? "perspective(".concat(this.perspective, "px) translate(").concat(this.left, "px, ").concat(this.top, "px)") + '' + this.transform : "translate(".concat(this.left, "px, ").concat(this.top, "px)"), + '-ms-transform': this.transform ? "perspective(".concat(this.perspective, "px) translate(").concat(this.left, "px, ").concat(this.top, "px)") + '' + this.transform : "translate(".concat(this.left, "px, ").concat(this.top, "px)"), + '-moz-transform': this.transform ? "perspective(".concat(this.perspective, "px) translate(").concat(this.left, "px, ").concat(this.top, "px)") + '' + this.transform : "translate(".concat(this.left, "px, ").concat(this.top, "px)"), + '-webkit-transform': this.transform ? "perspective(".concat(this.perspective, "px) translate(").concat(this.left, "px, ").concat(this.top, "px)") + '' + this.transform : "translate(".concat(this.left, "px, ").concat(this.top, "px)"), + '-o-transform': this.transform ? "perspective(".concat(this.perspective, "px) translate(").concat(this.left, "px, ").concat(this.top, "px)") + '' + this.transform : "translate(".concat(this.left, "px, ").concat(this.top, "px)"), + width: this.computedWidth, + height: this.computedHeight, + zIndex: this.zIndex + }, this.dragging && this.disableUserSelect ? userSelectNone : userSelectAuto); + } else { + return _objectSpread2({ + transform: this.transform ? "translate(".concat(this.left, "px, ").concat(this.top, "px)") + '' + this.transform : "translate(".concat(this.left, "px, ").concat(this.top, "px)"), + '-ms-transform': this.transform ? "translate(".concat(this.left, "px, ").concat(this.top, "px)") + '' + this.transform : "translate(".concat(this.left, "px, ").concat(this.top, "px)"), + '-moz-transform': this.transform ? "translate(".concat(this.left, "px, ").concat(this.top, "px)") + '' + this.transform : "translate(".concat(this.left, "px, ").concat(this.top, "px)"), + '-webkit-transform': this.transform ? "translate(".concat(this.left, "px, ").concat(this.top, "px)") + '' + this.transform : "translate(".concat(this.left, "px, ").concat(this.top, "px)"), + '-o-transform': this.transform ? "translate(".concat(this.left, "px, ").concat(this.top, "px)") + '' + this.transform : "translate(".concat(this.left, "px, ").concat(this.top, "px)"), + width: this.computedWidth, + height: this.computedHeight, + zIndex: this.zIndex + }, this.dragging && this.disableUserSelect ? userSelectNone : userSelectAuto); + } + }, + // 控制柄显示与否 + actualHandles: function actualHandles() { + if (!this.resizable) return []; + return this.handles; + }, + computedWidth: function computedWidth() { + if (this.w === 'auto') { + if (!this.widthTouched) { + return 'auto'; + } + } + return this.width + 'px'; + }, + computedHeight: function computedHeight() { + if (this.h === 'auto') { + if (!this.heightTouched) { + return 'auto'; + } + } + return this.height + 'px'; + }, + resizingOnX: function resizingOnX() { + return Boolean(this.handle) && (this.handle.includes('l') || this.handle.includes('r')); + }, + resizingOnY: function resizingOnY() { + return Boolean(this.handle) && (this.handle.includes('t') || this.handle.includes('b')); + }, + isCornerHandle: function isCornerHandle() { + return Boolean(this.handle) && ['tl', 'tr', 'br', 'bl'].includes(this.handle); + } + }, + watch: { + active: function active(val) { + this.enabled = val; + if (val) ; else { + this.$emit('deactivated'); + } + }, + z: function z(val) { + if (val >= 0 || val === 'auto') { + this.zIndex = val; + } + }, + x: function x(val) { + if (this.resizing || this.dragging) { + return; + } + if (this.parent) { + this.bounds = this.calcDragLimits(); + } + this.moveHorizontally(val); + }, + y: function y(val) { + if (this.resizing || this.dragging) { + return; + } + if (this.parent) { + this.bounds = this.calcDragLimits(); + } + this.moveVertically(val); + }, + lockAspectRatio: function lockAspectRatio(val) { + if (val) { + this.aspectFactor = this.width / this.height; + } else { + this.aspectFactor = undefined; + } + }, + minWidth: function minWidth(val) { + if (val > 0 && val <= this.width) { + this.minW = val; + } + }, + minHeight: function minHeight(val) { + if (val > 0 && val <= this.height) { + this.minH = val; + } + }, + maxWidth: function maxWidth(val) { + this.maxW = val; + }, + maxHeight: function maxHeight(val) { + this.maxH = val; + }, + w: function w(val) { + if (this.resizing || this.dragging) { + return; + } + if (this.parent) { + this.bounds = this.calcResizeLimits(); + } + this.changeWidth(val); + }, + h: function h(val) { + if (this.resizing || this.dragging) { + return; + } + if (this.parent) { + this.bounds = this.calcResizeLimits(); + } + this.changeHeight(val); + } + } +}; + +/* script */ +const __vue_script__$a = script$a; + +/* template */ +var __vue_render__$a = function () { + var _obj; + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c( + "div", + { + class: [ + ((_obj = {}), + (_obj[_vm.classNameActive] = _vm.enabled), + (_obj[_vm.classNameDragging] = _vm.dragging), + (_obj[_vm.classNameResizing] = _vm.resizing), + (_obj[_vm.classNameDraggable] = _vm.draggable), + (_obj[_vm.classNameResizable] = _vm.resizable), + _obj), + _vm.className, + ], + style: _vm.style, + on: { + mousedown: _vm.elementMouseDown, + touchstart: _vm.elementTouchDown, + contextmenu: _vm.onContextMenu, + }, + }, + [ + _vm._l(_vm.actualHandles, function (handle) { + return _c( + "div", + { + key: handle, + class: [_vm.classNameHandle, _vm.classNameHandle + "-" + handle], + style: _vm.handleStyle(handle), + on: { + mousedown: function ($event) { + $event.stopPropagation(); + $event.preventDefault(); + return _vm.handleDown(handle, $event) + }, + touchstart: function ($event) { + $event.stopPropagation(); + $event.preventDefault(); + return _vm.handleTouchDown(handle, $event) + }, + }, + }, + [_vm._t(handle)], + 2 + ) + }), + _vm._v(" "), + _vm._t("default"), + ], + 2 + ) +}; +var __vue_staticRenderFns__$a = []; +__vue_render__$a._withStripped = true; + + /* style */ + const __vue_inject_styles__$a = function (inject) { + if (!inject) return + inject("data-v-95085f0c_0", { source: ".vdr[data-v-95085f0c] {\n touch-action: none;\n position: absolute;\n box-sizing: border-box;\n border: 1px dashed #d6d6d6;\n}\n.handle[data-v-95085f0c] {\n box-sizing: border-box;\n position: absolute;\n width: 8px;\n height: 8px;\n background: #ffffff;\n border: 1px solid #333;\n box-shadow: 0 0 2px #bbb;\n}\n.handle-tl[data-v-95085f0c] {\n top: -5px;\n left: -5px;\n cursor: nw-resize;\n}\n.handle-tm[data-v-95085f0c] {\n top: -5px;\n left: calc(50% - 4px);\n /*margin-left: -5px;*/\n cursor: n-resize;\n}\n.handle-tr[data-v-95085f0c] {\n top: -5px;\n right: -5px;\n cursor: ne-resize;\n}\n.handle-ml[data-v-95085f0c] {\n top: calc(50% - 4px);\n /*margin-top: -5px;*/\n left: -5px;\n cursor: w-resize;\n}\n.handle-mr[data-v-95085f0c] {\n top: calc(50% - 4px);\n /*margin-top: -5px;*/\n right: -5px;\n cursor: e-resize;\n}\n.handle-bl[data-v-95085f0c] {\n bottom: -5px;\n left: -5px;\n cursor: sw-resize;\n}\n.handle-bm[data-v-95085f0c] {\n bottom: -5px;\n left: calc(50% - 4px);\n /*margin-left: -5px;*/\n cursor: s-resize;\n}\n.handle-br[data-v-95085f0c] {\n bottom: -5px;\n right: -5px;\n cursor: se-resize;\n}\n.ref-line[data-v-95085f0c] {\n position: absolute;\n background-color: #ff00cc;\n z-index: 9999;\n}\n.v-line[data-v-95085f0c] {\n width: 1px;\n}\n.h-line[data-v-95085f0c] {\n height: 1px;\n}\n@media only screen and (max-width: 768px) {\n[class*=\"handle-\"][data-v-95085f0c]:before {\n content: \"\";\n left: -10px;\n right: -10px;\n bottom: -10px;\n top: -10px;\n position: absolute;\n}\n}\n", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,kBAAkB;EAClB,sBAAsB;EACtB,0BAA0B;AAC5B;AACA;EACE,sBAAsB;EACtB,kBAAkB;EAClB,UAAU;EACV,WAAW;EACX,mBAAmB;EACnB,sBAAsB;EACtB,wBAAwB;AAC1B;AACA;EACE,SAAS;EACT,UAAU;EACV,iBAAiB;AACnB;AACA;EACE,SAAS;EACT,qBAAqB;EACrB,qBAAqB;EACrB,gBAAgB;AAClB;AACA;EACE,SAAS;EACT,WAAW;EACX,iBAAiB;AACnB;AACA;EACE,oBAAoB;EACpB,oBAAoB;EACpB,UAAU;EACV,gBAAgB;AAClB;AACA;EACE,oBAAoB;EACpB,oBAAoB;EACpB,WAAW;EACX,gBAAgB;AAClB;AACA;EACE,YAAY;EACZ,UAAU;EACV,iBAAiB;AACnB;AACA;EACE,YAAY;EACZ,qBAAqB;EACrB,qBAAqB;EACrB,gBAAgB;AAClB;AACA;EACE,YAAY;EACZ,WAAW;EACX,iBAAiB;AACnB;AACA;EACE,kBAAkB;EAClB,yBAAyB;EACzB,aAAa;AACf;AACA;EACE,UAAU;AACZ;AACA;EACE,WAAW;AACb;AACA;AACE;IACE,WAAW;IACX,WAAW;IACX,YAAY;IACZ,aAAa;IACb,UAAU;IACV,kBAAkB;AACpB;AACF","file":"index.vue","sourcesContent":[".vdr {\n touch-action: none;\n position: absolute;\n box-sizing: border-box;\n border: 1px dashed #d6d6d6;\n}\n.handle {\n box-sizing: border-box;\n position: absolute;\n width: 8px;\n height: 8px;\n background: #ffffff;\n border: 1px solid #333;\n box-shadow: 0 0 2px #bbb;\n}\n.handle-tl {\n top: -5px;\n left: -5px;\n cursor: nw-resize;\n}\n.handle-tm {\n top: -5px;\n left: calc(50% - 4px);\n /*margin-left: -5px;*/\n cursor: n-resize;\n}\n.handle-tr {\n top: -5px;\n right: -5px;\n cursor: ne-resize;\n}\n.handle-ml {\n top: calc(50% - 4px);\n /*margin-top: -5px;*/\n left: -5px;\n cursor: w-resize;\n}\n.handle-mr {\n top: calc(50% - 4px);\n /*margin-top: -5px;*/\n right: -5px;\n cursor: e-resize;\n}\n.handle-bl {\n bottom: -5px;\n left: -5px;\n cursor: sw-resize;\n}\n.handle-bm {\n bottom: -5px;\n left: calc(50% - 4px);\n /*margin-left: -5px;*/\n cursor: s-resize;\n}\n.handle-br {\n bottom: -5px;\n right: -5px;\n cursor: se-resize;\n}\n.ref-line {\n position: absolute;\n background-color: #ff00cc;\n z-index: 9999;\n}\n.v-line {\n width: 1px;\n}\n.h-line {\n height: 1px;\n}\n@media only screen and (max-width: 768px) {\n [class*=\"handle-\"]:before {\n content: \"\";\n left: -10px;\n right: -10px;\n bottom: -10px;\n top: -10px;\n position: absolute;\n }\n}\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__$a = "data-v-95085f0c"; + /* module identifier */ + const __vue_module_identifier__$a = undefined; + /* functional template */ + const __vue_is_functional_template__$a = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$a = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$a, staticRenderFns: __vue_staticRenderFns__$a }, + __vue_inject_styles__$a, + __vue_script__$a, + __vue_scope_id__$a, + __vue_is_functional_template__$a, + __vue_module_identifier__$a, + false, + createInjector, + undefined, + undefined + ); + +var script$9 = { + name: 'ConfigItem', + components: _defineProperty(_defineProperty({}, Row.name, Row), Col.name, Col), + props: { + title: { + type: String, + default: '' + } + } +}; + +/* script */ +const __vue_script__$9 = script$9; + +/* template */ +var __vue_render__$9 = function () { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c( + "div", + { staticClass: "config-item" }, + [ + _c( + "a-row", + { staticClass: "config-item-title" }, + [ + _c("a-col", { attrs: { span: 6 } }, [_vm._v(_vm._s(_vm.title))]), + _vm._v(" "), + _c("a-col", { attrs: { span: 18 } }, [ + _c( + "div", + { staticClass: "config-item-auxiliary" }, + [_vm._t("auxiliary")], + 2 + ), + _vm._v(" "), + _c( + "div", + { staticClass: "config-item-enhance" }, + [_vm._t("enhance")], + 2 + ), + ]), + ], + 1 + ), + _vm._v(" "), + _c("div", { staticClass: "config-item-content" }, [_vm._t("content")], 2), + ], + 1 + ) +}; +var __vue_staticRenderFns__$9 = []; +__vue_render__$9._withStripped = true; + + /* style */ + const __vue_inject_styles__$9 = function (inject) { + if (!inject) return + inject("data-v-eced1050_0", { source: ".config-item[data-v-eced1050] {\n padding: 10px 12px;\n}\n.config-item-enhance[data-v-eced1050] {\n margin-top: 12px;\n}\n.config-item-content[data-v-eced1050] {\n margin-top: 12px;\n}\n", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;AACpB;AACA;EACE,gBAAgB;AAClB;AACA;EACE,gBAAgB;AAClB","file":"index.vue","sourcesContent":[".config-item {\n padding: 10px 12px;\n}\n.config-item-enhance {\n margin-top: 12px;\n}\n.config-item-content {\n margin-top: 12px;\n}\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__$9 = "data-v-eced1050"; + /* module identifier */ + const __vue_module_identifier__$9 = undefined; + /* functional template */ + const __vue_is_functional_template__$9 = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$9 = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$9, staticRenderFns: __vue_staticRenderFns__$9 }, + __vue_inject_styles__$9, + __vue_script__$9, + __vue_scope_id__$9, + __vue_is_functional_template__$9, + __vue_module_identifier__$9, + false, + createInjector, + undefined, + undefined + ); + +// +// +// +// +// +// +// +// +// +// +// +// + +var script$8 = { + name: 'EditScreens', + data: function data() { + return { + width: '', + isPressSpace: false + }; + }, + methods: { + handleScroll: function handleScroll() { + var $app = this.$refs.$app; + var refSketchRuleBox = this.$refs.refSketchRuleBox; + if (!$app) return; + var screensRect = $app.getBoundingClientRect(); + var canvasRect = refSketchRuleBox.getBoundingClientRect(); + var perspectiveX = screensRect.left - canvasRect.left; + var perspectiveY = screensRect.top - canvasRect.top; + this.$emit('handleScroll', { + perspectiveX: perspectiveX, + perspectiveY: perspectiveY + }); + }, + handleOtherStop: function handleOtherStop() { + this.$emit('handleOtherStop'); + } + } +}; + +/* script */ +const __vue_script__$8 = script$8; + +/* template */ +var __vue_render__$8 = function () { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c( + "div", + { + ref: "$app", + staticClass: "edit-screens", + on: { scroll: _vm.handleScroll }, + }, + [ + _c("div", { ref: "$container", staticClass: "edit-screen-container" }, [ + _c( + "div", + { + ref: "refSketchRuleBox", + staticClass: "canvas", + on: { click: _vm.handleOtherStop }, + }, + [ + _c( + "div", + { style: { pointerEvents: _vm.isPressSpace ? "none" : "auto" } }, + [_vm._t("default")], + 2 + ), + ] + ), + ]), + ] + ) +}; +var __vue_staticRenderFns__$8 = []; +__vue_render__$8._withStripped = true; + + /* style */ + const __vue_inject_styles__$8 = function (inject) { + if (!inject) return + inject("data-v-6541cebf_0", { source: ".edit-screens[data-v-6541cebf] {\n position: relative;\n margin: 24px 0 0 24px;\n width: calc(100% - 24px);\n height: calc(100% - 24px);\n overflow: auto;\n user-select: none;\n}\n.edit-screens .edit-screen-container[data-v-6541cebf] {\n position: absolute;\n width: 100%;\n height: 100%;\n}\n.edit-screens .edit-screen-container .canvas[data-v-6541cebf] {\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,qBAAqB;EACrB,wBAAwB;EACxB,yBAAyB;EACzB,cAAc;EACd,iBAAiB;AACnB;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,WAAW;EACX,YAAY;AACd","file":"index.vue","sourcesContent":[".edit-screens {\n position: relative;\n margin: 24px 0 0 24px;\n width: calc(100% - 24px);\n height: calc(100% - 24px);\n overflow: auto;\n user-select: none;\n}\n.edit-screens .edit-screen-container {\n position: absolute;\n width: 100%;\n height: 100%;\n}\n.edit-screens .edit-screen-container .canvas {\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__$8 = "data-v-6541cebf"; + /* module identifier */ + const __vue_module_identifier__$8 = undefined; + /* functional template */ + const __vue_is_functional_template__$8 = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$8 = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$8, staticRenderFns: __vue_staticRenderFns__$8 }, + __vue_inject_styles__$8, + __vue_script__$8, + __vue_scope_id__$8, + __vue_is_functional_template__$8, + __vue_module_identifier__$8, + false, + createInjector, + undefined, + undefined + ); + +var script$7 = { + name: 'Feedback', + props: _objectSpread2({}, Result.props), + components: _defineProperty({}, Result.name, Result), + data: function data() { + return {}; + } +}; + +/* script */ +const __vue_script__$7 = script$7; + +/* template */ +var __vue_render__$7 = function () { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c( + "div", + { staticClass: "feedback" }, + [_c("a-result", _vm._b({}, "a-result", _vm.$props, false))], + 1 + ) +}; +var __vue_staticRenderFns__$7 = []; +__vue_render__$7._withStripped = true; + + /* style */ + const __vue_inject_styles__$7 = function (inject) { + if (!inject) return + inject("data-v-4ea49bf0_0", { source: "[data-v-4ea49bf0]:export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n[data-v-4ea49bf0] .ant-result-title {\n color: white;\n}\n[data-v-4ea49bf0] .ant-result-subtitle {\n color: white;\n}\n.feedback[data-v-4ea49bf0] {\n height: 100%;\n background-color: #141414;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n", map: {"version":3,"sources":["index.vue","C:\\Users\\lihq1\\Desktop\\开源\\vue-lcd-engine\\components\\Feedback\\index.vue"],"names":[],"mappings":"AAAA;EACE,sBAAsB;EACtB,mBAAmB;EACnB,sBAAsB;EACtB,sBAAsB;EACtB,oBAAoB;EACpB,mBAAmB;EACnB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,iBAAiB;EACjB,6BAA6B;EAC7B,wCAAwC;AAC1C;AACC;EACC,YAAY;AACd;AACC;ECCD,YAAA;ADCA;ACCA;EACA,YAAA;EACA,yBAAA;EDCE,aAAa;ECCf,mBAAA;EACA,uBAAA;AACA","file":"index.vue","sourcesContent":[":export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n /deep/ .ant-result-title {\n color: white;\n}\n /deep/ .ant-result-subtitle {\n color: white;\n}\n.feedback {\n height: 100%;\n background-color: #141414;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n","\r\n\r\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__$7 = "data-v-4ea49bf0"; + /* module identifier */ + const __vue_module_identifier__$7 = undefined; + /* functional template */ + const __vue_is_functional_template__$7 = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$7 = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$7, staticRenderFns: __vue_staticRenderFns__$7 }, + __vue_inject_styles__$7, + __vue_script__$7, + __vue_scope_id__$7, + __vue_is_functional_template__$7, + __vue_module_identifier__$7, + false, + createInjector, + undefined, + undefined + ); + +// +// +// +// +// +// +// +// +// +// +// +// + +var script$6 = { + name: 'Layout', + props: { + logo: { + type: String, + default: '' + }, + title: { + type: String, + default: '' + } + } +}; + +/* script */ +const __vue_script__$6 = script$6; + +/* template */ +var __vue_render__$6 = function () { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c("div", { staticClass: "layout" }, [ + _c("header", { staticClass: "layout-header" }, [ + _c("img", { + staticClass: "header-logo", + attrs: { src: _vm.logo, alt: "logo" }, + }), + _vm._v(" "), + _c("span", { staticClass: "header-title" }, [_vm._v(_vm._s(_vm.title))]), + ]), + _vm._v(" "), + _c("main", { staticClass: "layout-main" }, [_c("router-view")], 1), + ]) +}; +var __vue_staticRenderFns__$6 = []; +__vue_render__$6._withStripped = true; + + /* style */ + const __vue_inject_styles__$6 = function (inject) { + if (!inject) return + inject("data-v-3bbf3843_0", { source: "[data-v-3bbf3843]:export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.layout[data-v-3bbf3843] {\n background-color: #141414;\n height: 100%;\n}\n.layout-header[data-v-3bbf3843] {\n height: 60px;\n background-color: #1f1f1f;\n padding: 16px 24px;\n display: flex;\n align-items: center;\n justify-content: left;\n box-shadow: 0px 1px 0px 0px #000000;\n border-bottom: 1px solid #404040;\n}\n.layout-header .header-logo[data-v-3bbf3843] {\n width: 24px;\n height: 24px;\n}\n.layout-header .header-title[data-v-3bbf3843] {\n font-size: 20px;\n margin-left: 12px;\n}\n.layout-main[data-v-3bbf3843] {\n height: calc(100% - 60px);\n overflow-y: auto;\n}\n", map: {"version":3,"sources":["index.vue","C:\\Users\\lihq1\\Desktop\\开源\\vue-lcd-engine\\components\\Layout\\index.vue"],"names":[],"mappings":"AAAA;EACE,sBAAsB;EACtB,mBAAmB;EACnB,sBAAsB;EACtB,sBAAsB;EACtB,oBAAoB;EACpB,mBAAmB;EACnB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,iBAAiB;EACjB,6BAA6B;EAC7B,wCAAwC;AAC1C;AACA;EACE,yBAAyB;EACzB,YAAY;AACd;AACA;EACE,YAAY;EACZ,yBAAyB;EACzB,kBAAkB;EAClB,aAAa;EACb,mBAAmB;EACnB,qBAAqB;EACrB,mCAAmC;ECCrC,gCAAA;ADCA;ACCA;EACA,WAAA;EACA,YAAA;ADCA;ACCA;EACA,eAAA;EACA,iBAAA;AACA;AACA;EACA,yBAAA;EACA,gBAAA;AACA","file":"index.vue","sourcesContent":[":export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.layout {\n background-color: #141414;\n height: 100%;\n}\n.layout-header {\n height: 60px;\n background-color: #1f1f1f;\n padding: 16px 24px;\n display: flex;\n align-items: center;\n justify-content: left;\n box-shadow: 0px 1px 0px 0px #000000;\n border-bottom: 1px solid #404040;\n}\n.layout-header .header-logo {\n width: 24px;\n height: 24px;\n}\n.layout-header .header-title {\n font-size: 20px;\n margin-left: 12px;\n}\n.layout-main {\n height: calc(100% - 60px);\n overflow-y: auto;\n}\n","\r\n\r\n\r\n\r\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__$6 = "data-v-3bbf3843"; + /* module identifier */ + const __vue_module_identifier__$6 = undefined; + /* functional template */ + const __vue_is_functional_template__$6 = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$6 = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$6, staticRenderFns: __vue_staticRenderFns__$6 }, + __vue_inject_styles__$6, + __vue_script__$6, + __vue_scope_id__$6, + __vue_is_functional_template__$6, + __vue_module_identifier__$6, + false, + createInjector, + undefined, + undefined + ); + +var script$5 = { + name: 'Loading', + components: _defineProperty({}, Spin.name, Spin), + data: function data() { + return { + visible: true + }; + } +}; + +/* script */ +const __vue_script__$5 = script$5; + +/* template */ +var __vue_render__$5 = function () { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c( + "a-spin", + { attrs: { spinning: _vm.visible, wrapperClassName: "loading" } }, + [_vm.visible ? _c("div", { staticClass: "loading" }) : _vm._e()] + ) +}; +var __vue_staticRenderFns__$5 = []; +__vue_render__$5._withStripped = true; + + /* style */ + const __vue_inject_styles__$5 = function (inject) { + if (!inject) return + inject("data-v-3d236889_0", { source: ".loading[data-v-3d236889] {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 44;\n}\n.loading-box[data-v-3d236889] {\n position: absolute;\n left: 50%;\n top: 50%;\n width: 100px;\n transform: translate(-50%, -50%);\n line-height: 28px;\n}\n.loading-box i[data-v-3d236889] {\n font-size: 24px;\n margin-right: 5px;\n}\n", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,OAAO;EACP,QAAQ;EACR,MAAM;EACN,SAAS;EACT,WAAW;AACb;AACA;EACE,kBAAkB;EAClB,SAAS;EACT,QAAQ;EACR,YAAY;EACZ,gCAAgC;EAChC,iBAAiB;AACnB;AACA;EACE,eAAe;EACf,iBAAiB;AACnB","file":"index.vue","sourcesContent":[".loading {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 44;\n}\n.loading-box {\n position: absolute;\n left: 50%;\n top: 50%;\n width: 100px;\n transform: translate(-50%, -50%);\n line-height: 28px;\n}\n.loading-box i {\n font-size: 24px;\n margin-right: 5px;\n}\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__$5 = "data-v-3d236889"; + /* module identifier */ + const __vue_module_identifier__$5 = undefined; + /* functional template */ + const __vue_is_functional_template__$5 = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$5 = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$5, staticRenderFns: __vue_staticRenderFns__$5 }, + __vue_inject_styles__$5, + __vue_script__$5, + __vue_scope_id__$5, + __vue_is_functional_template__$5, + __vue_module_identifier__$5, + false, + createInjector, + undefined, + undefined + ); + +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// + +var script$4 = { + name: 'SketchRule', + props: { + mode: { + type: String, + default: 'horizontal' + }, + width: { + type: Number + }, + height: { + type: Number + }, + configColor: { + type: Object, + default: function _default() { + return { + fillStyle: '#666', + strokeStyle: '#666', + font: 16, + lineWidth: 1 + }; + } + }, + scale: { + // 缩放 + type: Number, + default: 1 + }, + layout: { + type: Array, + default: function _default() { + return []; + } + }, + perspective: { + // 刻度尺跟随滚动条移动偏移量 + type: Number, + default: 0 + } + }, + computed: { + ruleId: function ruleId() { + return Math.random().toFixed(16) + '-' + this.mode; + }, + hv: function hv() { + return this.$refs["rule-".concat(this.mode)].querySelector('.indicator'); + }, + vertical: function vertical() { + return this.mode === 'horizontal'; + }, + styleBorder: function styleBorder() { + var _this$lineConfig = this.lineConfig, + width = _this$lineConfig.width, + color = _this$lineConfig.color, + type = _this$lineConfig.type; + var border = "".concat(width, "px ").concat(type, " ").concat(color); + return this.vertical ? { + borderLeft: border + } : { + borderTop: border + }; + }, + lock: function lock() { + return document.querySelector('.rule-panel-lock').getBoundingClientRect(); + }, + $Q: function $Q() { + var scale = 10; + var text = 10; + if (this.scale < 0.1) { + text = 80; + } else if (this.scale >= 0.1 && this.scale <= 0.25) { + text = 40; + } else if (this.scale > 0.25 && this.scale <= 0.5) { + text = 20; + } else if (this.scale > 0.5 && this.scale <= 1) { + text = 10; + } else if (this.scale > 1 && this.scale <= 3) { + text = 5; + } + scale = text * this.scale; + return { + scale: scale, + text: text + }; + } + }, + watch: { + canvasWidth: function canvasWidth(val, oldVal) { + if (oldVal) { + this.horizontalValue = val - oldVal; + } + }, + layout: function layout() { + this.handleUpdate(); + }, + perspective: function perspective() { + this.handleUpdate(); + }, + scale: function scale() { + this.handleUpdate(); + } + }, + data: function data() { + return { + config: { + // 刻度尺配置 + size: 101, + x: 0, + y: 0, + w: 10, + h: 10, + width: 20, + height: 20, + fillStyle: '#fff', + strokeStyle: '#fff', + font: 12, + lineWidth: 1 + }, + cxt: null, + canvas: null, + showIndicator: false, + showValue: 0, + lineArr: [], + showAnctionValue: 0, + startValue: null, + lineConfig: { + // 拖拽线的样式 + color: '#51d6a9', + type: 'dashed', + width: 1 + }, + canvasWidth: 0, + horizontalValue: 0 + }; + }, + mounted: function mounted() { + var _this = this; + // window.addEventListener('resize', this.getWrapperSize) + this.$nextTick(function () { + _this.initDom(); + }); + }, + methods: { + initDom: function initDom() { + this.canvas = document.getElementById(this.ruleId); + this.config = Object.assign(this.config, this.configColor); + if (!this.canvas) return; + this.cxt = this.canvas.getContext('2d'); + this.initBindEvent(); + this.initConfig(); + this.draw(this.cxt, this.config); + }, + initConfig: function initConfig() { + var _document$querySelect2; + var _document$querySelect = document.querySelector('.editor-render-top').getBoundingClientRect(), + width = _document$querySelect.width, + height = _document$querySelect.height; + this.warpOffset = (_document$querySelect2 = document.querySelector('.ruler')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.getBoundingClientRect(); + var iconOffSet = this.lock.width; + this.canvasWidth = width; + var numLength = this.perspective; + var dom = document.querySelector('.ruler'); + dom.style.height = height + 'px'; + this.config.width = this.vertical ? 20 : iconOffSet; + this.config.height = this.vertical ? iconOffSet : 20; + var Width = this.vertical ? width - iconOffSet + numLength : this.config.width; + var Height = this.vertical ? this.config.height : height - iconOffSet + numLength; + var Size = this.vertical ? Width : Height; + this.canvas.setAttribute('width', Width); + this.canvas.setAttribute('height', Height); + this.config.size = Math.ceil(Math.ceil(Size / 10 * 40) + 1); + }, + initBindEvent: function initBindEvent() { + this.handleMouseenter(); + this.handleMouseleave(); + this.handleMousemove(); + this.handleMouseClick(); + }, + getScale: function getScale() {}, + draw: function draw(cxt, config) { + var scale = this.scale; + var size = config.size || 101; + var x = config.x || 0; + var y = config.y || 0; + var w = config.w || 10; + var h = config.h || 10; + var v = this.mode || 'horizontal'; + cxt.clearRect(0, 0, config.width, config.height); + cxt.strokeStyle = config.strokeStyle; + cxt.lineWidth = config.lineWidth / (this.scale * 1.5); + cxt.font = "".concat(12, "px -apple-system,\n \"Helvetica Neue\", \".SFNSText-Regular\",\n \"SF UI Text\", Arial, \"PingFang SC\", \"Hiragino Sans GB\",\n \"Microsoft YaHei\", \"WenQuanYi Zen Hei\", sans-serif"); + cxt.fillStyle = config.fillStyle; + for (var i = 0; i < size; i++) { + cxt.beginPath(); + if (v == 'vertical') { + var startY = y - this.perspective + i * this.$Q.scale; + cxt.moveTo(x, startY); + if (i % 10 == 0) { + cxt.save(); + cxt.translate(10, -10); + cxt.rotate(90 * Math.PI / 180); + cxt.fillText(x + i * this.$Q.text, x + w * 1.2 + i * this.$Q.scale - this.perspective, y); + cxt.restore(); + cxt.lineTo(x + w * 1.3, x + i * this.$Q.scale - this.perspective); + } else { + cxt.lineTo(x + (i % 5 === 0 ? 0.8 : 0.5) * w, startY); + } + cxt.scale(1, scale); + } else { + var startX = x - this.perspective + i * this.$Q.scale; + cxt.moveTo(startX, y); + if (i % 10 == 0) { + cxt.fillText(x + i * this.$Q.text, startX + 2, y + h * 1.8); + cxt.lineTo(startX, y + h * 1.3); + } else { + cxt.lineTo(startX, y + (i % 5 === 0 ? 0.8 : 0.5) * h); + } + cxt.scale(scale, 1); + } + cxt.stroke(); + cxt.closePath(); + cxt.setTransform(1, 0, 0, 1, 0, 0); + } + }, + getWrapperSize: function getWrapperSize() { + if (!this.canvas) return; + this.initConfig(); + this.draw(this.cxt, this.config); + }, + setPosition: function setPosition(_ref) { + var offsetX = _ref.offsetX, + offsetY = _ref.offsetY; + if (this.vertical) { + this.hv.style.left = offsetX + 'px'; + this.showValue = (offsetX + this.perspective) / this.scale; + } else { + this.hv.style.top = offsetY + 'px'; + this.showValue = (offsetY + this.perspective) / this.scale; + } + }, + handleMouseenter: function handleMouseenter() { + var _this2 = this; + this.canvas.onmouseenter = function (e) { + if (_this2.startValue) return; + _this2.showIndicator = true; + _this2.setPosition(e); + }; + }, + handleMouseleave: function handleMouseleave() { + var _this3 = this; + this.canvas.onmouseleave = function () { + _this3.showIndicator = false; + }; + }, + handleMousemove: function handleMousemove() { + var _this4 = this; + this.canvas.onmousemove = function (e) { + if (_this4.startValue) return; + _this4.setPosition(e); + }; + }, + // 点击出现对齐线 + handleMouseClick: function handleMouseClick() { + var _this5 = this; + this.canvas.onclick = function (e) { + var offsetX = e.offsetX, + offsetY = e.offsetY; + if (_this5.vertical) { + !_this5.lineArr.includes(offsetX) && _this5.lineArr.push({ + top: 0, + left: offsetX, + value: (offsetX + _this5.perspective) / _this5.scale + }); + } else { + !_this5.lineArr.includes(offsetY) && _this5.lineArr.push({ + top: offsetY, + left: 0, + value: (offsetY + _this5.perspective) / _this5.scale + }); + } + }; + }, + handleEnterLeave: function handleEnterLeave() { + var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + this.showAnctionValue = value; + }, + handleDelete: function handleDelete(e) { + var index = this.lineArr.findIndex(function (k) { + return k.value === e; + }); + this.lineArr.splice(index, 1); + }, + handleMouseDown: function handleMouseDown(e) { + this.startValue = e; + document.addEventListener('mousemove', this.handleMove); + document.addEventListener('mouseup', this.handleMouseUp); + }, + handleMouseUp: function handleMouseUp() { + // const warpCanvasWidthHeight = this.vertical + // ? Math.floor(this.canvas.getAttribute('width')) / this.scale - this.lock.width - 3 + // : Math.floor(this.canvas.getAttribute('height')) / this.scale - this.lock.width - 1 + // this.lineArr = this.lineArr.filter(e => e.value < warpCanvasWidthHeight / this.scale && e.value >= 0) + this.startValue = null; + document.removeEventListener('mousemove', this.handleMove); + document.removeEventListener('mouseup', this.handleMouseUp); + }, + setStyle: function setStyle(e) { + // e = { color: 'red', type: 'dashed', width: 1 } + this.lineConfig = Object.assign(this.lineConfig, e); + }, + // 拖动已经显示的对齐线移动 + handleMove: function handleMove(e) { + var _this6 = this; + e.stopPropagation(); + e.preventDefault(); + var clientX = e.clientX, + clientY = e.clientY; + var iconOffSet = this.lock.width; + var left = this.vertical ? Math.round(clientX - this.warpOffset.left - iconOffSet) : 0; + var top = this.vertical ? 0 : Math.round(clientY - this.warpOffset.top - iconOffSet); + var value = this.vertical ? Math.round((clientX - this.warpOffset.left - iconOffSet + this.perspective) / this.scale) : Math.round(clientY - this.warpOffset.top - iconOffSet + this.perspective / this.scale); + var index = this.lineArr.findIndex(function (k) { + return Math.abs(k.value - _this6.startValue) <= 3; + }); + this.startValue = value; + this.showAnctionValue = value; + index >= 0 && this.$set(this.lineArr, index, { + top: top, + left: left, + value: value + }); + }, + listenMouseMove: function listenMouseMove(e) {}, + handleScrollSetine: function handleScrollSetine() { + var _this7 = this; + if (!this.lineArr.length) return; + this.lineArr.forEach(function (e, i) { + var valueMax = Math.round(e.value) * _this7.scale - _this7.perspective; + _this7.$set(_this7.lineArr, i, { + top: _this7.vertical ? 0 : valueMax, + left: _this7.vertical ? valueMax : 0, + value: Math.round(e.value) + }); + }); + }, + handleUpdate: function handleUpdate() { + if (!this.canvas) return; + this.initConfig(); + this.draw(this.cxt, this.config); + this.handleScrollSetine(); + } + }, + beforeDestroy: function beforeDestroy() { + window.removeEventListener('resize', this.getWrapperSize); + } +}; + +/* script */ +const __vue_script__$4 = script$4; + +/* template */ +var __vue_render__$4 = function () { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c("div", { ref: "rule-" + _vm.mode, class: ["rule-" + _vm.mode] }, [ + _c("canvas", { attrs: { id: _vm.ruleId } }), + _vm._v(" "), + _c( + "div", + { staticClass: "lines" }, + _vm._l(_vm.lineArr, function (item, index) { + return _c( + "div", + { + key: index, + staticClass: "line", + style: Object.assign( + {}, + { top: item.top + "px", left: item.left + "px" }, + _vm.styleBorder, + { display: item.value >= 0 ? "" : "none" } + ), + attrs: { + "aria-left": item.left, + "aria-top": item.top, + "aria-value": Math.round(item.value), + }, + on: { + mouseenter: function ($event) { + return _vm.handleEnterLeave(item.value) + }, + mouseleave: function ($event) { + return _vm.handleEnterLeave() + }, + mousedown: function ($event) { + return _vm.handleMouseDown(item.value) + }, + }, + }, + [ + _c("div", { staticClass: "anction" }, [ + _c( + "span", + { + staticClass: "del", + style: { + visibility: + _vm.showAnctionValue === item.value + ? "visible" + : "hidden", + }, + on: { + click: function ($event) { + return _vm.handleDelete(item.value) + }, + }, + }, + [_vm._v("x")] + ), + _vm._v(" "), + _c("span", { staticClass: "value" }, [ + _vm._v(_vm._s(Math.round(item.value))), + ]), + ]), + ] + ) + }), + 0 + ), + _vm._v(" "), + _c( + "div", + { + directives: [ + { + name: "show", + rawName: "v-show", + value: _vm.showIndicator, + expression: "showIndicator", + }, + ], + staticClass: "indicator", + style: _vm.styleBorder, + }, + [ + _c("div", { staticClass: "value" }, [ + _vm._v(_vm._s(Math.round(_vm.showValue))), + ]), + ] + ), + ]) +}; +var __vue_staticRenderFns__$4 = []; +__vue_render__$4._withStripped = true; + + /* style */ + const __vue_inject_styles__$4 = function (inject) { + if (!inject) return + inject("data-v-a7216922_0", { source: "[data-v-a7216922]:export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.rule-horizontal[data-v-a7216922] {\n position: absolute;\n left: 24px;\n width: calc(100% - 24px);\n font-size: 12px;\n}\n.rule-horizontal .lines .line[data-v-a7216922] {\n position: absolute;\n top: 0;\n cursor: ew-resize;\n height: 100vh;\n padding-left: 5px;\n z-index: 1;\n}\n.rule-horizontal .lines .line .anction[data-v-a7216922] {\n position: absolute;\n top: 24px;\n display: flex;\n justify-content: center;\n align-items: center;\n user-select: none;\n}\n.rule-horizontal .lines .line .anction .del[data-v-a7216922] {\n padding: 0;\n font-size: 20px;\n font-weight: 600;\n cursor: pointer;\n}\n.rule-horizontal .lines .line .anction .value[data-v-a7216922] {\n pointer-events: none;\n margin-left: 5px;\n transform: translateY(3px);\n}\n.rule-horizontal .indicator[data-v-a7216922] {\n position: absolute;\n pointer-events: none;\n top: 0;\n height: 100vh;\n z-index: 1;\n}\n.rule-horizontal .indicator .value[data-v-a7216922] {\n position: absolute;\n width: auto;\n padding: 0 2px;\n margin-top: 4px;\n margin-left: 4px;\n}\n.rule-vertical[data-v-a7216922] {\n position: absolute;\n top: 24px;\n width: 24px;\n height: calc(100% - 24px);\n font-size: 12px;\n}\n.rule-vertical .lines .line[data-v-a7216922] {\n position: absolute;\n top: 0;\n cursor: ns-resize;\n width: 100vw;\n padding-top: 5px;\n z-index: 1;\n}\n.rule-vertical .lines .line .anction[data-v-a7216922] {\n position: absolute;\n left: 24px;\n display: flex;\n justify-content: center;\n align-items: center;\n user-select: none;\n}\n.rule-vertical .lines .line .anction .del[data-v-a7216922] {\n padding: 0;\n font-size: 20px;\n font-weight: 600;\n cursor: pointer;\n}\n.rule-vertical .lines .line .anction .value[data-v-a7216922] {\n pointer-events: none;\n margin-left: 5px;\n transform: translateY(3px);\n}\n.rule-vertical .indicator[data-v-a7216922] {\n position: absolute;\n pointer-events: none;\n top: 0;\n width: 100vw;\n z-index: 1;\n}\n.rule-vertical .indicator .value[data-v-a7216922] {\n position: absolute;\n left: 0;\n width: auto;\n padding: 0 2px;\n margin-top: -5px;\n margin-left: 2px;\n transform: rotate(-90deg);\n transform-origin: 0 0;\n}\ncanvas[data-v-a7216922] {\n background: #292929;\n pointer-events: auto;\n}\n", map: {"version":3,"sources":["SketchRule.vue"],"names":[],"mappings":"AAAA;EACE,sBAAsB;EACtB,mBAAmB;EACnB,sBAAsB;EACtB,sBAAsB;EACtB,oBAAoB;EACpB,mBAAmB;EACnB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,iBAAiB;EACjB,6BAA6B;EAC7B,wCAAwC;AAC1C;AACA;EACE,kBAAkB;EAClB,UAAU;EACV,wBAAwB;EACxB,eAAe;AACjB;AACA;EACE,kBAAkB;EAClB,MAAM;EACN,iBAAiB;EACjB,aAAa;EACb,iBAAiB;EACjB,UAAU;AACZ;AACA;EACE,kBAAkB;EAClB,SAAS;EACT,aAAa;EACb,uBAAuB;EACvB,mBAAmB;EACnB,iBAAiB;AACnB;AACA;EACE,UAAU;EACV,eAAe;EACf,gBAAgB;EAChB,eAAe;AACjB;AACA;EACE,oBAAoB;EACpB,gBAAgB;EAChB,0BAA0B;AAC5B;AACA;EACE,kBAAkB;EAClB,oBAAoB;EACpB,MAAM;EACN,aAAa;EACb,UAAU;AACZ;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,cAAc;EACd,eAAe;EACf,gBAAgB;AAClB;AACA;EACE,kBAAkB;EAClB,SAAS;EACT,WAAW;EACX,yBAAyB;EACzB,eAAe;AACjB;AACA;EACE,kBAAkB;EAClB,MAAM;EACN,iBAAiB;EACjB,YAAY;EACZ,gBAAgB;EAChB,UAAU;AACZ;AACA;EACE,kBAAkB;EAClB,UAAU;EACV,aAAa;EACb,uBAAuB;EACvB,mBAAmB;EACnB,iBAAiB;AACnB;AACA;EACE,UAAU;EACV,eAAe;EACf,gBAAgB;EAChB,eAAe;AACjB;AACA;EACE,oBAAoB;EACpB,gBAAgB;EAChB,0BAA0B;AAC5B;AACA;EACE,kBAAkB;EAClB,oBAAoB;EACpB,MAAM;EACN,YAAY;EACZ,UAAU;AACZ;AACA;EACE,kBAAkB;EAClB,OAAO;EACP,WAAW;EACX,cAAc;EACd,gBAAgB;EAChB,gBAAgB;EAChB,yBAAyB;EACzB,qBAAqB;AACvB;AACA;EACE,mBAAmB;EACnB,oBAAoB;AACtB","file":"SketchRule.vue","sourcesContent":[":export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.rule-horizontal {\n position: absolute;\n left: 24px;\n width: calc(100% - 24px);\n font-size: 12px;\n}\n.rule-horizontal .lines .line {\n position: absolute;\n top: 0;\n cursor: ew-resize;\n height: 100vh;\n padding-left: 5px;\n z-index: 1;\n}\n.rule-horizontal .lines .line .anction {\n position: absolute;\n top: 24px;\n display: flex;\n justify-content: center;\n align-items: center;\n user-select: none;\n}\n.rule-horizontal .lines .line .anction .del {\n padding: 0;\n font-size: 20px;\n font-weight: 600;\n cursor: pointer;\n}\n.rule-horizontal .lines .line .anction .value {\n pointer-events: none;\n margin-left: 5px;\n transform: translateY(3px);\n}\n.rule-horizontal .indicator {\n position: absolute;\n pointer-events: none;\n top: 0;\n height: 100vh;\n z-index: 1;\n}\n.rule-horizontal .indicator .value {\n position: absolute;\n width: auto;\n padding: 0 2px;\n margin-top: 4px;\n margin-left: 4px;\n}\n.rule-vertical {\n position: absolute;\n top: 24px;\n width: 24px;\n height: calc(100% - 24px);\n font-size: 12px;\n}\n.rule-vertical .lines .line {\n position: absolute;\n top: 0;\n cursor: ns-resize;\n width: 100vw;\n padding-top: 5px;\n z-index: 1;\n}\n.rule-vertical .lines .line .anction {\n position: absolute;\n left: 24px;\n display: flex;\n justify-content: center;\n align-items: center;\n user-select: none;\n}\n.rule-vertical .lines .line .anction .del {\n padding: 0;\n font-size: 20px;\n font-weight: 600;\n cursor: pointer;\n}\n.rule-vertical .lines .line .anction .value {\n pointer-events: none;\n margin-left: 5px;\n transform: translateY(3px);\n}\n.rule-vertical .indicator {\n position: absolute;\n pointer-events: none;\n top: 0;\n width: 100vw;\n z-index: 1;\n}\n.rule-vertical .indicator .value {\n position: absolute;\n left: 0;\n width: auto;\n padding: 0 2px;\n margin-top: -5px;\n margin-left: 2px;\n transform: rotate(-90deg);\n transform-origin: 0 0;\n}\ncanvas {\n background: #292929;\n pointer-events: auto;\n}\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__$4 = "data-v-a7216922"; + /* module identifier */ + const __vue_module_identifier__$4 = undefined; + /* functional template */ + const __vue_is_functional_template__$4 = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$4 = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$4, staticRenderFns: __vue_staticRenderFns__$4 }, + __vue_inject_styles__$4, + __vue_script__$4, + __vue_scope_id__$4, + __vue_is_functional_template__$4, + __vue_module_identifier__$4, + false, + createInjector, + undefined, + undefined + ); + +var script$3 = { + name: 'Ruler', + props: { + width: { + type: Number + }, + height: { + type: Number + }, + perspectiveX: { + type: Number, + default: 0 + }, + perspectiveY: { + type: Number, + default: 0 + }, + layoutX: { + type: Array, + default: function _default() { + return []; + } + }, + layoutY: { + type: Array, + default: function _default() { + return []; + } + }, + scale: { + type: Number, + default: 1 + } + }, + components: { + SketchRule: __vue_component__$4 + }, + data: function data() { + return {}; + } +}; + +/* script */ +const __vue_script__$3 = script$3; + +/* template */ +var __vue_render__$3 = function () { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c( + "div", + { staticClass: "ruler" }, + [ + _c("svg-icon", { + staticClass: "rule-panel-lock", + attrs: { type: "editor-lock" }, + }), + _vm._v(" "), + _c("SketchRule", { + ref: "horizontal", + attrs: { + width: _vm.width, + height: _vm.height, + perspective: _vm.perspectiveX, + layout: _vm.layoutX, + scale: _vm.scale, + }, + }), + _vm._v(" "), + _c("SketchRule", { + ref: "vertical", + attrs: { + mode: "vertical", + width: _vm.width, + height: _vm.height, + perspective: _vm.perspectiveY, + layout: _vm.layoutY, + scale: _vm.scale, + }, + }), + _vm._v(" "), + _vm._t("container"), + ], + 2 + ) +}; +var __vue_staticRenderFns__$3 = []; +__vue_render__$3._withStripped = true; + + /* style */ + const __vue_inject_styles__$3 = function (inject) { + if (!inject) return + inject("data-v-2bdc2ee0_0", { source: "[data-v-2bdc2ee0]:export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.ruler[data-v-2bdc2ee0] {\n position: relative;\n background-image: linear-gradient(90deg, #141414 14px, transparent 0), linear-gradient(0deg, transparent 14px, rgba(48, 48, 48, 0.64) 0);\n background-size: 17px 17px;\n background-position: 15px, 20px, 0, 0;\n width: 100%;\n overflow: hidden;\n}\n.ruler .rule-panel-lock[data-v-2bdc2ee0] {\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n width: 24px;\n height: 24px;\n cursor: pointer;\n}\n", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,sBAAsB;EACtB,mBAAmB;EACnB,sBAAsB;EACtB,sBAAsB;EACtB,oBAAoB;EACpB,mBAAmB;EACnB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,iBAAiB;EACjB,6BAA6B;EAC7B,wCAAwC;AAC1C;AACA;EACE,kBAAkB;EAClB,wIAAwI;EACxI,0BAA0B;EAC1B,qCAAqC;EACrC,WAAW;EACX,gBAAgB;AAClB;AACA;EACE,aAAa;EACb,uBAAuB;EACvB,mBAAmB;EACnB,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,eAAe;AACjB","file":"index.vue","sourcesContent":[":export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.ruler {\n position: relative;\n background-image: linear-gradient(90deg, #141414 14px, transparent 0), linear-gradient(0deg, transparent 14px, rgba(48, 48, 48, 0.64) 0);\n background-size: 17px 17px;\n background-position: 15px, 20px, 0, 0;\n width: 100%;\n overflow: hidden;\n}\n.ruler .rule-panel-lock {\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n width: 24px;\n height: 24px;\n cursor: pointer;\n}\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__$3 = "data-v-2bdc2ee0"; + /* module identifier */ + const __vue_module_identifier__$3 = undefined; + /* functional template */ + const __vue_is_functional_template__$3 = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$3 = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$3, staticRenderFns: __vue_staticRenderFns__$3 }, + __vue_inject_styles__$3, + __vue_script__$3, + __vue_scope_id__$3, + __vue_is_functional_template__$3, + __vue_module_identifier__$3, + false, + createInjector, + undefined, + undefined + ); + +var script$2 = { + name: 'Size', + components: _defineProperty({}, Input.name, Input), + props: { + width: { + type: Number, + default: 0 + }, + height: { + type: Number, + default: 0 + } + }, + computed: { + resize: function resize() { + return !this.w.disabled && !this.h.disabled; + } + }, + watch: { + width: { + immediate: true, + handler: function handler(val, oldVal) { + this.w = _objectSpread2(_objectSpread2({}, this.w), {}, { + value: val + }); + } + }, + height: { + immediate: true, + handler: function handler(val, oldVal) { + this.h = _objectSpread2(_objectSpread2({}, this.h), {}, { + value: val + }); + } + }, + resize: { + immediate: true, + handler: function handler(val) { + this.$emit('size', val); + } + } + }, + data: function data() { + return { + w: { + value: this.width, + disabled: false + }, + h: { + value: this.height, + disabled: false + } + }; + } +}; + +/* script */ +const __vue_script__$2 = script$2; + +/* template */ +var __vue_render__$2 = function () { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c("div", { staticClass: "size" }, [ + _c( + "div", + { staticClass: "size-item" }, + [ + _c("a-input", { + staticClass: "size-item-input", + attrs: { disabled: _vm.w.disabled, suffix: "W" }, + on: { + change: function ($event) { + _vm.$emit("update:width", Number(_vm.w.value)); + }, + }, + model: { + value: _vm.w.value, + callback: function ($$v) { + _vm.$set(_vm.w, "value", $$v); + }, + expression: "w.value", + }, + }), + _vm._v(" "), + _c("svg-icon", { + attrs: { type: _vm.w.disabled ? "editor-lock" : "editor-unlock" }, + on: { + click: function ($event) { + _vm.w.disabled = !_vm.w.disabled; + }, + }, + }), + ], + 1 + ), + _vm._v(" "), + _c( + "div", + { staticClass: "size-item" }, + [ + _c("a-input", { + staticClass: "size-item-input", + attrs: { disabled: _vm.h.disabled, suffix: "H" }, + on: { + change: function ($event) { + _vm.$emit("update:height", Number(_vm.h.value)); + }, + }, + model: { + value: _vm.h.value, + callback: function ($$v) { + _vm.$set(_vm.h, "value", $$v); + }, + expression: "h.value", + }, + }), + _vm._v(" "), + _c("svg-icon", { + attrs: { type: _vm.h.disabled ? "editor-lock" : "editor-unlock" }, + on: { + click: function ($event) { + _vm.h.disabled = !_vm.h.disabled; + }, + }, + }), + ], + 1 + ), + ]) +}; +var __vue_staticRenderFns__$2 = []; +__vue_render__$2._withStripped = true; + + /* style */ + const __vue_inject_styles__$2 = function (inject) { + if (!inject) return + inject("data-v-eebdab88_0", { source: "[data-v-eebdab88]:export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.size[data-v-eebdab88] {\n display: flex;\n align-items: center;\n justify-content: left;\n}\n.size[data-v-eebdab88] .ant-input {\n background-color: transparent;\n}\n.size[data-v-eebdab88] .ant-input-disabled {\n color: #595959;\n}\n.size-item[data-v-eebdab88] {\n flex: 1;\n}\n.size-item-input[data-v-eebdab88] {\n width: 70%;\n margin-right: 10px;\n}\n", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,sBAAsB;EACtB,mBAAmB;EACnB,sBAAsB;EACtB,sBAAsB;EACtB,oBAAoB;EACpB,mBAAmB;EACnB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,iBAAiB;EACjB,6BAA6B;EAC7B,wCAAwC;AAC1C;AACA;EACE,aAAa;EACb,mBAAmB;EACnB,qBAAqB;AACvB;AACA;EACE,6BAA6B;AAC/B;AACA;EACE,cAAc;AAChB;AACA;EACE,OAAO;AACT;AACA;EACE,UAAU;EACV,kBAAkB;AACpB","file":"index.vue","sourcesContent":[":export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.size {\n display: flex;\n align-items: center;\n justify-content: left;\n}\n.size /deep/ .ant-input {\n background-color: transparent;\n}\n.size /deep/ .ant-input-disabled {\n color: #595959;\n}\n.size-item {\n flex: 1;\n}\n.size-item-input {\n width: 70%;\n margin-right: 10px;\n}\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__$2 = "data-v-eebdab88"; + /* module identifier */ + const __vue_module_identifier__$2 = undefined; + /* functional template */ + const __vue_is_functional_template__$2 = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$2 = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$2, staticRenderFns: __vue_staticRenderFns__$2 }, + __vue_inject_styles__$2, + __vue_script__$2, + __vue_scope_id__$2, + __vue_is_functional_template__$2, + __vue_module_identifier__$2, + false, + createInjector, + undefined, + undefined + ); + +var script$1 = { + name: 'SvgIcon', + components: _defineProperty({}, Icon.name, Icon), + props: { + type: { + type: String + } + }, + data: function data() { + return { + SVG_TYPES: SVG_TYPES + }; + } +}; + +/* script */ +const __vue_script__$1 = script$1; + +/* template */ +var __vue_render__$1 = function () { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c("a-icon", { + attrs: { type: _vm.type, component: _vm.SVG_TYPES["lcd-icon-" + _vm.type] }, + on: { + click: function ($event) { + return _vm.$emit("click") + }, + }, + }) +}; +var __vue_staticRenderFns__$1 = []; +__vue_render__$1._withStripped = true; + + /* style */ + const __vue_inject_styles__$1 = undefined; + /* scoped */ + const __vue_scope_id__$1 = undefined; + /* module identifier */ + const __vue_module_identifier__$1 = undefined; + /* functional template */ + const __vue_is_functional_template__$1 = false; + /* style inject */ + + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$1 = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$1, staticRenderFns: __vue_staticRenderFns__$1 }, + __vue_inject_styles__$1, + __vue_script__$1, + __vue_scope_id__$1, + __vue_is_functional_template__$1, + __vue_module_identifier__$1, + false, + undefined, + undefined, + undefined + ); + +// +var script = { + name: 'Thumbnail', + mixins: [window$1], + props: { + src: { + type: String, + default: '' + }, + avatar: { + type: String, + default: '' + } + } +}; + +/* script */ +const __vue_script__ = script; + +/* template */ +var __vue_render__ = function () { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c( + "div", + { staticClass: "thumbnail" }, + [ + !_vm.src + ? [ + _c("div", { staticClass: "thumbnail-default" }, [ + _c("img", { + staticClass: "thumbnail-default-avatar", + attrs: { src: _vm.avatar, alt: "default" }, + }), + _vm._v(" "), + _vm.windowWidth >= 1200 + ? _c("span", { staticClass: "thumbnail-default-tooltip" }, [ + _vm._v("暂无封面"), + ]) + : _vm._e(), + ]), + ] + : [ + _c("img", { + staticClass: "thumbnail-image", + attrs: { src: _vm.src, alt: "thumbnail" }, + }), + ], + ], + 2 + ) +}; +var __vue_staticRenderFns__ = []; +__vue_render__._withStripped = true; + + /* style */ + const __vue_inject_styles__ = function (inject) { + if (!inject) return + inject("data-v-12393bd0_0", { source: ":export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.thumbnail {\n aspect-ratio: 1.77777778;\n}\n.thumbnail-default {\n width: 100%;\n height: 100%;\n background-color: #141414;\n border: 1px solid #3779ee;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n}\n.thumbnail-default-avatar {\n width: 40%;\n}\n.thumbnail-default-tooltip {\n margin-top: 22px;\n}\n.thumbnail-image {\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["index.vue","C:\\Users\\lihq1\\Desktop\\开源\\vue-lcd-engine\\components\\Thumbnail\\index.vue"],"names":[],"mappings":"AAAA;EACE,sBAAsB;EACtB,mBAAmB;EACnB,sBAAsB;EACtB,sBAAsB;EACtB,oBAAoB;EACpB,mBAAmB;EACnB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,iBAAiB;EACjB,6BAA6B;EAC7B,wCAAwC;AAC1C;AACA;EACE,wBAAwB;AAC1B;AACA;EACE,WAAW;EACX,YAAY;EACZ,yBAAyB;EACzB,yBAAyB;EACzB,aAAa;EACb,mBAAmB;EACnB,uBAAuB;EACvB,sBAAsB;AACxB;AACA;EACE,UAAU;AACZ;AACA;EACE,gBAAgB;ACClB;AACA;EACA,WAAA;EDCE,YAAY;ACCd","file":"index.vue","sourcesContent":[":export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.thumbnail {\n aspect-ratio: 1.77777778;\n}\n.thumbnail-default {\n width: 100%;\n height: 100%;\n background-color: #141414;\n border: 1px solid #3779ee;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n}\n.thumbnail-default-avatar {\n width: 40%;\n}\n.thumbnail-default-tooltip {\n margin-top: 22px;\n}\n.thumbnail-image {\n width: 100%;\n height: 100%;\n}\n","\r\n\r\n\r\n\r\n\r\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__ = undefined; + /* module identifier */ + const __vue_module_identifier__ = undefined; + /* functional template */ + const __vue_is_functional_template__ = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__ = /*#__PURE__*/normalizeComponent( + { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ }, + __vue_inject_styles__, + __vue_script__, + __vue_scope_id__, + __vue_is_functional_template__, + __vue_module_identifier__, + false, + createInjector, + undefined, + undefined + ); + +[__vue_component__$b, __vue_component__$a, __vue_component__$9, __vue_component__$8, __vue_component__$7, __vue_component__$6, __vue_component__$5, __vue_component__$3, __vue_component__$2, __vue_component__$1, __vue_component__].forEach(function (item) { + item.install = function (Vue) { + Vue.component(item.name, item); + }; +}); + +export { __vue_component__$b as Cascader, __vue_component__$a as ComponentBox, __vue_component__$9 as ConfigItem, __vue_component__$8 as EditScreens, __vue_component__$7 as Feedback, __vue_component__$6 as Layout, __vue_component__$5 as Loading, __vue_component__$3 as Ruler, __vue_component__$2 as Size, __vue_component__$1 as SvgIcon, __vue_component__ as Thumbnail }; diff --git a/dist/vue-lcd-engine.esm.min.js b/dist/vue-lcd-engine.esm.min.js new file mode 100644 index 0000000000000000000000000000000000000000..c64ab5cf19183fbee01681725fca9f6c260d1c4a --- /dev/null +++ b/dist/vue-lcd-engine.esm.min.js @@ -0,0 +1 @@ +import"core-js/modules/es.object.to-string.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.function.name.js";import"core-js/modules/es.array.find-index.js";import"core-js/modules/es.array.find.js";import"core-js/modules/es.number.constructor.js";import{Tooltip as t,Spin as e,Col as n,Row as i,Result as r,Input as o,Icon as a}from"ant-design-vue";import"core-js/modules/es.json.stringify.js";import{omit as s,throttle as l}from"lodash";import"core-js/modules/es.set.js";import"core-js/modules/es.string.iterator.js";import"core-js/modules/web.dom-collections.iterator.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.array.includes.js";import"core-js/modules/es.error.cause.js";import"core-js/modules/es.regexp.constructor.js";import"core-js/modules/es.regexp.dot-all.js";import"core-js/modules/es.regexp.exec.js";import"core-js/modules/es.regexp.sticky.js";import"core-js/modules/es.regexp.to-string.js";import"core-js/modules/es.regexp.test.js";import"core-js/modules/es.string.includes.js";import"core-js/modules/es.array.fill.js";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.array.push.js";import"core-js/modules/es.string.replace.js";import"core-js/modules/es.number.to-fixed.js";import"core-js/modules/es.array.concat.js";import"core-js/modules/es.array.splice.js";function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function d(t){var e=function(t,e){if("object"!=c(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=c(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==c(e)?e:String(e)}function h(t,e,n){return(e=d(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var A={name:"CascaderItem",components:h({},t.name,t),props:{optionsItem:{type:Array,default:function(){return[]}},selected:{type:Object,default:function(){return{}}},mode:{type:String,default:"horizontal"},indexLevel:{type:Number,default:1},tooltip:{type:Boolean,default:!1},showTitle:{type:Boolean,default:!0}},data:function(){return{}},methods:{handleSelected:function(t){this.$emit("handleSelected",t,this.indexLevel)}}};function p(t,e,n,i,r,o,a,s,l,c){"boolean"!=typeof a&&(l=s,s=a,a=!1);const d="function"==typeof n?n.options:n;let h;if(t&&t.render&&(d.render=t.render,d.staticRenderFns=t.staticRenderFns,d._compiled=!0,r&&(d.functional=!0)),i&&(d._scopeId=i),o?(h=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(o)},d._ssrRegister=h):e&&(h=a?function(t){e.call(this,c(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,s(t))}),h)if(d.functional){const t=d.render;d.render=function(e,n){return h.call(n),t(e,n)}}else{const t=d.beforeCreate;d.beforeCreate=t?[].concat(t,h):[h]}return n}const u="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());function f(t){return(t,e)=>function(t,e){const n=u?e.media||"default":t,i=C[n]||(C[n]={ids:new Set,styles:[]});if(!i.ids.has(t)){i.ids.add(t);let n=e.source;if(e.map&&(n+="\n/*# sourceURL="+e.map.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e.map))))+" */"),i.element||(i.element=document.createElement("style"),i.element.type="text/css",e.media&&i.element.setAttribute("media",e.media),void 0===m&&(m=document.head||document.getElementsByTagName("head")[0]),m.appendChild(i.element)),"styleSheet"in i.element)i.styles.push(n),i.element.styleSheet.cssText=i.styles.filter(Boolean).join("\n");else{const t=i.ids.size-1,e=document.createTextNode(n),r=i.element.childNodes;r[t]&&i.element.removeChild(r[t]),r.length?i.element.insertBefore(e,r[t]):i.element.appendChild(e)}}}(t,e)}let m;const C={};const g=A;var v=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ul",{staticClass:"cascader-item-content"},t._l(t.optionsItem,(function(e,i){var r;return n("li",{key:i,class:["cascader-item","cascader-item-"+t.mode,(r={},r["cascader-item-"+t.mode+"-active"]=t.selected===e,r)],on:{click:function(n){return t.handleSelected(e)}}},[n("a-tooltip",{attrs:{placement:"rightBottom"},scopedSlots:t._u([t.tooltip?{key:"title",fn:function(){return[n("span",[t._v(t._s(e.label))])]},proxy:!0}:null],null,!0)},[t._v(" "),n("div",[t._t("icon-title",(function(){return[t.selected===e?[n("svg-icon",{attrs:{type:e.iconHover}})]:[e.icon?n("svg-icon",{attrs:{type:e.icon}}):t._e()]]}))],2)]),t._v(" "),n("a-tooltip",{attrs:{placement:"rightBottom"},scopedSlots:t._u([t.tooltip?{key:"title",fn:function(){return[n("span",[t._v(t._s(e.label))])]},proxy:!0}:null],null,!0)},[t._v(" "),t.showTitle?n("span",{staticClass:"cascader-item-name"},[t._v(t._s(e.label))]):t._e()])],1)})),0)};v._withStripped=!0;const x=p({render:v,staticRenderFns:[]},(function(t){t&&t("data-v-cb71bf0e_0",{source:"[data-v-cb71bf0e]:export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.cascader-item-content[data-v-cb71bf0e] {\n margin-top: 1px;\n padding: 0;\n box-sizing: border-box;\n width: 100%;\n}\n.cascader-item-content .cascader-item[data-v-cb71bf0e] {\n width: 100%;\n cursor: pointer;\n}\n.cascader-item-content .cascader-item-horizontal[data-v-cb71bf0e] {\n display: flex;\n align-items: center;\n height: 48px;\n}\n.cascader-item-content .cascader-item-horizontal i[data-v-cb71bf0e] {\n margin: 0 10px 0 15px;\n}\n.cascader-item-content .cascader-item-horizontal i.anticon[data-v-cb71bf0e] {\n pointer-events: none;\n}\n.cascader-item-content .cascader-item-vertical[data-v-cb71bf0e] {\n display: flex;\n justify-content: center;\n flex-direction: column;\n align-items: center;\n margin: 11px 6px;\n width: calc(100% - 12px);\n height: 80px;\n}\n.cascader-item-content .cascader-item-vertical i[data-v-cb71bf0e] {\n pointer-events: none;\n}\n.cascader-item-content .cascader-item-vertical-active[data-v-cb71bf0e] {\n color: #ffffff;\n background-color: #2c2c2c;\n}\n.cascader-item-content .cascader-item-horizontal-active[data-v-cb71bf0e] {\n color: #ffffff;\n background-color: #1a1a1a;\n}\n",map:{version:3,sources:["CascaderItem.vue"],names:[],mappings:"AAAA;EACE,sBAAsB;EACtB,mBAAmB;EACnB,sBAAsB;EACtB,sBAAsB;EACtB,oBAAoB;EACpB,mBAAmB;EACnB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,iBAAiB;EACjB,6BAA6B;EAC7B,wCAAwC;AAC1C;AACA;EACE,eAAe;EACf,UAAU;EACV,sBAAsB;EACtB,WAAW;AACb;AACA;EACE,WAAW;EACX,eAAe;AACjB;AACA;EACE,aAAa;EACb,mBAAmB;EACnB,YAAY;AACd;AACA;EACE,qBAAqB;AACvB;AACA;EACE,oBAAoB;AACtB;AACA;EACE,aAAa;EACb,uBAAuB;EACvB,sBAAsB;EACtB,mBAAmB;EACnB,gBAAgB;EAChB,wBAAwB;EACxB,YAAY;AACd;AACA;EACE,oBAAoB;AACtB;AACA;EACE,cAAc;EACd,yBAAyB;AAC3B;AACA;EACE,cAAc;EACd,yBAAyB;AAC3B",file:"CascaderItem.vue",sourcesContent:[":export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.cascader-item-content {\n margin-top: 1px;\n padding: 0;\n box-sizing: border-box;\n width: 100%;\n}\n.cascader-item-content .cascader-item {\n width: 100%;\n cursor: pointer;\n}\n.cascader-item-content .cascader-item-horizontal {\n display: flex;\n align-items: center;\n height: 48px;\n}\n.cascader-item-content .cascader-item-horizontal i {\n margin: 0 10px 0 15px;\n}\n.cascader-item-content .cascader-item-horizontal i.anticon {\n pointer-events: none;\n}\n.cascader-item-content .cascader-item-vertical {\n display: flex;\n justify-content: center;\n flex-direction: column;\n align-items: center;\n margin: 11px 6px;\n width: calc(100% - 12px);\n height: 80px;\n}\n.cascader-item-content .cascader-item-vertical i {\n pointer-events: none;\n}\n.cascader-item-content .cascader-item-vertical-active {\n color: #ffffff;\n background-color: #2c2c2c;\n}\n.cascader-item-content .cascader-item-horizontal-active {\n color: #ffffff;\n background-color: #1a1a1a;\n}\n"]},media:void 0})}),g,"data-v-cb71bf0e",false,undefined,!1,f,void 0,void 0);var B={"lcd-icon-editor-center_normal":{template:'\n \n 编组\n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-float_selected":{template:'\n \n 编组备份\n \n \n \n \n \n \n \n '},"lcd-icon-editor-background_normal":{template:'\n \n 编组 3\n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-component_selected":{template:'\n \n 形状\n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-background_selected":{template:'\n \n 编组备份 4\n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-center_selected":{template:'\n \n 编组备份 2\n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-collapse":{template:'\n \n 路径\n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-exit":{template:'\n \n 形状 2\n \n \n \n \n \n \n \n \n \n '},"lcd-icon-home-checked":{template:'\n \n 形状\n \n \n \n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-handbook_hover":{template:'\n \n 编组 20备份\n \n \n \n \n \n \n \n '},"lcd-icon-editor-handbook_normal":{template:'\n \n 编组 20\n \n \n \n \n \n \n \n '},"lcd-icon-editor-expand":{template:'\n \n 编组 29\n \n \n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-float_normal":{template:'\n \n 编组 4\n \n \n \n \n \n \n \n '},"lcd-icon-home-more":{template:'\n \n 编组 13\n \n \n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-panel_normal":{template:'\n \n 编组 2\n \n \n \n \n \n \n \n '},"lcd-icon-editor-redo":{template:'\n \n 编组 38\n \n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-home-delete":{template:'\n \n 编组 15\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-panel_selected":{template:'\n \n 编组备份 3\n \n \n \n \n \n \n \n '},"lcd-icon-editor-preview":{template:'\n \n 编组 31\n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-undo":{template:'\n \n 编组 32\n \n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-remove":{template:'\n \n 编组 47\n \n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-save":{template:'\n \n 形状\n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-home-tooltip":{template:'\n \n 编组 13\n \n \n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-restore":{template:'\n \n 路径\n \n \n \n \n \n \n \n \n \n '},"lcd-icon-home-base":{template:'\n \n 编组 14\n \n \n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-lock":{template:'\n \n 编组 49\n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-home-confirm":{template:'\n \n 编组 12\n \n \n \n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-home-edit":{template:'\n \n 编组 14\n \n \n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-home-emtry":{template:'\n \n 编组 12\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-logo":{template:'\n \n 形状\n \n \n \n \n \n \n \n '},"lcd-icon-editor-unlock":{template:'\n \n 编组 48\n \n \n \n \n \n \n \n \n \n \n '}};const w={name:"CascaderComponent",props:{options:{type:Array,default:function(){return[]}},layout:{type:String,default:"biserial"},cover:String,proxyName:String},data:function(){return{}},methods:{handleDragStart:function(t,e){var n;null==t||null===(n=t.dataTransfer)||void 0===n||n.setData("ChartData",JSON.stringify(s(e,["coverAddress"])))},handleDragEnd:function(){}}};var b=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"cascader-component"},t._l(t.options,(function(e,i){return n("div",{key:i,class:["cascader-component-draggle","cascader-component-draggle-"+t.layout]},[n("div",{staticClass:"cascader-component-draggle-title"},[t._v(t._s(e.label))]),t._v(" "),n("div",{staticClass:"cascader-component-draggle-warp",attrs:{draggable:"true"},on:{dragstart:function(n){return t.handleDragStart(n,e)},dragend:t.handleDragEnd}},[n("img",{staticClass:"list-img",attrs:{src:e.coverAddress?t.proxyName+"/"+e.coverAddress:t.cover,alt:e.coverAddress?t.proxyName+"/"+e.coverAddress:t.cover}})])])})),0)};b._withStripped=!0;const E=p({render:b,staticRenderFns:[]},(function(t){t&&t("data-v-f4e622b4_0",{source:"[data-v-f4e622b4]:export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.cascader-component[data-v-f4e622b4] {\n width: 100%;\n height: auto;\n}\n.cascader-component-draggle[data-v-f4e622b4] {\n margin: 12px;\n background: #2e2e2e;\n width: calc(100% - 26px);\n cursor: pointer;\n border: 1px solid transparent;\n}\n.cascader-component-draggle[data-v-f4e622b4]:hover {\n border: 1px solid #3779ee;\n}\n.cascader-component-draggle:hover .list-img[data-v-f4e622b4] {\n transform: scale(1.05);\n}\n.cascader-component-draggle .cascader-component-draggle-title[data-v-f4e622b4] {\n padding: 0 12px;\n box-sizing: border-box;\n color: rgba(255, 255, 255, 0.6);\n font-size: 14px;\n height: 36px;\n line-height: 36px;\n}\n.cascader-component-draggle .cascader-component-draggle-warp[data-v-f4e622b4] {\n display: flex;\n justify-content: center;\n align-content: center;\n text-align: center;\n padding: 0 12px 15px 12px;\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n}\n.cascader-component-draggle .cascader-component-draggle-warp .list-img[data-v-f4e622b4] {\n width: 100%;\n height: 100%;\n border-radius: 2px;\n object-fit: contain;\n transition: all 0.5s;\n}\n",map:{version:3,sources:["CascaderComponent.vue","C:\\Users\\lihq1\\Desktop\\开源\\vue-lcd-engine\\components\\Cascader\\components\\CascaderComponent.vue"],names:[],mappings:"AAAA;EACE,sBAAsB;EACtB,mBAAmB;EACnB,sBAAsB;EACtB,sBAAsB;EACtB,oBAAoB;EACpB,mBAAmB;EACnB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,iBAAiB;EACjB,6BAA6B;EAC7B,wCAAwC;AAC1C;AACA;EACE,WAAW;EACX,YAAY;AACd;AACA;EACE,YAAY;EACZ,mBAAmB;EACnB,wBAAwB;EACxB,eAAe;EACf,6BAA6B;AAC/B;AACA;EACE,yBAAyB;AAC3B;AACA;EACE,sBAAsB;AACxB;AACA;EACE,eAAe;EACf,sBAAsB;EACtB,+BAA+B;EAC/B,eAAe;EACf,YAAY;EACZ,iBAAiB;AACnB;AACA;EACE,aAAa;EACb,uBAAuB;EACvB,qBAAqB;EACrB,kBAAkB;EAClB,yBAAyB;EACzB,sBAAsB;EACtB,WAAW;EACX,YAAY;AACd;AACA;EACE,WAAW;EACX,YAAY;EACZ,kBAAkB;EAClB,mBAAmB;EACnB,oBAAoB;ACCtB",file:"CascaderComponent.vue",sourcesContent:[":export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.cascader-component {\n width: 100%;\n height: auto;\n}\n.cascader-component-draggle {\n margin: 12px;\n background: #2e2e2e;\n width: calc(100% - 26px);\n cursor: pointer;\n border: 1px solid transparent;\n}\n.cascader-component-draggle:hover {\n border: 1px solid #3779ee;\n}\n.cascader-component-draggle:hover .list-img {\n transform: scale(1.05);\n}\n.cascader-component-draggle .cascader-component-draggle-title {\n padding: 0 12px;\n box-sizing: border-box;\n color: rgba(255, 255, 255, 0.6);\n font-size: 14px;\n height: 36px;\n line-height: 36px;\n}\n.cascader-component-draggle .cascader-component-draggle-warp {\n display: flex;\n justify-content: center;\n align-content: center;\n text-align: center;\n padding: 0 12px 15px 12px;\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n}\n.cascader-component-draggle .cascader-component-draggle-warp .list-img {\n width: 100%;\n height: 100%;\n border-radius: 2px;\n object-fit: contain;\n transition: all 0.5s;\n}\n",'\r\n\r\n\r\n\r\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__$c = "data-v-f4e622b4"; + /* module identifier */ + const __vue_module_identifier__$c = undefined; + /* functional template */ + const __vue_is_functional_template__$c = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$c = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$c, staticRenderFns: __vue_staticRenderFns__$c }, + __vue_inject_styles__$c, + __vue_script__$c, + __vue_scope_id__$c, + __vue_is_functional_template__$c, + __vue_module_identifier__$c, + false, + createInjector, + undefined, + undefined + ); + + var window$1 = { + data: function data() { + return { + windowWidth: null, + // 存放窗口宽度的状态值 + windowHeight: null // 存放窗口高度的状态值 + }; + }, + mounted: function mounted() { + this.updateWindowSize(); // 初始化获取当前窗口宽度 + + window.addEventListener('resize', this.handleResize); // 添加窗口大小改变的事件监听器 + }, + beforeDestroy: function beforeDestroy() { + window.removeEventListener('resize', this.handleResize); // 在组件销毁之前移除事件监听器 + }, + methods: { + updateWindowSize: function updateWindowSize() { + this.windowWidth = window.innerWidth; // 将当前窗口宽度赋值给状态值 + this.windowHeight = window.innerHeight; // 将当前窗口宽度赋值给状态值 + }, + handleResize: lodash.throttle(function (event) { + this.updateWindowSize(); + this.$router.go(0); + }, 500) + } + }; + + var script$b = { + name: 'Cascader', + mixins: [window$1], + components: _defineProperty({ + CascaderItem: __vue_component__$d, + CascaderComponent: __vue_component__$c + }, antDesignVue.Spin.name, antDesignVue.Spin), + props: { + proxyName: { + type: String, + default: 'tgcos' + }, + cover: { + type: String, + default: '' + }, + options: { + // 数据 + type: Array, + default: function _default() { + return []; + } + }, + defaultSelect: { + // 默认选中 + type: Array, + default: function _default() { + return []; + } + }, + fieldNames: { + type: Object, + default: function _default() { + return { + children: 'children', + label: 'label', + value: 'value' + }; + } + }, + loading: { + type: Boolean, + default: false + } + }, + watch: { + defaultSelect: function defaultSelect() { + this.getCheckedNames(this.options); + } + }, + computed: { + styleMediaClass: function styleMediaClass() { + if (this.windowWidth < 1366) { + return 'cascader-column-close'; + } + return ''; + } + }, + data: function data() { + return { + selectedLevelOne: null, + selectedLevelTwo: null, + selectedLevelThree: null, + selectedLevelFour: null, + defaultIndex: 0 // 默认选中第一个 + }; + }, + methods: { + handleSelected: function handleSelected(e, index) { + var _this = this; + var label = this.fieldNames.label; + var children = this.fieldNames.children; + if (this.windowWidth < 1000) return; + if (!this.selectedLevelTwo) { + this.$emit('handleColseOpen', 1); + } + if (index === 1) { + this.selectedLevelOne = e; + if (e[children] && this.defaultSelect.length > 1) { + var Index = e.children.findIndex(function (e) { + return e[label] == _this.defaultSelect[1]; + }); + this.selectedLevelTwo = e[children][Index]; + this.selectedLevelThree = e[children][Index][children]; + } else { + this.selectedLevelTwo = null; + this.selectedLevelThree = null; + } + } else if (index === 2) { + this.selectedLevelTwo = e; + if (e[children] && e[children].length) { + this.selectedLevelThree = e.layout ? e[children] : e[children][this.defaultIndex][children]; + this.selectedLevelFour = e[children][this.defaultIndex]; + } + if (!e[children]) { + this.selectedLevelThree = null; + this.selectedLevelFour = null; + } + } else { + this.selectedLevelThree = e[children] || null; + this.selectedLevelFour = e; + } + }, + handleColse: function handleColse() { + this.selectedLevelTwo = null; + this.selectedLevelThree = null; + this.selectedLevelFour = null; + this.$emit('handleColseOpen', 0); + }, + getCheckedNames: function getCheckedNames(data) { + var label = this.fieldNames.label; + var children = this.fieldNames.children; + var that = this; + var result = this.defaultSelect; + var keyValue = ['selectedLevelOne', 'selectedLevelTwo', 'selectedLevelFour', 'selectedLevelThree']; + var index = 0; + data.forEach(function (element) { + return traverse([element]); + }); + function traverse(element) { + var key = element.find(function (e) { + return e[label] === result[index]; + }) || null; + if (key) { + that[keyValue[index]] = key; + index++; + if (index === result.length) { + that[keyValue[keyValue.length - 1]] = key[children] || null; + } + key[children] && key[children].forEach(function (k) { + return traverse([k]); + }); + } + } + } + } + }; + + /* script */ + const __vue_script__$b = script$b; + + /* template */ + var __vue_render__$b = function () { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c("a-spin", { attrs: { spinning: _vm.loading } }, [ + _c("div", { staticClass: "cascader" }, [ + _vm.options + ? _c( + "div", + { class: ["cascader-column", _vm.styleMediaClass] }, + [ + _c("cascader-item", { + attrs: { + optionsItem: _vm.options, + indexLevel: 1, + mode: "vertical", + selected: _vm.selectedLevelOne, + tooltip: _vm.windowWidth < 1366, + }, + on: { handleSelected: _vm.handleSelected }, + }), + _vm._v(" "), + _vm._t("opearte", function () { + return [_c("div")] + }), + ], + 2 + ) + : _vm._e(), + _vm._v(" "), + _vm.selectedLevelOne + ? _c( + "div", + { class: ["cascader-column", _vm.styleMediaClass] }, + [ + _c("cascader-item", { + attrs: { + optionsItem: _vm.selectedLevelOne[_vm.fieldNames.children], + indexLevel: 2, + selected: _vm.selectedLevelTwo, + tooltip: _vm.windowWidth < 1366, + }, + on: { handleSelected: _vm.handleSelected }, + }), + ], + 1 + ) + : _vm._e(), + _vm._v(" "), + _vm.selectedLevelTwo && _vm.windowWidth >= 1000 + ? _c("div", { class: ["cascader-column", _vm.styleMediaClass] }, [ + _c("div", { staticClass: "cascader-column-top" }, [ + _c( + "div", + { + staticClass: "cascader-column-top-close", + on: { click: _vm.handleColse }, + }, + [_vm._v("X")] + ), + ]), + _vm._v(" "), + _c("div", { staticClass: "cascader-column-main" }, [ + !_vm.selectedLevelTwo.layout + ? _c( + "div", + { staticClass: "cascader-column-left" }, + [ + _c( + "cascader-item", + { + attrs: { + optionsItem: + _vm.selectedLevelTwo[_vm.fieldNames.children], + indexLevel: 3, + selected: _vm.selectedLevelFour, + tooltip: _vm.windowWidth < 1600, + showTitle: _vm.windowWidth > 760, + }, + on: { handleSelected: _vm.handleSelected }, + }, + [_c("template", { slot: "icon-title" }, [_c("div")])], + 2 + ), + ], + 1 + ) + : _vm._e(), + _vm._v(" "), + _c( + "div", + { staticClass: "cascader-column-right" }, + [ + _c("cascader-component", { + attrs: { + cover: _vm.cover, + proxyName: _vm.proxyName, + options: _vm.selectedLevelThree, + layout: _vm.selectedLevelTwo.layout || "biserial", + }, + }), + ], + 1 + ), + ]), + ]) + : _vm._e(), + ]), + ]) + }; + var __vue_staticRenderFns__$b = []; + __vue_render__$b._withStripped = true; + + /* style */ + const __vue_inject_styles__$b = function (inject) { + if (!inject) return + inject("data-v-655ef464_0", { source: "[data-v-655ef464]:export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.cascader[data-v-655ef464] {\n display: flex;\n flex-wrap: wrap;\n height: 100%;\n color: rgba(255, 255, 255, 0.6);\n overflow: hidden;\n}\n.cascader .cascader-column[data-v-655ef464] {\n position: relative;\n font-size: 16px;\n height: 100%;\n}\n.cascader .cascader-column[data-v-655ef464]:nth-child(1) {\n flex: 80;\n}\n.cascader .cascader-column[data-v-655ef464]:nth-child(2) {\n flex: 130;\n background: #141414;\n}\n.cascader .cascader-column[data-v-655ef464]:nth-child(3) {\n flex: 350;\n}\n.cascader .cascader-column .cascader-column-top[data-v-655ef464] {\n display: flex;\n justify-content: flex-end;\n line-height: 40px;\n height: 40px;\n box-shadow: 0px 1px 0px 0px #000000;\n}\n.cascader .cascader-column .cascader-column-top-close[data-v-655ef464] {\n text-align: center;\n width: 16px;\n height: 40px;\n margin-right: 12px;\n cursor: pointer;\n color: #ffffff;\n}\n.cascader .cascader-column .cascader-column-main[data-v-655ef464] {\n display: flex;\n width: 100%;\n height: calc(100% - 40px);\n}\n.cascader .cascader-column .cascader-column-main .cascader-column-left[data-v-655ef464] {\n flex: 110;\n}\n.cascader .cascader-column .cascader-column-main .cascader-column-left[data-v-655ef464] .cascader-item-name {\n margin: 0 auto;\n width: calc(100% - 16px);\n padding: 4px;\n box-sizing: border-box;\n text-align: center;\n border-radius: 4px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.cascader .cascader-column .cascader-column-main .cascader-column-left[data-v-655ef464] .cascader-item-horizontal-active .cascader-item-name {\n background-color: #333;\n}\n.cascader .cascader-column .cascader-column-main .cascader-column-right[data-v-655ef464] {\n flex: 240;\n height: 100%;\n overflow: auto;\n}\n.cascader .cascader-column-close[data-v-655ef464] {\n font-size: 12px;\n}\n.cascader .cascader-column-close[data-v-655ef464]:nth-child(1) {\n flex: 100;\n}\n.cascader .cascader-column-close[data-v-655ef464]:nth-child(1) .cascader-item-vertical {\n width: calc(100% - 12px);\n}\n.cascader .cascader-column-close[data-v-655ef464]:nth-child(2) {\n flex: 60;\n}\n.cascader .cascader-column-close[data-v-655ef464]:nth-child(2) .cascader-item-name {\n display: none;\n}\n.cascader .cascader-column-close[data-v-655ef464]:nth-child(2) .cascader-item-horizontal {\n justify-content: center;\n}\n.cascader .cascader-column-close[data-v-655ef464]:nth-child(2) .cascader-item-horizontal i {\n margin: 0;\n}\n.ant-spin-nested-loading[data-v-655ef464] {\n height: 100%;\n}\n.ant-spin-nested-loading[data-v-655ef464] .ant-spin-container {\n height: 100%;\n}\n.ant-spin-nested-loading[data-v-655ef464] .ant-spin-spinning {\n max-height: 100%;\n}\n", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,sBAAsB;EACtB,mBAAmB;EACnB,sBAAsB;EACtB,sBAAsB;EACtB,oBAAoB;EACpB,mBAAmB;EACnB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,iBAAiB;EACjB,6BAA6B;EAC7B,wCAAwC;AAC1C;AACA;EACE,aAAa;EACb,eAAe;EACf,YAAY;EACZ,+BAA+B;EAC/B,gBAAgB;AAClB;AACA;EACE,kBAAkB;EAClB,eAAe;EACf,YAAY;AACd;AACA;EACE,QAAQ;AACV;AACA;EACE,SAAS;EACT,mBAAmB;AACrB;AACA;EACE,SAAS;AACX;AACA;EACE,aAAa;EACb,yBAAyB;EACzB,iBAAiB;EACjB,YAAY;EACZ,mCAAmC;AACrC;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,kBAAkB;EAClB,eAAe;EACf,cAAc;AAChB;AACA;EACE,aAAa;EACb,WAAW;EACX,yBAAyB;AAC3B;AACA;EACE,SAAS;AACX;AACA;EACE,cAAc;EACd,wBAAwB;EACxB,YAAY;EACZ,sBAAsB;EACtB,kBAAkB;EAClB,kBAAkB;EAClB,gBAAgB;EAChB,uBAAuB;EACvB,mBAAmB;AACrB;AACA;EACE,sBAAsB;AACxB;AACA;EACE,SAAS;EACT,YAAY;EACZ,cAAc;AAChB;AACA;EACE,eAAe;AACjB;AACA;EACE,SAAS;AACX;AACA;EACE,wBAAwB;AAC1B;AACA;EACE,QAAQ;AACV;AACA;EACE,aAAa;AACf;AACA;EACE,uBAAuB;AACzB;AACA;EACE,SAAS;AACX;AACA;EACE,YAAY;AACd;AACA;EACE,YAAY;AACd;AACA;EACE,gBAAgB;AAClB","file":"index.vue","sourcesContent":[":export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.cascader {\n display: flex;\n flex-wrap: wrap;\n height: 100%;\n color: rgba(255, 255, 255, 0.6);\n overflow: hidden;\n}\n.cascader .cascader-column {\n position: relative;\n font-size: 16px;\n height: 100%;\n}\n.cascader .cascader-column:nth-child(1) {\n flex: 80;\n}\n.cascader .cascader-column:nth-child(2) {\n flex: 130;\n background: #141414;\n}\n.cascader .cascader-column:nth-child(3) {\n flex: 350;\n}\n.cascader .cascader-column .cascader-column-top {\n display: flex;\n justify-content: flex-end;\n line-height: 40px;\n height: 40px;\n box-shadow: 0px 1px 0px 0px #000000;\n}\n.cascader .cascader-column .cascader-column-top-close {\n text-align: center;\n width: 16px;\n height: 40px;\n margin-right: 12px;\n cursor: pointer;\n color: #ffffff;\n}\n.cascader .cascader-column .cascader-column-main {\n display: flex;\n width: 100%;\n height: calc(100% - 40px);\n}\n.cascader .cascader-column .cascader-column-main .cascader-column-left {\n flex: 110;\n}\n.cascader .cascader-column .cascader-column-main .cascader-column-left /deep/ .cascader-item-name {\n margin: 0 auto;\n width: calc(100% - 16px);\n padding: 4px;\n box-sizing: border-box;\n text-align: center;\n border-radius: 4px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.cascader .cascader-column .cascader-column-main .cascader-column-left /deep/ .cascader-item-horizontal-active .cascader-item-name {\n background-color: #333;\n}\n.cascader .cascader-column .cascader-column-main .cascader-column-right {\n flex: 240;\n height: 100%;\n overflow: auto;\n}\n.cascader .cascader-column-close {\n font-size: 12px;\n}\n.cascader .cascader-column-close:nth-child(1) {\n flex: 100;\n}\n.cascader .cascader-column-close:nth-child(1) /deep/ .cascader-item-vertical {\n width: calc(100% - 12px);\n}\n.cascader .cascader-column-close:nth-child(2) {\n flex: 60;\n}\n.cascader .cascader-column-close:nth-child(2) /deep/ .cascader-item-name {\n display: none;\n}\n.cascader .cascader-column-close:nth-child(2) /deep/ .cascader-item-horizontal {\n justify-content: center;\n}\n.cascader .cascader-column-close:nth-child(2) /deep/ .cascader-item-horizontal i {\n margin: 0;\n}\n.ant-spin-nested-loading {\n height: 100%;\n}\n.ant-spin-nested-loading /deep/ .ant-spin-container {\n height: 100%;\n}\n.ant-spin-nested-loading /deep/ .ant-spin-spinning {\n max-height: 100%;\n}\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__$b = "data-v-655ef464"; + /* module identifier */ + const __vue_module_identifier__$b = undefined; + /* functional template */ + const __vue_is_functional_template__$b = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$b = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$b, staticRenderFns: __vue_staticRenderFns__$b }, + __vue_inject_styles__$b, + __vue_script__$b, + __vue_scope_id__$b, + __vue_is_functional_template__$b, + __vue_module_identifier__$b, + false, + createInjector, + undefined, + undefined + ); + + function ownKeys(e, r) { + var t = Object.keys(e); + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + r && (o = o.filter(function (r) { + return Object.getOwnPropertyDescriptor(e, r).enumerable; + })), t.push.apply(t, o); + } + return t; + } + function _objectSpread2(e) { + for (var r = 1; r < arguments.length; r++) { + var t = null != arguments[r] ? arguments[r] : {}; + r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { + _defineProperty(e, r, t[r]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { + Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); + }); + } + return e; + } + + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + return arr2; + } + + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) return _arrayLikeToArray(arr); + } + + function _iterableToArray(iter) { + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); + } + + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); + } + + function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); + } + + function _createForOfIteratorHelper(o, allowArrayLike) { + var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; + if (!it) { + if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { + if (it) o = it; + var i = 0; + var F = function F() {}; + return { + s: F, + n: function n() { + if (i >= o.length) return { + done: true + }; + return { + done: false, + value: o[i++] + }; + }, + e: function e(_e) { + throw _e; + }, + f: F + }; + } + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + var normalCompletion = true, + didErr = false, + err; + return { + s: function s() { + it = it.call(o); + }, + n: function n() { + var step = it.next(); + normalCompletion = step.done; + return step; + }, + e: function e(_e2) { + didErr = true; + err = _e2; + }, + f: function f() { + try { + if (!normalCompletion && it["return"] != null) it["return"](); + } finally { + if (didErr) throw err; + } + } + }; + } + + function _regeneratorRuntime() { + _regeneratorRuntime = function _regeneratorRuntime() { + return e; + }; + var t, + e = {}, + r = Object.prototype, + n = r.hasOwnProperty, + o = Object.defineProperty || function (t, e, r) { + t[e] = r.value; + }, + i = "function" == typeof Symbol ? Symbol : {}, + a = i.iterator || "@@iterator", + c = i.asyncIterator || "@@asyncIterator", + u = i.toStringTag || "@@toStringTag"; + function define(t, e, r) { + return Object.defineProperty(t, e, { + value: r, + enumerable: !0, + configurable: !0, + writable: !0 + }), t[e]; + } + try { + define({}, ""); + } catch (t) { + define = function define(t, e, r) { + return t[e] = r; + }; + } + function wrap(t, e, r, n) { + var i = e && e.prototype instanceof Generator ? e : Generator, + a = Object.create(i.prototype), + c = new Context(n || []); + return o(a, "_invoke", { + value: makeInvokeMethod(t, r, c) + }), a; + } + function tryCatch(t, e, r) { + try { + return { + type: "normal", + arg: t.call(e, r) + }; + } catch (t) { + return { + type: "throw", + arg: t + }; + } + } + e.wrap = wrap; + var h = "suspendedStart", + l = "suspendedYield", + f = "executing", + s = "completed", + y = {}; + function Generator() {} + function GeneratorFunction() {} + function GeneratorFunctionPrototype() {} + var p = {}; + define(p, a, function () { + return this; + }); + var d = Object.getPrototypeOf, + v = d && d(d(values([]))); + v && v !== r && n.call(v, a) && (p = v); + var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); + function defineIteratorMethods(t) { + ["next", "throw", "return"].forEach(function (e) { + define(t, e, function (t) { + return this._invoke(e, t); + }); + }); + } + function AsyncIterator(t, e) { + function invoke(r, o, i, a) { + var c = tryCatch(t[r], t, o); + if ("throw" !== c.type) { + var u = c.arg, + h = u.value; + return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { + invoke("next", t, i, a); + }, function (t) { + invoke("throw", t, i, a); + }) : e.resolve(h).then(function (t) { + u.value = t, i(u); + }, function (t) { + return invoke("throw", t, i, a); + }); + } + a(c.arg); + } + var r; + o(this, "_invoke", { + value: function value(t, n) { + function callInvokeWithMethodAndArg() { + return new e(function (e, r) { + invoke(t, n, e, r); + }); + } + return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); + } + }); + } + function makeInvokeMethod(e, r, n) { + var o = h; + return function (i, a) { + if (o === f) throw new Error("Generator is already running"); + if (o === s) { + if ("throw" === i) throw a; + return { + value: t, + done: !0 + }; + } + for (n.method = i, n.arg = a;;) { + var c = n.delegate; + if (c) { + var u = maybeInvokeDelegate(c, n); + if (u) { + if (u === y) continue; + return u; + } + } + if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { + if (o === h) throw o = s, n.arg; + n.dispatchException(n.arg); + } else "return" === n.method && n.abrupt("return", n.arg); + o = f; + var p = tryCatch(e, r, n); + if ("normal" === p.type) { + if (o = n.done ? s : l, p.arg === y) continue; + return { + value: p.arg, + done: n.done + }; + } + "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); + } + }; + } + function maybeInvokeDelegate(e, r) { + var n = r.method, + o = e.iterator[n]; + if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; + var i = tryCatch(o, e.iterator, r.arg); + if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; + var a = i.arg; + return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); + } + function pushTryEntry(t) { + var e = { + tryLoc: t[0] + }; + 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); + } + function resetTryEntry(t) { + var e = t.completion || {}; + e.type = "normal", delete e.arg, t.completion = e; + } + function Context(t) { + this.tryEntries = [{ + tryLoc: "root" + }], t.forEach(pushTryEntry, this), this.reset(!0); + } + function values(e) { + if (e || "" === e) { + var r = e[a]; + if (r) return r.call(e); + if ("function" == typeof e.next) return e; + if (!isNaN(e.length)) { + var o = -1, + i = function next() { + for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; + return next.value = t, next.done = !0, next; + }; + return i.next = i; + } + } + throw new TypeError(_typeof(e) + " is not iterable"); + } + return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { + value: GeneratorFunctionPrototype, + configurable: !0 + }), o(GeneratorFunctionPrototype, "constructor", { + value: GeneratorFunction, + configurable: !0 + }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { + var e = "function" == typeof t && t.constructor; + return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); + }, e.mark = function (t) { + return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; + }, e.awrap = function (t) { + return { + __await: t + }; + }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { + return this; + }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { + void 0 === i && (i = Promise); + var a = new AsyncIterator(wrap(t, r, n, o), i); + return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { + return t.done ? t.value : a.next(); + }); + }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { + return this; + }), define(g, "toString", function () { + return "[object Generator]"; + }), e.keys = function (t) { + var e = Object(t), + r = []; + for (var n in e) r.push(n); + return r.reverse(), function next() { + for (; r.length;) { + var t = r.pop(); + if (t in e) return next.value = t, next.done = !1, next; + } + return next.done = !0, next; + }; + }, e.values = values, Context.prototype = { + constructor: Context, + reset: function reset(e) { + if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); + }, + stop: function stop() { + this.done = !0; + var t = this.tryEntries[0].completion; + if ("throw" === t.type) throw t.arg; + return this.rval; + }, + dispatchException: function dispatchException(e) { + if (this.done) throw e; + var r = this; + function handle(n, o) { + return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; + } + for (var o = this.tryEntries.length - 1; o >= 0; --o) { + var i = this.tryEntries[o], + a = i.completion; + if ("root" === i.tryLoc) return handle("end"); + if (i.tryLoc <= this.prev) { + var c = n.call(i, "catchLoc"), + u = n.call(i, "finallyLoc"); + if (c && u) { + if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); + if (this.prev < i.finallyLoc) return handle(i.finallyLoc); + } else if (c) { + if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); + } else { + if (!u) throw new Error("try statement without catch or finally"); + if (this.prev < i.finallyLoc) return handle(i.finallyLoc); + } + } + } + }, + abrupt: function abrupt(t, e) { + for (var r = this.tryEntries.length - 1; r >= 0; --r) { + var o = this.tryEntries[r]; + if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { + var i = o; + break; + } + } + i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); + var a = i ? i.completion : {}; + return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); + }, + complete: function complete(t, e) { + if ("throw" === t.type) throw t.arg; + return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; + }, + finish: function finish(t) { + for (var e = this.tryEntries.length - 1; e >= 0; --e) { + var r = this.tryEntries[e]; + if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; + } + }, + "catch": function _catch(t) { + for (var e = this.tryEntries.length - 1; e >= 0; --e) { + var r = this.tryEntries[e]; + if (r.tryLoc === t) { + var n = r.completion; + if ("throw" === n.type) { + var o = n.arg; + resetTryEntry(r); + } + return o; + } + } + throw new Error("illegal catch attempt"); + }, + delegateYield: function delegateYield(e, r, n) { + return this.delegate = { + iterator: values(e), + resultName: r, + nextLoc: n + }, "next" === this.method && (this.arg = t), y; + } + }, e; + } + + function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { + try { + var info = gen[key](arg); + var value = info.value; + } catch (error) { + reject(error); + return; + } + if (info.done) { + resolve(value); + } else { + Promise.resolve(value).then(_next, _throw); + } + } + function _asyncToGenerator(fn) { + return function () { + var self = this, + args = arguments; + return new Promise(function (resolve, reject) { + var gen = fn.apply(self, args); + function _next(value) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); + } + function _throw(err) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); + } + _next(undefined); + }); + }; + } + + function _arrayWithHoles(arr) { + if (Array.isArray(arr)) return arr; + } + + function _iterableToArrayLimit(r, l) { + var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; + if (null != t) { + var e, + n, + i, + u, + a = [], + f = !0, + o = !1; + try { + if (i = (t = t.call(r)).next, 0 === l) { + if (Object(t) !== t) return; + f = !1; + } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); + } catch (r) { + o = !0, n = r; + } finally { + try { + if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; + } finally { + if (o) throw n; + } + } + return a; + } + } + + function _nonIterableRest() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + function _slicedToArray(arr, i) { + return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); + } + + function isFunction(func) { + return typeof func === 'function' || Object.prototype.toString.call(func) === '[object Function]'; + } + function snapToGrid(grid, pendingX, pendingY) { + var scale = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1; + var x = Math.round(pendingX / scale / grid[0]) * grid[0]; + var y = Math.round(pendingY / scale / grid[1]) * grid[1]; + return [x, y]; + } + function computeWidth(parentWidth, left, right) { + return parentWidth - left - right; + } + function computeHeight(parentHeight, top, bottom) { + return parentHeight - top - bottom; + } + function restrictToBounds(value, min, max) { + if (min !== null && value < min) { + return min; + } + if (max !== null && max < value) { + return max; + } + return value; + } + + // 将选择器与父元素匹配 + function matchesSelectorToParentElements(el, selector, baseNode) { + var node = el; + var matchesSelectorFunc = ['matches', 'webkitMatchesSelector', 'mozMatchesSelector', 'msMatchesSelector', 'oMatchesSelector'].find(function (func) { + return isFunction(node[func]); + }); + if (!isFunction(node[matchesSelectorFunc])) return false; + do { + if (node[matchesSelectorFunc](selector)) return true; + if (node === baseNode) return false; + node = node.parentNode; + } while (node); + return false; + } + function getComputedSize($el) { + var style = window.getComputedStyle($el); + return [parseFloat(style.getPropertyValue('width'), 10), parseFloat(style.getPropertyValue('height'), 10)]; + } + // 添加事件 + function addEvent(el, event, handler) { + if (!el) { + return; + } + if (el.attachEvent) { + el.attachEvent('on' + event, handler); + } else if (el.addEventListener) { + el.addEventListener(event, handler, true); + } else { + el['on' + event] = handler; + } + } + + // 删除事件 + function removeEvent(el, event, handler) { + if (!el) { + return; + } + if (el.detachEvent) { + el.detachEvent('on' + event, handler); + } else if (el.removeEventListener) { + el.removeEventListener(event, handler, true); + } else { + el['on' + event] = null; + } + } + + var events = { + mouse: { + start: 'mousedown', + move: 'mousemove', + stop: 'mouseup' + }, + touch: { + start: 'touchstart', + move: 'touchmove', + stop: 'touchend' + } + }; + + // 禁止用户选取 + var userSelectNone = { + userSelect: 'none', + MozUserSelect: 'none', + WebkitUserSelect: 'none', + MsUserSelect: 'none' + }; + // 用户选中自动 + var userSelectAuto = { + userSelect: 'auto', + MozUserSelect: 'auto', + WebkitUserSelect: 'auto', + MsUserSelect: 'auto' + }; + var eventsFor = events.mouse; + var script$a = { + replace: true, + name: 'ComponentBox', + props: { + className: { + type: String, + default: 'vdr' + }, + classNameDraggable: { + type: String, + default: 'draggable' + }, + classNameResizable: { + type: String, + default: 'resizable' + }, + classNameDragging: { + type: String, + default: 'dragging' + }, + classNameResizing: { + type: String, + default: 'resizing' + }, + classNameActive: { + type: String, + default: 'active' + }, + classNameHandle: { + type: String, + default: 'handle' + }, + disableUserSelect: { + type: Boolean, + default: true + }, + enableNativeDrag: { + type: Boolean, + default: false + }, + preventDeactivation: { + type: Boolean, + default: false + }, + active: { + type: Boolean, + default: false + }, + draggable: { + type: Boolean, + default: true + }, + resizable: { + type: Boolean, + default: true + }, + // 锁定宽高比 + lockAspectRatio: { + type: Boolean, + default: false + }, + w: { + type: [Number, String], + default: 200, + validator: function validator(val) { + if (typeof val === 'number') { + return val > 0; + } + return val === 'auto'; + } + }, + h: { + type: [Number, String], + default: 200, + validator: function validator(val) { + if (typeof val === 'number') { + return val > 0; + } + return val === 'auto'; + } + }, + transform: { + type: String, + default: '' + }, + perspective: { + type: Number, + default: 0 + }, + minWidth: { + type: Number, + default: 0, + validator: function validator(val) { + return val >= 0; + } + }, + minHeight: { + type: Number, + default: 0, + validator: function validator(val) { + return val >= 0; + } + }, + maxWidth: { + type: Number, + default: null, + validator: function validator(val) { + return val >= 0; + } + }, + maxHeight: { + type: Number, + default: null, + validator: function validator(val) { + return val >= 0; + } + }, + x: { + type: Number, + default: 0 + }, + y: { + type: Number, + default: 0 + }, + z: { + type: [String, Number], + default: 'auto', + validator: function validator(val) { + return typeof val === 'string' ? val === 'auto' : val >= 0; + } + }, + handles: { + type: Array, + default: function _default() { + return ['tl', 'tm', 'tr', 'mr', 'br', 'bm', 'bl', 'ml']; + }, + validator: function validator(val) { + var s = new Set(['tl', 'tm', 'tr', 'mr', 'br', 'bm', 'bl', 'ml']); + return new Set(val.filter(function (h) { + return s.has(h); + })).size === val.length; + } + }, + dragHandle: { + type: String, + default: null + }, + dragCancel: { + type: String, + default: null + }, + axis: { + type: String, + default: 'both', + validator: function validator(val) { + return ['x', 'y', 'both'].includes(val); + } + }, + grid: { + type: Array, + default: function _default() { + return [1, 1]; + } + }, + parent: { + type: [Boolean, String], + default: false + }, + onDragStart: { + type: Function, + default: function _default() { + return true; + } + }, + onDrag: { + type: Function, + default: function _default() { + return true; + } + }, + onResizeStart: { + type: Function, + default: function _default() { + return true; + } + }, + onResize: { + type: Function, + default: function _default() { + return true; + } + }, + // 冲突检测 + isConflictCheck: { + type: Boolean, + default: false + }, + // 元素对齐 + snap: { + type: Boolean, + default: false + }, + // 当调用对齐时,用来设置组件与组件之间的对齐距离,以像素为单位 + snapTolerance: { + type: Number, + default: 5, + validator: function validator(val) { + return typeof val === 'number'; + } + }, + // 缩放比例 + scaleRatio: { + type: Number, + default: 1, + validator: function validator(val) { + return typeof val === 'number'; + } + }, + // handle是否缩放 + handleInfo: { + type: Object, + default: function _default() { + return { + size: 8, + offset: -5, + switch: true + }; + } + } + }, + data: function data() { + return { + left: this.x, + top: this.y, + right: null, + bottom: null, + width: null, + height: null, + widthTouched: false, + heightTouched: false, + aspectFactor: null, + parentWidth: null, + parentHeight: null, + minW: this.minWidth, + minH: this.minHeight, + maxW: this.maxWidth, + maxH: this.maxHeight, + handle: null, + enabled: this.active, + resizing: false, + dragging: false, + zIndex: this.z + }; + }, + created: function created() { + // eslint-disable-next-line 无效的prop:minWidth不能大于maxWidth + if (this.maxWidth && this.minWidth > this.maxWidth) ; + // eslint-disable-next-line 无效prop:minHeight不能大于maxHeight' + if (this.maxWidth && this.minHeight > this.maxHeight) ; + this.resetBoundsAndMouseState(); + }, + mounted: function mounted() { + if (!this.enableNativeDrag) { + this.$el.ondragstart = function () { + return false; + }; + } + var _this$getParentSize = this.getParentSize(), + _this$getParentSize2 = _slicedToArray(_this$getParentSize, 2), + parentWidth = _this$getParentSize2[0], + parentHeight = _this$getParentSize2[1]; + this.parentWidth = parentWidth; + this.parentHeight = parentHeight; + var _getComputedSize = getComputedSize(this.$el), + _getComputedSize2 = _slicedToArray(_getComputedSize, 2), + width = _getComputedSize2[0], + height = _getComputedSize2[1]; + this.aspectFactor = (this.w !== 'auto' ? this.w : width) / (this.h !== 'auto' ? this.h : height); + this.width = this.w !== 'auto' ? this.w : width; + this.height = this.h !== 'auto' ? this.h : height; + this.right = this.parentWidth - this.width - this.left; + this.bottom = this.parentHeight - this.height - this.top; + this.settingAttribute(); + + // 优化:取消选中的行为优先绑定在父节点上 + var parentElement = this.$el.parentNode; + addEvent(parentElement || document.documentElement, 'mousedown', this.deselect); + addEvent(parentElement || document.documentElement, 'touchend touchcancel', this.deselect); + addEvent(window, 'resize', this.checkParentSize); + }, + beforeDestroy: function beforeDestroy() { + removeEvent(document.documentElement, 'mousedown', this.deselect); + removeEvent(document.documentElement, 'touchstart', this.handleUp); + removeEvent(document.documentElement, 'mousemove', this.move); + removeEvent(document.documentElement, 'touchmove', this.move); + removeEvent(document.documentElement, 'mouseup', this.handleUp); + removeEvent(document.documentElement, 'touchend touchcancel', this.deselect); + removeEvent(window, 'resize', this.checkParentSize); + }, + methods: { + // 右键菜单 + onContextMenu: function onContextMenu(e) { + this.$emit('contextmenu', e); + }, + // 重置边界和鼠标状态 + resetBoundsAndMouseState: function resetBoundsAndMouseState() { + this.mouseClickPosition = { + mouseX: 0, + mouseY: 0, + x: 0, + y: 0, + w: 0, + h: 0 + }; + this.bounds = { + minLeft: null, + maxLeft: null, + minRight: null, + maxRight: null, + minTop: null, + maxTop: null, + minBottom: null, + maxBottom: null + }; + }, + // 检查父元素大小 + checkParentSize: function checkParentSize() { + if (this.parent) { + var _this$getParentSize3 = this.getParentSize(), + _this$getParentSize4 = _slicedToArray(_this$getParentSize3, 2), + newParentWidth = _this$getParentSize4[0], + newParentHeight = _this$getParentSize4[1]; + // 修复父元素改变大小后,组件resizing时活动异常 + this.right = newParentWidth - this.width - this.left; + this.bottom = newParentHeight - this.height - this.top; + this.parentWidth = newParentWidth; + this.parentHeight = newParentHeight; + } + }, + // 获取父元素大小 + getParentSize: function getParentSize() { + if (this.parent === true) { + var style = window.getComputedStyle(this.$el.parentNode, null); + return [parseInt(style.getPropertyValue('width'), 10), parseInt(style.getPropertyValue('height'), 10)]; + } + if (typeof this.parent === 'string') { + var parentNode = document.querySelector(this.parent); + if (!(parentNode instanceof HTMLElement)) { + throw new Error("The selector ".concat(this.parent, " does not match any element")); + } + return [parentNode.offsetWidth, parentNode.offsetHeight]; + } + return [null, null]; + }, + // 元素触摸按下 + elementTouchDown: function elementTouchDown(e) { + // 阻止事件冒泡 + e.stopPropagation(); + eventsFor = events.touch; + this.elementDown(e); + }, + elementMouseDown: function elementMouseDown(e) { + // 阻止事件冒泡 + e.stopPropagation(); + eventsFor = events.mouse; + this.elementDown(e); + }, + // 元素按下 + elementDown: function elementDown(e) { + // 阻止事件冒泡 + e.stopPropagation(); + if (e instanceof MouseEvent && e.which !== 1) { + return; + } + var target = e.target || e.srcElement; + if (this.$el.contains(target)) { + if (this.onDragStart(e) === false) { + return; + } + if (this.dragHandle && !matchesSelectorToParentElements(target, this.dragHandle, this.$el) || this.dragCancel && matchesSelectorToParentElements(target, this.dragCancel, this.$el)) { + this.dragging = false; + return; + } + if (!this.enabled) { + this.enabled = true; + this.$emit('activated'); + this.$emit('update:active', true); + } + if (this.draggable) { + this.dragging = true; + } + this.mouseClickPosition.mouseX = e.touches ? e.touches[0].pageX : e.pageX; + this.mouseClickPosition.mouseY = e.touches ? e.touches[0].pageY : e.pageY; + this.mouseClickPosition.left = this.left; + this.mouseClickPosition.right = this.right; + this.mouseClickPosition.top = this.top; + this.mouseClickPosition.bottom = this.bottom; + this.mouseClickPosition.w = this.width; + this.mouseClickPosition.h = this.height; + if (this.parent) { + var _this$getParentSize5 = this.getParentSize(), + _this$getParentSize6 = _slicedToArray(_this$getParentSize5, 2), + parentWidth = _this$getParentSize6[0], + parentHeight = _this$getParentSize6[1]; + // 拖拽时重新计算父组件跟当前组件的宽高位移等信息 + this.parentWidth = parentWidth; + this.parentHeight = parentHeight; + this.right = this.parentWidth - this.width - this.left; + this.bottom = this.parentHeight - this.height - this.top; + this.bounds = this.calcDragLimits(); + } + addEvent(document.documentElement, eventsFor.move, this.move); + addEvent(document.documentElement, eventsFor.stop, this.handleUp); + } + }, + // 计算移动范围 + calcDragLimits: function calcDragLimits() { + return { + minLeft: this.left % this.grid[0], + maxLeft: Math.floor((this.parentWidth - this.width - this.left) / this.grid[0]) * this.grid[0] + this.left, + minRight: this.right % this.grid[0], + maxRight: Math.floor((this.parentWidth - this.width - this.right) / this.grid[0]) * this.grid[0] + this.right, + minTop: this.top % this.grid[1], + maxTop: Math.floor((this.parentHeight - this.height - this.top) / this.grid[1]) * this.grid[1] + this.top, + minBottom: this.bottom % this.grid[1], + maxBottom: Math.floor((this.parentHeight - this.height - this.bottom) / this.grid[1]) * this.grid[1] + this.bottom + }; + }, + // 取消 + deselect: function deselect(e) { + var target = e.target || e.srcElement; + var regex = new RegExp(this.className + '-([trmbl]{2})', ''); + if (!this.$el.contains(target) && !regex.test(target.className)) { + if (this.enabled && !this.preventDeactivation) { + this.enabled = false; + this.$emit('deactivated'); + this.$emit('update:active', false); + } + removeEvent(document.documentElement, eventsFor.move, this.handleResize); + } + if (e.button !== 2) { + this.resetBoundsAndMouseState(); + } + }, + // 控制柄触摸按下 + handleTouchDown: function handleTouchDown(handle, e) { + eventsFor = events.touch; + this.handleDown(handle, e); + }, + // 控制柄按下 + handleDown: function handleDown(handle, e) { + if (e instanceof MouseEvent && e.which !== 1) { + return; + } + if (this.onResizeStart(handle, e) === false) { + return; + } + if (e.stopPropagation) e.stopPropagation(); + + // Here we avoid a dangerous recursion by faking + // corner handles as middle handles + if (this.lockAspectRatio && !handle.includes('m')) { + this.handle = 'm' + handle.substring(1); + } else { + this.handle = handle; + } + this.resizing = true; + this.mouseClickPosition.mouseX = e.touches ? e.touches[0].pageX : e.pageX; + this.mouseClickPosition.mouseY = e.touches ? e.touches[0].pageY : e.pageY; + this.mouseClickPosition.left = this.left; + this.mouseClickPosition.right = this.right; + this.mouseClickPosition.top = this.top; + this.mouseClickPosition.bottom = this.bottom; + this.mouseClickPosition.w = this.width; + this.mouseClickPosition.h = this.height; + this.bounds = this.calcResizeLimits(); + addEvent(document.documentElement, eventsFor.move, this.handleResize); + addEvent(document.documentElement, eventsFor.stop, this.handleUp); + }, + // 计算调整大小范围 + calcResizeLimits: function calcResizeLimits() { + var minW = this.minW; + var minH = this.minH; + var maxW = this.maxW; + var maxH = this.maxH; + var aspectFactor = this.aspectFactor; + var _this$grid = _slicedToArray(this.grid, 2), + gridX = _this$grid[0], + gridY = _this$grid[1]; + var width = this.width; + var height = this.height; + var left = this.left; + var top = this.top; + var right = this.right; + var bottom = this.bottom; + if (this.lockAspectRatio) { + if (minW / minH > aspectFactor) { + minH = minW / aspectFactor; + } else { + minW = aspectFactor * minH; + } + if (maxW && maxH) { + maxW = Math.min(maxW, aspectFactor * maxH); + maxH = Math.min(maxH, maxW / aspectFactor); + } else if (maxW) { + maxH = maxW / aspectFactor; + } else if (maxH) { + maxW = aspectFactor * maxH; + } + } + maxW = maxW - maxW % gridX; + maxH = maxH - maxH % gridY; + var limits = { + minLeft: null, + maxLeft: null, + minTop: null, + maxTop: null, + minRight: null, + maxRight: null, + minBottom: null, + maxBottom: null + }; + if (this.parent) { + limits.minLeft = left % gridX; + limits.maxLeft = left + Math.floor((width - minW) / gridX) * gridX; + limits.minTop = top % gridY; + limits.maxTop = top + Math.floor((height - minH) / gridY) * gridY; + limits.minRight = right % gridX; + limits.maxRight = right + Math.floor((width - minW) / gridX) * gridX; + limits.minBottom = bottom % gridY; + limits.maxBottom = bottom + Math.floor((height - minH) / gridY) * gridY; + if (maxW) { + limits.minLeft = Math.max(limits.minLeft, this.parentWidth - right - maxW); + limits.minRight = Math.max(limits.minRight, this.parentWidth - left - maxW); + } + if (maxH) { + limits.minTop = Math.max(limits.minTop, this.parentHeight - bottom - maxH); + limits.minBottom = Math.max(limits.minBottom, this.parentHeight - top - maxH); + } + if (this.lockAspectRatio) { + limits.minLeft = Math.max(limits.minLeft, left - top * aspectFactor); + limits.minTop = Math.max(limits.minTop, top - left / aspectFactor); + limits.minRight = Math.max(limits.minRight, right - bottom * aspectFactor); + limits.minBottom = Math.max(limits.minBottom, bottom - right / aspectFactor); + } + } else { + limits.minLeft = null; + limits.maxLeft = left + Math.floor((width - minW) / gridX) * gridX; + limits.minTop = null; + limits.maxTop = top + Math.floor((height - minH) / gridY) * gridY; + limits.minRight = null; + limits.maxRight = right + Math.floor((width - minW) / gridX) * gridX; + limits.minBottom = null; + limits.maxBottom = bottom + Math.floor((height - minH) / gridY) * gridY; + if (maxW) { + limits.minLeft = -(right + maxW); + limits.minRight = -(left + maxW); + } + if (maxH) { + limits.minTop = -(bottom + maxH); + limits.minBottom = -(top + maxH); + } + if (this.lockAspectRatio && maxW && maxH) { + limits.minLeft = Math.min(limits.minLeft, -(right + maxW)); + limits.minTop = Math.min(limits.minTop, -(maxH + bottom)); + limits.minRight = Math.min(limits.minRight, -left - maxW); + limits.minBottom = Math.min(limits.minBottom, -top - maxH); + } + } + return limits; + }, + // 移动 + move: function move(e) { + e.stopPropagation(); + if (this.resizing) { + this.handleResize(e); + } else if (this.dragging) { + this.handleDrag(e); + } + }, + // 元素移动 + handleDrag: function handleDrag(e) { + var _this = this; + return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() { + var axis, grid, bounds, mouseClickPosition, tmpDeltaX, tmpDeltaY, _snapToGrid, _snapToGrid2, deltaX, deltaY, left, top, right, bottom; + return _regeneratorRuntime().wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + axis = _this.axis; + grid = _this.grid; + bounds = _this.bounds; + mouseClickPosition = _this.mouseClickPosition; + tmpDeltaX = axis && axis !== 'y' ? mouseClickPosition.mouseX - (e.touches ? e.touches[0].pageX : e.pageX) : 0; + tmpDeltaY = axis && axis !== 'x' ? mouseClickPosition.mouseY - (e.touches ? e.touches[0].pageY : e.pageY) : 0; + _snapToGrid = snapToGrid(grid, tmpDeltaX, tmpDeltaY, _this.scaleRatio), _snapToGrid2 = _slicedToArray(_snapToGrid, 2), deltaX = _snapToGrid2[0], deltaY = _snapToGrid2[1]; + left = restrictToBounds(mouseClickPosition.left - deltaX, bounds.minLeft, bounds.maxLeft); + top = restrictToBounds(mouseClickPosition.top - deltaY, bounds.minTop, bounds.maxTop); + if (!(_this.onDrag(left, top) === false)) { + _context.next = 11; + break; + } + return _context.abrupt("return"); + case 11: + right = restrictToBounds(mouseClickPosition.right + deltaX, bounds.minRight, bounds.maxRight); + bottom = restrictToBounds(mouseClickPosition.bottom + deltaY, bounds.minBottom, bounds.maxBottom); + _this.left = left; + _this.top = top; + _this.right = right; + _this.bottom = bottom; + _context.next = 19; + return _this.snapCheck(); + case 19: + _this.$emit('dragging', _this.left, _this.top); + case 20: + case "end": + return _context.stop(); + } + }, _callee); + }))(); + }, + moveHorizontally: function moveHorizontally(val) { + var _snapToGrid3 = snapToGrid(this.grid, val, this.top, this.scale), + _snapToGrid4 = _slicedToArray(_snapToGrid3, 2), + deltaX = _snapToGrid4[0]; + _snapToGrid4[1]; + var left = restrictToBounds(deltaX, this.bounds.minLeft, this.bounds.maxLeft); + this.left = left; + this.right = this.parentWidth - this.width - left; + }, + moveVertically: function moveVertically(val) { + var _snapToGrid5 = snapToGrid(this.grid, this.left, val, this.scale), + _snapToGrid6 = _slicedToArray(_snapToGrid5, 2); + _snapToGrid6[0]; + var deltaY = _snapToGrid6[1]; + var top = restrictToBounds(deltaY, this.bounds.minTop, this.bounds.maxTop); + this.top = top; + this.bottom = this.parentHeight - this.height - top; + }, + // 控制柄移动 + handleResize: function handleResize(e) { + // ; + var left = this.left; + var top = this.top; + var right = this.right; + var bottom = this.bottom; + var mouseClickPosition = this.mouseClickPosition; + this.lockAspectRatio; + var aspectFactor = this.aspectFactor; + var tmpDeltaX = mouseClickPosition.mouseX - (e.touches ? e.touches[0].pageX : e.pageX); + var tmpDeltaY = mouseClickPosition.mouseY - (e.touches ? e.touches[0].pageY : e.pageY); + if (!this.widthTouched && tmpDeltaX) { + this.widthTouched = true; + } + if (!this.heightTouched && tmpDeltaY) { + this.heightTouched = true; + } + var _snapToGrid7 = snapToGrid(this.grid, tmpDeltaX, tmpDeltaY, this.scaleRatio), + _snapToGrid8 = _slicedToArray(_snapToGrid7, 2), + deltaX = _snapToGrid8[0], + deltaY = _snapToGrid8[1]; + if (this.handle.includes('b')) { + bottom = restrictToBounds(mouseClickPosition.bottom + deltaY, this.bounds.minBottom, this.bounds.maxBottom); + if (this.lockAspectRatio && this.resizingOnY) { + right = this.right - (this.bottom - bottom) * aspectFactor; + } + } else if (this.handle.includes('t')) { + top = restrictToBounds(mouseClickPosition.top - deltaY, this.bounds.minTop, this.bounds.maxTop); + if (this.lockAspectRatio && this.resizingOnY) { + left = this.left - (this.top - top) * aspectFactor; + } + } + if (this.handle.includes('r')) { + right = restrictToBounds(mouseClickPosition.right + deltaX, this.bounds.minRight, this.bounds.maxRight); + if (this.lockAspectRatio && this.resizingOnX) { + bottom = this.bottom - (this.right - right) / aspectFactor; + } + } else if (this.handle.includes('l')) { + left = restrictToBounds(mouseClickPosition.left - deltaX, this.bounds.minLeft, this.bounds.maxLeft); + if (this.lockAspectRatio && this.resizingOnX) { + top = this.top - (this.left - left) / aspectFactor; + } + } + var width = computeWidth(this.parentWidth, left, right); + var height = computeHeight(this.parentHeight, top, bottom); + if (this.onResize(this.handle, left, top, width, height) === false) { + return; + } + this.left = left; + this.top = top; + this.right = right; + this.bottom = bottom; + this.width = width; + this.height = height; + this.$emit('resizing', this.left, this.top, this.width, this.height); + }, + changeWidth: function changeWidth(val) { + var _snapToGrid9 = snapToGrid(this.grid, val, 0, this.scale), + _snapToGrid10 = _slicedToArray(_snapToGrid9, 2), + newWidth = _snapToGrid10[0]; + _snapToGrid10[1]; + var right = restrictToBounds(this.parentWidth - newWidth - this.left, this.bounds.minRight, this.bounds.maxRight); + var bottom = this.bottom; + if (this.lockAspectRatio) { + bottom = this.bottom - (this.right - right) / this.aspectFactor; + } + var width = computeWidth(this.parentWidth, this.left, right); + var height = computeHeight(this.parentHeight, this.top, bottom); + this.right = right; + this.bottom = bottom; + this.width = width; + this.height = height; + }, + changeHeight: function changeHeight(val) { + var _snapToGrid11 = snapToGrid(this.grid, 0, val, this.scale), + _snapToGrid12 = _slicedToArray(_snapToGrid11, 2); + _snapToGrid12[0]; + var newHeight = _snapToGrid12[1]; + var bottom = restrictToBounds(this.parentHeight - newHeight - this.top, this.bounds.minBottom, this.bounds.maxBottom); + var right = this.right; + if (this.lockAspectRatio) { + right = this.right - (this.bottom - bottom) * this.aspectFactor; + } + var width = computeWidth(this.parentWidth, this.left, right); + var height = computeHeight(this.parentHeight, this.top, bottom); + this.right = right; + this.bottom = bottom; + this.width = width; + this.height = height; + }, + // 从控制柄松开 + handleUp: function handleUp(e) { + var _this2 = this; + return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() { + var temArr, refLine, i; + return _regeneratorRuntime().wrap(function _callee2$(_context2) { + while (1) switch (_context2.prev = _context2.next) { + case 0: + _this2.handle = null; + + // 初始化辅助线数据 + temArr = new Array(3).fill({ + display: false, + position: '', + origin: '', + lineLength: '' + }); + refLine = { + vLine: [], + hLine: [] + }; + for (i in refLine) { + refLine[i] = JSON.parse(JSON.stringify(temArr)); + } + if (!_this2.resizing) { + _context2.next = 10; + break; + } + _this2.resizing = false; + _context2.next = 8; + return _this2.conflictCheck(); + case 8: + _this2.$emit('refLineParams', refLine); + _this2.$emit('resizestop', _this2.left, _this2.top, _this2.width, _this2.height); + case 10: + if (!_this2.dragging) { + _context2.next = 16; + break; + } + _this2.dragging = false; + _context2.next = 14; + return _this2.conflictCheck(); + case 14: + _this2.$emit('refLineParams', refLine); + _this2.$emit('dragstop', _this2.left, _this2.top, _this2.width, _this2.height); + case 16: + _this2.resetBoundsAndMouseState(); + removeEvent(document.documentElement, eventsFor.move, _this2.handleResize); + removeEvent(document.documentElement, eventsFor.move, _this2.move); + removeEvent(document.documentElement, 'mouseup', _this2.handleUp); + case 20: + case "end": + return _context2.stop(); + } + }, _callee2); + }))(); + }, + // 新增方法 ↓↓↓ + // 设置属性 + settingAttribute: function settingAttribute() { + // 设置冲突检测 + this.$el.setAttribute('data-is-check', "".concat(this.isConflictCheck)); + // 设置对齐元素 + this.$el.setAttribute('data-is-snap', "".concat(this.snap)); + }, + // 冲突检测 + conflictCheck: function conflictCheck() { + var top = this.top; + var left = this.left; + var width = this.width; + var height = this.height; + if (this.isConflictCheck) { + var nodes = this.$el.parentNode.childNodes; // 获取当前父节点下所有子节点 + var _iterator = _createForOfIteratorHelper(nodes), + _step; + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var item = _step.value; + if (item.className !== undefined && !item.className.includes(this.classNameActive) && item.getAttribute('data-is-check') !== null && item.getAttribute('data-is-check') !== 'false') { + var tw = item.offsetWidth; + var th = item.offsetHeight; + // 正则获取left与right + var _this$formatTransform = this.formatTransformVal(item.style.transform), + _this$formatTransform2 = _slicedToArray(_this$formatTransform, 2), + tl = _this$formatTransform2[0], + tt = _this$formatTransform2[1]; + + // 左上角与右下角重叠 + var tfAndBr = top >= tt && left >= tl && tt + th > top && tl + tw > left || top <= tt && left < tl && top + height > tt && left + width > tl; + // 右上角与左下角重叠 + var brAndTf = left <= tl && top >= tt && left + width > tl && top < tt + th || top < tt && left > tl && top + height > tt && left < tl + tw; + // 下边与上边重叠 + var bAndT = top <= tt && left >= tl && top + height > tt && left < tl + tw || top >= tt && left <= tl && top < tt + th && left > tl + tw; + // 上边与下边重叠(宽度不一样) + var tAndB = top <= tt && left >= tl && top + height > tt && left < tl + tw || top >= tt && left <= tl && top < tt + th && left > tl + tw; + // 左边与右边重叠 + var lAndR = left >= tl && top >= tt && left < tl + tw && top < tt + th || top > tt && left <= tl && left + width > tl && top < tt + th; + // 左边与右边重叠(高度不一样) + var rAndL = top <= tt && left >= tl && top + height > tt && left < tl + tw || top >= tt && left <= tl && top < tt + th && left + width > tl; + + // 如果冲突,就将回退到移动前的位置 + if (tfAndBr || brAndTf || bAndT || tAndB || lAndR || rAndL) { + this.top = this.mouseClickPosition.top; + this.left = this.mouseClickPosition.left; + this.right = this.mouseClickPosition.right; + this.bottom = this.mouseClickPosition.bottom; + this.width = this.mouseClickPosition.w; + this.height = this.mouseClickPosition.h; + this.$emit('resizing', this.left, this.top, this.width, this.height); + } + } + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + } + }, + // 检测对齐元素 + snapCheck: function snapCheck() { + var _this3 = this; + return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() { + var width, height, activeLeft, activeRight, activeTop, activeBottom, temArr, refLine, i, nodes, tem, _yield$_this3$getActi, groupWidth, groupHeight, groupLeft, groupTop, bln, _iterator2, _step2, item, w, h, _this3$formatTransfor, _this3$formatTransfor2, l, t, r, b, hc, vc, ts, TS, bs, BS, ls, LS, rs, RS, arrTem, _i, xory, horv, _this3$calcLineValues, origin, length; + return _regeneratorRuntime().wrap(function _callee3$(_context3) { + while (1) switch (_context3.prev = _context3.next) { + case 0: + width = _this3.width; + height = _this3.height; + if (!_this3.snap) { + _context3.next = 24; + break; + } + activeLeft = _this3.left; + activeRight = _this3.left + width; + activeTop = _this3.top; + activeBottom = _this3.top + height; // 初始化辅助线数据 + temArr = new Array(3).fill({ + display: false, + position: '', + origin: '', + lineLength: '' + }); + refLine = { + vLine: [], + hLine: [] + }; + for (i in refLine) { + refLine[i] = JSON.parse(JSON.stringify(temArr)); + } + + // 获取当前父节点下所有子节点 + nodes = _this3.$el.parentNode.childNodes; + tem = { + value: { + x: [[], [], []], + y: [[], [], []] + }, + display: [], + position: [] + }; + _context3.next = 14; + return _this3.getActiveAll(nodes); + case 14: + _yield$_this3$getActi = _context3.sent; + groupWidth = _yield$_this3$getActi.groupWidth; + groupHeight = _yield$_this3$getActi.groupHeight; + groupLeft = _yield$_this3$getActi.groupLeft; + groupTop = _yield$_this3$getActi.groupTop; + bln = _yield$_this3$getActi.bln; + if (!bln) { + width = groupWidth; + height = groupHeight; + activeLeft = groupLeft; + activeRight = groupLeft + groupWidth; + activeTop = groupTop; + activeBottom = groupTop + groupHeight; + } + _iterator2 = _createForOfIteratorHelper(nodes); + try { + for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { + item = _step2.value; + if (item.className !== undefined && !item.className.includes(_this3.classNameActive) && item.getAttribute('data-is-snap') !== null && item.getAttribute('data-is-snap') !== 'false') { + w = item.offsetWidth; + h = item.offsetHeight; + _this3$formatTransfor = _this3.formatTransformVal(item.style.transform), _this3$formatTransfor2 = _slicedToArray(_this3$formatTransfor, 2), l = _this3$formatTransfor2[0], t = _this3$formatTransfor2[1]; + r = l + w; // 对齐目标right + b = t + h; // 对齐目标的bottom + hc = Math.abs(activeTop + height / 2 - (t + h / 2)) <= _this3.snapTolerance; // 水平中线 + vc = Math.abs(activeLeft + width / 2 - (l + w / 2)) <= _this3.snapTolerance; // 垂直中线 + ts = Math.abs(t - activeBottom) <= _this3.snapTolerance; // 从上到下 + TS = Math.abs(b - activeBottom) <= _this3.snapTolerance; // 从上到下 + bs = Math.abs(t - activeTop) <= _this3.snapTolerance; // 从下到上 + BS = Math.abs(b - activeTop) <= _this3.snapTolerance; // 从下到上 + ls = Math.abs(l - activeRight) <= _this3.snapTolerance; // 外左 + LS = Math.abs(r - activeRight) <= _this3.snapTolerance; // 外左 + rs = Math.abs(l - activeLeft) <= _this3.snapTolerance; // 外右 + RS = Math.abs(r - activeLeft) <= _this3.snapTolerance; // 外右 + tem['display'] = [ts, TS, bs, BS, hc, hc, ls, LS, rs, RS, vc, vc]; + tem['position'] = [t, b, t, b, t + h / 2, t + h / 2, l, r, l, r, l + w / 2, l + w / 2]; + + // fix:中线自动对齐,元素可能超过父元素边界的问题 + if (ts) { + if (bln) { + _this3.top = Math.max(t - height, _this3.bounds.minTop); + _this3.bottom = _this3.parentHeight - _this3.top - height; + } + tem.value.y[0].push(l, r, activeLeft, activeRight); + } + if (bs) { + if (bln) { + _this3.top = t; + _this3.bottom = _this3.parentHeight - _this3.top - height; + } + tem.value.y[0].push(l, r, activeLeft, activeRight); + } + if (TS) { + if (bln) { + _this3.top = Math.max(b - height, _this3.bounds.minTop); + _this3.bottom = _this3.parentHeight - _this3.top - height; + } + tem.value.y[1].push(l, r, activeLeft, activeRight); + } + if (BS) { + if (bln) { + _this3.top = b; + _this3.bottom = _this3.parentHeight - _this3.top - height; + } + tem.value.y[1].push(l, r, activeLeft, activeRight); + } + if (ls) { + if (bln) { + _this3.left = Math.max(l - width, _this3.bounds.minLeft); + _this3.right = _this3.parentWidth - _this3.left - width; + } + tem.value.x[0].push(t, b, activeTop, activeBottom); + } + if (rs) { + if (bln) { + _this3.left = l; + _this3.right = _this3.parentWidth - _this3.left - width; + } + tem.value.x[0].push(t, b, activeTop, activeBottom); + } + if (LS) { + if (bln) { + _this3.left = Math.max(r - width, _this3.bounds.minLeft); + _this3.right = _this3.parentWidth - _this3.left - width; + } + tem.value.x[1].push(t, b, activeTop, activeBottom); + } + if (RS) { + if (bln) { + _this3.left = r; + _this3.right = _this3.parentWidth - _this3.left - width; + } + tem.value.x[1].push(t, b, activeTop, activeBottom); + } + if (hc) { + if (bln) { + _this3.top = Math.max(t + h / 2 - height / 2, _this3.bounds.minTop); + _this3.bottom = _this3.parentHeight - _this3.top - height; + } + tem.value.y[2].push(l, r, activeLeft, activeRight); + } + if (vc) { + if (bln) { + _this3.left = Math.max(l + w / 2 - width / 2, _this3.bounds.minLeft); + _this3.right = _this3.parentWidth - _this3.left - width; + } + tem.value.x[2].push(t, b, activeTop, activeBottom); + } + // 辅助线坐标与是否显示(display)对应的数组,易于循环遍历 + arrTem = [0, 1, 0, 1, 2, 2, 0, 1, 0, 1, 2, 2]; + for (_i = 0; _i <= arrTem.length; _i++) { + // 前6为Y辅助线,后6为X辅助线 + xory = _i < 6 ? 'y' : 'x'; + horv = _i < 6 ? 'hLine' : 'vLine'; + if (tem.display[_i]) { + _this3$calcLineValues = _this3.calcLineValues(tem.value[xory][arrTem[_i]]), origin = _this3$calcLineValues.origin, length = _this3$calcLineValues.length; + refLine[horv][arrTem[_i]].display = tem.display[_i]; + refLine[horv][arrTem[_i]].position = tem.position[_i] + 'px'; + refLine[horv][arrTem[_i]].origin = origin; + refLine[horv][arrTem[_i]].lineLength = length; + } + } + } + } + } catch (err) { + _iterator2.e(err); + } finally { + _iterator2.f(); + } + _this3.$emit('refLineParams', refLine); + case 24: + case "end": + return _context3.stop(); + } + }, _callee3); + }))(); + }, + calcLineValues: function calcLineValues(arr) { + var length = Math.max.apply(Math, _toConsumableArray(arr)) - Math.min.apply(Math, _toConsumableArray(arr)) + 'px'; + var origin = Math.min.apply(Math, _toConsumableArray(arr)) + 'px'; + return { + length: length, + origin: origin + }; + }, + getActiveAll: function getActiveAll(nodes) { + var _this4 = this; + return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() { + var activeAll, XArray, YArray, groupWidth, groupHeight, groupLeft, groupTop, _iterator3, _step3, item, AllLength, _iterator4, _step4, i, l, r, t, b, bln; + return _regeneratorRuntime().wrap(function _callee4$(_context4) { + while (1) switch (_context4.prev = _context4.next) { + case 0: + activeAll = []; + XArray = []; + YArray = []; + groupWidth = 0; + groupHeight = 0; + groupLeft = 0; + groupTop = 0; + _iterator3 = _createForOfIteratorHelper(nodes); + try { + for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { + item = _step3.value; + if (item.className !== undefined && item.className.includes(_this4.classNameActive)) { + activeAll.push(item); + } + } + } catch (err) { + _iterator3.e(err); + } finally { + _iterator3.f(); + } + AllLength = activeAll.length; + if (AllLength > 1) { + _iterator4 = _createForOfIteratorHelper(activeAll); + try { + for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) { + i = _step4.value; + l = i.offsetLeft; + r = l + i.offsetWidth; + t = i.offsetTop; + b = t + i.offsetHeight; + XArray.push(t, b); + YArray.push(l, r); + } + } catch (err) { + _iterator4.e(err); + } finally { + _iterator4.f(); + } + groupWidth = Math.max.apply(Math, YArray) - Math.min.apply(Math, YArray); + groupHeight = Math.max.apply(Math, XArray) - Math.min.apply(Math, XArray); + groupLeft = Math.min.apply(Math, YArray); + groupTop = Math.min.apply(Math, XArray); + } + bln = AllLength === 1; + return _context4.abrupt("return", { + groupWidth: groupWidth, + groupHeight: groupHeight, + groupLeft: groupLeft, + groupTop: groupTop, + bln: bln + }); + case 13: + case "end": + return _context4.stop(); + } + }, _callee4); + }))(); + }, + // 正则获取left与top + formatTransformVal: function formatTransformVal(string) { + var _string$replace$split = string.replace(/[^0-9\-,]/g, '').split(','), + _string$replace$split2 = _slicedToArray(_string$replace$split, 2), + left = _string$replace$split2[0], + top = _string$replace$split2[1]; + if (top === undefined) top = 0; + return [+left, +top]; + } + }, + computed: { + handleStyle: function handleStyle() { + var _this5 = this; + return function (stick) { + if (!_this5.handleInfo.switch) return { + display: _this5.enabled ? 'block' : 'none' + }; + var size = (_this5.handleInfo.size / _this5.scaleRatio).toFixed(2); + var offset = (_this5.handleInfo.offset / _this5.scaleRatio).toFixed(2); + var center = (size / 2).toFixed(2); + var styleMap = { + tl: { + top: "".concat(offset, "px"), + left: "".concat(offset, "px") + }, + tm: { + top: "".concat(offset, "px"), + left: "calc(50% - ".concat(center, "px)") + }, + tr: { + top: "".concat(offset, "px"), + right: "".concat(offset, "px") + }, + mr: { + top: "calc(50% - ".concat(center, "px)"), + right: "".concat(offset, "px") + }, + br: { + bottom: "".concat(offset, "px"), + right: "".concat(offset, "px") + }, + bm: { + bottom: "".concat(offset, "px"), + right: "calc(50% - ".concat(center, "px)") + }, + bl: { + bottom: "".concat(offset, "px"), + left: "".concat(offset, "px") + }, + ml: { + top: "calc(50% - ".concat(center, "px)"), + left: "".concat(offset, "px") + } + }; + var stickStyle = { + width: "".concat(size, "px"), + height: "".concat(size, "px"), + top: styleMap[stick].top, + left: styleMap[stick].left, + right: styleMap[stick].right, + bottom: styleMap[stick].bottom + }; + stickStyle.display = _this5.enabled ? 'block' : 'none'; + return stickStyle; + }; + }, + style: function style() { + if (this.perspective > 0) { + return _objectSpread2({ + transform: this.transform ? "perspective(".concat(this.perspective, "px) translate(").concat(this.left, "px, ").concat(this.top, "px)") + '' + this.transform : "translate(".concat(this.left, "px, ").concat(this.top, "px)"), + '-ms-transform': this.transform ? "perspective(".concat(this.perspective, "px) translate(").concat(this.left, "px, ").concat(this.top, "px)") + '' + this.transform : "translate(".concat(this.left, "px, ").concat(this.top, "px)"), + '-moz-transform': this.transform ? "perspective(".concat(this.perspective, "px) translate(").concat(this.left, "px, ").concat(this.top, "px)") + '' + this.transform : "translate(".concat(this.left, "px, ").concat(this.top, "px)"), + '-webkit-transform': this.transform ? "perspective(".concat(this.perspective, "px) translate(").concat(this.left, "px, ").concat(this.top, "px)") + '' + this.transform : "translate(".concat(this.left, "px, ").concat(this.top, "px)"), + '-o-transform': this.transform ? "perspective(".concat(this.perspective, "px) translate(").concat(this.left, "px, ").concat(this.top, "px)") + '' + this.transform : "translate(".concat(this.left, "px, ").concat(this.top, "px)"), + width: this.computedWidth, + height: this.computedHeight, + zIndex: this.zIndex + }, this.dragging && this.disableUserSelect ? userSelectNone : userSelectAuto); + } else { + return _objectSpread2({ + transform: this.transform ? "translate(".concat(this.left, "px, ").concat(this.top, "px)") + '' + this.transform : "translate(".concat(this.left, "px, ").concat(this.top, "px)"), + '-ms-transform': this.transform ? "translate(".concat(this.left, "px, ").concat(this.top, "px)") + '' + this.transform : "translate(".concat(this.left, "px, ").concat(this.top, "px)"), + '-moz-transform': this.transform ? "translate(".concat(this.left, "px, ").concat(this.top, "px)") + '' + this.transform : "translate(".concat(this.left, "px, ").concat(this.top, "px)"), + '-webkit-transform': this.transform ? "translate(".concat(this.left, "px, ").concat(this.top, "px)") + '' + this.transform : "translate(".concat(this.left, "px, ").concat(this.top, "px)"), + '-o-transform': this.transform ? "translate(".concat(this.left, "px, ").concat(this.top, "px)") + '' + this.transform : "translate(".concat(this.left, "px, ").concat(this.top, "px)"), + width: this.computedWidth, + height: this.computedHeight, + zIndex: this.zIndex + }, this.dragging && this.disableUserSelect ? userSelectNone : userSelectAuto); + } + }, + // 控制柄显示与否 + actualHandles: function actualHandles() { + if (!this.resizable) return []; + return this.handles; + }, + computedWidth: function computedWidth() { + if (this.w === 'auto') { + if (!this.widthTouched) { + return 'auto'; + } + } + return this.width + 'px'; + }, + computedHeight: function computedHeight() { + if (this.h === 'auto') { + if (!this.heightTouched) { + return 'auto'; + } + } + return this.height + 'px'; + }, + resizingOnX: function resizingOnX() { + return Boolean(this.handle) && (this.handle.includes('l') || this.handle.includes('r')); + }, + resizingOnY: function resizingOnY() { + return Boolean(this.handle) && (this.handle.includes('t') || this.handle.includes('b')); + }, + isCornerHandle: function isCornerHandle() { + return Boolean(this.handle) && ['tl', 'tr', 'br', 'bl'].includes(this.handle); + } + }, + watch: { + active: function active(val) { + this.enabled = val; + if (val) ; else { + this.$emit('deactivated'); + } + }, + z: function z(val) { + if (val >= 0 || val === 'auto') { + this.zIndex = val; + } + }, + x: function x(val) { + if (this.resizing || this.dragging) { + return; + } + if (this.parent) { + this.bounds = this.calcDragLimits(); + } + this.moveHorizontally(val); + }, + y: function y(val) { + if (this.resizing || this.dragging) { + return; + } + if (this.parent) { + this.bounds = this.calcDragLimits(); + } + this.moveVertically(val); + }, + lockAspectRatio: function lockAspectRatio(val) { + if (val) { + this.aspectFactor = this.width / this.height; + } else { + this.aspectFactor = undefined; + } + }, + minWidth: function minWidth(val) { + if (val > 0 && val <= this.width) { + this.minW = val; + } + }, + minHeight: function minHeight(val) { + if (val > 0 && val <= this.height) { + this.minH = val; + } + }, + maxWidth: function maxWidth(val) { + this.maxW = val; + }, + maxHeight: function maxHeight(val) { + this.maxH = val; + }, + w: function w(val) { + if (this.resizing || this.dragging) { + return; + } + if (this.parent) { + this.bounds = this.calcResizeLimits(); + } + this.changeWidth(val); + }, + h: function h(val) { + if (this.resizing || this.dragging) { + return; + } + if (this.parent) { + this.bounds = this.calcResizeLimits(); + } + this.changeHeight(val); + } + } + }; + + /* script */ + const __vue_script__$a = script$a; + + /* template */ + var __vue_render__$a = function () { + var _obj; + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c( + "div", + { + class: [ + ((_obj = {}), + (_obj[_vm.classNameActive] = _vm.enabled), + (_obj[_vm.classNameDragging] = _vm.dragging), + (_obj[_vm.classNameResizing] = _vm.resizing), + (_obj[_vm.classNameDraggable] = _vm.draggable), + (_obj[_vm.classNameResizable] = _vm.resizable), + _obj), + _vm.className, + ], + style: _vm.style, + on: { + mousedown: _vm.elementMouseDown, + touchstart: _vm.elementTouchDown, + contextmenu: _vm.onContextMenu, + }, + }, + [ + _vm._l(_vm.actualHandles, function (handle) { + return _c( + "div", + { + key: handle, + class: [_vm.classNameHandle, _vm.classNameHandle + "-" + handle], + style: _vm.handleStyle(handle), + on: { + mousedown: function ($event) { + $event.stopPropagation(); + $event.preventDefault(); + return _vm.handleDown(handle, $event) + }, + touchstart: function ($event) { + $event.stopPropagation(); + $event.preventDefault(); + return _vm.handleTouchDown(handle, $event) + }, + }, + }, + [_vm._t(handle)], + 2 + ) + }), + _vm._v(" "), + _vm._t("default"), + ], + 2 + ) + }; + var __vue_staticRenderFns__$a = []; + __vue_render__$a._withStripped = true; + + /* style */ + const __vue_inject_styles__$a = function (inject) { + if (!inject) return + inject("data-v-95085f0c_0", { source: ".vdr[data-v-95085f0c] {\n touch-action: none;\n position: absolute;\n box-sizing: border-box;\n border: 1px dashed #d6d6d6;\n}\n.handle[data-v-95085f0c] {\n box-sizing: border-box;\n position: absolute;\n width: 8px;\n height: 8px;\n background: #ffffff;\n border: 1px solid #333;\n box-shadow: 0 0 2px #bbb;\n}\n.handle-tl[data-v-95085f0c] {\n top: -5px;\n left: -5px;\n cursor: nw-resize;\n}\n.handle-tm[data-v-95085f0c] {\n top: -5px;\n left: calc(50% - 4px);\n /*margin-left: -5px;*/\n cursor: n-resize;\n}\n.handle-tr[data-v-95085f0c] {\n top: -5px;\n right: -5px;\n cursor: ne-resize;\n}\n.handle-ml[data-v-95085f0c] {\n top: calc(50% - 4px);\n /*margin-top: -5px;*/\n left: -5px;\n cursor: w-resize;\n}\n.handle-mr[data-v-95085f0c] {\n top: calc(50% - 4px);\n /*margin-top: -5px;*/\n right: -5px;\n cursor: e-resize;\n}\n.handle-bl[data-v-95085f0c] {\n bottom: -5px;\n left: -5px;\n cursor: sw-resize;\n}\n.handle-bm[data-v-95085f0c] {\n bottom: -5px;\n left: calc(50% - 4px);\n /*margin-left: -5px;*/\n cursor: s-resize;\n}\n.handle-br[data-v-95085f0c] {\n bottom: -5px;\n right: -5px;\n cursor: se-resize;\n}\n.ref-line[data-v-95085f0c] {\n position: absolute;\n background-color: #ff00cc;\n z-index: 9999;\n}\n.v-line[data-v-95085f0c] {\n width: 1px;\n}\n.h-line[data-v-95085f0c] {\n height: 1px;\n}\n@media only screen and (max-width: 768px) {\n[class*=\"handle-\"][data-v-95085f0c]:before {\n content: \"\";\n left: -10px;\n right: -10px;\n bottom: -10px;\n top: -10px;\n position: absolute;\n}\n}\n", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,kBAAkB;EAClB,sBAAsB;EACtB,0BAA0B;AAC5B;AACA;EACE,sBAAsB;EACtB,kBAAkB;EAClB,UAAU;EACV,WAAW;EACX,mBAAmB;EACnB,sBAAsB;EACtB,wBAAwB;AAC1B;AACA;EACE,SAAS;EACT,UAAU;EACV,iBAAiB;AACnB;AACA;EACE,SAAS;EACT,qBAAqB;EACrB,qBAAqB;EACrB,gBAAgB;AAClB;AACA;EACE,SAAS;EACT,WAAW;EACX,iBAAiB;AACnB;AACA;EACE,oBAAoB;EACpB,oBAAoB;EACpB,UAAU;EACV,gBAAgB;AAClB;AACA;EACE,oBAAoB;EACpB,oBAAoB;EACpB,WAAW;EACX,gBAAgB;AAClB;AACA;EACE,YAAY;EACZ,UAAU;EACV,iBAAiB;AACnB;AACA;EACE,YAAY;EACZ,qBAAqB;EACrB,qBAAqB;EACrB,gBAAgB;AAClB;AACA;EACE,YAAY;EACZ,WAAW;EACX,iBAAiB;AACnB;AACA;EACE,kBAAkB;EAClB,yBAAyB;EACzB,aAAa;AACf;AACA;EACE,UAAU;AACZ;AACA;EACE,WAAW;AACb;AACA;AACE;IACE,WAAW;IACX,WAAW;IACX,YAAY;IACZ,aAAa;IACb,UAAU;IACV,kBAAkB;AACpB;AACF","file":"index.vue","sourcesContent":[".vdr {\n touch-action: none;\n position: absolute;\n box-sizing: border-box;\n border: 1px dashed #d6d6d6;\n}\n.handle {\n box-sizing: border-box;\n position: absolute;\n width: 8px;\n height: 8px;\n background: #ffffff;\n border: 1px solid #333;\n box-shadow: 0 0 2px #bbb;\n}\n.handle-tl {\n top: -5px;\n left: -5px;\n cursor: nw-resize;\n}\n.handle-tm {\n top: -5px;\n left: calc(50% - 4px);\n /*margin-left: -5px;*/\n cursor: n-resize;\n}\n.handle-tr {\n top: -5px;\n right: -5px;\n cursor: ne-resize;\n}\n.handle-ml {\n top: calc(50% - 4px);\n /*margin-top: -5px;*/\n left: -5px;\n cursor: w-resize;\n}\n.handle-mr {\n top: calc(50% - 4px);\n /*margin-top: -5px;*/\n right: -5px;\n cursor: e-resize;\n}\n.handle-bl {\n bottom: -5px;\n left: -5px;\n cursor: sw-resize;\n}\n.handle-bm {\n bottom: -5px;\n left: calc(50% - 4px);\n /*margin-left: -5px;*/\n cursor: s-resize;\n}\n.handle-br {\n bottom: -5px;\n right: -5px;\n cursor: se-resize;\n}\n.ref-line {\n position: absolute;\n background-color: #ff00cc;\n z-index: 9999;\n}\n.v-line {\n width: 1px;\n}\n.h-line {\n height: 1px;\n}\n@media only screen and (max-width: 768px) {\n [class*=\"handle-\"]:before {\n content: \"\";\n left: -10px;\n right: -10px;\n bottom: -10px;\n top: -10px;\n position: absolute;\n }\n}\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__$a = "data-v-95085f0c"; + /* module identifier */ + const __vue_module_identifier__$a = undefined; + /* functional template */ + const __vue_is_functional_template__$a = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$a = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$a, staticRenderFns: __vue_staticRenderFns__$a }, + __vue_inject_styles__$a, + __vue_script__$a, + __vue_scope_id__$a, + __vue_is_functional_template__$a, + __vue_module_identifier__$a, + false, + createInjector, + undefined, + undefined + ); + + var script$9 = { + name: 'ConfigItem', + components: _defineProperty(_defineProperty({}, antDesignVue.Row.name, antDesignVue.Row), antDesignVue.Col.name, antDesignVue.Col), + props: { + title: { + type: String, + default: '' + } + } + }; + + /* script */ + const __vue_script__$9 = script$9; + + /* template */ + var __vue_render__$9 = function () { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c( + "div", + { staticClass: "config-item" }, + [ + _c( + "a-row", + { staticClass: "config-item-title" }, + [ + _c("a-col", { attrs: { span: 6 } }, [_vm._v(_vm._s(_vm.title))]), + _vm._v(" "), + _c("a-col", { attrs: { span: 18 } }, [ + _c( + "div", + { staticClass: "config-item-auxiliary" }, + [_vm._t("auxiliary")], + 2 + ), + _vm._v(" "), + _c( + "div", + { staticClass: "config-item-enhance" }, + [_vm._t("enhance")], + 2 + ), + ]), + ], + 1 + ), + _vm._v(" "), + _c("div", { staticClass: "config-item-content" }, [_vm._t("content")], 2), + ], + 1 + ) + }; + var __vue_staticRenderFns__$9 = []; + __vue_render__$9._withStripped = true; + + /* style */ + const __vue_inject_styles__$9 = function (inject) { + if (!inject) return + inject("data-v-eced1050_0", { source: ".config-item[data-v-eced1050] {\n padding: 10px 12px;\n}\n.config-item-enhance[data-v-eced1050] {\n margin-top: 12px;\n}\n.config-item-content[data-v-eced1050] {\n margin-top: 12px;\n}\n", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;AACpB;AACA;EACE,gBAAgB;AAClB;AACA;EACE,gBAAgB;AAClB","file":"index.vue","sourcesContent":[".config-item {\n padding: 10px 12px;\n}\n.config-item-enhance {\n margin-top: 12px;\n}\n.config-item-content {\n margin-top: 12px;\n}\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__$9 = "data-v-eced1050"; + /* module identifier */ + const __vue_module_identifier__$9 = undefined; + /* functional template */ + const __vue_is_functional_template__$9 = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$9 = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$9, staticRenderFns: __vue_staticRenderFns__$9 }, + __vue_inject_styles__$9, + __vue_script__$9, + __vue_scope_id__$9, + __vue_is_functional_template__$9, + __vue_module_identifier__$9, + false, + createInjector, + undefined, + undefined + ); + + // + // + // + // + // + // + // + // + // + // + // + // + + var script$8 = { + name: 'EditScreens', + data: function data() { + return { + width: '', + isPressSpace: false + }; + }, + methods: { + handleScroll: function handleScroll() { + var $app = this.$refs.$app; + var refSketchRuleBox = this.$refs.refSketchRuleBox; + if (!$app) return; + var screensRect = $app.getBoundingClientRect(); + var canvasRect = refSketchRuleBox.getBoundingClientRect(); + var perspectiveX = screensRect.left - canvasRect.left; + var perspectiveY = screensRect.top - canvasRect.top; + this.$emit('handleScroll', { + perspectiveX: perspectiveX, + perspectiveY: perspectiveY + }); + }, + handleOtherStop: function handleOtherStop() { + this.$emit('handleOtherStop'); + } + } + }; + + /* script */ + const __vue_script__$8 = script$8; + + /* template */ + var __vue_render__$8 = function () { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c( + "div", + { + ref: "$app", + staticClass: "edit-screens", + on: { scroll: _vm.handleScroll }, + }, + [ + _c("div", { ref: "$container", staticClass: "edit-screen-container" }, [ + _c( + "div", + { + ref: "refSketchRuleBox", + staticClass: "canvas", + on: { click: _vm.handleOtherStop }, + }, + [ + _c( + "div", + { style: { pointerEvents: _vm.isPressSpace ? "none" : "auto" } }, + [_vm._t("default")], + 2 + ), + ] + ), + ]), + ] + ) + }; + var __vue_staticRenderFns__$8 = []; + __vue_render__$8._withStripped = true; + + /* style */ + const __vue_inject_styles__$8 = function (inject) { + if (!inject) return + inject("data-v-6541cebf_0", { source: ".edit-screens[data-v-6541cebf] {\n position: relative;\n margin: 24px 0 0 24px;\n width: calc(100% - 24px);\n height: calc(100% - 24px);\n overflow: auto;\n user-select: none;\n}\n.edit-screens .edit-screen-container[data-v-6541cebf] {\n position: absolute;\n width: 100%;\n height: 100%;\n}\n.edit-screens .edit-screen-container .canvas[data-v-6541cebf] {\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,qBAAqB;EACrB,wBAAwB;EACxB,yBAAyB;EACzB,cAAc;EACd,iBAAiB;AACnB;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,WAAW;EACX,YAAY;AACd","file":"index.vue","sourcesContent":[".edit-screens {\n position: relative;\n margin: 24px 0 0 24px;\n width: calc(100% - 24px);\n height: calc(100% - 24px);\n overflow: auto;\n user-select: none;\n}\n.edit-screens .edit-screen-container {\n position: absolute;\n width: 100%;\n height: 100%;\n}\n.edit-screens .edit-screen-container .canvas {\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__$8 = "data-v-6541cebf"; + /* module identifier */ + const __vue_module_identifier__$8 = undefined; + /* functional template */ + const __vue_is_functional_template__$8 = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$8 = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$8, staticRenderFns: __vue_staticRenderFns__$8 }, + __vue_inject_styles__$8, + __vue_script__$8, + __vue_scope_id__$8, + __vue_is_functional_template__$8, + __vue_module_identifier__$8, + false, + createInjector, + undefined, + undefined + ); + + var script$7 = { + name: 'Feedback', + props: _objectSpread2({}, antDesignVue.Result.props), + components: _defineProperty({}, antDesignVue.Result.name, antDesignVue.Result), + data: function data() { + return {}; + } + }; + + /* script */ + const __vue_script__$7 = script$7; + + /* template */ + var __vue_render__$7 = function () { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c( + "div", + { staticClass: "feedback" }, + [_c("a-result", _vm._b({}, "a-result", _vm.$props, false))], + 1 + ) + }; + var __vue_staticRenderFns__$7 = []; + __vue_render__$7._withStripped = true; + + /* style */ + const __vue_inject_styles__$7 = function (inject) { + if (!inject) return + inject("data-v-4ea49bf0_0", { source: "[data-v-4ea49bf0]:export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n[data-v-4ea49bf0] .ant-result-title {\n color: white;\n}\n[data-v-4ea49bf0] .ant-result-subtitle {\n color: white;\n}\n.feedback[data-v-4ea49bf0] {\n height: 100%;\n background-color: #141414;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n", map: {"version":3,"sources":["index.vue","C:\\Users\\lihq1\\Desktop\\开源\\vue-lcd-engine\\components\\Feedback\\index.vue"],"names":[],"mappings":"AAAA;EACE,sBAAsB;EACtB,mBAAmB;EACnB,sBAAsB;EACtB,sBAAsB;EACtB,oBAAoB;EACpB,mBAAmB;EACnB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,iBAAiB;EACjB,6BAA6B;EAC7B,wCAAwC;AAC1C;AACC;EACC,YAAY;AACd;AACC;ECCD,YAAA;ADCA;ACCA;EACA,YAAA;EACA,yBAAA;EDCE,aAAa;ECCf,mBAAA;EACA,uBAAA;AACA","file":"index.vue","sourcesContent":[":export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n /deep/ .ant-result-title {\n color: white;\n}\n /deep/ .ant-result-subtitle {\n color: white;\n}\n.feedback {\n height: 100%;\n background-color: #141414;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n","\r\n\r\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__$7 = "data-v-4ea49bf0"; + /* module identifier */ + const __vue_module_identifier__$7 = undefined; + /* functional template */ + const __vue_is_functional_template__$7 = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$7 = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$7, staticRenderFns: __vue_staticRenderFns__$7 }, + __vue_inject_styles__$7, + __vue_script__$7, + __vue_scope_id__$7, + __vue_is_functional_template__$7, + __vue_module_identifier__$7, + false, + createInjector, + undefined, + undefined + ); + + // + // + // + // + // + // + // + // + // + // + // + // + + var script$6 = { + name: 'Layout', + props: { + logo: { + type: String, + default: '' + }, + title: { + type: String, + default: '' + } + } + }; + + /* script */ + const __vue_script__$6 = script$6; + + /* template */ + var __vue_render__$6 = function () { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c("div", { staticClass: "layout" }, [ + _c("header", { staticClass: "layout-header" }, [ + _c("img", { + staticClass: "header-logo", + attrs: { src: _vm.logo, alt: "logo" }, + }), + _vm._v(" "), + _c("span", { staticClass: "header-title" }, [_vm._v(_vm._s(_vm.title))]), + ]), + _vm._v(" "), + _c("main", { staticClass: "layout-main" }, [_c("router-view")], 1), + ]) + }; + var __vue_staticRenderFns__$6 = []; + __vue_render__$6._withStripped = true; + + /* style */ + const __vue_inject_styles__$6 = function (inject) { + if (!inject) return + inject("data-v-3bbf3843_0", { source: "[data-v-3bbf3843]:export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.layout[data-v-3bbf3843] {\n background-color: #141414;\n height: 100%;\n}\n.layout-header[data-v-3bbf3843] {\n height: 60px;\n background-color: #1f1f1f;\n padding: 16px 24px;\n display: flex;\n align-items: center;\n justify-content: left;\n box-shadow: 0px 1px 0px 0px #000000;\n border-bottom: 1px solid #404040;\n}\n.layout-header .header-logo[data-v-3bbf3843] {\n width: 24px;\n height: 24px;\n}\n.layout-header .header-title[data-v-3bbf3843] {\n font-size: 20px;\n margin-left: 12px;\n}\n.layout-main[data-v-3bbf3843] {\n height: calc(100% - 60px);\n overflow-y: auto;\n}\n", map: {"version":3,"sources":["index.vue","C:\\Users\\lihq1\\Desktop\\开源\\vue-lcd-engine\\components\\Layout\\index.vue"],"names":[],"mappings":"AAAA;EACE,sBAAsB;EACtB,mBAAmB;EACnB,sBAAsB;EACtB,sBAAsB;EACtB,oBAAoB;EACpB,mBAAmB;EACnB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,iBAAiB;EACjB,6BAA6B;EAC7B,wCAAwC;AAC1C;AACA;EACE,yBAAyB;EACzB,YAAY;AACd;AACA;EACE,YAAY;EACZ,yBAAyB;EACzB,kBAAkB;EAClB,aAAa;EACb,mBAAmB;EACnB,qBAAqB;EACrB,mCAAmC;ECCrC,gCAAA;ADCA;ACCA;EACA,WAAA;EACA,YAAA;ADCA;ACCA;EACA,eAAA;EACA,iBAAA;AACA;AACA;EACA,yBAAA;EACA,gBAAA;AACA","file":"index.vue","sourcesContent":[":export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.layout {\n background-color: #141414;\n height: 100%;\n}\n.layout-header {\n height: 60px;\n background-color: #1f1f1f;\n padding: 16px 24px;\n display: flex;\n align-items: center;\n justify-content: left;\n box-shadow: 0px 1px 0px 0px #000000;\n border-bottom: 1px solid #404040;\n}\n.layout-header .header-logo {\n width: 24px;\n height: 24px;\n}\n.layout-header .header-title {\n font-size: 20px;\n margin-left: 12px;\n}\n.layout-main {\n height: calc(100% - 60px);\n overflow-y: auto;\n}\n","\r\n\r\n\r\n\r\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__$6 = "data-v-3bbf3843"; + /* module identifier */ + const __vue_module_identifier__$6 = undefined; + /* functional template */ + const __vue_is_functional_template__$6 = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$6 = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$6, staticRenderFns: __vue_staticRenderFns__$6 }, + __vue_inject_styles__$6, + __vue_script__$6, + __vue_scope_id__$6, + __vue_is_functional_template__$6, + __vue_module_identifier__$6, + false, + createInjector, + undefined, + undefined + ); + + var script$5 = { + name: 'Loading', + components: _defineProperty({}, antDesignVue.Spin.name, antDesignVue.Spin), + data: function data() { + return { + visible: true + }; + } + }; + + /* script */ + const __vue_script__$5 = script$5; + + /* template */ + var __vue_render__$5 = function () { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c( + "a-spin", + { attrs: { spinning: _vm.visible, wrapperClassName: "loading" } }, + [_vm.visible ? _c("div", { staticClass: "loading" }) : _vm._e()] + ) + }; + var __vue_staticRenderFns__$5 = []; + __vue_render__$5._withStripped = true; + + /* style */ + const __vue_inject_styles__$5 = function (inject) { + if (!inject) return + inject("data-v-3d236889_0", { source: ".loading[data-v-3d236889] {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 44;\n}\n.loading-box[data-v-3d236889] {\n position: absolute;\n left: 50%;\n top: 50%;\n width: 100px;\n transform: translate(-50%, -50%);\n line-height: 28px;\n}\n.loading-box i[data-v-3d236889] {\n font-size: 24px;\n margin-right: 5px;\n}\n", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,OAAO;EACP,QAAQ;EACR,MAAM;EACN,SAAS;EACT,WAAW;AACb;AACA;EACE,kBAAkB;EAClB,SAAS;EACT,QAAQ;EACR,YAAY;EACZ,gCAAgC;EAChC,iBAAiB;AACnB;AACA;EACE,eAAe;EACf,iBAAiB;AACnB","file":"index.vue","sourcesContent":[".loading {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 44;\n}\n.loading-box {\n position: absolute;\n left: 50%;\n top: 50%;\n width: 100px;\n transform: translate(-50%, -50%);\n line-height: 28px;\n}\n.loading-box i {\n font-size: 24px;\n margin-right: 5px;\n}\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__$5 = "data-v-3d236889"; + /* module identifier */ + const __vue_module_identifier__$5 = undefined; + /* functional template */ + const __vue_is_functional_template__$5 = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$5 = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$5, staticRenderFns: __vue_staticRenderFns__$5 }, + __vue_inject_styles__$5, + __vue_script__$5, + __vue_scope_id__$5, + __vue_is_functional_template__$5, + __vue_module_identifier__$5, + false, + createInjector, + undefined, + undefined + ); + + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + + var script$4 = { + name: 'SketchRule', + props: { + mode: { + type: String, + default: 'horizontal' + }, + width: { + type: Number + }, + height: { + type: Number + }, + configColor: { + type: Object, + default: function _default() { + return { + fillStyle: '#666', + strokeStyle: '#666', + font: 16, + lineWidth: 1 + }; + } + }, + scale: { + // 缩放 + type: Number, + default: 1 + }, + layout: { + type: Array, + default: function _default() { + return []; + } + }, + perspective: { + // 刻度尺跟随滚动条移动偏移量 + type: Number, + default: 0 + } + }, + computed: { + ruleId: function ruleId() { + return Math.random().toFixed(16) + '-' + this.mode; + }, + hv: function hv() { + return this.$refs["rule-".concat(this.mode)].querySelector('.indicator'); + }, + vertical: function vertical() { + return this.mode === 'horizontal'; + }, + styleBorder: function styleBorder() { + var _this$lineConfig = this.lineConfig, + width = _this$lineConfig.width, + color = _this$lineConfig.color, + type = _this$lineConfig.type; + var border = "".concat(width, "px ").concat(type, " ").concat(color); + return this.vertical ? { + borderLeft: border + } : { + borderTop: border + }; + }, + lock: function lock() { + return document.querySelector('.rule-panel-lock').getBoundingClientRect(); + }, + $Q: function $Q() { + var scale = 10; + var text = 10; + if (this.scale < 0.1) { + text = 80; + } else if (this.scale >= 0.1 && this.scale <= 0.25) { + text = 40; + } else if (this.scale > 0.25 && this.scale <= 0.5) { + text = 20; + } else if (this.scale > 0.5 && this.scale <= 1) { + text = 10; + } else if (this.scale > 1 && this.scale <= 3) { + text = 5; + } + scale = text * this.scale; + return { + scale: scale, + text: text + }; + } + }, + watch: { + canvasWidth: function canvasWidth(val, oldVal) { + if (oldVal) { + this.horizontalValue = val - oldVal; + } + }, + layout: function layout() { + this.handleUpdate(); + }, + perspective: function perspective() { + this.handleUpdate(); + }, + scale: function scale() { + this.handleUpdate(); + } + }, + data: function data() { + return { + config: { + // 刻度尺配置 + size: 101, + x: 0, + y: 0, + w: 10, + h: 10, + width: 20, + height: 20, + fillStyle: '#fff', + strokeStyle: '#fff', + font: 12, + lineWidth: 1 + }, + cxt: null, + canvas: null, + showIndicator: false, + showValue: 0, + lineArr: [], + showAnctionValue: 0, + startValue: null, + lineConfig: { + // 拖拽线的样式 + color: '#51d6a9', + type: 'dashed', + width: 1 + }, + canvasWidth: 0, + horizontalValue: 0 + }; + }, + mounted: function mounted() { + var _this = this; + // window.addEventListener('resize', this.getWrapperSize) + this.$nextTick(function () { + _this.initDom(); + }); + }, + methods: { + initDom: function initDom() { + this.canvas = document.getElementById(this.ruleId); + this.config = Object.assign(this.config, this.configColor); + if (!this.canvas) return; + this.cxt = this.canvas.getContext('2d'); + this.initBindEvent(); + this.initConfig(); + this.draw(this.cxt, this.config); + }, + initConfig: function initConfig() { + var _document$querySelect2; + var _document$querySelect = document.querySelector('.editor-render-top').getBoundingClientRect(), + width = _document$querySelect.width, + height = _document$querySelect.height; + this.warpOffset = (_document$querySelect2 = document.querySelector('.ruler')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.getBoundingClientRect(); + var iconOffSet = this.lock.width; + this.canvasWidth = width; + var numLength = this.perspective; + var dom = document.querySelector('.ruler'); + dom.style.height = height + 'px'; + this.config.width = this.vertical ? 20 : iconOffSet; + this.config.height = this.vertical ? iconOffSet : 20; + var Width = this.vertical ? width - iconOffSet + numLength : this.config.width; + var Height = this.vertical ? this.config.height : height - iconOffSet + numLength; + var Size = this.vertical ? Width : Height; + this.canvas.setAttribute('width', Width); + this.canvas.setAttribute('height', Height); + this.config.size = Math.ceil(Math.ceil(Size / 10 * 40) + 1); + }, + initBindEvent: function initBindEvent() { + this.handleMouseenter(); + this.handleMouseleave(); + this.handleMousemove(); + this.handleMouseClick(); + }, + getScale: function getScale() {}, + draw: function draw(cxt, config) { + var scale = this.scale; + var size = config.size || 101; + var x = config.x || 0; + var y = config.y || 0; + var w = config.w || 10; + var h = config.h || 10; + var v = this.mode || 'horizontal'; + cxt.clearRect(0, 0, config.width, config.height); + cxt.strokeStyle = config.strokeStyle; + cxt.lineWidth = config.lineWidth / (this.scale * 1.5); + cxt.font = "".concat(12, "px -apple-system,\n \"Helvetica Neue\", \".SFNSText-Regular\",\n \"SF UI Text\", Arial, \"PingFang SC\", \"Hiragino Sans GB\",\n \"Microsoft YaHei\", \"WenQuanYi Zen Hei\", sans-serif"); + cxt.fillStyle = config.fillStyle; + for (var i = 0; i < size; i++) { + cxt.beginPath(); + if (v == 'vertical') { + var startY = y - this.perspective + i * this.$Q.scale; + cxt.moveTo(x, startY); + if (i % 10 == 0) { + cxt.save(); + cxt.translate(10, -10); + cxt.rotate(90 * Math.PI / 180); + cxt.fillText(x + i * this.$Q.text, x + w * 1.2 + i * this.$Q.scale - this.perspective, y); + cxt.restore(); + cxt.lineTo(x + w * 1.3, x + i * this.$Q.scale - this.perspective); + } else { + cxt.lineTo(x + (i % 5 === 0 ? 0.8 : 0.5) * w, startY); + } + cxt.scale(1, scale); + } else { + var startX = x - this.perspective + i * this.$Q.scale; + cxt.moveTo(startX, y); + if (i % 10 == 0) { + cxt.fillText(x + i * this.$Q.text, startX + 2, y + h * 1.8); + cxt.lineTo(startX, y + h * 1.3); + } else { + cxt.lineTo(startX, y + (i % 5 === 0 ? 0.8 : 0.5) * h); + } + cxt.scale(scale, 1); + } + cxt.stroke(); + cxt.closePath(); + cxt.setTransform(1, 0, 0, 1, 0, 0); + } + }, + getWrapperSize: function getWrapperSize() { + if (!this.canvas) return; + this.initConfig(); + this.draw(this.cxt, this.config); + }, + setPosition: function setPosition(_ref) { + var offsetX = _ref.offsetX, + offsetY = _ref.offsetY; + if (this.vertical) { + this.hv.style.left = offsetX + 'px'; + this.showValue = (offsetX + this.perspective) / this.scale; + } else { + this.hv.style.top = offsetY + 'px'; + this.showValue = (offsetY + this.perspective) / this.scale; + } + }, + handleMouseenter: function handleMouseenter() { + var _this2 = this; + this.canvas.onmouseenter = function (e) { + if (_this2.startValue) return; + _this2.showIndicator = true; + _this2.setPosition(e); + }; + }, + handleMouseleave: function handleMouseleave() { + var _this3 = this; + this.canvas.onmouseleave = function () { + _this3.showIndicator = false; + }; + }, + handleMousemove: function handleMousemove() { + var _this4 = this; + this.canvas.onmousemove = function (e) { + if (_this4.startValue) return; + _this4.setPosition(e); + }; + }, + // 点击出现对齐线 + handleMouseClick: function handleMouseClick() { + var _this5 = this; + this.canvas.onclick = function (e) { + var offsetX = e.offsetX, + offsetY = e.offsetY; + if (_this5.vertical) { + !_this5.lineArr.includes(offsetX) && _this5.lineArr.push({ + top: 0, + left: offsetX, + value: (offsetX + _this5.perspective) / _this5.scale + }); + } else { + !_this5.lineArr.includes(offsetY) && _this5.lineArr.push({ + top: offsetY, + left: 0, + value: (offsetY + _this5.perspective) / _this5.scale + }); + } + }; + }, + handleEnterLeave: function handleEnterLeave() { + var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + this.showAnctionValue = value; + }, + handleDelete: function handleDelete(e) { + var index = this.lineArr.findIndex(function (k) { + return k.value === e; + }); + this.lineArr.splice(index, 1); + }, + handleMouseDown: function handleMouseDown(e) { + this.startValue = e; + document.addEventListener('mousemove', this.handleMove); + document.addEventListener('mouseup', this.handleMouseUp); + }, + handleMouseUp: function handleMouseUp() { + // const warpCanvasWidthHeight = this.vertical + // ? Math.floor(this.canvas.getAttribute('width')) / this.scale - this.lock.width - 3 + // : Math.floor(this.canvas.getAttribute('height')) / this.scale - this.lock.width - 1 + // this.lineArr = this.lineArr.filter(e => e.value < warpCanvasWidthHeight / this.scale && e.value >= 0) + this.startValue = null; + document.removeEventListener('mousemove', this.handleMove); + document.removeEventListener('mouseup', this.handleMouseUp); + }, + setStyle: function setStyle(e) { + // e = { color: 'red', type: 'dashed', width: 1 } + this.lineConfig = Object.assign(this.lineConfig, e); + }, + // 拖动已经显示的对齐线移动 + handleMove: function handleMove(e) { + var _this6 = this; + e.stopPropagation(); + e.preventDefault(); + var clientX = e.clientX, + clientY = e.clientY; + var iconOffSet = this.lock.width; + var left = this.vertical ? Math.round(clientX - this.warpOffset.left - iconOffSet) : 0; + var top = this.vertical ? 0 : Math.round(clientY - this.warpOffset.top - iconOffSet); + var value = this.vertical ? Math.round((clientX - this.warpOffset.left - iconOffSet + this.perspective) / this.scale) : Math.round(clientY - this.warpOffset.top - iconOffSet + this.perspective / this.scale); + var index = this.lineArr.findIndex(function (k) { + return Math.abs(k.value - _this6.startValue) <= 3; + }); + this.startValue = value; + this.showAnctionValue = value; + index >= 0 && this.$set(this.lineArr, index, { + top: top, + left: left, + value: value + }); + }, + listenMouseMove: function listenMouseMove(e) {}, + handleScrollSetine: function handleScrollSetine() { + var _this7 = this; + if (!this.lineArr.length) return; + this.lineArr.forEach(function (e, i) { + var valueMax = Math.round(e.value) * _this7.scale - _this7.perspective; + _this7.$set(_this7.lineArr, i, { + top: _this7.vertical ? 0 : valueMax, + left: _this7.vertical ? valueMax : 0, + value: Math.round(e.value) + }); + }); + }, + handleUpdate: function handleUpdate() { + if (!this.canvas) return; + this.initConfig(); + this.draw(this.cxt, this.config); + this.handleScrollSetine(); + } + }, + beforeDestroy: function beforeDestroy() { + window.removeEventListener('resize', this.getWrapperSize); + } + }; + + /* script */ + const __vue_script__$4 = script$4; + + /* template */ + var __vue_render__$4 = function () { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c("div", { ref: "rule-" + _vm.mode, class: ["rule-" + _vm.mode] }, [ + _c("canvas", { attrs: { id: _vm.ruleId } }), + _vm._v(" "), + _c( + "div", + { staticClass: "lines" }, + _vm._l(_vm.lineArr, function (item, index) { + return _c( + "div", + { + key: index, + staticClass: "line", + style: Object.assign( + {}, + { top: item.top + "px", left: item.left + "px" }, + _vm.styleBorder, + { display: item.value >= 0 ? "" : "none" } + ), + attrs: { + "aria-left": item.left, + "aria-top": item.top, + "aria-value": Math.round(item.value), + }, + on: { + mouseenter: function ($event) { + return _vm.handleEnterLeave(item.value) + }, + mouseleave: function ($event) { + return _vm.handleEnterLeave() + }, + mousedown: function ($event) { + return _vm.handleMouseDown(item.value) + }, + }, + }, + [ + _c("div", { staticClass: "anction" }, [ + _c( + "span", + { + staticClass: "del", + style: { + visibility: + _vm.showAnctionValue === item.value + ? "visible" + : "hidden", + }, + on: { + click: function ($event) { + return _vm.handleDelete(item.value) + }, + }, + }, + [_vm._v("x")] + ), + _vm._v(" "), + _c("span", { staticClass: "value" }, [ + _vm._v(_vm._s(Math.round(item.value))), + ]), + ]), + ] + ) + }), + 0 + ), + _vm._v(" "), + _c( + "div", + { + directives: [ + { + name: "show", + rawName: "v-show", + value: _vm.showIndicator, + expression: "showIndicator", + }, + ], + staticClass: "indicator", + style: _vm.styleBorder, + }, + [ + _c("div", { staticClass: "value" }, [ + _vm._v(_vm._s(Math.round(_vm.showValue))), + ]), + ] + ), + ]) + }; + var __vue_staticRenderFns__$4 = []; + __vue_render__$4._withStripped = true; + + /* style */ + const __vue_inject_styles__$4 = function (inject) { + if (!inject) return + inject("data-v-a7216922_0", { source: "[data-v-a7216922]:export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.rule-horizontal[data-v-a7216922] {\n position: absolute;\n left: 24px;\n width: calc(100% - 24px);\n font-size: 12px;\n}\n.rule-horizontal .lines .line[data-v-a7216922] {\n position: absolute;\n top: 0;\n cursor: ew-resize;\n height: 100vh;\n padding-left: 5px;\n z-index: 1;\n}\n.rule-horizontal .lines .line .anction[data-v-a7216922] {\n position: absolute;\n top: 24px;\n display: flex;\n justify-content: center;\n align-items: center;\n user-select: none;\n}\n.rule-horizontal .lines .line .anction .del[data-v-a7216922] {\n padding: 0;\n font-size: 20px;\n font-weight: 600;\n cursor: pointer;\n}\n.rule-horizontal .lines .line .anction .value[data-v-a7216922] {\n pointer-events: none;\n margin-left: 5px;\n transform: translateY(3px);\n}\n.rule-horizontal .indicator[data-v-a7216922] {\n position: absolute;\n pointer-events: none;\n top: 0;\n height: 100vh;\n z-index: 1;\n}\n.rule-horizontal .indicator .value[data-v-a7216922] {\n position: absolute;\n width: auto;\n padding: 0 2px;\n margin-top: 4px;\n margin-left: 4px;\n}\n.rule-vertical[data-v-a7216922] {\n position: absolute;\n top: 24px;\n width: 24px;\n height: calc(100% - 24px);\n font-size: 12px;\n}\n.rule-vertical .lines .line[data-v-a7216922] {\n position: absolute;\n top: 0;\n cursor: ns-resize;\n width: 100vw;\n padding-top: 5px;\n z-index: 1;\n}\n.rule-vertical .lines .line .anction[data-v-a7216922] {\n position: absolute;\n left: 24px;\n display: flex;\n justify-content: center;\n align-items: center;\n user-select: none;\n}\n.rule-vertical .lines .line .anction .del[data-v-a7216922] {\n padding: 0;\n font-size: 20px;\n font-weight: 600;\n cursor: pointer;\n}\n.rule-vertical .lines .line .anction .value[data-v-a7216922] {\n pointer-events: none;\n margin-left: 5px;\n transform: translateY(3px);\n}\n.rule-vertical .indicator[data-v-a7216922] {\n position: absolute;\n pointer-events: none;\n top: 0;\n width: 100vw;\n z-index: 1;\n}\n.rule-vertical .indicator .value[data-v-a7216922] {\n position: absolute;\n left: 0;\n width: auto;\n padding: 0 2px;\n margin-top: -5px;\n margin-left: 2px;\n transform: rotate(-90deg);\n transform-origin: 0 0;\n}\ncanvas[data-v-a7216922] {\n background: #292929;\n pointer-events: auto;\n}\n", map: {"version":3,"sources":["SketchRule.vue"],"names":[],"mappings":"AAAA;EACE,sBAAsB;EACtB,mBAAmB;EACnB,sBAAsB;EACtB,sBAAsB;EACtB,oBAAoB;EACpB,mBAAmB;EACnB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,iBAAiB;EACjB,6BAA6B;EAC7B,wCAAwC;AAC1C;AACA;EACE,kBAAkB;EAClB,UAAU;EACV,wBAAwB;EACxB,eAAe;AACjB;AACA;EACE,kBAAkB;EAClB,MAAM;EACN,iBAAiB;EACjB,aAAa;EACb,iBAAiB;EACjB,UAAU;AACZ;AACA;EACE,kBAAkB;EAClB,SAAS;EACT,aAAa;EACb,uBAAuB;EACvB,mBAAmB;EACnB,iBAAiB;AACnB;AACA;EACE,UAAU;EACV,eAAe;EACf,gBAAgB;EAChB,eAAe;AACjB;AACA;EACE,oBAAoB;EACpB,gBAAgB;EAChB,0BAA0B;AAC5B;AACA;EACE,kBAAkB;EAClB,oBAAoB;EACpB,MAAM;EACN,aAAa;EACb,UAAU;AACZ;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,cAAc;EACd,eAAe;EACf,gBAAgB;AAClB;AACA;EACE,kBAAkB;EAClB,SAAS;EACT,WAAW;EACX,yBAAyB;EACzB,eAAe;AACjB;AACA;EACE,kBAAkB;EAClB,MAAM;EACN,iBAAiB;EACjB,YAAY;EACZ,gBAAgB;EAChB,UAAU;AACZ;AACA;EACE,kBAAkB;EAClB,UAAU;EACV,aAAa;EACb,uBAAuB;EACvB,mBAAmB;EACnB,iBAAiB;AACnB;AACA;EACE,UAAU;EACV,eAAe;EACf,gBAAgB;EAChB,eAAe;AACjB;AACA;EACE,oBAAoB;EACpB,gBAAgB;EAChB,0BAA0B;AAC5B;AACA;EACE,kBAAkB;EAClB,oBAAoB;EACpB,MAAM;EACN,YAAY;EACZ,UAAU;AACZ;AACA;EACE,kBAAkB;EAClB,OAAO;EACP,WAAW;EACX,cAAc;EACd,gBAAgB;EAChB,gBAAgB;EAChB,yBAAyB;EACzB,qBAAqB;AACvB;AACA;EACE,mBAAmB;EACnB,oBAAoB;AACtB","file":"SketchRule.vue","sourcesContent":[":export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.rule-horizontal {\n position: absolute;\n left: 24px;\n width: calc(100% - 24px);\n font-size: 12px;\n}\n.rule-horizontal .lines .line {\n position: absolute;\n top: 0;\n cursor: ew-resize;\n height: 100vh;\n padding-left: 5px;\n z-index: 1;\n}\n.rule-horizontal .lines .line .anction {\n position: absolute;\n top: 24px;\n display: flex;\n justify-content: center;\n align-items: center;\n user-select: none;\n}\n.rule-horizontal .lines .line .anction .del {\n padding: 0;\n font-size: 20px;\n font-weight: 600;\n cursor: pointer;\n}\n.rule-horizontal .lines .line .anction .value {\n pointer-events: none;\n margin-left: 5px;\n transform: translateY(3px);\n}\n.rule-horizontal .indicator {\n position: absolute;\n pointer-events: none;\n top: 0;\n height: 100vh;\n z-index: 1;\n}\n.rule-horizontal .indicator .value {\n position: absolute;\n width: auto;\n padding: 0 2px;\n margin-top: 4px;\n margin-left: 4px;\n}\n.rule-vertical {\n position: absolute;\n top: 24px;\n width: 24px;\n height: calc(100% - 24px);\n font-size: 12px;\n}\n.rule-vertical .lines .line {\n position: absolute;\n top: 0;\n cursor: ns-resize;\n width: 100vw;\n padding-top: 5px;\n z-index: 1;\n}\n.rule-vertical .lines .line .anction {\n position: absolute;\n left: 24px;\n display: flex;\n justify-content: center;\n align-items: center;\n user-select: none;\n}\n.rule-vertical .lines .line .anction .del {\n padding: 0;\n font-size: 20px;\n font-weight: 600;\n cursor: pointer;\n}\n.rule-vertical .lines .line .anction .value {\n pointer-events: none;\n margin-left: 5px;\n transform: translateY(3px);\n}\n.rule-vertical .indicator {\n position: absolute;\n pointer-events: none;\n top: 0;\n width: 100vw;\n z-index: 1;\n}\n.rule-vertical .indicator .value {\n position: absolute;\n left: 0;\n width: auto;\n padding: 0 2px;\n margin-top: -5px;\n margin-left: 2px;\n transform: rotate(-90deg);\n transform-origin: 0 0;\n}\ncanvas {\n background: #292929;\n pointer-events: auto;\n}\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__$4 = "data-v-a7216922"; + /* module identifier */ + const __vue_module_identifier__$4 = undefined; + /* functional template */ + const __vue_is_functional_template__$4 = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$4 = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$4, staticRenderFns: __vue_staticRenderFns__$4 }, + __vue_inject_styles__$4, + __vue_script__$4, + __vue_scope_id__$4, + __vue_is_functional_template__$4, + __vue_module_identifier__$4, + false, + createInjector, + undefined, + undefined + ); + + var script$3 = { + name: 'Ruler', + props: { + width: { + type: Number + }, + height: { + type: Number + }, + perspectiveX: { + type: Number, + default: 0 + }, + perspectiveY: { + type: Number, + default: 0 + }, + layoutX: { + type: Array, + default: function _default() { + return []; + } + }, + layoutY: { + type: Array, + default: function _default() { + return []; + } + }, + scale: { + type: Number, + default: 1 + } + }, + components: { + SketchRule: __vue_component__$4 + }, + data: function data() { + return {}; + } + }; + + /* script */ + const __vue_script__$3 = script$3; + + /* template */ + var __vue_render__$3 = function () { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c( + "div", + { staticClass: "ruler" }, + [ + _c("svg-icon", { + staticClass: "rule-panel-lock", + attrs: { type: "editor-lock" }, + }), + _vm._v(" "), + _c("SketchRule", { + ref: "horizontal", + attrs: { + width: _vm.width, + height: _vm.height, + perspective: _vm.perspectiveX, + layout: _vm.layoutX, + scale: _vm.scale, + }, + }), + _vm._v(" "), + _c("SketchRule", { + ref: "vertical", + attrs: { + mode: "vertical", + width: _vm.width, + height: _vm.height, + perspective: _vm.perspectiveY, + layout: _vm.layoutY, + scale: _vm.scale, + }, + }), + _vm._v(" "), + _vm._t("container"), + ], + 2 + ) + }; + var __vue_staticRenderFns__$3 = []; + __vue_render__$3._withStripped = true; + + /* style */ + const __vue_inject_styles__$3 = function (inject) { + if (!inject) return + inject("data-v-2bdc2ee0_0", { source: "[data-v-2bdc2ee0]:export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.ruler[data-v-2bdc2ee0] {\n position: relative;\n background-image: linear-gradient(90deg, #141414 14px, transparent 0), linear-gradient(0deg, transparent 14px, rgba(48, 48, 48, 0.64) 0);\n background-size: 17px 17px;\n background-position: 15px, 20px, 0, 0;\n width: 100%;\n overflow: hidden;\n}\n.ruler .rule-panel-lock[data-v-2bdc2ee0] {\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n width: 24px;\n height: 24px;\n cursor: pointer;\n}\n", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,sBAAsB;EACtB,mBAAmB;EACnB,sBAAsB;EACtB,sBAAsB;EACtB,oBAAoB;EACpB,mBAAmB;EACnB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,iBAAiB;EACjB,6BAA6B;EAC7B,wCAAwC;AAC1C;AACA;EACE,kBAAkB;EAClB,wIAAwI;EACxI,0BAA0B;EAC1B,qCAAqC;EACrC,WAAW;EACX,gBAAgB;AAClB;AACA;EACE,aAAa;EACb,uBAAuB;EACvB,mBAAmB;EACnB,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,eAAe;AACjB","file":"index.vue","sourcesContent":[":export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.ruler {\n position: relative;\n background-image: linear-gradient(90deg, #141414 14px, transparent 0), linear-gradient(0deg, transparent 14px, rgba(48, 48, 48, 0.64) 0);\n background-size: 17px 17px;\n background-position: 15px, 20px, 0, 0;\n width: 100%;\n overflow: hidden;\n}\n.ruler .rule-panel-lock {\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n width: 24px;\n height: 24px;\n cursor: pointer;\n}\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__$3 = "data-v-2bdc2ee0"; + /* module identifier */ + const __vue_module_identifier__$3 = undefined; + /* functional template */ + const __vue_is_functional_template__$3 = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$3 = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$3, staticRenderFns: __vue_staticRenderFns__$3 }, + __vue_inject_styles__$3, + __vue_script__$3, + __vue_scope_id__$3, + __vue_is_functional_template__$3, + __vue_module_identifier__$3, + false, + createInjector, + undefined, + undefined + ); + + var script$2 = { + name: 'Size', + components: _defineProperty({}, antDesignVue.Input.name, antDesignVue.Input), + props: { + width: { + type: Number, + default: 0 + }, + height: { + type: Number, + default: 0 + } + }, + computed: { + resize: function resize() { + return !this.w.disabled && !this.h.disabled; + } + }, + watch: { + width: { + immediate: true, + handler: function handler(val, oldVal) { + this.w = _objectSpread2(_objectSpread2({}, this.w), {}, { + value: val + }); + } + }, + height: { + immediate: true, + handler: function handler(val, oldVal) { + this.h = _objectSpread2(_objectSpread2({}, this.h), {}, { + value: val + }); + } + }, + resize: { + immediate: true, + handler: function handler(val) { + this.$emit('size', val); + } + } + }, + data: function data() { + return { + w: { + value: this.width, + disabled: false + }, + h: { + value: this.height, + disabled: false + } + }; + } + }; + + /* script */ + const __vue_script__$2 = script$2; + + /* template */ + var __vue_render__$2 = function () { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c("div", { staticClass: "size" }, [ + _c( + "div", + { staticClass: "size-item" }, + [ + _c("a-input", { + staticClass: "size-item-input", + attrs: { disabled: _vm.w.disabled, suffix: "W" }, + on: { + change: function ($event) { + _vm.$emit("update:width", Number(_vm.w.value)); + }, + }, + model: { + value: _vm.w.value, + callback: function ($$v) { + _vm.$set(_vm.w, "value", $$v); + }, + expression: "w.value", + }, + }), + _vm._v(" "), + _c("svg-icon", { + attrs: { type: _vm.w.disabled ? "editor-lock" : "editor-unlock" }, + on: { + click: function ($event) { + _vm.w.disabled = !_vm.w.disabled; + }, + }, + }), + ], + 1 + ), + _vm._v(" "), + _c( + "div", + { staticClass: "size-item" }, + [ + _c("a-input", { + staticClass: "size-item-input", + attrs: { disabled: _vm.h.disabled, suffix: "H" }, + on: { + change: function ($event) { + _vm.$emit("update:height", Number(_vm.h.value)); + }, + }, + model: { + value: _vm.h.value, + callback: function ($$v) { + _vm.$set(_vm.h, "value", $$v); + }, + expression: "h.value", + }, + }), + _vm._v(" "), + _c("svg-icon", { + attrs: { type: _vm.h.disabled ? "editor-lock" : "editor-unlock" }, + on: { + click: function ($event) { + _vm.h.disabled = !_vm.h.disabled; + }, + }, + }), + ], + 1 + ), + ]) + }; + var __vue_staticRenderFns__$2 = []; + __vue_render__$2._withStripped = true; + + /* style */ + const __vue_inject_styles__$2 = function (inject) { + if (!inject) return + inject("data-v-eebdab88_0", { source: "[data-v-eebdab88]:export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.size[data-v-eebdab88] {\n display: flex;\n align-items: center;\n justify-content: left;\n}\n.size[data-v-eebdab88] .ant-input {\n background-color: transparent;\n}\n.size[data-v-eebdab88] .ant-input-disabled {\n color: #595959;\n}\n.size-item[data-v-eebdab88] {\n flex: 1;\n}\n.size-item-input[data-v-eebdab88] {\n width: 70%;\n margin-right: 10px;\n}\n", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,sBAAsB;EACtB,mBAAmB;EACnB,sBAAsB;EACtB,sBAAsB;EACtB,oBAAoB;EACpB,mBAAmB;EACnB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,iBAAiB;EACjB,6BAA6B;EAC7B,wCAAwC;AAC1C;AACA;EACE,aAAa;EACb,mBAAmB;EACnB,qBAAqB;AACvB;AACA;EACE,6BAA6B;AAC/B;AACA;EACE,cAAc;AAChB;AACA;EACE,OAAO;AACT;AACA;EACE,UAAU;EACV,kBAAkB;AACpB","file":"index.vue","sourcesContent":[":export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.size {\n display: flex;\n align-items: center;\n justify-content: left;\n}\n.size /deep/ .ant-input {\n background-color: transparent;\n}\n.size /deep/ .ant-input-disabled {\n color: #595959;\n}\n.size-item {\n flex: 1;\n}\n.size-item-input {\n width: 70%;\n margin-right: 10px;\n}\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__$2 = "data-v-eebdab88"; + /* module identifier */ + const __vue_module_identifier__$2 = undefined; + /* functional template */ + const __vue_is_functional_template__$2 = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$2 = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$2, staticRenderFns: __vue_staticRenderFns__$2 }, + __vue_inject_styles__$2, + __vue_script__$2, + __vue_scope_id__$2, + __vue_is_functional_template__$2, + __vue_module_identifier__$2, + false, + createInjector, + undefined, + undefined + ); + + var script$1 = { + name: 'SvgIcon', + components: _defineProperty({}, antDesignVue.Icon.name, antDesignVue.Icon), + props: { + type: { + type: String + } + }, + data: function data() { + return { + SVG_TYPES: SVG_TYPES + }; + } + }; + + /* script */ + const __vue_script__$1 = script$1; + + /* template */ + var __vue_render__$1 = function () { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c("a-icon", { + attrs: { type: _vm.type, component: _vm.SVG_TYPES["lcd-icon-" + _vm.type] }, + on: { + click: function ($event) { + return _vm.$emit("click") + }, + }, + }) + }; + var __vue_staticRenderFns__$1 = []; + __vue_render__$1._withStripped = true; + + /* style */ + const __vue_inject_styles__$1 = undefined; + /* scoped */ + const __vue_scope_id__$1 = undefined; + /* module identifier */ + const __vue_module_identifier__$1 = undefined; + /* functional template */ + const __vue_is_functional_template__$1 = false; + /* style inject */ + + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$1 = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$1, staticRenderFns: __vue_staticRenderFns__$1 }, + __vue_inject_styles__$1, + __vue_script__$1, + __vue_scope_id__$1, + __vue_is_functional_template__$1, + __vue_module_identifier__$1, + false, + undefined, + undefined, + undefined + ); + + // + var script = { + name: 'Thumbnail', + mixins: [window$1], + props: { + src: { + type: String, + default: '' + }, + avatar: { + type: String, + default: '' + } + } + }; + + /* script */ + const __vue_script__ = script; + + /* template */ + var __vue_render__ = function () { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c( + "div", + { staticClass: "thumbnail" }, + [ + !_vm.src + ? [ + _c("div", { staticClass: "thumbnail-default" }, [ + _c("img", { + staticClass: "thumbnail-default-avatar", + attrs: { src: _vm.avatar, alt: "default" }, + }), + _vm._v(" "), + _vm.windowWidth >= 1200 + ? _c("span", { staticClass: "thumbnail-default-tooltip" }, [ + _vm._v("暂无封面"), + ]) + : _vm._e(), + ]), + ] + : [ + _c("img", { + staticClass: "thumbnail-image", + attrs: { src: _vm.src, alt: "thumbnail" }, + }), + ], + ], + 2 + ) + }; + var __vue_staticRenderFns__ = []; + __vue_render__._withStripped = true; + + /* style */ + const __vue_inject_styles__ = function (inject) { + if (!inject) return + inject("data-v-12393bd0_0", { source: ":export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.thumbnail {\n aspect-ratio: 1.77777778;\n}\n.thumbnail-default {\n width: 100%;\n height: 100%;\n background-color: #141414;\n border: 1px solid #3779ee;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n}\n.thumbnail-default-avatar {\n width: 40%;\n}\n.thumbnail-default-tooltip {\n margin-top: 22px;\n}\n.thumbnail-image {\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["index.vue","C:\\Users\\lihq1\\Desktop\\开源\\vue-lcd-engine\\components\\Thumbnail\\index.vue"],"names":[],"mappings":"AAAA;EACE,sBAAsB;EACtB,mBAAmB;EACnB,sBAAsB;EACtB,sBAAsB;EACtB,oBAAoB;EACpB,mBAAmB;EACnB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,iBAAiB;EACjB,6BAA6B;EAC7B,wCAAwC;AAC1C;AACA;EACE,wBAAwB;AAC1B;AACA;EACE,WAAW;EACX,YAAY;EACZ,yBAAyB;EACzB,yBAAyB;EACzB,aAAa;EACb,mBAAmB;EACnB,uBAAuB;EACvB,sBAAsB;AACxB;AACA;EACE,UAAU;AACZ;AACA;EACE,gBAAgB;ACClB;AACA;EACA,WAAA;EDCE,YAAY;ACCd","file":"index.vue","sourcesContent":[":export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.thumbnail {\n aspect-ratio: 1.77777778;\n}\n.thumbnail-default {\n width: 100%;\n height: 100%;\n background-color: #141414;\n border: 1px solid #3779ee;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n}\n.thumbnail-default-avatar {\n width: 40%;\n}\n.thumbnail-default-tooltip {\n margin-top: 22px;\n}\n.thumbnail-image {\n width: 100%;\n height: 100%;\n}\n","\r\n\r\n\r\n\r\n\r\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__ = undefined; + /* module identifier */ + const __vue_module_identifier__ = undefined; + /* functional template */ + const __vue_is_functional_template__ = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__ = /*#__PURE__*/normalizeComponent( + { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ }, + __vue_inject_styles__, + __vue_script__, + __vue_scope_id__, + __vue_is_functional_template__, + __vue_module_identifier__, + false, + createInjector, + undefined, + undefined + ); + + [__vue_component__$b, __vue_component__$a, __vue_component__$9, __vue_component__$8, __vue_component__$7, __vue_component__$6, __vue_component__$5, __vue_component__$3, __vue_component__$2, __vue_component__$1, __vue_component__].forEach(function (item) { + item.install = function (Vue) { + Vue.component(item.name, item); + }; + }); + + exports.Cascader = __vue_component__$b; + exports.ComponentBox = __vue_component__$a; + exports.ConfigItem = __vue_component__$9; + exports.EditScreens = __vue_component__$8; + exports.Feedback = __vue_component__$7; + exports.Layout = __vue_component__$6; + exports.Loading = __vue_component__$5; + exports.Ruler = __vue_component__$3; + exports.Size = __vue_component__$2; + exports.SvgIcon = __vue_component__$1; + exports.Thumbnail = __vue_component__; + + Object.defineProperty(exports, '__esModule', { value: true }); + + return exports; + +})({}, null, null, null, null, null, null, antd, null, _); diff --git a/dist/vue-lcd-engine.global.min.js b/dist/vue-lcd-engine.global.min.js new file mode 100644 index 0000000000000000000000000000000000000000..3e14522b8309e10f17782413ed75a1b4635c3a97 --- /dev/null +++ b/dist/vue-lcd-engine.global.min.js @@ -0,0 +1 @@ +var lcd=function(t,n,e,i,r,o,a,s,l,c){"use strict";function d(t){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},d(t)}function h(t){var n=function(t,n){if("object"!=d(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,n||"default");if("object"!=d(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==d(n)?n:String(n)}function A(t,n,e){return(n=h(n))in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}var p={name:"CascaderItem",components:A({},s.Tooltip.name,s.Tooltip),props:{optionsItem:{type:Array,default:function(){return[]}},selected:{type:Object,default:function(){return{}}},mode:{type:String,default:"horizontal"},indexLevel:{type:Number,default:1},tooltip:{type:Boolean,default:!1},showTitle:{type:Boolean,default:!0}},data:function(){return{}},methods:{handleSelected:function(t){this.$emit("handleSelected",t,this.indexLevel)}}};function u(t,n,e,i,r,o,a,s,l,c){"boolean"!=typeof a&&(l=s,s=a,a=!1);const d="function"==typeof e?e.options:e;let h;if(t&&t.render&&(d.render=t.render,d.staticRenderFns=t.staticRenderFns,d._compiled=!0,r&&(d.functional=!0)),i&&(d._scopeId=i),o?(h=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),n&&n.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(o)},d._ssrRegister=h):n&&(h=a?function(t){n.call(this,c(t,this.$root.$options.shadowRoot))}:function(t){n.call(this,s(t))}),h)if(d.functional){const t=d.render;d.render=function(n,e){return h.call(e),t(n,e)}}else{const t=d.beforeCreate;d.beforeCreate=t?[].concat(t,h):[h]}return e}const f="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());function m(t){return(t,n)=>function(t,n){const e=f?n.media||"default":t,i=g[e]||(g[e]={ids:new Set,styles:[]});if(!i.ids.has(t)){i.ids.add(t);let e=n.source;if(n.map&&(e+="\n/*# sourceURL="+n.map.sources[0]+" */",e+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(n.map))))+" */"),i.element||(i.element=document.createElement("style"),i.element.type="text/css",n.media&&i.element.setAttribute("media",n.media),void 0===C&&(C=document.head||document.getElementsByTagName("head")[0]),C.appendChild(i.element)),"styleSheet"in i.element)i.styles.push(e),i.element.styleSheet.cssText=i.styles.filter(Boolean).join("\n");else{const t=i.ids.size-1,n=document.createTextNode(e),r=i.element.childNodes;r[t]&&i.element.removeChild(r[t]),r.length?i.element.insertBefore(n,r[t]):i.element.appendChild(n)}}}(t,n)}let C;const g={};const v=p;var x=function(){var t=this,n=t.$createElement,e=t._self._c||n;return e("ul",{staticClass:"cascader-item-content"},t._l(t.optionsItem,(function(n,i){var r;return e("li",{key:i,class:["cascader-item","cascader-item-"+t.mode,(r={},r["cascader-item-"+t.mode+"-active"]=t.selected===n,r)],on:{click:function(e){return t.handleSelected(n)}}},[e("a-tooltip",{attrs:{placement:"rightBottom"},scopedSlots:t._u([t.tooltip?{key:"title",fn:function(){return[e("span",[t._v(t._s(n.label))])]},proxy:!0}:null],null,!0)},[t._v(" "),e("div",[t._t("icon-title",(function(){return[t.selected===n?[e("svg-icon",{attrs:{type:n.iconHover}})]:[n.icon?e("svg-icon",{attrs:{type:n.icon}}):t._e()]]}))],2)]),t._v(" "),e("a-tooltip",{attrs:{placement:"rightBottom"},scopedSlots:t._u([t.tooltip?{key:"title",fn:function(){return[e("span",[t._v(t._s(n.label))])]},proxy:!0}:null],null,!0)},[t._v(" "),t.showTitle?e("span",{staticClass:"cascader-item-name"},[t._v(t._s(n.label))]):t._e()])],1)})),0)};x._withStripped=!0;const B=u({render:x,staticRenderFns:[]},(function(t){t&&t("data-v-cb71bf0e_0",{source:"[data-v-cb71bf0e]:export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.cascader-item-content[data-v-cb71bf0e] {\n margin-top: 1px;\n padding: 0;\n box-sizing: border-box;\n width: 100%;\n}\n.cascader-item-content .cascader-item[data-v-cb71bf0e] {\n width: 100%;\n cursor: pointer;\n}\n.cascader-item-content .cascader-item-horizontal[data-v-cb71bf0e] {\n display: flex;\n align-items: center;\n height: 48px;\n}\n.cascader-item-content .cascader-item-horizontal i[data-v-cb71bf0e] {\n margin: 0 10px 0 15px;\n}\n.cascader-item-content .cascader-item-horizontal i.anticon[data-v-cb71bf0e] {\n pointer-events: none;\n}\n.cascader-item-content .cascader-item-vertical[data-v-cb71bf0e] {\n display: flex;\n justify-content: center;\n flex-direction: column;\n align-items: center;\n margin: 11px 6px;\n width: calc(100% - 12px);\n height: 80px;\n}\n.cascader-item-content .cascader-item-vertical i[data-v-cb71bf0e] {\n pointer-events: none;\n}\n.cascader-item-content .cascader-item-vertical-active[data-v-cb71bf0e] {\n color: #ffffff;\n background-color: #2c2c2c;\n}\n.cascader-item-content .cascader-item-horizontal-active[data-v-cb71bf0e] {\n color: #ffffff;\n background-color: #1a1a1a;\n}\n",map:{version:3,sources:["CascaderItem.vue"],names:[],mappings:"AAAA;EACE,sBAAsB;EACtB,mBAAmB;EACnB,sBAAsB;EACtB,sBAAsB;EACtB,oBAAoB;EACpB,mBAAmB;EACnB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,iBAAiB;EACjB,6BAA6B;EAC7B,wCAAwC;AAC1C;AACA;EACE,eAAe;EACf,UAAU;EACV,sBAAsB;EACtB,WAAW;AACb;AACA;EACE,WAAW;EACX,eAAe;AACjB;AACA;EACE,aAAa;EACb,mBAAmB;EACnB,YAAY;AACd;AACA;EACE,qBAAqB;AACvB;AACA;EACE,oBAAoB;AACtB;AACA;EACE,aAAa;EACb,uBAAuB;EACvB,sBAAsB;EACtB,mBAAmB;EACnB,gBAAgB;EAChB,wBAAwB;EACxB,YAAY;AACd;AACA;EACE,oBAAoB;AACtB;AACA;EACE,cAAc;EACd,yBAAyB;AAC3B;AACA;EACE,cAAc;EACd,yBAAyB;AAC3B",file:"CascaderItem.vue",sourcesContent:[":export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.cascader-item-content {\n margin-top: 1px;\n padding: 0;\n box-sizing: border-box;\n width: 100%;\n}\n.cascader-item-content .cascader-item {\n width: 100%;\n cursor: pointer;\n}\n.cascader-item-content .cascader-item-horizontal {\n display: flex;\n align-items: center;\n height: 48px;\n}\n.cascader-item-content .cascader-item-horizontal i {\n margin: 0 10px 0 15px;\n}\n.cascader-item-content .cascader-item-horizontal i.anticon {\n pointer-events: none;\n}\n.cascader-item-content .cascader-item-vertical {\n display: flex;\n justify-content: center;\n flex-direction: column;\n align-items: center;\n margin: 11px 6px;\n width: calc(100% - 12px);\n height: 80px;\n}\n.cascader-item-content .cascader-item-vertical i {\n pointer-events: none;\n}\n.cascader-item-content .cascader-item-vertical-active {\n color: #ffffff;\n background-color: #2c2c2c;\n}\n.cascader-item-content .cascader-item-horizontal-active {\n color: #ffffff;\n background-color: #1a1a1a;\n}\n"]},media:void 0})}),v,"data-v-cb71bf0e",false,undefined,!1,m,void 0,void 0);var w={"lcd-icon-editor-center_normal":{template:'\n \n 编组\n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-float_selected":{template:'\n \n 编组备份\n \n \n \n \n \n \n \n '},"lcd-icon-editor-background_normal":{template:'\n \n 编组 3\n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-component_selected":{template:'\n \n 形状\n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-background_selected":{template:'\n \n 编组备份 4\n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-center_selected":{template:'\n \n 编组备份 2\n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-collapse":{template:'\n \n 路径\n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-exit":{template:'\n \n 形状 2\n \n \n \n \n \n \n \n \n \n '},"lcd-icon-home-checked":{template:'\n \n 形状\n \n \n \n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-handbook_hover":{template:'\n \n 编组 20备份\n \n \n \n \n \n \n \n '},"lcd-icon-editor-handbook_normal":{template:'\n \n 编组 20\n \n \n \n \n \n \n \n '},"lcd-icon-editor-expand":{template:'\n \n 编组 29\n \n \n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-float_normal":{template:'\n \n 编组 4\n \n \n \n \n \n \n \n '},"lcd-icon-home-more":{template:'\n \n 编组 13\n \n \n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-panel_normal":{template:'\n \n 编组 2\n \n \n \n \n \n \n \n '},"lcd-icon-editor-redo":{template:'\n \n 编组 38\n \n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-home-delete":{template:'\n \n 编组 15\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-panel_selected":{template:'\n \n 编组备份 3\n \n \n \n \n \n \n \n '},"lcd-icon-editor-preview":{template:'\n \n 编组 31\n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-undo":{template:'\n \n 编组 32\n \n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-remove":{template:'\n \n 编组 47\n \n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-save":{template:'\n \n 形状\n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-home-tooltip":{template:'\n \n 编组 13\n \n \n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-restore":{template:'\n \n 路径\n \n \n \n \n \n \n \n \n \n '},"lcd-icon-home-base":{template:'\n \n 编组 14\n \n \n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-editor-lock":{template:'\n \n 编组 49\n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-home-confirm":{template:'\n \n 编组 12\n \n \n \n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-home-edit":{template:'\n \n 编组 14\n \n \n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-home-emtry":{template:'\n \n 编组 12\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '},"lcd-icon-logo":{template:'\n \n 形状\n \n \n \n \n \n \n \n '},"lcd-icon-editor-unlock":{template:'\n \n 编组 48\n \n \n \n \n \n \n \n \n \n \n '}};const b={name:"CascaderComponent",props:{options:{type:Array,default:function(){return[]}},layout:{type:String,default:"biserial"},cover:String,proxyName:String},data:function(){return{}},methods:{handleDragStart:function(t,n){var e;null==t||null===(e=t.dataTransfer)||void 0===e||e.setData("ChartData",JSON.stringify(c.omit(n,["coverAddress"])))},handleDragEnd:function(){}}};var E=function(){var t=this,n=t.$createElement,e=t._self._c||n;return e("div",{staticClass:"cascader-component"},t._l(t.options,(function(n,i){return e("div",{key:i,class:["cascader-component-draggle","cascader-component-draggle-"+t.layout]},[e("div",{staticClass:"cascader-component-draggle-title"},[t._v(t._s(n.label))]),t._v(" "),e("div",{staticClass:"cascader-component-draggle-warp",attrs:{draggable:"true"},on:{dragstart:function(e){return t.handleDragStart(e,n)},dragend:t.handleDragEnd}},[e("img",{staticClass:"list-img",attrs:{src:n.coverAddress?t.proxyName+"/"+n.coverAddress:t.cover,alt:n.coverAddress?t.proxyName+"/"+n.coverAddress:t.cover}})])])})),0)};E._withStripped=!0;const y=u({render:E,staticRenderFns:[]},(function(t){t&&t("data-v-f4e622b4_0",{source:"[data-v-f4e622b4]:export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.cascader-component[data-v-f4e622b4] {\n width: 100%;\n height: auto;\n}\n.cascader-component-draggle[data-v-f4e622b4] {\n margin: 12px;\n background: #2e2e2e;\n width: calc(100% - 26px);\n cursor: pointer;\n border: 1px solid transparent;\n}\n.cascader-component-draggle[data-v-f4e622b4]:hover {\n border: 1px solid #3779ee;\n}\n.cascader-component-draggle:hover .list-img[data-v-f4e622b4] {\n transform: scale(1.05);\n}\n.cascader-component-draggle .cascader-component-draggle-title[data-v-f4e622b4] {\n padding: 0 12px;\n box-sizing: border-box;\n color: rgba(255, 255, 255, 0.6);\n font-size: 14px;\n height: 36px;\n line-height: 36px;\n}\n.cascader-component-draggle .cascader-component-draggle-warp[data-v-f4e622b4] {\n display: flex;\n justify-content: center;\n align-content: center;\n text-align: center;\n padding: 0 12px 15px 12px;\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n}\n.cascader-component-draggle .cascader-component-draggle-warp .list-img[data-v-f4e622b4] {\n width: 100%;\n height: 100%;\n border-radius: 2px;\n object-fit: contain;\n transition: all 0.5s;\n}\n",map:{version:3,sources:["CascaderComponent.vue","C:\\Users\\lihq1\\Desktop\\开源\\vue-lcd-engine\\components\\Cascader\\components\\CascaderComponent.vue"],names:[],mappings:"AAAA;EACE,sBAAsB;EACtB,mBAAmB;EACnB,sBAAsB;EACtB,sBAAsB;EACtB,oBAAoB;EACpB,mBAAmB;EACnB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,iBAAiB;EACjB,6BAA6B;EAC7B,wCAAwC;AAC1C;AACA;EACE,WAAW;EACX,YAAY;AACd;AACA;EACE,YAAY;EACZ,mBAAmB;EACnB,wBAAwB;EACxB,eAAe;EACf,6BAA6B;AAC/B;AACA;EACE,yBAAyB;AAC3B;AACA;EACE,sBAAsB;AACxB;AACA;EACE,eAAe;EACf,sBAAsB;EACtB,+BAA+B;EAC/B,eAAe;EACf,YAAY;EACZ,iBAAiB;AACnB;AACA;EACE,aAAa;EACb,uBAAuB;EACvB,qBAAqB;EACrB,kBAAkB;EAClB,yBAAyB;EACzB,sBAAsB;EACtB,WAAW;EACX,YAAY;AACd;AACA;EACE,WAAW;EACX,YAAY;EACZ,kBAAkB;EAClB,mBAAmB;EACnB,oBAAoB;ACCtB",file:"CascaderComponent.vue",sourcesContent:[":export {\n primary_color: #3779ee;\n link_color: #1890ff;\n success_color: #2bbe8c;\n warning_color: #faad14;\n error_color: #eb5c5c;\n dark_color: #141414;\n dark_color_1: #0f0f0f;\n dark_color_2: #1f1f1f;\n dark_color_3: #2e2e2e;\n dark_color_4: #3a3a3a;\n dark_color_5: #404040;\n dark_color_6: #595959;\n text_color: white;\n text_color_secondary: #e6e6e6;\n disabled_color: rgba(20, 20, 20, 0.0025);\n}\n.cascader-component {\n width: 100%;\n height: auto;\n}\n.cascader-component-draggle {\n margin: 12px;\n background: #2e2e2e;\n width: calc(100% - 26px);\n cursor: pointer;\n border: 1px solid transparent;\n}\n.cascader-component-draggle:hover {\n border: 1px solid #3779ee;\n}\n.cascader-component-draggle:hover .list-img {\n transform: scale(1.05);\n}\n.cascader-component-draggle .cascader-component-draggle-title {\n padding: 0 12px;\n box-sizing: border-box;\n color: rgba(255, 255, 255, 0.6);\n font-size: 14px;\n height: 36px;\n line-height: 36px;\n}\n.cascader-component-draggle .cascader-component-draggle-warp {\n display: flex;\n justify-content: center;\n align-content: center;\n text-align: center;\n padding: 0 12px 15px 12px;\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n}\n.cascader-component-draggle .cascader-component-draggle-warp .list-img {\n width: 100%;\n height: 100%;\n border-radius: 2px;\n object-fit: contain;\n transition: all 0.5s;\n}\n",'\r\n\r\n